feat(agent): add bounded graph discovery and orientation - #213
Merged
Conversation
forhappy
marked this pull request as ready for review
August 10, 2026 01:48
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
GRAPH_REPORT.mdbegin with a bounded Agent Orientation carrying graph health, build identity, evidence-backed anchors, and injection-safe Markdownmainshared lexical normalization and opt-in BM25 profiling without weakening the discovery contractWhy
Compass already advised agents to query the graph first, but the public result and report surfaces did not provide one typed, bounded, provenance-rich context model. Broad lexical scoring also missed compositional workflow questions such as checkpoint creation and repository-state recording. This change makes Compass usable as a local context layer for coding assistants while keeping correctness, determinism, ambiguity, graph health, and resource limits explicit.
Agent workflow
compass init, install the detected or explicitly selected agent integration withcompass install, and keepcompass watchrunning in a second terminal; usecompass update .if watch is unavailable or failed.compass queryfirst. For a first session or broad repository orientation, read only the bounded Agent Orientation at the start ofcompass-out/GRAPH_REPORT.md, then query.next=<cursor>using--cursor <cursor>only when exhaustive scope is required.The Compass skill and native platform rules changed to install this workflow consistently. They are local instruction assets written by
compass install; they do not grant permissions, call a model, or replace source verification.Compatibility
The discovery and orientation schemas and CLI options are additive. Legacy Store snapshots remain readable with explicitly degraded relationship recall. Updated persistent indexes and SQLite query caches are versioned and rebuilt rather than silently reinterpreted. Migration and compatibility notes are included. Legacy traversal and CompassQL routing remain available.
Main reconciliation
Merged
origin/mainat5c816045in merge commit01946f2a. Conflict resolution:GitHub reports the PR mergeable.
Validation completed after merge
cargo test -p compass-model -p compass-query -p compass-mcp --lib --tests --lockedcargo test -p compass-cli --lib --locked: 78/78cargo test -p compass-cli --test install_cli --locked: 24/24 platform install, upgrade, plugin-load, and uninstall casescompass-model,compass-query,compass-mcp, andcompass-cliacross all targets/featurescargo fmt --alland diff checksd7edd6c3: explicit opaque cursor and text-budget guidance plus atomic OpenCode/Kilo preflight; local unit, install integration, formatting, and strict Clippy gates pass5d0fd9e1: exact-first immutable Store/SQLite parity, bounded multi-concept intersections, predicate-prioritized recall, production-aware behavior ranking, and explicit exact-name completenesscargo test -p compass-query --all-targets --locked: 118 unit tests plus every query integration target pass, including 21 immutable Store parity tests and the reviewed 500-query relevance corpuspython3 -m unittest discover -s benchmarks/performance/tests -p 'test_*.py': 195/195Qualification status
The sealed legacy baseline covers seven pinned repositories with 14 fresh workloads and 10/10 samples per workload. Warm MCP parity is explicitly unavailable on that legacy revision because its generic MCP response has no typed
structuredContent; the harness does not synthesize a semantically incomparable digest.Angular is excluded, not passed: both the initial 1,800-second build and the bounded 3,600-second recovery timed out while actively materializing, and neither produced a valid graph/store artifact.
The final sealed seven-repository run completed on pushed HEAD
2a4a3cde: 28/28 workload results pass, all 280/280 measured samples are eligible, every sample has top-1 and recall@10 = 1, ambiguity checks pass, and all graph inputs were read-only reuse. Warm p50 improved in 13/14 rows (median 1.66%) and warm p95 improved in 10/14 (median 2.08%); Rails route recognition remains a disclosed noisy p95 outlier. The harness correctly reports onlysuite-mismatchagainst the legacy baseline because the reviewed oracle manifest changed, so no cross-suite latency/RSS ratios are promoted. Sealed evidence:plan013-after-final-v3/run.jsonsha256f32f0896f4995c843dc0fe31948433a2b05e48801efa746ac06e3b867d291324.