Skip to content

fix(retrieval): start reconciliation lease after attestation - #71

Merged
777genius merged 2 commits into
mainfrom
fix/retrieval-reconciliation-lease-clock
Sep 15, 2026
Merged

777genius merged 2 commits into
mainfrom
fix/retrieval-reconciliation-lease-clock

Conversation

@777genius

@777genius 777genius commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Active retrieval reconciliation could return a lease that was already expired when physical Qdrant attestation took longer than the 30-second lease TTL. The reconciliation flow now advances its logical timestamp by measured monotonic elapsed time and starts the renewed lease after attestation completes.

A regression test models a 40-second attestation and verifies that the renewed lease retains its full 30-second TTL.

Validation:

  • uv run --extra dev pytest tests/server/test_active_reconciliation_identity.py tests/server/test_retrieval_profile_runtime.py tests/server/test_retrieval_profile_admin_command.py -q - 32 passed
  • Ruff check and format check passed
  • git diff --check passed

Summary by CodeRabbit

  • Bug Fixes

    • Improved active reconciliation timing so leases reflect the time spent completing attestations.
    • Lease issuance and expiration timestamps now remain accurate after slower attestation processing.
    • Lease renewal timing remains consistent when database clock time differs from the requested application time.
  • Tests

    • Added coverage confirming leases start and expire from the adjusted post-attestation time.
    • Updated continuity checks to accommodate clock-based lease issuance while preserving TTL validation.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1b2067c4-dee4-4651-9b8b-93ae12781d30

📥 Commits

Reviewing files that changed from the base of the PR and between 09f9387 and 59fac6c.

📒 Files selected for processing (1)
  • tests/e2e/test_locator_lane_lease_continuity_postgres.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

reconcile_active now accounts for elapsed attestation time when creating activation evidence and reconciliation leases. Tests verify delayed lease issuance and PostgreSQL lease continuity.

Changes

Reconciliation Lease Timing

Layer / File(s) Summary
Advance lease timestamps after attestation
packages/infinity_context_server/infinity_context_server/retrieval_profile_composition.py, tests/server/test_active_reconciliation_identity.py, tests/e2e/test_locator_lane_lease_continuity_postgres.py
reconcile_active records monotonic start time, advances lease_now by the elapsed duration, and uses it for activation evidence and lease timestamps. Tests verify delayed attestation timing and lease continuity.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 59fac

Lease issuance now accounts for attestation time while preserving the configured TTL, and no concrete merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: starting the reconciliation lease after attestation completes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/retrieval-reconciliation-lease-clock

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit clocks the attestation run
Lease time hops when work is done
Evidence follows the measured pace
Renewal keeps its proper place
Tests watch each timestamp land
Carrots cheer the corrected span

Comment @coderabbitai help to get the list of available commands.

@777genius
777genius merged commit 86c9fcc into main Sep 15, 2026
16 checks passed
@777genius
777genius deleted the fix/retrieval-reconciliation-lease-clock branch September 15, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants