Add a failed-first NASM canary for ordinary call puts syntax and restore extraction by matching the grammar's actual_instruction node.
The NASM resolver is language-gated, requires the opcode to be call using portable ASCII case folding, and returns the first operand symbol so non-call instructions such as ret are ignored.
Validation: failed-first extraction produced 247 passed / 1 failed at nasm_call_edge; after the fix, git diff --check, scripts/check-source-safety.sh, make -j8 -f Makefile.cbm build/c/test-runner, and CBM_ONLY_SUITE=extraction ./build/c/test-runner passed with 248/248.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Use the LLVM grammar's instruction_call, instruction_invoke, and instruction_callbr node names instead of dead call/invoke token names, so call extraction reaches real instruction nodes.
Teach the shared field-based callee resolver to read a callee field and unwrap simple value/var/expression wrappers, which keeps the fix reusable for grammars that expose a semantic callee field.
Add an exact LLVM IR canary for call void @callee(). Failed-first validation produced 246 passed / 1 failed before the fix; after the fix, extraction passes 247/247. Also passed git diff --check, scripts/check-source-safety.sh, and make -j8 -f Makefile.cbm build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Use the vendored Meson grammar's normal_command node and command field to extract Meson command callees such as project and executable.
Add exact call-edge canaries for Meson and Just. The rebuilt failed-first extraction run showed Meson missing project/executable calls while the Just canary already passed through the existing generic function_call path.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=extraction ./build/c/test-runner passed 246/246.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Compute each edge's LinkRank value once and reuse it for both the persisted linkrank row and node_degree.linkrank_in accumulation.
This keeps ranking linear in edges but removes the duplicate edge scan and duplicate formula evaluation in the post-PageRank phase. The node_degree path still works independently if the linkrank insert statement cannot be prepared.
Add a regression test that compares node_degree.linkrank_in with the sum of incoming persisted LinkRank rows.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=pagerank ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Wire the rank_scope config value into cbm_pagerank_compute_with_config so config-backed PageRank and LinkRank can select full, project, or dependency scope.
Keep the default as full to preserve existing project-plus-dependency behavior, and clear the full project/dependency rank prefix before writing any narrower scope because the rank tables do not persist scope.
Update the config registry wording and add a regression test for full-to-project stale-row cleanup, invalid-scope fallback, and config temp-dir cleanup.
Validation: git diff --check; bash scripts/check-source-safety.sh; CBM_ONLY_SUITE=pagerank ./build/c/test-runner; CBM_ONLY_SUITE=cli ./build/c/test-runner; make -j8 -f Makefile.cbm build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Restore verified callee extraction for Jsonnet functioncall, Typst call, Make function_call/shell_function, and Puppet function_call nodes.
Align the Make call-node specs with the verified shell_function path. Leave Puppet include syntax and other mismatched upstream helper candidates deferred to parse-probe work instead of broadening call-node behavior without evidence.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=extraction ./build/c/test-runner (245 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Restore verified tree-sitter callee extraction for CSS function calls, SQL invocations, Elm function_call_expr targets, and Nix apply_expression heads.
Add extraction canaries for each restored path and keep unverified mismatched grammars deferred to parse-probe work instead of guessing tree shapes.
Validation: git diff --check; bash scripts/check-source-safety.sh; CBM_ONLY_SUITE=extraction ./build/c/test-runner (241 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Restore upstream-compatible textual CBMCall synthesis for Java method references, Kotlin operator/convention syntax, and C++/CUDA operator and implicit call forms. These call records are the join input for existing LSP resolutions, so the graph can form CALLS edges for method references, operator overloads, copy-init, conversion operators, and delete/destructor operands instead of silently dropping resolved calls.
Keep the implementation language-gated and reuse existing arena allocation, cbm_memmem, TS_FIELD, and cbm_calls_push helpers. Also normalize C++ template_function callees to the bare name so template-call LSP resolutions have the same textual join key.
Validation:
- git diff --check
- bash scripts/check-source-safety.sh
- make -j8 -f Makefile.cbm build/c/test-runner
- CBM_ONLY_SUITE=extraction ./build/c/test-runner
- CBM_ONLY_SUITE=java_lsp ./build/c/test-runner
- CBM_ONLY_SUITE=kotlin_lsp ./build/c/test-runner
- CBM_ONLY_SUITE=c_lsp ./build/c/test-runner
- CBM_ONLY_SUITE=matrix_known_classes ./build/c/test-runner
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Keep the shared LSP override index semantically aligned with the linear resolver. C++ textual callees using :: or -> now match dotted LSP QNs, and allowed original-text reason joins cover function-pointer and implicit-call strategies without falling off the indexed fast path.
Use the project cbm_strdup compatibility wrapper for indexed keys and retain the existing incomplete-index fallback to the linear helper when key allocation or formatting fails.
Add focused parallel-suite tests for C++ segment matching, reason-gated joins, indexed/linear parity, and overlong-key fallback.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=parallel ./build/c/test-runner; CBM_ONLY_SUITE=c_lsp ./build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Restore upstream-compatible extraction behavior for Objective-C, Dart, and Rust call attribution without reintroducing duplicate scope paths.
Objective-C now resolves top-level C function definitions and attributes method-body calls to the method under the implementation class. Dart function bodies inherit the preceding function or method signature scope. Rust impl items use the class-boundary path for impl type scopes.
Add deterministic canaries for ObjC helper calls, Dart body calls, Rust impl method calls, and update the Dart language contract now that the gap is closed.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=extraction ./build/c/test-runner; CBM_ONLY_SUITE=lang_contract ./build/c/test-runner; CBM_ONLY_SUITE=grammar_labels ./build/c/test-runner; CBM_ONLY_SUITE=grammar_regression ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Restore focused upstream extraction fixes for PureScript exp_apply callees, SCSS @function call edges, Julia assignment-form short functions, and Agda body-call attribution.
Keep the changes branch-compatible: use existing arena/text helpers, preserve plain Julia assignments as variables, skip Agda type-signature expressions so types do not become CALLS edges, and add deterministic extraction regressions for each restored behavior.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=extraction ./build/c/test-runner; CBM_ONLY_SUITE=grammar_regression ./build/c/test-runner; CBM_ONLY_SUITE=grammar_labels ./build/c/test-runner; CBM_ONLY_SUITE=lang_contract ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Port the next upstream correctness slice in fork-compatible form. TSX per-file JSX import resolution no longer emits raw relative module specifiers as final targets; Java static imports retry package-qualified classes by registered short name before falling back to text; OCaml unified call scoping now mirrors value_definition naming and skips nested local let scopes; C/C++ out-of-line method callers are rebuilt with the resolved class QN so LSP caller joins match the extractor.
Focused validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=ts_lsp ./build/c/test-runner; CBM_ONLY_SUITE=java_lsp ./build/c/test-runner; CBM_ONLY_SUITE=extraction ./build/c/test-runner; CBM_ONLY_SUITE=c_lsp ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Port the upstream Python/Kotlin builtin target fixes and the Windows ARM64 stdlib include onto the fork branch. Python call extraction now keeps keyword-filtered builtins only when the generated stdlib data provides real LSP target nodes, so LSP-resolved builtin calls can form CALLS edges. Kotlin now injects kotlin.Any plus toString/equals/hashCode target definitions before graph minting so lsp_kt_any edges point at real nodes. compat.h includes stdlib.h directly for getenv/_putenv_s declarations on stricter Windows toolchains.
Focused validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=extraction ./build/c/test-runner; CBM_ONLY_SUITE=kotlin_lsp ./build/c/test-runner; CBM_ONLY_SUITE=grammar_labels ./build/c/test-runner; CBM_ONLY_SUITE=platform ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Port the upstream deny-wins-by-value behavior for infra URL route extraction so upstream/config/healthcheck URLs cannot be re-minted by duplicate string refs with less specific key paths.
Preserve the fork's manifest skip and existing route-literal filtering, use the existing hash table and logging paths, and add an integrated pipeline canary that keeps a positive push_endpoint route while rejecting registry and healthcheck URLs.
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 (284 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Use the existing exact-delta planner and store delete publisher for the narrow safe case of one deleted file, no changed files, and FAST-or-lighter indexing. Rejected delete shapes continue to fall back before graph mutation or full publish.
Add a focused pipeline regression that deletes an isolated file, proves a completed positive generation was published, and compares the result against a fresh FAST rebuild.
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 (283 passed); CBM_ONLY_SUITE=incremental ./build/c/test-runner (160 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Replace all-caps INSTEAD OF language in MCP tool descriptions with precise preference wording. This keeps the guidance actionable without overstating behavior or changing any tool names, schemas, or dispatch paths.
Extend the tool-consolidation regression to check both streamlined and classic tool lists for this wording.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Clarify that graph-backed default tools can trigger first-use auto-indexing, while search_code searches source for an already indexed/current project. Align MCP schemas, installed CLI guidance, and SessionStart reminders with the actual handler paths.
Add a tool-consolidation regression so future schema/help text does not claim all default tools auto-index.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a shared git snapshot provider for HEAD, dirty worktree hash, and tracked file count. The provider uses the existing portable command fallback, streams status output with O(1) buffer memory, keeps clean trees unambiguous, and supports non-git fallback without changing incremental defaults.
Migrate watcher polling to the provider with flags so baseline still avoids dirty-status work, normal polls check HEAD plus dirty state, and post-index refresh updates HEAD, dirty hash, and file count together.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=watcher ./build/c/test-runner. Pipeline suite also passed after adding git_snapshot to the shared test runner link before the final dirty-hash clean-state tweak.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Centralize git command formatting, path validation, null-device selection, first-line capture, and command-size checks for git context and watcher code.
This keeps the current command fallback behavior, makes Windows shell metacharacter handling consistent, replaces a touched watcher strdup path with cbm_strdup, and prepares the next git snapshot/pre-discovery acceleration slice without adding a new default route.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=watcher ./build/c/test-runner; CBM_ONLY_SUITE=pipeline ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Remove git_context.c's private strdup helper and replace literal command/output buffer sizes with CBM-prefixed constants backed by the repository size constants.
This is a prerequisite cleanup for a future shared git snapshot boundary; it does not change command syntax, dependencies, pipeline routing, stdout/stderr behavior, or default incremental behavior.
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 (282 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Centralize pipeline DB path formatting through a bounded CBM_PATH_MAX helper reused by incremental routing and full-dump persistence. The full dump path now fails before mkdir or SQLite dump when the DB path or parent directory cannot be represented, rather than truncating into a different destination.
Use cbm_strdup and the existing cbm_mkdir_p portability wrapper, preserve normalized forward-slash cache paths, and mirror the CLI parent-dir backslash handling for explicit Windows-style DB paths.
Add a focused pipeline regression that builds an overlong explicit DB path and verifies the truncated prefix file is not created.
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 (282 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Centralize watcher git command formatting so every cbm_popen path validates the root path and checks snprintf truncation before executing.
Reject watch roots that cannot fit the core git commands instead of accepting a path that would later be truncated. Keep POSIX submodule dirty hashing best-effort, so optional submodule probing does not block the portable parent-repo watcher path.
Add a focused watcher regression for an overlong but shell-safe path and validate with source-safety, a forced test-runner rebuild, and CBM_ONLY_SUITE=watcher.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Hash-confirm same-size mtime drift against current file_state metadata before marking a file changed. When a touch-only drift is verified, refresh file_hash metadata on the no-op path so later runs return to metadata-only classification.
Keep missing legacy file_state rows on the existing compatibility path for metadata-equal files, but fail closed for mtime drift without current content metadata. Add a regression covering generation stability and refreshed mtime storage.
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; CBM_ONLY_SUITE=incremental ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
query_graph warned on stale route-derived data only when the Cypher text named Route or route edge types. Broad queries can still return Route rows without spelling those terms, so they could expose stale route-derived graph data without a warning.
Scan the already-materialized Cypher result for returned .label columns containing Route and reuse the existing structured warning path. This does not add stdout/stderr output or change query execution.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=mcp ./build/c/test-runner (129 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
SvelteKit filesystem routes are derived from a concrete File node, but the route pass inserted those Route nodes without file_path ownership. That kept them outside exact file-delta cleanup and owner metadata even though decorator and gRPC route nodes are file-owned.
Pass the source File node path through the existing route upsert helper and add an infrascan canary that proves the generated Route keeps the source file path and HANDLES edge.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; CBM_ONLY_SUITE=infrascan ./build/c/test-runner (8 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Maintain contentless nodes_fts entries inside file-delta publish/delete transactions so BM25 search sees exact-delta node replacements without waiting for a full FTS rebuild.
The delete path uses SQLite FTS5's contentless delete command before removing old nodes, skips absent FTS tables for no-FTS builds, and only deletes rowids already present in nodes_fts to preserve legacy/test stores.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Return a structured search_graph warning when callers read route-derived graph data through label=Route or route-derived relationship filters and the routes derived view is stale.
This reuses the existing route-derived query vocabulary and adds a focused MCP canary for the direct Route-label search path.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Use the store module's heap_strdup helper instead of raw strdup when materializing vector search results. Only publish a result row after all copied strings succeed, and return CBM_STORE_ERR with cleanup on allocation failure instead of exposing a partially initialized row.
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 (69 passed); CBM_ONLY_SUITE=mcp ./build/c/test-runner (126 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add production FAST-route parity canaries for delete, rename-like delete+add, and new-folder insertion. Each case proves the current exact route fails closed to the containment path, preserves compatibility-generation semantics, and matches a fresh FAST rebuild.
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 (280 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Raise the live FAST exact-delta changed-file cap to two after the batch publish path gained same-generation node-before-edge ordering. Convert the former two-file fallback fixture into a production-route exact parity test, and add a three-file fixture that proves larger batches still fall back before publish and match a fresh FAST rebuild.
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 (277 passed); CBM_ONLY_SUITE=incremental ./build/c/test-runner (160 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Make batch file-delta publish order-independent for same-generation deltas by splitting the existing single-file publish body into reusable delete, node, edge, and metadata phases. Batch publish now deletes old rows for every file, inserts all new nodes, then inserts edges and metadata, so forward references to nodes from later deltas resolve inside the same transaction.\n\nAdd a two-file FAST exact-delta regression that publishes main.go before helper.go and compares the resulting database with a fresh FAST rebuild. The test helper now runs the postpasses needed for canonical node-property parity.\n\nValidation: 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 (276 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Make the test-only exact scratch helper choose the existing Branch node when present, matching the production exact incremental root-selection rule. This prevents the two-file scratch probe from creating project-root CONTAINS_FILE edges that the real indexed graph would not produce.\n\nNo production behavior changes. 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 (275 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a focused two-file Go probe for the multi-file exact-delta investigation. The helper builds an exact scratch graph by reusing the existing store seed, sequential pass, LSP cross, calls, usages, and delta-builder paths, without exposing new production API surface or enabling multi-file exact publish.
The probe verifies the module-level helper -> main.main USAGE edge exists in both scratch and the helper.go file delta. This narrows the remaining blocker: multi-file exact publishing stays disabled until broader end-to-end full-vs-delta parity is proven across affected frontier and derived surfaces.
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 (275 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Multi-file exact upsert was parity-unsafe: a two-file Go batch could miss a cross-file package-name USAGE edge compared with a fresh FAST rebuild. Limit live exact upsert to one changed file through a named constant and let larger batches fall through to the existing containment path before publish.
Keep the single-file exact path aligned with the full sequential pass order by carrying a per-file result cache and running lsp_cross before calls/usages only when that cache exists. Add parity coverage for the single-file exact path and for multi-file fallback to a fresh FAST rebuild.
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 (274 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Strengthen the live exact-upsert regression by snapshotting the FAST exact-update database, forcing a clean FAST rebuild of the same repo state, and comparing canonical nodes, edges, and file hashes with the existing graph diff helper. This keeps the test focused on semantic parity rather than transient row IDs.
Validation: git diff --check; bash scripts/check-source-safety.sh; make -j8 -f Makefile.cbm build/c/test-runner; captured CBM_ONLY_SUITE=pipeline ./build/c/test-runner (273 passed, exact route logged incremental.exact.done files=1).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Wire a conservative exact-upsert route for opt-in incremental FAST/DEP runs after classification and before the existing full graph load/redump path. The route reuses the existing scratch seed, extraction, descriptor metadata, batch planner, generation reservation, stamp, and publish APIs, and it falls back before publish for deletes, global-derived modes, oversized frontiers, planner rejection, or scratch/pass failures.
Add focused pipeline coverage for a safe isolated-file exact upsert with a positive generation and for FULL mode remaining on the containment path. 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 (273 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Seed Project, Branch, and Folder nodes into exact-delta scratch graphs so changed-file structure can regenerate the same containment endpoints that full indexing created. This avoids false fallback for ordinary Branch-to-File and Folder-to-File structure without publishing any production route by itself.
Add a focused pipeline regression for Branch-to-File containment: changed file nodes stay excluded from scratch, structure roots are available, descriptor generation emits the exact CONTAINS_FILE tuple, and planner accepts it as an exact candidate.
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 (271 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an internal helper that stamps a reserved positive generation onto an exact file-delta descriptor after preflight planning and before publish. The helper preserves the store API const contract by copying any attached file-state into descriptor-owned storage before handing it to publish.
Add focused pipeline tests for invalid zero generation, metadata stamping, and the plan-reserve-stamp-apply route so the live exact-delta path can keep provisional generation 0 during planning without publishing generationless deltas.
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 (270 passed).
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Keep plan-only exact-delta candidates usable with provisional generation zero, but make apply_file_delta_batch fail closed with missing_generation before calling the store publish path.
Add a focused regression for generation-zero apply attempts while preserving the existing publish_error coverage for positive but unreserved generations.
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.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a focused exact-delta regression proving multi-file delete batches fail closed with delete_batch_requires_full and leave existing graph nodes untouched.
This preserves the current safety boundary: single-file exact delete is supported internally, while mixed or multi-delete cleanup remains a separate design task before live routing.
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.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Route both delete-file-delta public APIs through one internal transaction helper so rollback, stale-derived-view marking, and optional generation completion cannot drift.
Keep the existing caller-visible validation behavior: cbm_store_delete_file_delta_complete still requires a positive reserved generation, while cbm_store_delete_file_delta keeps its existing argument contract.
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.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add edge owner paths to inbound-edge metadata so the file-delta planner can distinguish source-node ownership from edge cleanup ownership.
Add cbm_store_delete_file_delta_complete(), reusing the existing delete body while completing the reserved generation in the same SQLite transaction.
Allow only single-file exact delete candidates with a positive generation, existing ownership, inbound-edge safety, and complete affected frontier. apply_file_delta_batch now fails closed with frontier_requires_batch when affected paths are not all included in the supplied batch.
Rename and new-folder exact routing remain fallback/design tasks; production live exact routing remains unwired/default-off.
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; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=incremental ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a focused regression for the structural exact-delta boundary: descriptor generation may include a CONTAINS_FILE edge for the changed file, but planning must still fall back when the source folder endpoint is new and unresolved in the existing store.
This keeps new folder creation out of exact-delta routing until folder-node creation, cleanup, and full-vs-delta parity semantics are designed. Validated with git diff --check, scripts/check-source-safety.sh, build/c/test-runner build, and CBM_ONLY_SUITE=pipeline ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Emit regenerated CONTAINS_FILE edges from the file-delta descriptor when the edge targets the changed File node. This keeps the rule graph-semantic and language-independent while leaving new folder creation fallback-only through normal endpoint resolution.
Update the structural exact-delta fixture to model edge ownership, prove descriptor/planner acceptance, publish the delta, and verify duplicate structural edges are not left behind.
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.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add an internal store query that returns exact inbound edge tuples and owner paths for file-delta preflight.
Use it in the exact-delta planner so unowned structural CONTAINS_FILE edges are accepted only when the candidate regenerates the same source, target, and type tuple. Existing realistic full-pipeline structure still falls back when the descriptor omits that edge; live exact-delta routing remains unwired.
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; CBM_ONLY_SUITE=pipeline ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Make owner rebuild treat a rel_path as file-owned only when a File node exists for that path. Full-pipeline Folder nodes can carry directory paths in file_path, and those paths must not become exact-delta node or edge owners.
Expand the owner rebuild regression to cover Function, File, and Folder nodes, including a Folder -> File structural edge. Validated with diff check, source-safety, test-runner rebuild, store_nodes, pipeline, and incremental suites.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Add a focused pipeline exact-delta regression that drives the real file-structure helper for a nested file and proves structural containment stays fallback-only under the current descriptor ownership model.
This prevents a future live exact-delta route from publishing a partial graph when Project/Folder containment is present but not represented as owned regenerable delta data. Validated with diff check, source-safety, test-runner rebuild, and CBM_ONLY_SUITE=pipeline.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
Replace raw strdup calls in the incremental inbound-edge snapshot with cbm_strdup so the touched path follows the repository portability wrapper convention. Add a source-safety diff guard and self-test that reject newly introduced raw strdup calls in production code without failing historical existing uses.
Validation: git diff --check; make -j8 -f Makefile.cbm build/c/test-runner; make -f Makefile.cbm lint-source-safety; CBM_ONLY_SUITE=pipeline ./build/c/test-runner; CBM_ONLY_SUITE=incremental ./build/c/test-runner.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>