feat(query): embed Grafeo code graph projection - #487
Merged
ScriptedAlchemy merged 6 commits intoAug 3, 2026
Merged
Conversation
|
# Conflicts: # Cargo.lock
ScriptedAlchemy
merged commit Aug 3, 2026
cd48a8b
into
codex/tracedecay-total-redesign-plan
18 of 23 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BTreeMapadjacency and hand-written BFS behindCodeGraphEvidenceAdapterV1with embedded, in-process GrafeoLpgStore, filteredGraphProjection, and BFS visitor APIs; no server, sidecar, query strings, second durable store, dual path, or fallbackgrafeo-{adapters,common,core}exactly to0.5.42with onlyalgos/lpg; nopetgraphor Grafeo query/storage featurePreserved contracts
The traversal retains a bounded Pareto frontier per node. This is necessary for byte-equivalent canonical results when a later weak edge equalizes paths that had different authority earlier.
Evidence
Final branch checks on PR #421 head
4615475cff7383a6f8c232953fc65f1e038eb75f:cargo test -p tracedecay-query --lib: 139 passed, 1 ignoredcargo clippy -p tracedecay-query --all-targets -- -D warnings: passedcargo test -p tracedecay-search-eval --lib: 38 passedcargo fmt --all -- --check: passedminimal-grafeo-features-okFalsifiable graph tests cover cycles/self-loops, convergent fanout, equal-cost and downstream-bottleneck paths, edge filtering, duplicate edges, missing/conflicting/foreign bindings, depth/candidate limits, deterministic ordering, stale/cancelled/unavailable states, and byte-equivalent duplicate-edge output.
Measurements
Same 16-symbol/30-edge fixture, 25 samples per process, three isolated process runs; table reports the median run. Peak RSS is
/usr/bin/timeprocess RSS, not runtime instrumentation.The fixture shows expected embedded-projection overhead: about 8.8× build p50, 3.3× traversal p50, and +1.5 MiB peak RSS. Absolute p95 remains below 0.7 ms; projection construction occurs once per immutable generation. No benchmark or memory API was added to production.
Limitations and future Work DAG safety
This PR does not implement Work/task DAG, git history, sessions/LCM, memory, or vectors.
Grafeo's direct
topological_sort/is_dagAPIs can operate over a label/type-filtered projection, so the domain-scoped code labels and edge types leave one embedded substrate available for a future Work DAG. Two constraints must be handled in that future adapter:Vecfrom anFxHashMap; user-visible order must be canonicalizednode_idsandedges_from; Work DAG mutation must use an application-owned single-writer lock or validate an immutable snapshotThe plugin registry wrapper also reports a cycle as a successful string row; a future typed adapter must call the direct
Option/boolean APIs instead. These are explicit adapter constraints, not reasons to addpetgraphor a standalone service.Rollback
Revert this child PR. Grafeo holds only a disposable derived projection, so rollback requires no persisted-data migration.
References