Skip to content

perf(evidence): reuse authenticated file snapshots during session import - #1721

Merged
N0zoM1z0 merged 1 commit into
mainfrom
perf/evidence-bundle-authentication
Oct 11, 2026
Merged

N0zoM1z0 merged 1 commit into
mainfrom
perf/evidence-bundle-authentication

Conversation

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

File-backed MCP imports previously authenticated and copied the same newly imported Evidence record across the filesystem reader, ledger parser and immutable commit. Seal an authenticated snapshot specifically for session import, so the ledger reuses its identity; ordinary CLI/comparison reads keep their mutable behavior. Validate internally constructed unknown candidates directly with the existing immutable bundle constructor.

Semantic and manifest authentication, process-capture validation, atomic unknown merges, detached public reads and complete output are preserved. No domain parser API or tool schema changes.

Closes #1718.

Validation:

  • npm run check: typecheck, lint, format, knip, metadata and architecture guards passed.
  • Focused filesystem and compiled CLI boundaries: 18 tests passed, including snapshot identity reuse, detached mutation, malformed/tampered input and unknown history rejection.
  • Evidence/ledger source tests: 38 passed with the normal deadline. The existing >125,000-dependent graph case timed out on this busy single-CPU host, then passed in a separate CPU-profile run (~30.3s) with a 120s profiling deadline; its workload, assertions and repository timeout are unchanged.
  • Real stdio MCP / SDK 2.3.1: three fresh servers before and after, using a complete 3,062,416-byte JS Evidence bundle. First/duplicate import, tamper rejection, full exported-bundle equality, ping and awaited cleanup passed.
  • Flameox analyzed server-only import profiles and the actual heavy Vitest fork. Shared-host wall times were variable and do not establish a stable latency speedup. Native providers, live cloud models and Windows were not exercised by this change.

Large-snapshot admission remains separately tracked in #1680.

Seal file-backed MCP imports at the session boundary while preserving mutable
ordinary file reads. Validate internally constructed ledger candidates directly
with the existing immutable bundle constructor.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

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 ✅ Completed 2026-10-11T05:44:26.684902Z 91377ba 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.

@N0zoM1z0 N0zoM1z0 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer self-review: snapshot trust still comes from the authenticated domain constructor; ordinary CLI reads remain mutable, and unknown candidate validation completes before ledger mutation. The 18 focused boundary tests and real stdio MCP import/tamper/full-export checks passed; profiling and noisy timing limits are documented in the PR. No material finding in the narrowed change.

@N0zoM1z0
N0zoM1z0 merged commit 966dc3a into main Oct 11, 2026
31 checks passed
@N0zoM1z0
N0zoM1z0 deleted the perf/evidence-bundle-authentication branch October 11, 2026 05:53
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
morluto added a commit that referenced this pull request Oct 13, 2026
* perf(evidence): reuse sealed bundle reads in compare and export

`rea compare`, the compare_bundles MCP tool and `rea evidence-export`
read bundles through the mutable reader, so each consumer
re-authenticated every record again: compareBundles parsed both bundles
a second time and bundleDigest's serializeEvidenceBundle a third time;
export's writer parsed the source once more before serializing.

These consumers only read the bundle, so read it through the existing
sealed reader (readImmutableEvidenceBundle). Later parses hit the
immutable bundle cache. Ordinary mutable reads, kept deliberately by
#1721, are unchanged. Output is byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(process): report no remaining time after a provider deadline fires

Node timers can fire while performance.now() is still a fraction of a
millisecond short of the monotonic deadline. ProviderStartupDeadline then
reported interruption "timeout" and an aborted signal while remainingMs()
returned ceil(0.x) = 1, so polling loops guarded by remainingMs() > 0
(Hopper and Ghidra startup) could run past an elapsed deadline, and the
real-timer test "aborts a bounded wait when its real monotonic deadline
expires" failed intermittently in CI (expected 1 to be 0).

Once the deadline's own timer has classified a timeout, report zero
remaining time. A deterministic regression test fires the timer with the
monotonic clock 0.4 ms short of the deadline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
@morluto morluto added performance Performance regressions, scaling limits, and bounded-resource work area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(evidence): reuse authenticated file snapshots during MCP session import

2 participants