Skip to content

fix(code-index): fence stale progress boundaries and repeated refusals - #4795

Closed
ScriptedAlchemy wants to merge 5 commits into
masterfrom
fix/4508-progress-boundary-fencing
Closed

ScriptedAlchemy wants to merge 5 commits into
masterfrom
fix/4508-progress-boundary-fencing

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refs #4508 — partial correctness repair; issue remains open. This PR protects truthful report ordering for the existing text-artifact phase; it does not yet instrument pre-seal capture/parse or native graph publication.

Root cause addressed

The live build-progress slot accepted delayed reports from a matching owner even if their committed page/chunk/import/payload counters were lower, or after the text owner had already reached Ready. Repeated publication of the same blocked reason also increased progress_epoch without any changed status. In addition, an incompatible/missing text-artifact staging file can legitimately restart its build without changing the generation or scheduler owner; a naive global counter-monotonicity check would hide that restart and freeze the report.

Implementation

  • Validate every snapshot's generation identity; reject backward committed counters and backward Ready transitions within the same staging attempt.
  • When a missing/incompatible SQLite staging file or incompatible source cursor produces a new staging builder, explicitly begin a new reporting attempt before publishing its actual counters. This allows a truthful restart at zero while preserving increasing progress_epoch and rejecting a stale owner.
  • Retain the last published microsecond timestamp across a verified staging retry, including when the wall clock/sample order moves backward. Clear the timestamp only on a new generation owner.
  • Make repeated identical blocked-reason reports idempotent, but clear the reason on newly committed progress.
  • Suppress unchanged phase/batch observations on retry wakes so status cannot present idle elapsed-time refreshes as new progress; preserve the real Ready transition that clears a previously reported refusal.
  • Add four non-vacuous unit regressions for all four committed counter regressions, wrong-generation reports, Ready retreat, owner replacement, verified staging reset/continued commits with clock continuity, repeated blocked events and clearing upon a real commit, unchanged-phase retry deduplication and resumed text completion, including same-phase Ready clearing a prior refusal. Existing assertions are preserved.

Only two files change under crates/tracedecay-code-index-runtime, via five ordinary fast-forward commits based on master 91c72aba7750a398dd28e83d64bf0c6d6fef4172; all pushes used exact expected-head nonforce updates.

Validation and review gates

No Bazel execution is claimed: the tool execution environment has no Bazel workspace/toolchain. Hosted native CI must run the exact PR head with bazel test //crates/tracedecay-code-index-runtime:unit_test --test_output=errors, plus applicable Rustfmt/build/CI gates. The PR-triggered workflow has reported native=none in its run title; static CI alone is not a substitute for native Rust tests. Independent review is still required. Do not merge on metadata checks alone.

Still necessary for #4508

Add genuinely measured pre-seal capture/parse progress and committed native graph page/segment publication reports; verify all stages and restarted/resumed status polling end-to-end on a cold large repo, including stalled/refusal semantics. Only then consider Fixes #4508 and closing the issue on master.

No release, infrastructure, decision-model, or Kev changes. This PR is independent of protected draft #4776, which must not merge.

Latest update (2026-11-08)

Commit d62e730b65c7066691d071ad93e7d55fbca6ee56 adds the no-op phase guard and one production-path resumability regression. It is a candidate fix, not a tested pass: GitHub Actions on this head is queued with native=none; Bazel-native Rust execution and independent review are still absent. Graph page/segment and pre-seal capture/parse work producers remain unimplemented. Keep the PR unmerged pending proof.

CI-blocked history; replaced without rewriting

Hosted Repository gates on run 42432012520 failed because immutable commit 9dca677 has a 75-character header (72 maximum). Under the required no force/rewrite/discard policy, this PR branch and its commits are preserved unchanged. The same two file trees were recreated as an ordinary new commit e287f491d278fc16862aa7c0d252226407a63193 from current master, on fix/4508-progress-boundaries-ci-clean; this PR is retired in favor of its single active replacement. #4508 is still incomplete and must remain open.

@changeset-bot

changeset-bot Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d62e730

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 added a commit that referenced this pull request Nov 8, 2026
Refs #4508

Reapply PR #4795 without changing its existing branch or commits.
The previous immutable history failed the 72-character commit header gate.
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: status publishes no progress during capture, parse, and graph publication

1 participant