Repository navigation
fix(evidence): preserve JSON ownership across metadata rebinding - #7036
Merged
Merged
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. |
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryBoth metadata-rebinding paths now use one helper to preserve JSON ownership. The helper shares sealed payloads and seals the new envelope, letting error projection reuse complete
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Authenticated immutable Evidence] --> B[Borrow sealed source members]
B --> C[Seal changed envelope]
C --> D[Register Evidence ownership]
C --> E[Register JSON ownership]
E --> F[Error projection reuses complete Evidence]
Reviews (1) · Last reviewed commit: "fix(evidence): preserve JSON ownership a..." · Reviewed by Greptile |
3 of 6 tasks
8 of 22 tasks
This was referenced Oct 24, 2026
12 of 22 tasks
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
Main CI fails its low-headroom managed Evidence test because adding caller-path metadata loses the shared JSON sealing proof. Error projection then clones the completed report precisely when memory admission has refused more work.
Change and scope
Seal rebound Evidence through the existing JSON owner as well as the Evidence owner. Borrow each already-sealed source member before sealing the small changed envelope, so large result/parameter/location trees are shared. Use that single path for both caller-input metadata and snapshot subject-path rebinding; remove their separate shallow-freeze registrations.
The fix belongs to the domain Evidence owner. CLI/MCP, snapshot identity, raw caller paths, complete retained Evidence and error schemas are unchanged. Ordinary repair within existing contribution scope; a maintainer capability decision is not applicable. No new target execution, mutation authority, provider, configuration, package or generated-metadata changes. Tests read authored fixtures, launch CLI processes and create/delete temporary bundles.
Evidence and validation
Main CI 40120484609, shard 8:
managedBundleReadGuards.test.tsfails at the original strict reference assertion. Local latest-main base3f168af2reproduces 1 failed / 10 passed. The existing test and admission limit remain unchanged.Two new domain regressions fail on the original implementation for both rebinding producers: projected partial Evidence must retain its reference, payload references and semantic identity. Both pass after the owner fix; generic JSON parsing also reuses the sealed result.
Four exact test files covering Evidence, error projection, immutable JSON and the unchanged low-headroom integration test: 129 tests passed.
Snapshot/bundle/ledger: 30 passed, including a graph with >125,000 dependents. Real compiled CLI managed bundle/paging and cancellation/finalization: 16 passed. MCP managed member/artifact summary handlers: 5 passed. In total 180 tests in 10 files passed in serial batches (153.17 s wall / 173.56 s family CPU / 2031.3 MiB maximum sampled family RSS), build excluded.
Runtime build passed. Linux local fixtures exercise the actual managed parser and compiled CLI plus MCP handlers, not a new real external-provider claim. The low-headroom failure is injected at the production admission boundary with a simulated provider.
Rebased onto latest main
31fc9762(independent Go parsing changes); runtime compilation andnpm run checkpassed on the updated base (41.38 s wall / 70.46 s CPU / 2367.2 MiB sampled family RSS).git diff --checkpassed.Measured bounds
A bounded source-level microbenchmark creates sealed Evidence, alternates both public rebinding operations, projects six resource errors, and serializes/hashes every complete response. Three fresh processes per variant, two CPUs, Node 24.22.1, 768 MiB V8 heap. All equivalent response bytes and SHA-256 digests match before/after; no token reduction is claimed.
The six warm projection/serialization operations take a median 1296 → 206 ms on the large input; the table also includes fresh imports and input construction. OS caches were uncontrolled. This isolates envelope/projection costs, not complete provider analysis; agent tokens/catalog/transport costs were not measured. An initial benchmark fixture used an invalid architecture and was rejected before analysis; its failed attempt is retained outside the repository and excluded from measurements. RSS sums descendants approximately every 100 ms and may double-count shared pages or miss short-lived/reparented children. Local test/benchmark runs use a 3 GiB sampled stop; no host OOM occurred.
Published head
c65d19d5passed complete selected CI: 32,815 tests passed, zero failed, 234 skipped, all eight built shards and the finalCI requiredgate passed. Greptile review completed successfully with no actionable inline findings. Codex's separate review still reports running at merge preparation; it is not counted as completed. The final diff and both producing boundaries were manually inspected by the agent, and the original low-headroom assertion is unchanged.Post-merge main
03ed0c63passed actual main CI: 32,835 passed, zero failed, 234 skipped, all eight built shards, Windows/native package/real verification lanes and the final gate passed.Author readiness
Human owner: @gensokyo-dev
The owner explicitly delegated readiness declarations and agent-managed review. Inspection and execution were performed by Codex; no separate human inspection is claimed.