Skip to content

fix(code-index): keep sealed generation when freshness proof expires - #1818

Merged
ScriptedAlchemy merged 3 commits into
masterfrom
cursor/graph-rebuild-root-seal-5c52
Sep 19, 2026
Merged

ScriptedAlchemy merged 3 commits into
masterfrom
cursor/graph-rebuild-root-seal-5c52

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Summary

Dispatch SHA: c1633dd96bb0f70d89d5a33cc64c3d5c35d71dfa

Clippy on runs 35442002957 / 35442004499 failed in tracedecay-sessions (u64::try_from of Metadata::len) before this crate was checked. That one-liner is now on master via #1858. This head does not carry a second copy. cargo clippy -p tracedecay-code-index-runtime -p tracedecay-sessions --all-targets --locked -- -D warnings passed on the scheduler tree this head still has.

Does not touch .github/workflows/ci.yml.

Test plan

  • cargo test -p tracedecay-code-index-runtime --lib sealed_generation — 5 passed, including the moved-commit refusal and the expired-proof and predecessor-witness keeps. Five adjacent currency tests passed. Scheduler sources are byte-identical to that run after this rebase.
  • cursor_cas_lost_on_a_partially_covered_window_replays_the_tail — 1 passed on the length line fix(sessions): drop the u64 identity conversion clippy rejects #1858 landed.

Checklist

  • CHANGELOG.md updated (release-please owns the published notes)
  • No secrets
  • Not a breaking wire change
Open in Web Open in Cursor 

@changeset-bot

changeset-bot Bot commented Sep 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c1633dd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review September 19, 2026 06:47
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Pairs with #1825 (clone copy off freshness receipt). Merge order: either works independently; land both for the full ~90s rebuild path.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 19, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-19T06:52:36.257832Z a2f50b7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2f50b7970

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// does not name this generation. The sealed digests are the proof.
// Graph-off still captures so a metadata-only drift is verified
// without a full decode when the quiet witness is absent.
if sealed_bytes_match && (quiet_witness || !rebuild_changed_source_without_decode) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Rebuild when the source revision changes

When graph activation is enabled and the checkout moves to another commit or branch whose indexed source bytes are identical (for example, a docs-only commit), sealed_bytes_match remains true and !rebuild_changed_source_without_decode makes this return Noop even though the Git witness changed. This skips the later reference/source_revision comparisons in finish_retained_reconcile, marks the old generation current, and can leave its stale commit/reference attribution in place indefinitely until code bytes change; require the resolved revision to match the retained snapshot, or run the authoritative capture before accepting the generation.

AGENTS.md reference: AGENTS.md:L177-L178

Useful? React with 👍 / 👎.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Cancelled CI run 35427551242: this fixes the same defect as f2ab808 + 8b75523 (clone-postings occurrence indexes, per-page resume reads) on fix/master-ci-green-3 (PR #1797). After #1797 lands I will merge master into this branch; anything that survives gets its own review and run, otherwise the PR closes as superseded.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Correction to my previous comment: this PR is not a duplicate of the clone-postings fix; that text was meant for #1824/#1830. I cancelled the run only to keep the shared runner queue (2 concurrent, ~20 deep) moving while #1797 waits; this PR gets its own review agent and a fresh dispatch afterwards. Apologies for the noise.

@cursor
cursor Bot force-pushed the cursor/graph-rebuild-root-seal-5c52 branch from e441823 to 35ac50f Compare September 19, 2026 11:33
@cursor
cursor Bot force-pushed the cursor/graph-rebuild-root-seal-5c52 branch from 35ac50f to 5bb2534 Compare September 19, 2026 12:06
cursoragent and others added 3 commits September 19, 2026 14:39
A seal or clone backfill outlives the 30s freshness window. Expiry
and a predecessor witness used to clear the newer generation and
reseal it. Unchanged sealed bytes now rebind that proof instead.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
The seat-swap witness does not own the lexical full-copy. That copy
stays on the retained successor driver.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Dropping the witness generation-id guard let the graph-on retained
reconcile return `Noop` whenever the sealed file digests still matched,
including after a commit or branch switch that touches no indexed byte
(an empty or docs-only commit). `accept_unchanged_sealed_snapshot` then
persisted the new git-metadata sample onto the retained generation's
witness, so the stale `reference`/`source_revision` attribution stayed
masked until code bytes moved. `finish_retained_reconcile` rebuilds on
exactly that drift, and `branch_generations` resolves generations by the
commit they sealed, so the retained generation must not outlive it.

Gate the accept on the attribution a fresh capture would seal: HEAD's ref
must still match the snapshot's, and a snapshot that sealed a revision
must still name HEAD's commit. `self.identity` is re-resolved a few lines
above, so this adds no walk. A snapshot sealed from a dirty tree carries
no revision and keeps the fast path.

Verified by `a_moved_commit_refuses_the_sealed_generation_despite_identical_bytes`,
which fails on the parent commit with `Some(Noop(..))`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cursor
cursor Bot force-pushed the cursor/graph-rebuild-root-seal-5c52 branch from 5bb2534 to c1633dd Compare September 19, 2026 14:39
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Folded into #1848 at an earlier head; the commits this branch received afterwards are being reviewed for the next integration batch (ci/pr-batch-e). Leaving open until that batch lands.

@ScriptedAlchemy
ScriptedAlchemy merged commit 6d22852 into master Sep 19, 2026
25 checks passed
ScriptedAlchemy added a commit that referenced this pull request Sep 19, 2026
chore: integration batch E (post-fold commits of #1804, #1818, #1821, #1825)
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