Repository navigation
feat(cli): summarize committed reference-source inventories - #2768
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Thanks for adding the summary view in #2768, @To3akaRin. It gives people an inventory, outline, and size picture without making them sift through every file hash, while keeping the full graph available when they need it. The clear treatment of omitted outline entries and unknown sizes is especially helpful. |
Summary
Fixes #2442.
rea import-reference-source ROOT --detail summarynow answers the initial inventory question without printing every committed file hash and relationship. CompleteHistoricalSourceGraphoutput remains the default and is byte-identical to explicit--detail fullon the regression fixture.Problem and expected behavior
Large source imports require callers to consume the full graph just to inspect its inventory, languages, manifests and root structure. The opt-in
HistoricalSourceSummarycontains the canonicalHistoricalSourceManifest, provenance, VCS facts, inventory state, counts, file/directory states, known sizes, exclusions, limitations and a caller-selected outline.--outline-depthaccepts a nonnegative safe integer, defaults to 2 for summaries, and requires--detail summary. Depth 1 shows root children; depth 0 hides all outline entries.outline.omitted_entry_countcounts inventoried entries hidden by depth, separately from source exclusions and unexamined coverage. Known file bytes use decimal text for exact large totals, with an independent unknown-size count.Change and scope
createHistoricalSourceManifest; do not reread source files or reinterpret source evidence.This is an explicit local projection of an existing CLI operation. A new-provider/target-execution maintainer scope decision is not applicable. No upstream implementation or prompt text was copied.
Contract and boundary impact
HistoricalSourceGraph, selected by the CLI after resource cleanup.HistoricalSourceSummarymarker; default graph output and existing failures remain unchanged. No MCP tool/provider/catalog contract change.Expected effects:
Evidence and regression coverage
Before implementation, the new public CLI suite had 3 failures because the base rejected
--detail; 7 negative-input cases passed. After implementation, the new CLI suite passes 11/11:invalid_input.Number.MAX_SAFE_INTEGER.Existing import-status, exclusion and committed-graph suites also pass. POSIX permission behavior is exercised; the existing native-Windows cases are skipped on this macOS host.
Output and resource measurements
Compared the unchanged full output with summary depth 2 on this branch's real
src/tree: 1,840 entries (1,721 files, 119 directories), 10,459 relationships, and the same partial inventory and limitation. Summary retains 1,158 outline entries and explicitly omits 682. Every run produced the same root/graph commitment and manifest ID.tokenx1.3.0)Method: alternating full/summary public CLI invocations under
/usr/bin/time -l, four runs each, Node compile cache disabled, stdout captured and parsed. Each invocation starts a new Node process; source imports acquire no target/provider subprocesses, so the measured Node process is the workflow process family. First runs are process-cold, not a flushed filesystem-cache experiment; subsequent runs reuse OS filesystem caches. Background host work was not controlled. Tokens are a heuristic estimate of output only, not measured model usage or whole-agent-task cost. No stable elapsed-time, CPU or memory improvement is claimed. The selected output was 90.8% smaller in bytes; shallow trees and large exclusion/limitation lists need not shrink similarly. Depth 0 removes only the outline.Validation performed
npm run test:focused -- src/domain/referenceSourceSummary.test.ts src/domain/referenceSourceGraph.test.ts tests/boundary/cli/referenceSourceSummary.test.ts tests/boundary/cli/referenceSourceExclusions.test.ts tests/boundary/cli/referenceSourceImportStatus.test.ts— 31 passed, 2 Windows cases skipped before the added help assertion.npm run test:focused -- tests/boundary/cli/referenceSourceSummary.test.ts— final 11/11 passed, including help.npm run check— typecheck, lint, format, knip, metadata, module boundaries and architecture guards passed.npm run docs:check— passed, including the 2 README consistency tests.npm run verify:test-discovery— all 1,057 test files discovered exactly once.git diff --check— passed.Host: macOS arm64, Node.js 24.19.0, npm 11.17.0. The pinned Node.js 24.18.0 was unavailable after TLS/download failures; it was not tested locally. Full CI/coverage and Linux/Windows execution remain unverified locally. This projection uses no native analysis engine; no real-engine claims are made.
Before merge