Skip to content

fix: force reindex rebuilds the SCIP symbol indexes too - #344

Merged
flupkede merged 4 commits into
developfrom
features/force-reindex-forces-symbols
Oct 17, 2026
Merged

flupkede merged 4 commits into
developfrom
features/force-reindex-forces-symbols

Conversation

@flupkede

Copy link
Copy Markdown
Owner

Why

User, verbatim: "als we 'n' of -f doen en het is een repo met een scip index MOET hij die mee opnieuw bouwen — dit ontwerp dateert gewoon nog van voor scip en is niet correct mee geupdate." Field case: after Razor joined the text index, find_impact kept answering from ~19-hour-old references — the SCIP gate said Fresh (no .cs changes) and skipped.

What

  • The force path carries no symbol flag at all. Both force entry points — the HTTP force branch (index -f delegates ?force=true) and the TUI n task — end in the new shared tail finish_force_reindex: fresh FSW, then a FORCED, gate-bypassing symbol pass. There is no decision left to revert; the TUI previously never ran a symbol pass at all.
  • Unchanged: plain reindex stays gate-driven; ?symbols=true stays the explicit no-force symbol-only trigger; local CLI builds (index -f --local / delegation failure) build no symbols (serve owns the symbol pipeline there — documented carve-out).

Tests

  • finish_force_reindex_starts_fsw_and_keeps_guard_contract — runs the REAL tail on a temp repo in production order (force reindex → tail), pins FSW task registration + the guard-release contract (callers own end_indexing).
  • Forced-pass semantics pinned by the existing maybe_rebuild_symbols force=true test.
  • Round-1's helper-only pin was proven insufficient (revert kept the suite green — executed probe); the remedy is structural: the revert target no longer exists.

Validation

fmt clean; clippy --all-targets -D warnings clean; cargo test --lib --bins 894+890 green.

'n' in the TUI and 'codesearch index -f' promised a full rebuild but
date from before the symbol indexes existed: the HTTP handler forced
the symbol pass only behind the separate ?symbols=true flag (so the
gate saw a fresh SCIP index and skipped it), and the TUI's force
reindex never ran a symbol pass at all. Field effect: after adding
Razor to the text index, find_impact kept answering from ~19h-old
references because no .cs file had changed.

Force now implies symbols: the handler computes
force_implies_symbols(force, symbols) and the TUI's force task runs
maybe_rebuild_symbols(force=true) after restart_fsw - mirroring the
HTTP path, which already had the step. Explicit ?symbols=true remains
the no-force way to force only the symbol pass; plain reindex stays
gate-driven. Local CLI builds (index -f --local / delegation failure)
still build no symbols at all - serve owns the symbol pipeline there.

Pinned by force_reindex_implies_symbol_rebuild; defect-probed (old
semantics fails the assert).
CHANGELOG under pending [1.5.33] (Fixed), highlights line, plan ticked.
Full validation green: fmt, clippy -D warnings (stage 1), cargo test
--lib --bins 894+890.
Final-review finding (proven by executing the revert in a throwaway
clone): the pin test covered only the pure helper - reverting the
handler line to 'let do_symbols = symbols' kept the suite green. The
helper is gone; the structure now makes the revert impossible:

- the FORCE branch ends in finish_force_reindex, which is always forced
  and takes no flag - there is no decision left to revert;
- the plain-reindex branch passes the ?symbols query flag straight to
  maybe_rebuild_symbols (gate-driven unless ?symbols=true), unchanged;
- force_implies_symbols and its helper-only test are deleted.

The seam test finish_force_reindex_starts_fsw_and_keeps_guard_contract
runs the real tail on a temp repo (production order: force reindex
first, then the tail) and pins FSW registration + the guard contract;
the forced-pass semantics stay pinned by the existing
maybe_rebuild_symbols force=true test.

Review-fixes:
- [Important] pin test covered only the helper; reintroduced defect kept
  the suite green -> removed the revert target structurally (flagless
  force branch through the shared forced tail) + real seam test.
@flupkede
flupkede merged commit eef179a into develop Oct 17, 2026
6 checks passed
@flupkede
flupkede deleted the features/force-reindex-forces-symbols branch October 17, 2026 09:02
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.

1 participant