Skip to content

Make native query answers compact and honor output budgets - #352

Merged
forhappy merged 5 commits into
mainfrom
codex/compact-query-output
Oct 2, 2026
Merged

forhappy merged 5 commits into
mainfrom
codex/compact-query-output

Conversation

@forhappy

@forhappy forhappy commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Native query answers currently spend space on audit envelopes, duplicate node inventories and empty sections. Default CLI and MCP text now shows a compact, source-located answer with uncertainty intact; --verbose/--evidence exposes the full paged audit ledger. Raw query, Agent View and MCP structured contracts are unchanged, and exploration retains isolated requested symbols.

Finite commands share a strict UTF-8 output budget and an exact continuation. Commands without a native cursor save an immutable completed answer for compass output, so continuation never repeats an action. Oversized JSON/JSONL fails intact, and streaming events/watch/serve/REPL reject finite budgets before starting. Complete native responses use a bounded, corruption-checked cache keyed by verified graph, Program IR, profiles, request limits and semantic mode. Partial responses and source excerpts remain native.

Validation: workspace Clippy and native lib/bin tests passed (1,124 tests; two existing vendored grammar tests ignored), along with CLI product, all CLI suites (311 tests), renderer, MCP, store/query integration, CompassQL TCK/support and product-boundary gates. New regressions cover one-hop cost, Unicode budgets, immutable saved output, corruption/retention/redirected paths, machine output, init publication, cache invalidation and isolated exploration.

The fixed 50-question replay preserves all row verdicts (49/50) and reduces mean estimated output from 419 to 364 tokens, versus 550 for the installed comparator. The 25-question natural suite preserves 24/25 at 547 tokens versus 757. The qualification record includes source/artifact pins and both optimized binary hashes. On the four complete graphs, repeated-query medians are 30–34 ms versus 85–994 ms before; every raw JSON answer is byte-identical across binaries and repetitions. Partial Gson remains uncached, and some cold timings regress. These are source-reviewed text-recall panels over five pinned public repositories, not population-wide precision claims.

Compatibility and migration notes document compact defaults, the new output reader and --budget no longer selecting legacy traversal. JS/viewer and graph-publication qualification were not rerun locally because their contracts and source are unchanged; CI runs those broader gates.

All 14 CI jobs pass on 4cafb0eb, including the six native platforms, full CLI integration tests, nextest, query relevance, code-graph fixtures, JavaScript/VS Code, publishable archives, cargo installation and standalone launch, Windows installers, and dependency checks. Legacy fixtures explicitly select --traverse; disposable caches are excluded from Git and crate archives at every working-directory depth. Workspace packaging also passes locally with the four test-generated cache records present.

@forhappy
forhappy marked this pull request as ready for review October 2, 2026 08:46
@forhappy
forhappy merged commit 49bffe0 into main Oct 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant