[PR #4962] [MERGED] perf(analysis-view): reuse validated immutable parents #6695

Closed
opened 2026-11-01 21:42:22 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4962
Author: @N0zoM1z0
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @N0zoM1z0

Base: main ← Head: perf/4810-immutable-validation-20261018


📝 Commits (8)

  • 1e35962 perf(analysis-view): reuse validated immutable source results
  • e30a94a fix(analysis-view): preserve parsed representations before immutable reuse
  • 3f271ef test(perf): record immutable parent validation measurements
  • 646312d fix(analysis-view): bound comparisons of shared JSON snapshots
  • 71e0b27 chore: merge latest main test fixes
  • fc55be1 test(perf): verify bounded immutable validation on fresh workflows
  • 3930a64 fix(analysis-view): preserve aliases across parsed subtrees
  • 94ba004 test(perf): verify alias-preserving validation reuse

📊 Changes

13 files changed (+1473 additions, -22 deletions)

View changed files

📝 experiments/analysis-efficiency/README.md (+5 -0)
➕ experiments/analysis-efficiency/immutable-parent-validation.json (+654 -0)
➕ experiments/analysis-efficiency/immutable-parent-validation.md (+249 -0)
📝 src/application/analysisView/AnalysisViewService.test.ts (+30 -0)
📝 src/application/analysisView/AnalysisViewService.ts (+7 -2)
📝 src/domain/analysisView/analysisView.ts (+5 -8)
📝 src/domain/immutableJson.test.ts (+206 -1)
📝 src/domain/immutableJson.ts (+85 -0)
📝 src/domain/immutableJsonSteps.test.ts (+25 -0)
📝 src/domain/javascript/javascriptApplicationAnalysis.ts (+33 -10)
📝 src/domain/javascript/javascriptApplicationAnalysisSteps.test.ts (+96 -0)
📝 src/domain/native/binaryLayout.test.ts (+55 -1)
📝 src/domain/native/binaryLayout.ts (+23 -0)

📄 Description

Summary

Fixes #4810. Imported JavaScript graphs and native layouts previously received full validation for every selected view. The shared CLI/MCP implementation now reuses successful validation of the exact immutable source.

Change and scope

The JSON owner authenticates a selected snapshot member; native/JavaScript owners keep weak successful-validation entries without a second retained parsed graph. Full schema/hash/binding checks precede admission. Two-way identity mapping checks preserved descendants and rejects node splits/merges as well as field/prototype normalization. The existing owned-JavaScript graph path returns parsed metadata without whole-graph comparison; only its expensive imported fallback caches a complete result. Proxies cannot acquire a JSON sealing proof.

Existing static retained-Evidence workflows only; new maintainer scope approval is not applicable. Schemas/defaults, Evidence identity/provenance/coverage, complete source access and session lookup remain unchanged. No provider execution/mutation, package, installer or generated-catalog change.

Evidence and limits

Three fresh alternating before/after pairs per authentic SQLite ELF, shipped npm and small /usr/bin/true history. Median paired speedup for eight later two-row reads: 5.53× SQLite / 184.65× npm. First views can cost more. An earlier checkpoint had slower small-case reads in two of three pairs; current samples improve, and all history remains visible. No general small-input, whole-task/memory or agent-investigation gain is claimed. Raw-transport token estimates are unchanged; actual model usage was not remeasured.

All 18 paired tasks preserve facts, original records and the complete 207-tool catalog. Three public CLI source pairs are byte-identical. An earlier instrumented small-case MCP task confirms one successful format admission and eight cache hits; it is labeled historical and excluded from timing comparisons. Measurements, paired effects, CPU/family-memory costs, failed attempts and reproduction.

Local heavy work is serial under one CPU, 8 GiB hard / 7 GiB early family memory and no swap. Completed corpus tasks have verified payload cleanup and zero observed payload-exit OOM. Two host-memory guard stops remain incomplete; both sides were rerun as fresh pairs after recovery. Final whole-scope counters remain unknown.

Validation performed

  • 130 focused source tests; npm run check:fast, npm run build:cached, npm run check, npm run docs:check — pass.
  • Four compiled CLI/MCP boundary files — 36 tests pass. Six public CLI invocations and 18 retained MCP tasks pass.
  • Two mixed-history tasks preserve all 97 original records, 64 follow-up heads/revision two, atomic tamper/stale-update refusal and close invalidation — pass.
  • Synced main through bb212ffec (test/config fixes; current measured source 3930a640f). The current source passes all 27 integration tests through official test:focused with default deadlines; matching unmodified-main controls and prior-source attempts remain documented. An initial local 30-second timeout remains recorded and unexplained; direct/extended-deadline diagnostics are labeled separately.
  • Normal commit/pre-push formatting, lint and typecheck pass. Real other providers/platforms and fresh JavaScript producer performance remain outside this checkpoint.

Author readiness

Human owner: @N0zoM1z0

The owner explicitly delegated preparation and initial-readiness entry in this session. The following diff/evidence review was performed by the agent under that delegation; independent human review of this final diff is not asserted.

  • 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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4962 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `perf/4810-immutable-validation-20261018` --- ### 📝 Commits (8) - [`1e35962`](https://github.com/morluto/rea/commit/1e359626c7f26f23d67ca1cae23a79cc25993fae) perf(analysis-view): reuse validated immutable source results - [`e30a94a`](https://github.com/morluto/rea/commit/e30a94a4de6a3c4ec7c577c1551d2b448d82081e) fix(analysis-view): preserve parsed representations before immutable reuse - [`3f271ef`](https://github.com/morluto/rea/commit/3f271efdef8d71020bdcfd7b2d3d9817bf0a6ad8) test(perf): record immutable parent validation measurements - [`646312d`](https://github.com/morluto/rea/commit/646312dad75e2cb2becb0dd4139b99a1c04d6bcc) fix(analysis-view): bound comparisons of shared JSON snapshots - [`71e0b27`](https://github.com/morluto/rea/commit/71e0b2739a9cf9903e1cfa63dc5a5b576040fea7) chore: merge latest main test fixes - [`fc55be1`](https://github.com/morluto/rea/commit/fc55be1e05555c6b295209ef5f354617f663b8f8) test(perf): verify bounded immutable validation on fresh workflows - [`3930a64`](https://github.com/morluto/rea/commit/3930a640fb8387cbd3079eee13fb90f82d1881dc) fix(analysis-view): preserve aliases across parsed subtrees - [`94ba004`](https://github.com/morluto/rea/commit/94ba0043b838205ad4444dea43c8787672677bdd) test(perf): verify alias-preserving validation reuse ### 📊 Changes **13 files changed** (+1473 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `experiments/analysis-efficiency/README.md` (+5 -0) ➕ `experiments/analysis-efficiency/immutable-parent-validation.json` (+654 -0) ➕ `experiments/analysis-efficiency/immutable-parent-validation.md` (+249 -0) 📝 `src/application/analysisView/AnalysisViewService.test.ts` (+30 -0) 📝 `src/application/analysisView/AnalysisViewService.ts` (+7 -2) 📝 `src/domain/analysisView/analysisView.ts` (+5 -8) 📝 `src/domain/immutableJson.test.ts` (+206 -1) 📝 `src/domain/immutableJson.ts` (+85 -0) 📝 `src/domain/immutableJsonSteps.test.ts` (+25 -0) 📝 `src/domain/javascript/javascriptApplicationAnalysis.ts` (+33 -10) 📝 `src/domain/javascript/javascriptApplicationAnalysisSteps.test.ts` (+96 -0) 📝 `src/domain/native/binaryLayout.test.ts` (+55 -1) 📝 `src/domain/native/binaryLayout.ts` (+23 -0) </details> ### 📄 Description ## Summary Fixes #4810. Imported JavaScript graphs and native layouts previously received full validation for every selected view. The shared CLI/MCP implementation now reuses successful validation of the exact immutable source. ## Change and scope The JSON owner authenticates a selected snapshot member; native/JavaScript owners keep weak successful-validation entries without a second retained parsed graph. Full schema/hash/binding checks precede admission. Two-way identity mapping checks preserved descendants and rejects node splits/merges as well as field/prototype normalization. The existing owned-JavaScript graph path returns parsed metadata without whole-graph comparison; only its expensive imported fallback caches a complete result. Proxies cannot acquire a JSON sealing proof. Existing static retained-Evidence workflows only; new maintainer scope approval is not applicable. Schemas/defaults, Evidence identity/provenance/coverage, complete source access and session lookup remain unchanged. No provider execution/mutation, package, installer or generated-catalog change. ## Evidence and limits Three fresh alternating before/after pairs per authentic SQLite ELF, shipped npm and small `/usr/bin/true` history. Median **paired** speedup for eight later two-row reads: **5.53× SQLite / 184.65× npm**. First views can cost more. An earlier checkpoint had slower small-case reads in two of three pairs; current samples improve, and all history remains visible. No general small-input, whole-task/memory or agent-investigation gain is claimed. Raw-transport token estimates are unchanged; actual model usage was not remeasured. All 18 paired tasks preserve facts, original records and the complete 207-tool catalog. Three public CLI source pairs are byte-identical. An earlier instrumented small-case MCP task confirms one successful format admission and eight cache hits; it is labeled historical and excluded from timing comparisons. [Measurements, paired effects, CPU/family-memory costs, failed attempts and reproduction](https://github.com/morluto/rea/blob/94ba0043b838205ad4444dea43c8787672677bdd/experiments/analysis-efficiency/immutable-parent-validation.md). Local heavy work is serial under one CPU, 8 GiB hard / 7 GiB early family memory and no swap. Completed corpus tasks have verified payload cleanup and zero observed payload-exit OOM. Two host-memory guard stops remain incomplete; both sides were rerun as fresh pairs after recovery. Final whole-scope counters remain unknown. ## Validation performed - 130 focused source tests; `npm run check:fast`, `npm run build:cached`, `npm run check`, `npm run docs:check` — pass. - Four compiled CLI/MCP boundary files — 36 tests pass. Six public CLI invocations and 18 retained MCP tasks pass. - Two mixed-history tasks preserve all 97 original records, 64 follow-up heads/revision two, atomic tamper/stale-update refusal and close invalidation — pass. - Synced main through `bb212ffec` (test/config fixes; current measured source `3930a640f`). The current source passes all 27 integration tests through official `test:focused` with default deadlines; matching unmodified-main controls and prior-source attempts remain documented. An initial local 30-second timeout remains recorded and unexplained; direct/extended-deadline diagnostics are labeled separately. - Normal commit/pre-push formatting, lint and typecheck pass. Real other providers/platforms and fresh JavaScript producer performance remain outside this checkpoint. ## Author readiness Human owner: @N0zoM1z0 The owner explicitly delegated preparation and initial-readiness entry in this session. The following diff/evidence review was performed by the agent under that delegation; independent human review of this final diff is not asserted. - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:42:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6695
No description provided.