Repository navigation
feat(evidence): paginate retained evidence discovery summaries - #9084
Conversation
Let callers page summary metadata in canonical Evidence ID order without loading record payloads into the response. Keep filter and link totals global to all matches and preserve the unpaged response for existing clients.
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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no blocking issue was found. SummaryAdds optional metadata paging to
No new correctness or security issues were found. Source paths were checked and Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
MCP[MCP session records] --> Inspect[Shared bundle inspection]
CLI[CLI bundle file] --> Authenticate[Authenticate complete bundle]
Authenticate --> Inspect
Inspect --> Filter[Apply exact filters in Evidence ID order]
Filter --> Count[Count all matches and direct links]
Count --> Select[Select requested metadata rows]
Select --> Page[Return rows and optional page continuation]
Page --> Budget{MCP response fits?}
Budget -->|Yes| Deliver[Deliver response]
Budget -->|No| Recovery[Recommend smaller page or export]
Reviews (10) · Last reviewed commit: "chore: integrate main with evidence summ..." · Reviewed by Greptile |
|
The failed Linux shard (4/8) reports one failing test: The same named test passed on the exact base revision. Both the test and |
|
TL;DR: I ran the 4 changed test files from this PR on Node 22.23.4, 24.22.1 and 26.12.1. All 56 tests passed on each version. With 7 source files put back to the merge base f912a68, 7 tests failed on each version. Edit (20 Nov): I ran the new head, 0f1be10, in a VM, and the results are here. FindingsThe PR changes 13 files against the merge base: 4 test files and 9 others.
The red run fails the same 7 tests on all three Node versions. I read the names from the Node 24.22.1 log:
I read CI on head 9449d7b live with
The head is 48 commits behind main c78c8ae. Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/boundary/cli/analysisViewCli.test.ts tests/boundary/mcp/evidenceLinkInspectionMcp.test.ts tests/boundary/mcp/evidenceRecordSelectionMcp.test.ts tests/boundary/mcp/largeToolResult.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
Merge main a8527d4 and resolve the tool-description conflict by retaining the current concise contract while documenting optional metadata pagination, canonical order and whole-selection counts. Validation: all 30 selected domain and real MCP tests pass on Node 24.22.1 with repository-locked dependencies and the repository Vitest configuration. Coverage includes full and compact summary pages, retained record identities, link counts and paging, and large-response recovery. git diff --check passes. Full repository CI remains pending.
|
Merged Validation on the published tree: all 30 tests across The branch includes |
|
Updated to The exact-source validation run passed: locked This head also merges cleanly with main |
Keep the production changes from upstream and update the verification consumers that still asserted their retired contracts: - assert unknown workflow identity structurally and retain the bounded provider caveats; - observe the process capture's partial-error delivery while preserving live cleanup ownership assertions; - use the package's declared imports in the isolated release controller; - refresh the replay card digest after the Evidence subject identity migration; - use the supported compact Kimi profile while testing case-insensitive environment keys; - assert each public interface's own capture issue path. These are shared test and verifier compatibility repairs. The evidence summary pagination and config-printer feature changes remain separate.
Bring in morluto/rea@9ecfb109 (morluto#11650) with its original authorship and the narrowly scoped shared test/verifier repairs. The PR's functional patch is unchanged; the added repairs align existing checks with the accepted upstream subject identity, delivery, CLI and schema-profile contracts.
Merge morluto/rea commit 4c8e616 (morluto#11686), including its command-registry baseline. Preserve the accepted upstream implementation and authorship while retaining this PR's feature changes and previously verified test compatibility repairs.
Reuse the core registrar for decompile-all instead of registering it twice after upstream morluto#11680. Assert the outer MCP start/completion notifications separately from provider cleanup progress introduced by morluto#11637, retaining cleanup, rate, timeout, cancellation, and evidence assertions.
|
The remaining CI gates are now green on This is ready for maintainer review and merge when convenient. |
|
Integrated main The standard build, Current-head CI is running. Current-head CI passed. |
|
TL;DR: I ran the PR's 5 changed test files on head 0f1be10. All 72 tests passed on Node 22.23.4, 24.22.1 and 26.12.1. With 7 source files swapped back to merge base 56d31bc, 7 tests failed on each version. Findings
The red run keeps the head's test files and swaps back these 7 source files:
The same 7 tests fail on all three Node versions. On Node 24.22.1 they are:
The PR changes 14 files against the merge base: 5 test files and 9 others. The head is 417 commits behind main 3e3faf2. CI on the head, read live with
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/boundary/cli/analysisViewCli.test.ts tests/boundary/mcp/evidenceLinkInspectionMcp.test.ts tests/boundary/mcp/evidenceRecordSelectionMcp.test.ts tests/boundary/mcp/largeToolResult.test.ts tests/boundary/mcp/toolResult.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
gensokyo-dev
left a comment
There was a problem hiding this comment.
Verified on current main: the 71 focused tests pass and 7 fail without the change. Rows follow canonical Evidence ID order (createEvidenceBundle sorts them, including parsed bundles), totals still cover every match, and the unpaged shape is unchanged. Fresh CI is green. Thanks.
Summary paging (morluto#9084) now owns offset/limit for detail summary, so the refusal rows for those fields move to detail complete, and the link count and tool descriptions describe both paging and linked_evidence_id. Main removed the tracked planning records under docs/specs (morluto#12856), so this branch's evidence-referrers plan, spec and task files are dropped. The advertised get_evidence_bundle summary is regenerated. Co-Authored-By: gensokyo-dev <[email protected]>
Summary
Let callers page the metadata returned by
get_evidence_bundleandinspect-evidence-bundlewithdetail: "summary". Previously that projection returned every matching row and rejected pagination. Once the summary exceeded the MCP response budget, even identifying the next Evidence ID could require exporting the whole bundle. Selecting full records did not solve the problem for large payloads.Behavior and compatibility
offsetorlimitenables paging. Offsets default to 0 and page size to 64. Apply the existing exact filters first and return rows in canonical Evidence ID order. Followpage.next_offsetuntil it is null against an unchanged session or file.pagemember. Complete bundle, record and link delivery keep their existing semantics.matching_records,direct_linksandmissing_direct_linksstill cover all matches. Bundle totals and unknown-revision counts keep their original scope. Metadata projection is limited to selected rows except where a procedure filter requires it; computing global counts still scans the matches.Regression evidence
The MCP regression uses 96 retained records and a 16 KiB response budget. Before the change the full summary and one complete record exceeded the budget, and a request for seven summary rows was rejected. The test now follows seven-row pages and recovers all 96 IDs exactly once. It checks actual serialized delivery size, advertised schemas, filtered totals and recovery for a single oversized metadata row.
The compiled public CLI regression exercises the same selection from a portable bundle, checks two page offsets and verifies that unpaged summary, complete-record selection and the canonical bundle still work.
Current integration and validation (2026-11-19)
Head
0f1be10e03integrates main56d31bc7a. The merge keeps main's typed error projection with summary pagination as the recovery operation, and replaces inherited fixture repairs with the current upstream fixtures. Process capture now preserves the workflow's own terminal cleanup notification; the obsolete extra-completion assertions are gone.Using Node 24.22.1 / npm 11.16.0, the standard runtime/skill build,
npm run check:fast,npm run docs:check(including 8 README consistency tests), changed-file formatting, andgit diff --checkpassed. The six focused suites completed with 77 passed and 2 environment-blocked failures: all 41 MCP tests, all 7 process-progress tests, and 29 CLI tests passed.The two remaining CLI HAR cases fail because this sandbox lacks
/tmp/.and the POSIX CLI fixture intentionally does not inheritTMPDIR. The private-directory owner, HAR decoder, and CLI environment fixture are byte-identical to main. A sanitized child process running that unchanged owner reproduced the sameENOENT; selecting an existing temporary parent allowed creation and cleanup. No temporary-directory or permission workaround is included in this PR. CI for this head provides the standard-host check.Dependencies were installed from the lockfile with
npm ci --ignore-scripts, followed by the repository prepare script, because the optional Frida native download was unavailable. Frida runtime behavior and the full repository gate were not tested here.Earlier integration and review evidence
The final documentation follow-up addresses the canonical-owner review: the CLI guide keeps its paging example and links to the existing retained Evidence contract for defaults, continuation, ordering and counts. It changes one paragraph in one Markdown file; all 60 code blocks, runtime sources and tests are unchanged from
c317bff2eb. The target file and unique existing anchor were checked. The local documentation build was not rerun; the new upstream Documentation job has passed onfd048391ec. The original documentation review thread is now marked resolved by the reviewer.Current head:
fd048391ec. It includes the accepted upstream subject-test repair #11650 and the accepted reverse-tools selector repair #11686 at4c8e616029, preserving the upstream commits and their original authorship. The latter repair follows the shared CLI registration introduced by #11680. Comparing the previous executed merge against its base and the new merge against4c8e616029confirms the same 22-file PR delta, including identical file contents and patches; the final follow-up adds only the two fixture adjustments described below.Six shared test/verifier compatibility repairs in
e2315ffafbare also included in #9279. They align existing checks with upstream contract migrations: explicit unknown subject identity, partial-error cleanup delivery, the isolated release controller's package imports, the replay-card Evidence ID, the supported Kimi schema profile, and the CLI/MCP capture issue-field names. The underlying feature patch is unchanged. For the replay-card golden, the captured 14,421-byte HTTP response contains 19 tool descriptions; replacing only the 19 migrated Evidence IDs reconstructs the previous825703b02f48…checksum exactly, attributing the newc303f523221a…checksum to upstream1f24b3fa.Validation of previous head
1e9e70d81fpassed with the repository's Node 24.22.1 / npm 11.16.0 toolchain and locked dependency installation:npm run check:fast: typecheck, lint, and architecture guards passed.git diff --checkpassed.test:focusedwrapper built the runtime prerequisites and completed 191 passed, 10 platform-specific skipped, across 14 test files. This includes all original 91 pagination/CLI/MCP tests, the 21 repaired subject/kernel-config tests, and the shared boundary regressions, including all seven environment-serving tests.The failures were checked against their executed baselines before being repaired. The source-test control reproduced 9 failed / 12 passed at the previous CI merge checkout and then passed all 21 with #11650. The MCP boundary control reproduced both failures on unmodified upstream
9ecfb109e8, then passed the repaired and neighboring cleanup suites. The release-controller control retains the missing-runtime, catalog-drift, and wrong-version rejection checks.The real capture verifier used checksum-pinned mitmproxy 12.2.3: the original verifier failed at case 122 on the CLI field-name assertion; the repaired verifier passed all 148 public CLI/MCP cases, including cleanup-lineage checks. The focused Windows profile proof passed, detected an injected duplicate uppercase environment key, and passed again after restoration.
The full upstream run for previous head
1e9e70d81fexecuted merge6ef512bagainst base858ff73880. Source tests, build, static checks and the web-network verifier passed. Built shard 11 found an outdated assertion in the DOL snapshot/reopen test: upstream #11551 changed persisted snapshot targets to{ kind, identity }, while this test still expected the format, architecture and entry point at the top level. The test and relevant snapshot/target-identity implementation are identical in the executed upstream base.Two test-only follow-ups now cover the shared integration failures. The DOL assertion follows
identityandidentity.selectionwhile retaining the exact PowerPC format and entry point, snapshot replay, artifact manifest and single provider-call checks. The Kuna retry test observes the already-invokedsession.closeresult, preserving its typed error, recovery, repeated-retry, cleanup-state and target-byte assertions; it makes no extra close call. That stale observation was exposed in #9279's full upstream run after #11647 moved close errors to the shared handler. The pagination feature and the six shared repairs above remain unchanged.The shared fixture control passed on two explicit revisions: #9279's corrected head
e129b96ec7and its corrected executed merge01faf16ff6. On the original head source, the stale DOL assertion reproduced 1 failed / 2 passed; on the actual merge source, the stale DOL and Kuna observations reproduced 2 failed / 1 passed. Each corrected revision then passed all 22 tests across six files, including the original 12 configuration-printer cases. Removing the production cleanup-retry offer made the Kuna assertion fail; restoring it passed. Both jobs also passedcheck:fast, formatting of the two changed tests and the final unchanged-source check. These are shared fixture controls on the named revisions; they are not a full run of this PR's pagination suite. This PR includes the identical corrected test blobs.The subsequent upstream run for
0d134c24c0executed merge74f09ae63aagainstf14e9a1d28. Its reverse-tools and portable lanes exposed a selector that still expected the old CLI registration shape. This head adopts the maintainer's accepted #11686 fix instead of carrying a separate selector implementation.Two additional test-only adjustments follow the shared owners already present in that executed base: the CLI schema fixture reuses the core registrar for
decompile-all, and the process-progress fixture distinguishes the shared outer start/completion messages from provider progress. The latter still requires an actual cleanup notification, the cleaned owned-process group, the correct exit/timeout disposition, bounded progress, cancellation cleanup and the existing evidence assertions.Validation of runtime source at
c317bff2ebpassed using Node 24.22.1, the repository's npm 11.16.0 and locked dependencies:--dryRunOnlypreflights. The main configuration's initial run passed 849 tests; the exhaustive-semantics command runner also completed successfully. These are preflight results, not a completed mutation score.npm run check:fastpassed typecheck, lint and architecture guards across 2,809 source files. Formatting of the two changed fixtures and the final exact tracked-source restoration checks passed. The validation workflow remains outside this PR.The full upstream run on
c317bff2ebhas passed all 12 portable shards, Portable tests, reverse-tools quality, source/static checks, the package build, documentation and the three native package baselines. The Windows capability/package lane was still running when the documentation-only follow-up was published. Onfd048391ec, the refreshed upstream run has completed successfully on this exact head. All 12 test shards, Portable tests, documentation, source/static checks, the package build, reverse-tools quality, the Windows capability/package lane and all three native package baselines passed. Windows capability/package verification completed at 05:11:54 UTC on 2026-11-16, and the final CI required gate passed at 05:13:57 UTC. The latest PR title, author-declaration and PR readiness checks also passed. The 61-test control above covers the byte-identical runtime/test sources atc317bff2eb; the earlier 191-test and shared 22-test results apply to their explicitly named revisions.Earlier validation
Integrated current main
bbe2bcc979be747698d9ad9ce87af017b92e0f10in3a9a9cde74d206ebc4db36c0854ad7b3af0b9313. The merge retains the upstream private limitation constants and advertised MCP tool-contract validation while preserving the summary-pagination behavior and regressions.Fresh local validation used Node 24.22.1 and npm 11.16.0:
npm run test:focused -- tests/boundary/mcp/evidenceRecordSelectionMcp.test.ts: 10 passed.npm run test:focused -- tests/boundary/mcp/evidenceLinkInspectionMcp.test.ts: 7 passed.npm run test:focused -- tests/boundary/mcp/largeToolResult.test.ts: 8 passed.npm run test:focused -- tests/boundary/cli/analysisViewCli.test.ts: all 31 passed against the compiled public CLI.npm run docs:check: passed through the standard wrapper, including all 9 README conformance tests.npm run checkbuild/metadata, typecheck, formatting, ordinary lint, Knip, architecture guards and production-reachability stages passed. Ordinary lint reported 0 errors and 3,834 warnings.git diff --checkpassed. The published Git tree matches the independently inspected local tree exactly.Validation gaps: the full
npm run checkinvocation did not finish successfully because its final typed-linttsgolintchild was terminated by SIGKILL. A standalone retry using the documentedGOMAXPROCS=1 GOMEMLIMIT=512MiB npm run lint:typedcontrols was also terminated by SIGKILL; typed lint is not counted as passed. The initial combined three-file MCP invocation exited before all files reported results; the three separate successful runs above provide the completed MCP results.CI for this exact integration commit completed successfully. The upstream title and author-declaration checks, static checks, package build, documentation, source and boundary tests, and native compatibility jobs passed. This hosted result is separate from the local typed-lint limitation recorded above.
Author readiness
Human owner: @Afloat16