You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Executes P1 of docs/plans/2026-08-08-derived-artifact-hardening-execution-plan.md,
the keystone that gates the rest of the derived-artifact hardening backlog:
every later phase changes extraction/derivation logic, and on a hand-bumped
policy_version alone, shipping any of them risks silently stale incremental
indexes on already-deployed installs.
- SOURCE_EXTRACTION_VERSION / GRAPH_DERIVATION_VERSION / PACKAGE_GRAPH_VERSION:
new version consts folded into InputCatalog::index_input_snapshot's existing
config_material/context_material fingerprint buckets (refresh.rs). Extends
the index_input_state mechanism that already existed rather than building a
new one - source-extraction bumps trigger a full reparse, graph/package
bumps trigger the cheaper graph-rebuild-only path.
- derived_artifact_versions.rs: 3 drift-guard tests (UPDATE_TOOLSNAPS-style)
hashing each version's frozen-fixture output against a checked-in literal,
so a behavior change without a matching version bump is caught in CI.
- DerivedStatus (Ready/NeedsBaseline/Stale only - Unsupported/Failed/Disabled
omitted, no real signal backs them) surfaced as
indexing_status.derived_status.{overall,source_facts,graph_facts}. Backed
by new index_input_bucket_drift (additive, index_input_drift itself
untouched) since type_relations/symbol_effects and symbol_digests/
package_dependencies need independently accurate freshness - the existing
4-way IndexInputDrift short-circuits on a config mismatch without checking
context, which would wrongly mark both stale if reused naively per-bucket.
- EMBEDDING_SPACE_VERSION + heal_embedding_space_mismatch: extends the
existing dimension-only self-heal (heal_dimension_mismatch) to also catch
a same-dimension model swap or a symbol_doc-formatting version bump, which
a stored-vector blob-length peek alone cannot distinguish from "nothing
changed". Wired into both real production call sites (bootstrap_embeddings,
calm-cli's index subcommand) rather than threaded through
create_embedding_table/create_chunk_embedding_table's signatures, which
would have forced ~17 call-site edits for zero behavioral gain in tests.
Also includes the remaining pre-existing, adjacent fixes that happened to
land in the same two files this session: Poetry dependency-group parsing
and orphaned embedding-vector pruning (package_deps.rs/embedding.rs).
Verified: full `cargo test --workspace --features embeddings` green (1054
calm-core + 365 calm-server + all other packages, 0 failures), clippy -D
warnings clean, rustfmt clean, indexing_status toolsnap regenerated.
Deliberately deferred to a later phase (P7, bundle hardening): folding
embedding_model_id into bundle.rs's config_fingerprint - that fingerprint's
own doc comment scopes it to file-coverage config only (languages/ignore),
so this belongs as an independent field there instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments