ISS-10710: poll the code index every 5 minutes; reindex when HEAD moves - #29
Merged
Merged
Conversation
PLN-2069 PR 1. The autosync loop now ticks every 60 s. Each tick checks git HEAD and reindexes on a move; the full-tree check runs once per poll interval (default 5 minutes, 60 s floor). Both are skipped while the file watcher is alive. Co-Authored-By: Claude <noreply@anthropic.com>
Consecutive unchanged full checks now bump a count on one entry instead of appending, so an idle repo keeps its reindex, error and bootstrap entries. Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Campaign
iss-10710-20260919, chunk C1 of 3: poll every 5 minutes; reindex when HEAD movesLands PLN-2069 PR 1 for ISS-10710. Based on
main, not stacked.What changes
The code-index autosync loop used to stat-walk the whole repo every 60 s (1.25 s per walk on symphony-alpha) and start a whole-repo reindex whenever anything had changed. It now runs a fixed 60 s tick:
git rev-parse HEAD. A HEAD move (pull, checkout, merge, rebase) triggers an incremental reindex on that tick.code_context.autosync_poll_msstill overrides it, and the 60 s floor stays.Files:
src/lemoncrow/pro/capabilities/code_context/engine.py,src/lemoncrow/core/settings_registry.py,tests/core/test_code_context.py.Acceptance ledger: 4 criteria, 1 met, 3 met differently, 0 not met
test_autosync_idle_ticks_walk_the_tree_once_per_poll_intervalcounts[1,1,1,1,1,2,2,2,2,2]walks over 10 ticks. It fails if the gate is removed. A HEAD-move reindex also reseeds the signature once (deviation 3).test_autosync_head_move_reindexes_on_the_next_tick_without_a_tree_walk: a commit in a tmp repo triggers exactly one reindex on the next tick, with no tree walk before it. Skipped while a watcher is alive (deviation 1).test_autosync_poll_interval_default_override_and_floor(invalid value, 120000 and 1000 cases). Removing the override or the floor each fails it.Every criterion's test fails against deliberately broken code: 14 counterfactual mutations were run. symphony-alpha's working tree and live index were not touched.
Deviations from PLN-2069 PR 1
full_checkevent in the autosync history. Without it, AC-1.4 and the rollout check have nothing to count. After review, consecutive idle checks fold into one entry with acount(see below).known_changeisstr | None, carrying the reason (watcher_triggeredorhead_moved). The reindex helpers return whether a reindex succeeded, so a failed HEAD-move reindex keeps the old HEAD and retries on the next tick.Review
/code-review:deepreturned APPROVED, with 2 verified findings (both MEDIUM) and no blocking or high ones. The review is proven to have read this branch at54e0273c.Fixed in
fb7e5808: idlefull_checkentries pushed real events out of the 20-entry autosync history, losing reindex, error and bootstrap entries after about 100 idle minutes. Consecutive idle checks now fold into one entry with acount. A regression test fails on the old code.Pushed back: reuse
_read_git_head(zoekt/server.py) instead of spawninggit rev-parse. Verbatim:The orchestrator independently confirmed that
_read_git_headreturnsNonefor a worktree and the correct commit for the main checkout.Declined, as out of scope (found while triaging, not a review finding): Zoekt's HEAD refresh never fires in git worktrees, for the same reason. Verbatim:
The re-review gate computed
SKIP: 1 prod file(s) changed, none overlapping blocking_high.Verification
All pass:
uv run pytest tests/core/test_code_context.py -k autosync(11 tests)tests/infra/code_intel/test_code_engine_autosync_retirement.py,test_reads_during_reindex.py,tests/core/test_settings_registry.py,tests/test_mypyc_compile_safety.pymypyon the two source filesruffon the changed filesgit diff --checkThe full suite was not run locally; CI runs it here.
Still owed by later chunks (merge this first)
editreindexes its files once, off the response path. It also closes two gaps the campaign found: files written by a partially failed edit, and edits outside the daemon's workspace.engine.pywith this PR, so it starts after this one merges.