GitNexus/gitnexus/test
Gergő Magyar 7bbaf6b73b
fix(review): fail closed on foreign embedding identity and vector-width drift (#3260)
Applied from a ce-code-review pass over this branch (run 20260911-053832-b49f88d6).

- `embeddings sync` now gates EVERY checkpoint kind on embedding identity.
  `unverified-count` was exempted, but `decideEmbeddingResume` abandons that
  kind before it compares identity, so the exemption was the only thing
  keeping a foreign model from filling holes beside the old model's vectors —
  two vector spaces in one CodeEmbedding table, reported healthy. The test
  that asserted this run succeeds now asserts the refusal.

- `embeddings sync` refuses when the index's recorded vector width differs
  from this run's. The column is FLOAT[N] fixed at build time and the pipeline
  deletes each batch's stale rows immediately before inserting, so a width
  change deleted rows it could not re-insert. `analyze` already forces a
  rebuild on the same mismatch; only a rebuild can retype the column.

- `GITNEXUS_EMBEDDING_RETRY_TIMEOUTS` parses with the repo's truthy convention
  (`1`/`true`/`yes`). The integer parser threw on `true`, so the conventional
  spelling hard-failed every embedding call rather than enabling the flag or
  leaving it off. README names the accepted spellings.

- One `persistMeta` write path replaces three inlined metadata
  read-modify-writes; #2790 traced two production drifts to hand-copied
  writers of these exact fields.

- Tests: the pipeline mock now invokes `onCheckpointWindowStart`/`onCheckpoint`,
  so the resume contract actually executes under test. Added coverage for the
  incomplete-index refusal, the partial-checkpoint branch, and the body-read
  timeout retry site that the existing opt-in test never reached.

Verified: tsc --noEmit clean; 99 tests pass across the three affected suites;
prettier clean.

Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 07:37:08 +00:00
..
fixtures fix(schema): persist Spring constructor-to-bean injection edges (#3239) 2026-09-10 16:03:53 +01:00
helpers feat(indexing): add Objective-C semantic indexing support (#3179) 2026-09-09 09:40:21 +00:00
integration feat(staleness): report diverged and unknown index state instead of fresh (#3257) 2026-09-11 08:07:37 +01:00
unit fix(review): fail closed on foreign embedding identity and vector-width drift (#3260) 2026-09-11 07:37:08 +00:00
utils fix(hook): emit MCP query hint when server owns DB lock (#2396) (#2397) 2026-07-08 18:34:05 +01:00