Repository navigation
feat(evidence): aggregate exact retained comparison references - #8267
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. |
|
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] This change appears safe to merge; no actionable defects were found. Summary
No actionable issues were found. This review inspected source and test assertions; it did not run tests. Supersession could not be confirmed because GitHub access was unavailable. Acknowledgments from
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Inline records or retained references] --> B[Read selection envelope]
B --> C{Reference?}
C -->|Yes| D[Look up exact ID in current session]
C -->|No| E[Keep inline record]
D --> F[Authenticate and check comparisons]
E --> F
F --> G[Reject duplicate IDs and classify findings]
G --> H[Resolve every source link]
H --> I[Record aggregate and any unresolved question]
I --> J[Return complete result]
Reviews (1) · Last reviewed commit: "feat(evidence): aggregate exact retained..." · Reviewed by Greptile |
Upstream morluto#8299 and morluto#8267 declare Evidence inputs once for 20 composition tools, which covers feat-evidence-source-contract (78da95a) and feat-evidence-sources-process-managed (31dbe14, which contains it). Reverse their net patch against 317bf3f (57 files), so main's version takes their files. Also restore morluto#8015's managedFieldConstantsComparison.test.ts, which this branch had adapted to the stack's async executeManagedMemberComparison. No topic uses the stack's names. Both branches stay on the fork.
Summary
Fixes #8214.
find_changed_behaviornow accepts exact{kind: "retained-evidence", evidence_id}selections alongside complete inline comparison Evidence, including mixed arrays. It reuses the existing session ledger and does not add a project store or new tool.Problem and change
Previously, a retained comparison reference was treated as damaged Evidence. Resending five real comparison records also exceeded the default 1,024-element input allowance before aggregation could run.
The application layer resolves only the explicitly selected identities through the existing Evidence resolver. The domain continues to authenticate every complete record, validate comparison operation/predicate/provider, reject duplicate IDs, classify findings, and preserve caller ID order. One shared selection reader keeps malformed-envelope errors typed without copying full records during reference resolution. The existing complete retained source-closure requirement remains enforced; summaries, foreign/missing references, and damaged observations are not substituted or silently repaired.
Update the public input contract and compact request example. Tests that previously obtained a source observation from a request example now use its existing fact owner directly. Update the investigation guide and authored skill (58), then regenerate metadata.
This is a read-only extension of existing Evidence aggregation. No new provider, target execution/mutation, persistent cache, file-reference form, input-limit increase, or changed analysis algorithm. Related draft #8035 explores a larger reference/persistence scope; this PR addresses only the existing issue's retained-input case.
Executed correctness and resource checks
npm run check:fast,npm run check,npm run docs:check(including 9 README checks), and architecture guards — passed. The SDK-converted input/output schemas and actual clients were exercised.d738e59a5ddee9f07fd1f915d95c478e18e17b6e87228a2c974eda89cce8293d. Fresh target-free production MCP sessions import the original bundle and aggregate already-computed comparisons. No provider is configured or target opened in this task. Two-record inline and reference forms return identical normalized results, parameters and source closure. Five-record inline input has 1,156 members/elements and fails at the unchanged 1,024 allowance; references use 16 and succeed with 9 static candidates, 0 observed runtime changes and behavior unknown.Measured completed task
Alternating fresh final-runtime sessions, two observations per form: one full catalog discovery, bundle import, and aggregation of the same two retained comparisons. Build/OS caches were warm. All measurements completed with cleanup and no 3-GiB guard stop.
cl100k_baseestimateThe pre-change main inline task also completed (1,003,384 estimated serialized tokens); the final catalog adds 30 estimated tokens. Catalog discovery itself costs 987,006 estimated tokens in the final runtime, so the complete serialization saving is about 0.88%, not the argument-only percentage. These are tiktoken 0.11.0 serialization estimates, not observed model usage or rendered agent context. Prompts, initialization/framing, hidden client caching and agent discovery behavior are unmeasured. Cold OS caches and within-session warm repeats were not measured. RSS sums visible descendants at roughly 20-ms intervals and may double-count shared pages or miss reparented children; sampler/tokenizer overhead is not included in reported child CPU. CPU/RSS ranges overlap, and the small wall-time sample does not control host/runtime-cache variance: no stable latency or memory benefit is claimed. The failed five-record baseline is a capacity reproduction, not an equivalent completed performance baseline.
Compatibility and scope
Existing inline inputs and aggregation semantics remain valid. References belong to the current investigation; import the originating complete bundle after a handoff. Missing-closure error wording tracked in #8237 remains separate; this PR preserves closure authentication and verifies import-based recovery. No new real-engine behavior, autonomous-agent quality, or complex-software speedup is claimed.
Author readiness
Human owner: @gensokyo-dev
The user explicitly authorized ready PRs and integration, including bypass of human-readiness gates. Personal human-review attestations remain unchecked.