Repository navigation
feat(artifacts): compare inventories from Evidence sources - #7869
Merged
Merged
Conversation
… CLI
compare_artifacts made agents send back the complete inventory Evidence
that REA already retains, and the CLI had no artifact comparison.
Each side of compare_artifacts now takes exactly one of: complete inline
Evidence (unchanged), {kind: "retained-evidence", evidence_id}, or
{kind: "evidence-file", path, evidence_id?}. The two references are the
sources inspect_analysis_view accepts; both tools now compose one
definition in evidenceReference.ts. A summary still resolves to its exact
retained parent, and every source form gives the same comparison Evidence.
An unresolvable retained reference is refused with a typed missing
reference error.
The application layer owns source resolution and the comparison Evidence,
so MCP and the new `rea compare-artifacts` command share one workflow.
readEvidenceFileSource reports bundle-selection refusals at the caller's
own field path.
…ctions compare_functions, compare_wasm_interfaces and the JavaScript application comparisons name each side with evidenceInputSchema and resolve it with resolvePairedEvidenceRequest. compare_artifacts reached the same result for inline and retained sides through its own dispatch. evidenceSourceInputSchema now extends evidenceInputSchema with the Evidence-file reference, and resolvePairedEvidenceSources sends inline and retained sides to the same resolveEvidenceInput and file sides to the shared Evidence file reader. compare_artifacts uses both, so the forms it shares with compare_functions are parsed and resolved by one owner. The advertised input schema is unchanged.
rea compare (compare_bundles) compares records by Evidence identity and explicit pairs and never reads artifact contents, so two build inventories stay unresolved there. Its help and the CLI guide now name compare-artifacts for that comparison.
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. |
Contributor
[Medium impact] The reviewed changes appear safe to merge; no blocking code issue was found. SummaryAdds artifact comparisons from retained Evidence and saved files through a shared CLI/MCP workflow.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[CLI or MCP] --> B{Evidence source}
B --> C[Inline Evidence]
B --> D[Retained record]
B --> E[Authenticated file or bundle]
C --> F[Resolve complete inventory]
D --> F
E --> F
F --> G[Compare inventories]
G --> H[Comparison Evidence citing both inputs]
Reviews (3) · Last reviewed commit: "test(evidence): inject failures at both ..." · Reviewed by Greptile |
This was referenced Oct 28, 2026
3 of 11 tasks
Entrpi
added a commit
to Entrpi/rea
that referenced
this pull request
Oct 29, 2026
…s-managed Bring in current upstream main through the contract branch, which now adopts morluto#7869's Evidence-file reader, proof reuse and bundle-local parents. The member comparison service imports EvidenceFileReadOptions from that reader's upstream location, src/application/analysisView/evidenceFileSource.ts.
3 tasks done
Entrpi
added a commit
to Entrpi/rea
that referenced
this pull request
Oct 29, 2026
…t-stacked-on-compare-sources) This head merges upstream main 21b1927 with morluto#7869 and adopts morluto#7869's owners, so it also brings that main here.
2 tasks done
15 of 22 tasks
3 tasks done
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
Fixes #7678. Compare artifact inventories using exact retained Evidence IDs or selected records in local Evidence files/bundles, while preserving existing inline Evidence. Adds
rea compare-artifacts <inputJson>through the same application workflow as MCP.Builds on Entrpi's prototype; its three commits retain their original author.
Problem and expected behavior
Agents currently resend complete inventories that REA already retains, and the CLI has no artifact-content comparison. The three source forms now produce identical comparison Evidence for the same resolved inputs.
A prototype edge case also failed: selecting a summary from a bundle lost access to its complete parent even when that parent was in the same file. CLI and a fresh MCP session now resolve that exact authenticated parent; a genuinely missing parent still fails and a subsequent valid request succeeds.
Change and scope
Shared source parsing and the existing Evidence-file owner handle admission, authentication and record selection. File-local related records are resolved while the authenticated read is in scope, then the session lookup is the fallback. Only selected complete inventories survive; there is no global file cache or additional file read to find the parent. The file owner now uses the existing immutable Evidence authentication proof, so downstream consumers reuse the authenticated value rather than cloning and hashing it again; each file request still reads and validates current bytes. Shared comparison/evidence construction replaces the server-only path. CLI resolves relative source paths from its working directory.
Ordinary existing local Evidence/artifact authority; additional maintainer scope decision is not applicable. Inputs and firmware are read statically.
Contract and boundary impact
EvidenceInputResolver/evidenceFileSource→ArtifactComparisonEvidence; CLI/MCP share the comparison and provenance.evidence_id, additive CLI command. Legacy raw inline Evidence remains accepted, matchingcompare_functions; no second inline spelling added.Expected effects:
Evidence and regression coverage
Validation performed
npm run check:fast,npm run docs:check(9 README tests), architecture guards, formatting and bounded single-thread type-aware lint passed. Final touched-source typed lint has no warnings.npm run knip:productioncompleted its reachability report with 27 advisory candidates; this is separate from ordinary Knip.Completed-task measurements
Main
64196b08cversus8355ae9b3: 12 alternating fresh MCP sessions, three before/after pairs for each corpus. Each task discovers the catalog, inspects both files, compares once and closes. Both use compact input/output schemas and session/artifact families. All 17 JSON-RPC messages include initialization/instructions, catalog, requests and text/structured responses.Catalog cost is included: 33,389 → 33,458 estimated tokens. Whole-wire estimates improve about 11%; time/CPU/memory overlap, so no acceleration or memory reduction is claimed. Tokenx counts describe serialized transport, not model billing/rendered context. Linux 10ms process-family RSS and wait4 plus sampler CPU include client/server/verifier. Node heaps capped at 2 GiB, family early-stop 1.5 GiB; no stop triggered. Runs had no concurrent local builds/tests. OS files were warm; runtime sessions were fresh, and retained records were populated by each task's inspections. Cold OS caches and producer/oracle preparation were not measured. Extra correctness sessions include CLI costs, but their wire counters cover MCP only and are not used in the paired table.
Review-fix measurements (
8355ae9b3→b815022a0): 16 alternating fresh MCP tasks, two pairs per corpus/source form, using independently CRC-verified ZIPs containing 5 actual TypeScript shim files and 192 actual Zod files. Selected Evidence is 11.6/212.4 KB; both standalone files and canonical shared bundles produce identical result digests and Evidence IDs before/after. For the 192-file bundle task, elapsed 3.16–3.22 → 3.09–3.11 s, CPU 4.87–4.92 → 4.75–4.78 s, family RSS 430.8–431.9 → 430.5–431.5 MiB; whole-wire estimate stays 36,448 tokens. Standalone large-file times were 2.92–3.06 → 3.07–3.12 s, so this small sample establishes no general speedup. Same resource limits, warm OS/fresh-session method and measurement caveats apply. Final-head retained-source tasks also reproduce both table token counts and result identities above.Compatibility, safety, and release
No intended breaking change. One-shot CLI has no session ledger and reports missing retained references; use saved Evidence instead. Runtime verification is Linux x64 / Node 24.22.1; Windows/macOS execution remains unverified. No firmware execution, flashing, or deep-provider behavior is claimed.
Author readiness
Human owner:
Before merge
type(scope): outcome.