Skip to content

fix(index): seal an edit's successor during text projection - #3075

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1791128495-edit-during-projection-seals-successor
Open

devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1791128495-edit-during-projection-seals-successor

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • If an edit arrives while a publication's text projection is running, the worker now seals the successor generation during the projection join. Before this change, the edit waited for the projection to finish and its generation to be seated.

Motivation

Fixes #2798. The publishing pass called .await on published_text_projection directly, so the worker could not act on a pending arrival until the projection finished and the seat completed.

Changes

  • registry/mount.rs: the projection join now loops with tokio::select! on the projection and worker_wake.
    • While the projection runs, a pending arrival triggers a successor seal. The pass only calls try_acquire_owned() on background_reconcile_admission and never waits on it, because it holds the publication gate.
    • The seal uses the same branch order as the source pass: first reconcile_retained_text_generation_with, then activate_or_reconcile (graph-on) or reconcile_now (graph-off).
    • A Published outcome is stashed in sealed_successor. The next pass returns it instead of resealing from source, and the arrival stays pending for that pass.
    • The post-projection source re-check is skipped when a successor is already sealed, so it does not race that seal.
    • The stash is cleared when publication authority becomes terminal.
  • New test-only gate pause_next_opened_published_text_projection (registry.rs, test_gates.rs). It holds a publication's projection after its first advance opens the build, so the publishing pass stays in the join.
  • New regression test edit_during_text_projection_seals_its_successor_before_the_projection_finishes (tests/reconcile.rs). It edits src/lib.rs while the projection is held and requires the durable pointer to move before the projection is released. It then checks that both generations project and that the served successor has the edited symbol.

Test plan

  • New test fails before the fix (10 s timeout waiting for the pointer to move) and passes after: bash scripts/require-exact-test.sh cargo test -p tracedecay-code-index-runtime --lib code_index_scheduler::tests::reconcile::edit_during_text_projection_seals_its_successor_before_the_projection_finishes -- --exact
  • cargo test -p tracedecay-code-index-runtime --lib: 587 passed, 1 ignored
  • cargo clippy -p tracedecay-code-index-runtime --all-targets -- -D warnings is clean
  • cargo fmt --all -- --check, python3 scripts/linux-test-partitions.py check, node scripts/lint-commit-range.mjs --repository . origin/master HEAD pass
  • cargo nextest run --workspace --no-fail-fast (not run locally; left to CI)

Checklist

  • CHANGELOG.md updated (not updated; release-please generates it)
  • No secrets, credentials, or .env files included
  • No breaking changes

Link to Devin session: https://app.devin.ai/sessions/4f29111e045a46a3a79417028ae66e8c
Open in Devin Desktop: https://app.devin.ai/desktop/session/4f29111e045a46a3a79417028ae66e8c?variant=devin
Requested by: @ScriptedAlchemy


Devin Review

An arrival during a publication's text projection waited for that
projection to finish and its generation to seat before the worker
reconciled it. The publishing pass now watches pending arrivals while it
joins the projection, seals the successor when admission is free, and
hands that outcome to the next pass instead of resealing from source.

Fixes #2798

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 06f9aef

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

devin-ai-integration[bot]

This comment was marked as resolved.

The early seal now claims the arrival it answers and the next pass
reuses that arrival, so an edit after the seal stays pending for its
own pass instead of being consumed by the presealed outcome.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

code-index: an edit made during a publication's text projection waits for that projection and its seat

1 participant