Skip to content

feat(evidence): aggregate exact retained comparison references - #8267

Merged
gensokyo-dev merged 1 commit into
mainfrom
fix/8214-retained-comparison-inputs
Oct 31, 2026
Merged

gensokyo-dev merged 1 commit into
mainfrom
fix/8214-retained-comparison-inputs

Conversation

@gensokyo-dev

Copy link
Copy Markdown
Collaborator

Summary

Fixes #8214. find_changed_behavior now 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

  • Focused domain/correlation, MCP investigation/integrity, compiled replay/capacity, and SDK schema suites: 108 passed across 8 files. Includes mixed runtime/static inputs, inline/reference parity, exact selected-ID order, duplicates, malformed selections, wrong operation, damaged inline data, missing records and incomplete source closure.
  • Actual compiled stdio MCP test: twelve distinct retained comparison observations aggregate under a caller's 1,024-element allowance after the equivalent inline request is refused. Static findings retain every selected comparison and both original source records, with runtime behavior unknown.
  • 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.
  • Real retained data: authentic Ghidra 12.1.4 observations from the unexecuted ELF workflow in fix(comparison)!: preserve same-entry correspondence across renames #8263, target SHA-256 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.

Cost Complete inline input Retained references
Aggregate arguments, cl100k_base estimate 8,908 103
Whole serialized task estimate, including catalog 1,003,414 994,609
Wall seconds 12.13 / 10.91 10.66 / 10.89
Waited process-family CPU seconds 14.74 / 13.26 13.24 / 13.29
Sampled process-family RSS MiB 988 / 877 883 / 1,021

The 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

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

The user explicitly authorized ready PRs and integration, including bypass of human-readiness gates. Personal human-review attestations remain unchecked.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T05:39:00.490322Z
We couldn’t complete this review. Comment @codex review to try again.
f19931b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] This change appears safe to merge; no actionable defects were found.

Summary

find_changed_behavior now accepts exact retained comparison references alongside inline Evidence, including mixed selections.

  • Comparison lists can now use IDs for records already in the session.

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 gensokyo-dev:

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]
Loading

Reviews (1) · Last reviewed commit: "feat(evidence): aggregate exact retained..." · Reviewed by Greptile

@gensokyo-dev
gensokyo-dev merged commit d9e01e5 into main Oct 31, 2026
46 of 48 checks passed
@gensokyo-dev
gensokyo-dev deleted the fix/8214-retained-comparison-inputs branch October 31, 2026 05:59
Entrpi added a commit to Entrpi/rea that referenced this pull request Oct 31, 2026
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.
@morluto morluto mentioned this pull request Nov 11, 2026
3 tasks done
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Aggregate retained comparison Evidence without resending full records

2 participants