Add derived-view freshness flags to store search and traversal results, and use the existing derived_view_state store APIs to suppress explicitly stale PageRank, LinkRank, and node-degree acceleration. Missing freshness rows remain legacy-compatible so old DBs keep their existing rank output.
Mark PageRank, LinkRank, and node-degree views complete after successful rank-table writes using the named unknown-generation constant when no index generation is available. MCP search_graph and trace_path now return structured warnings when stale derived rankings are ignored, without writing protocol-breaking stdout/stderr.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_search ./build/c/test-runner; CBM_ONLY_SUITE=pagerank ./build/c/test-runner; CBM_ONLY_SUITE=mcp ./build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a reusable cbm_derived_view_state_t reader and free helper for the derived_view_state ledger. This gives search, traversal, MCP, and future exact-delta routing one store-level read path instead of duplicating SQL.
Extend the store freshness regression to verify stale state reads, complete-state replacement reads, and missing-state behavior after an invalid status write is rejected.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner (76 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add named derived-view constants plus reusable store APIs for setting one derived-view state and marking multiple views stale in one transaction. This supports the exact-delta freshness plan without enabling live exact-delta routing or changing query semantics.
Update tests to cover stale batch marking, complete-state replacement, invalid status rejection, and zero-view no-op behavior. Replace the unsupported PageRank planner test literal with the shared derived-view constant.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -B -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner (76 passed); CBM_ONLY_SUITE=pipeline ./build/c/test-runner (256 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an exact-delta planning fixture for two changed files whose old graph and new deltas reference each other. The test proves the batch planner unions both affected paths, resolves same-batch endpoints, and can still produce an exact candidate without enabling any live incremental route.
This is a P4.4.3 proof slice only. Route/generated-edge cleanup, pass/config invalidation, and derived-view split work remain pending before default incremental behavior can change.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner (256 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Use compatible file_state content hashes to verify files whose legacy mtime+size metadata is unchanged, so same-size rewrites with preserved timestamps are detected instead of treated as no-ops.
Keep old databases compatible: when no file_state row exists, the classifier retains the existing file_hashes metadata path. Store/query or hash failures fail closed by classifying the file as changed.
This does not enable incremental indexing by default and it does not claim a performance win. Metadata-different files still use the fast stat path; metadata-equal files with file_state now pay a content-hash confirmation cost until later ctime/git/status candidate narrowing is designed and measured.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner (255 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Persist compatible file_state rows from full indexes and non-noop containment incremental publishes using the shared content-hash helper. Keep no-op incremental runs on the existing fast path and use generation 0 as named compatibility metadata until exact-delta generations are active.
Also make full-path file_hash persistence fail closed on delete/upsert/commit errors before file_state is written, matching the incremental metadata policy more closely.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner (253 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Expose the existing exact-delta XXH3 file hash helper through the internal pipeline API and have file-delta metadata use the shared helper. This prepares changed-file discovery work without changing incremental routing or default indexing behavior.
Add a focused pipeline regression proving direct helper output matches file_state.content_hash exactly, so future classifier work cannot drift into a second hash format.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a transactional store primitive for deleting all canonical graph and freshness metadata owned by one file. The helper removes owned nodes and edges, owner rows, symbol exports, import refs, file hashes, and file state, then optionally marks a derived view stale for the delete generation.
This is store-layer groundwork only: pipeline delete and rename routing still fail closed until changed-file discovery and affected-frontier coverage are complete.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Replace the plain cbm_init() static guard with a C11 atomic one-shot state machine so parallel extraction callers wait for allocator/library initialization instead of racing the guard.
Make the macOS mach timebase cache use the same release/acquire publication pattern while leaving the Linux, BSD, and Windows timing paths unchanged.
Add a parallel cbm_init() idempotence regression registered first in the parallel suite.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=parallel ./build/c/test-runner; CBM_ONLY_SUITE=platform ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Make cbm_system_info() publish its first-call cache with a C11 atomic one-shot state machine while preserving the existing Windows, macOS, BSD, and Linux detector branches and fallbacks.
Build the semantic pretrained-token map locally, use the portability strdup wrapper for new allocations, and keep the deterministic sparse-vector fallback when allocation fails without leaking partial key/value pairs.
Add a parallel first-call system-info regression covering consistent published snapshots.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=system_info ./build/c/test-runner; CBM_ONLY_SUITE=worker_pool ./build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Treat max_workers as the total number of active callbacks, including the caller thread, instead of spawning max_workers helpers and then also running work on the caller. This removes one extra thread per dispatch and matches callers that allocate per-worker state for exactly worker_count slots.
Reuse the portable thread wrapper default stack policy by passing stack_size=0, and document the total-concurrency contract in worker_pool.h. Add a focused regression that holds three iterations open and verifies max_workers=2 never exceeds two active callbacks.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=worker_pool ./build/c/test-runner; CBM_ONLY_SUITE=parallel ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Build deleted-node sets before mutating graph indexes so allocation or invariant failures return before partial deletes.
Reuse existing node_by_id keys as the temporary deleted-set ownership transfer instead of allocating duplicate ID strings, and size path lookup tables to the number of paths instead of over-reserving.
Add batch delete cascade coverage for cbm_gbuf_delete_by_paths and assert delete_by_label return values.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=graph_buffer ./build/c/test-runner; CBM_ONLY_SUITE=incremental ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Return only exactly represented directory names from cbm_readdir so callers never stat, open, list, or delete a fabricated prefix path. This centralizes the Windows UTF-8 expansion edge case in compat_fs instead of duplicating checks at each caller.
Also make MCP bad-project available_projects hints append only complete escaped JSON strings and expose available_projects_truncated when the compact hint omits entries.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=platform ./build/c/test-runner; CBM_ONLY_SUITE=mcp ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add cbm_getenv_fits so path-like environment values can fail closed when set but too long, instead of being silently truncated by bounded copies or falling back to HOME.
Use checked formatting for Claude hook command/script paths, install/uninstall Claude config paths, install/update binary targets, and PATH directory writes. Overlong paths now return or report an error before mutating a truncated location.
Add focused CLI regressions for overlong hook homes and CLAUDE_CONFIG_DIR, plus platform coverage for the new environment helper.
Validation: make -f Makefile.cbm cbm; make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=cli ./build/c/test-runner; CBM_ONLY_SUITE=platform ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Validate CLI config and instruction parent paths before creating directories so truncated fixed buffers cannot create a different target. Route JSON and markdown writes through the existing cbm_write_file_atomic helper for consistent replace semantics.
Add regression coverage for overlong JSON config and instruction paths to prove failed writes do not create truncated parent directories.
Validation: make -f Makefile.cbm cbm; make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=cli ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Make SessionStart hook comments explicit that stdout is harness-injected session context, not MCP protocol output. This removes vague same-methodology wording without changing install or hook behavior.
Validation: CBM_ONLY_SUITE=cli ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a root-overridable self-test harness for scripts/check-source-safety.sh so the guard can be tested against synthetic trees without scanning the real repository.
Cover clean input, MCP/server stdout writes, unsafe string APIs, and new raw filesystem APIs in production diffs. Add a dedicated lint-source-safety target because the broader lint-no-suppress path is currently blocked by existing NOLINT audit failures before this guard can run.
Validation: bash scripts/test-source-safety.sh; bash scripts/check-source-safety.sh; git diff --check; make -f Makefile.cbm lint-source-safety.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add CBM_PROFILE-gated spans around the httplink pass phases so generated/dependency hot spots can be measured without changing route semantics or protocol output.
The spans separate node collection, route discovery, prefix resolution, registration edges, route insertion, call-site scanning, and match/link work.
Validation:
- bash scripts/check-source-safety.sh
- git diff --check
- make -f Makefile.cbm build/c/test-runner
- CBM_ONLY_SUITE=httplink ./build/c/test-runner
- CBM_ONLY_SUITE=pipeline ./build/c/test-runner
- make -f Makefile.cbm cbm
- CLI CBM_PROFILE smoke on a temporary Express repo
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Replace the pass_httplinks private full-file reader with a shared bounded httplink helper that uses the existing platform file-size and mmap wrappers. Keep route extraction behavior unchanged while naming the full-source byte cap and adding a focused cap/length regression test.
Validation:
- bash scripts/check-source-safety.sh
- git diff --check
- make -f Makefile.cbm build/c/test-runner
- CBM_ONLY_SUITE=httplink ./build/c/test-runner
- CBM_ONLY_SUITE=pipeline ./build/c/test-runner
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Strengthen the file-delta publish and pipeline route parity fixtures by dumping delta-updated and fresh stores to temporary DBs and comparing canonical graph facts through the shared test_graph_diff helper.
This replaces count-plus-sampled-field evidence with stable node, edge, and file-hash equality while keeping production code unchanged. Validated with store_nodes, pipeline, source-safety, and diff-check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a batch-aware exact-delta planner preflight that checks inbound edges into the file being replaced before any future exact-delta publish route can run. Sources owned by files in the same delta batch are allowed; unchanged external sources and unowned structural sources fall back to full rebuild behavior.
This keeps live exact-delta routing/defaults unchanged while preventing a future owner-table delete/publish path from dropping cross-file or structural inbound edges. Covered by pipeline fallback regressions, store_nodes, source-safety, diff-check, and the incremental suite.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Require exact-delta planning to see existing file_state and node ownership for each upserted file before endpoint and frontier planning. Delta publish deletes stale graph rows through node_owners and edge_owners, so treating full-dump-style stores without ownership metadata as exact candidates could leave stale rows behind.
Add a reusable store owner-count helper and focused pipeline coverage for missing ownership fallback while keeping the live incremental route unwired/default-off.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check; escalated CBM_ONLY_SUITE=incremental ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an internal store-to-scratch-graph seeding helper for future exact-delta indexing. The helper copies unchanged persisted resolver targets into a graph buffer, skips changed paths, and seeds the registry with the same symbol labels used by the definition passes.
Consolidate registry-symbol and import-target label predicates so definition, import resolution, incremental registry seeding, and scratch seeding cannot drift. Add focused pipeline tests for stale changed-path exclusion and external endpoint descriptor planning.
This does not wire the production incremental route, change defaults, publish exact deltas, or alter MCP/CLI API behavior.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Move incremental changed/deleted/mode-skipped ownership into a single internal classification struct so the existing containment path and future exact-delta route decision share one pre-load state.
This preserves current routing and publish behavior, keeps incremental_reindex default-off, and switches touched string copies to cbm_strdup for repo wrapper consistency.
Validated with: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; escalated CBM_ONLY_SUITE=incremental ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a focused route-helper regression for the publish_error path. The test applies a valid exact-delta candidate without reserving its generation, so the atomic store publish/complete step fails and the helper reports fallback instead of success.
The assertion also verifies the candidate node is absent afterward, proving the failed publish did not leak graph rows through the route helper.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an internal exact-delta route helper that reuses the existing batch planner and the atomic store batch-complete primitive. Planner fallback returns a fallback route without writing the store; candidate batches publish atomically.
Update the pipeline descriptor/planner/publish fixture to exercise both route-helper outcomes: a single main-file delta falls back without changing the graph, while the helper/main batch applies and leaves the expected graph, file_state generations, and reverse import metadata.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add cbm_store_publish_file_delta_batch_complete() so exact-delta callers can publish a same-project/same-generation batch and mark the reserved generation complete in one store transaction.
Refactor generation completion into a transaction-local body and share batch delta validation with the existing batch publish helper. This avoids a future live exact-delta route committing graph rows before a generation-complete update fails.
Add a store_nodes regression proving a valid delta rolls back when completion cannot find a reserved generation, and update the pipeline parity fixture to use the atomic complete-generation primitive.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Update the pipeline descriptor/planner/publish fixture so the successful helper/main batch plan is committed through cbm_store_publish_file_delta_batch() instead of two sequential single-file publishes.
This keeps production routing and defaults unchanged while proving the exact-delta batch planner, batch store publish helper, and generation finish lifecycle compose for the route-boundary helper/main case.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an internal store batch publish helper for exact-delta indexing. The helper validates all file deltas before opening a transaction, requires one project and one generation per batch, reuses the existing single-file publish body, and rolls back the whole batch on the first file-level failure.
Add a store_nodes regression where a valid helper delta is followed by a main delta with an unresolved edge endpoint. The failed batch leaves the previous complete generation's helper/main graph and helper file_state intact.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an internal exact-delta batch preflight that reuses the single-file planner's fail-closed checks, resolves edge endpoints against all descriptors in the candidate batch plus the existing store, rejects mixed-project batches, and unions affected paths from import/export metadata.
Extend the pipeline delta fixture to prove the gap this closes: single-file planning of main.go fails before helper.go is published, while batch planning over both descriptors succeeds and reports both affected paths. This still does not enable production routing or change default incremental behavior.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a focused pipeline-level exact-delta fixture that composes graph-buffer descriptor construction, file metadata attachment, planner decisions, store generation lifecycle, and file-delta publish for a helper/main change.
The test remains internal and does not enable production routing or change default incremental behavior. It documents the current sequential orchestration boundary: publish the changed exporting helper first, then plan and publish the importer once the endpoint is in the store.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a same-generation multi-file publish fixture for exact deltas. The test replaces helper.go and main.go under one reserved generation, finishes the generation only after both publishes succeed, and verifies stale nodes are removed, final nodes/edge remain, file_state rows carry the final generation, and import metadata points to the new helper.
Refactor the local store delta test helpers so helper and main delta variants share descriptor construction instead of duplicating another full stack of test fixtures.
This is test-only and does not change production routing, defaults, MCP/CLI API surface, writer behavior, or file-delta publish behavior.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner (72 passed); CBM_ONLY_SUITE=pipeline ./build/c/test-runner (242 passed); CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner (96 passed); bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a focused failure-lifecycle test for exact file delta publish. The test reserves a generation, verifies a bad delta publish rolls back the graph, then marks the reserved generation failed and checks the failed terminal row replaces the reserved state.
This is test-only and does not change production routing, defaults, MCP/CLI API surface, writer behavior, or file-delta publish behavior.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner (71 passed); CBM_ONLY_SUITE=pipeline ./build/c/test-runner (242 passed); CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner (96 passed); bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a deterministic store-level parity fixture for exact file delta publish. The test compares a base graph plus a main.go delta against a fresh final graph built from the final file deltas, including generation reservation/finish lifecycle, graph rows, file_state, exports, and imports.
This is test-only and does not change production routing, defaults, MCP/CLI API surface, writer behavior, or file-delta publish behavior.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner (70 passed); CBM_ONLY_SUITE=pipeline ./build/c/test-runner (242 passed); CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner (96 passed); bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a store-level lifecycle helper that finishes a reserved index generation as complete or failed. The helper only updates rows still marked reserved, writes completed_at, validates the allowed status vocabulary, and uses the existing BEGIN IMMEDIATE transaction path.
This keeps multi-file exact-delta publishing explicit: reserve once, publish file deltas, then finish the generation after the caller knows the whole affected set succeeded or failed. No production routing, defaults, MCP/CLI API surface, writer behavior, or file-delta publish behavior changes in this slice.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner (69 passed); CBM_ONLY_SUITE=pipeline ./build/c/test-runner (242 passed); CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner (96 passed); bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Allocate per-project index generations inside the store with BEGIN IMMEDIATE and a reserved metadata row. This avoids caller-side MAX(generation)+1 guesses before exact-delta publish routing exists.
Add focused store tests for monotonic reservation, fingerprint normalization, missing-project rollback, and output reset. No production exact-delta routing, defaults, MCP/CLI API surface, writer behavior, or publish behavior changes in this slice.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner (67 passed); CBM_ONLY_SUITE=pipeline ./build/c/test-runner (242 passed); CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner (96 passed); bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an internal helper that attaches owned file_hash and file_state metadata to file-delta descriptors, including an XXH3 content hash, language, generation, and indexed_at timestamp.
Share platform mtime conversion across full indexing, incremental classification/hash persistence, and exact-delta metadata to avoid drift.
Keep legacy file_hashes.sha256 semantics unchanged and do not enable exact-delta production routing or change defaults.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add fail-closed exact-delta planner preflight for unsupported derived views and unresolved edge endpoints before any future publish path can run.
Reuse the existing store QN lookup for external endpoint resolution, guard endpoint scratch allocation, and add focused fallback plus positive resolved-endpoint tests.
This does not change production routing, defaults, MCP/CLI APIs, cache behavior, writer behavior, or publish behavior.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Harden the internal exact-delta planner so candidates require file_hash and file_state metadata before any future publish route can be considered.
Add explicit delete and rename fallback reasons because exact cleanup semantics for old paths, owner rows, reverse importers, and freshness state are not implemented yet.
Add focused planner tests for metadata-required candidates, missing metadata fallback, delete fallback, and rename fallback. This does not change incremental routing, defaults, or publish behavior.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an internal non-writing planner for future exact-delta routing. The planner classifies safe leaf-frontier candidates separately from fallback decisions for invalid input, unsupported graph-buffer edges, frontier lookup errors, and oversized affected frontiers.
Reuse the store affected-frontier helper and add focused pipeline tests for candidate planning, unsupported-edge fallback, and high-fanout fallback. This does not change incremental routing, defaults, or publish behavior.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an internal graph-buffer to store file-delta adapter with owned cleanup for future exact incremental indexing.
Reuse the existing IMPORTS local_name parser instead of duplicating edge-property parsing, and surface unsupported graph-buffer edges as an explicit fallback signal instead of publishing partial deltas.
Add focused pipeline tests for descriptor extraction and unsupported-edge handling. This does not change incremental routing, defaults, MCP/CLI APIs, or production publish behavior.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a store-level helper for future exact-delta planning that returns a sorted unique frontier containing the changed file, importers of old persisted exports, and importers of caller-provided new exports.
The implementation composes existing symbol export and import reference metadata queries, reuses store-local string-array cleanup, and adds focused store tests for retained exports, deleted exports, new exports, unrelated imports, and high-fanout dedupe.
This does not wire pipeline incremental behavior, change MCP or CLI APIs, enable autoindex, or change incremental defaults.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a store-level file delta descriptor and publish helper that validates project/path contracts, deletes owned graph rows, writes graph facts, ownership metadata, import/export metadata, file hashes, file_state, and derived freshness in one SQLite transaction.
Cover both rollback and success behavior: an unresolved edge target after cleanup starts leaves the old generation visible, while a successful publish advances graph rows and metadata together.
No pipeline wiring, incremental default change, MCP/CLI API change, second storage location, or full-dump behavior change is included in this slice.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=store_search ./build/c/test-runner; CBM_ONLY_SUITE=store_bulk ./build/c/test-runner; CBM_ONLY_SUITE=sqlite_writer ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; git diff --check; bash scripts/check-source-safety.sh.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add symbol_exports and import_refs store APIs for exact-delta planning, including export listing and importer path lookup through indexed metadata.
Keep the slice additive: no pipeline wiring, no incremental default change, no MCP or CLI API change, and no canonical graph schema behavior change.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=store_search ./build/c/test-runner; CBM_ONLY_SUITE=store_bulk ./build/c/test-runner; CBM_ONLY_SUITE=sqlite_writer ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; git diff --check; bash scripts/check-source-safety.sh.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add store APIs for node and edge owner upsert plus delete-by-file cleanup, using the existing cached statement and result-code conventions.
Cover the helpers with real node and edge rows so future exact-delta indexing can prove owner update and cleanup semantics without changing pipeline behavior.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=store_search ./build/c/test-runner; CBM_ONLY_SUITE=store_bulk ./build/c/test-runner; CBM_ONLY_SUITE=sqlite_writer ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; git diff --check; bash scripts/check-source-safety.sh.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a small store-level API for exact-delta file freshness metadata: cbm_file_state_t plus upsert/get/delete/free helpers. The current file_hashes classifier path remains unchanged.
Name the metadata status/default vocabulary so future publish code and schema defaults do not drift into duplicate raw strings.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=sqlite_writer ./build/c/test-runner; CBM_ONLY_SUITE=store_search ./build/c/test-runner; CBM_ONLY_SUITE=store_bulk ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add additive metadata tables and indexes for future staged exact-delta indexing: generations, file state, node/edge owners, symbol exports, import refs, and derived view freshness.
Keep this slice behavior-neutral. Normal store open migrates the schema, query-only open still does not create missing DBs, and writer-produced DBs remain minimal but migrate through cbm_store_open_path().
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=store_nodes ./build/c/test-runner; CBM_ONLY_SUITE=sqlite_writer ./build/c/test-runner; CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner; CBM_ONLY_SUITE=store_search ./build/c/test-runner; CBM_ONLY_SUITE=store_bulk ./build/c/test-runner; CBM_ONLY_SUITE=incremental ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Call the shared import-map builder and freer directly from calls, usages, semantic, LSP cross, and parallel passes.
This keeps import-map construction on one internal semantic path for future caching and exact-delta work without changing behavior or public APIs.
Validated with ASan test-runner rebuild, CBM_ONLY_SUITE=edge_imports, CBM_ONLY_SUITE=pipeline, CBM_ONLY_SUITE=parallel, source-safety, and git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Move the duplicate sequential and parallel per-file IMPORTS edge wrappers into a single internal helper beside the import resolver and edge emitter. This keeps source-file lookup, resolver ordering, JSON properties, and self-edge filtering identical across both definition paths without changing public APIs.
Validation: make -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=edge_imports ./build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; bash scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Update the edge_imports suite header to match the current registered test behavior: all fixtures are expected to pass and the suite is run through CBM_ONLY_SUITE=edge_imports.
Validation: CBM_ONLY_SUITE=edge_imports ./build/c/test-runner (59 passed); git diff --check; bash scripts/check-source-safety.sh.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>