[PR #5167] [MERGED] feat(cli): summarize managed members with durable Evidence paging #6796

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5167
Author: @jaelliot
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/managed-cli-summary-5148


📝 Commits (10+)

  • e6c120a feat(cli): summarize managed members with durable Evidence paging
  • 243239d refactor(cli): reuse existing Evidence delivery owners
  • 676620c Merge branch 'main' into fix/managed-cli-summary-5148
  • 1992c85 fix(cli): preserve cleanup recovery and cancellation status
  • 42306a1 fix(cli): preserve Evidence-file views when merging upstream
  • db38531 fix(cli): preserve request-file cancellation after upstream integration
  • 7b3ed4d fix(cli): honor queued interrupts during bundle paging
  • c0d3b54 feat(cli): add durable managed member summaries
  • f0b797d Merge remote-tracking branch 'origin/main' into perf/5148-managed-cli-durable-evidence
  • ab78a14 docs(perf): record latest-main managed workflow verification

📊 Changes

48 files changed (+4671 additions, -196 deletions)

View changed files

📝 docs/cli.md (+16 -1)
📝 docs/managed-code-analysis.md (+44 -1)
➕ experiments/analysis-efficiency/managed-cli-costs.py (+84 -0)
➕ experiments/analysis-efficiency/managed-cli-local-control.py (+44 -0)
➕ experiments/analysis-efficiency/managed-cli-oracle.py (+18 -0)
➕ experiments/analysis-efficiency/managed-cli-runtime.mjs (+87 -0)
➕ experiments/analysis-efficiency/managed-cli-shared-read.json (+72 -0)
➕ experiments/analysis-efficiency/managed-cli-task.mjs (+266 -0)
➕ experiments/analysis-efficiency/managed-cli.json (+1332 -0)
➕ experiments/analysis-efficiency/managed-cli.md (+219 -0)
📝 src/application/AnalysisProvider.ts (+3 -0)
📝 src/application/DirectAnalysis.ts (+90 -23)
📝 src/application/EvidenceBundleCommands.ts (+159 -12)
📝 src/application/EvidenceBundleFiles.ts (+24 -18)
📝 src/application/EvidenceInputResolver.test.ts (+3 -1)
📝 src/application/EvidenceInputResolver.ts (+1 -1)
📝 src/application/JsonAuthenticationHeadroom.test.ts (+69 -0)
📝 src/application/JsonAuthenticationHeadroom.ts (+58 -20)
📝 src/application/JsonFiles.ts (+8 -4)
📝 src/application/analysisView/AnalysisViewService.ts (+40 -35)

...and 28 more files

📄 Description

Summary

Fixes #5148. inspect-managed-members --detail summary --evidence-bundle FILE returns selection, source coverage, limitations and counts after atomically preserving complete original Evidence. inspect-analysis-view --evidence-bundle FILE authenticates and pages that exact parent after process exit or target deletion. Complete output remains the default; existing destinations are never replaced.

CLI and MCP reuse the application/domain projectors. Fresh managed and derived-view data is parsed into independent trees, hashed and sealed using active ancestry/iterators; existing immutable subtrees can be shared. General graph sealing preserves its separate alias/cycle/hidden-field semantics. Low-headroom error projection reuses the authenticated parent without cloning. Heap admission traverses by depth, reserves escaping expansion and avoids a width-sized row queue; canonical comparison streams existing encoder parts. Every bundle reader explicitly binds its owning operation, including both native-matching passes. No new provider, target execution, dependency or MCP schema.

Publication/read failures retain completed facts, original causes and exact cleanup ownership. One process primitive dispatches queued callbacks and OS signals. The managed producer checks completion before default delivery; inline/file/bundle views share the command finalizer and real cleanup scope. Existing inline error labels are preserved, and its redundant adapter copy is removed. Publication/authentication/projection checkpoints retain listeners through acceptance. Interrupted committed publication retains its receipt and linked partial summary. Synchronous work is cooperatively cancellable between stages.

Real completed tasks

Official Newtonsoft.Json 13.0.3 net6.0 DLL, SHA-256 22c649f75fce5be7c7ccda8880473b634ef69ecf33f5d1ab8ad892caf47d5a07. Independent dnfile/pefile oracle checks all 72 JsonConvert methods' tokens/names/RVAs/signature hashes and sixteen assembly-wide MemberRefs. The task asks identity, selection, source/page coverage, method total and the first eight methods/sixteen references. Full parents and answers match in all twelve alternating cold/warm tasks against clean main@3dbe314a. No library code executes or complete CIL behavioral claim.

Whole-task median Complete Summary + two pages
Estimated context tokens 451,373 13,078
Cold wall / family CPU seconds 9.969 / 9.743 14.801 / 14.555
Cold kernel family peak MiB 393.3 400.1
Warm wall / family CPU seconds 10.339 / 10.097 24.141 / 23.842
Warm kernel family peak MiB 401.8 407.2

Context includes question, recipe, argv, actual help and stdout (cl100k_base estimate); actual model usage is unmeasured. This opt-in context/portability improvement adds latency/CPU; no general speed or memory saving claim. Each run binds its distinct checkout, source state and entire compiled CLI graph before/after execution. Audits are included and warm compiled-file pages. Cold disables Node compile cache; OS cache is uncontrolled. Kernel family peak includes file cache. Serial one-CPU / 4 GiB guard, no OOM/resource stops or leftovers. An existing native code-composition control also returns the identical answer; its one-run observation and different token scope are recorded.

Reproduction and limits · All hashes, trials and ranges.

Validation

Linux x64, pinned Node 24.18.0/npm 11.16.0:

  • 556 tests across 36 files pass: compiled CLI/all eight collections, Evidence identity/ownership, publication/authentication, bundle comparison, native matching, cancellation and cleanup retry.

  • Eight new cases fail against the preceding producer/reader behavior and pass restored: graph-sized sealing/admission scratch, CLI export/compare/inspection, actual SDK comparison and native matching's initial read/later reload. No actual OOM is induced.

  • Four compiled queued-publication cases and eight default-complete/inline-projection cases (SIGINT/SIGTERM × event/actual POSIX signal) fail with their checkpoints removed and pass restored. Two real DLL publication and four real default/inline completion runs preserve identical parents or independently checked summaries and exit 130/143; committed receipts survive where applicable.

  • All six npm run check tasks plus architecture guards pass; all six npm run docs:check tasks and five README tests pass.

  • Expanded domain project: 5,617 passed across 287 files, 3 skipped (overlaps focused tests). Two existing large synthetic cases timed out once in a batch and passed isolated/fresh-shard runs with the same 30-second limit; cause unverified. No production/timeout change for those cases. The native built-in probe is now isolated; an earlier unsplit invocation was manually stopped before its heap ceiling and excluded.

  • Twelve final bound tasks, native control and clean no-pilot aggregation pass. Tampered-runtime aggregation is rejected and only admitted with its identity guard removed; all 42 measured CLI stderr files are empty.

  • Real Redux Toolkit 2.2.7 SDK regression passes an independent 180-file/99-node/210-relation oracle through the shared reader. Receipt is one regression with the existing semantic-node cap, not a paired source-performance or behavioral-equivalence claim.

  • Clean integration with main@260405996 passes build, all six static-check tasks, architecture guards and real Newtonsoft/ripgrep SDK tasks with identical parent/answer identities and independent oracles. This is integration validation, not an additional paired performance cohort.

  • CI encountered one Java-prerequisite cleanup failure and one HTTP socket-close failure in unchanged setup/HTTP paths. The corresponding complete 14-case setup and two-case HTTP files pass separately on both clean baseline main and this candidate. The setup and HTTP retries, all eight built-test shards, portable-report verification and the required CI aggregate passed. Their intermittent CI causes remain unverified, and no production or timeout change was made for them. Current integration/CI receipt.

Reporter executable, foreign OSes, Windows OS signals, full CIL semantics and actual model sessions remain unverified. Initial test-only spy/probe/schema-import issues were corrected before the full passing gates; earlier cohorts are superseded. Current-head Greptile reviewed 48 files with no comments. CI attempt 3 passed all required checks; optional lanes are explicitly skipped. Earlier cancelled metadata runs are superseded. Codex review of this head could not run because the repository code-review quota is exhausted; one explicit retry returned the same quota message (automatic, retry). Earlier actionable Codex threads are resolved; no current-head Codex pass is claimed. AI assistance: Codex.

Author readiness

Human owner: @jaelliot

  • 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/5167 **Author:** [@jaelliot](https://github.com/jaelliot) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/managed-cli-summary-5148` --- ### 📝 Commits (10+) - [`e6c120a`](https://github.com/morluto/rea/commit/e6c120a7f6bfdd7482ea13f9fb6dc57b5d2683d2) feat(cli): summarize managed members with durable Evidence paging - [`243239d`](https://github.com/morluto/rea/commit/243239d617aaa1ac7d910c71496aa9be1bb7317c) refactor(cli): reuse existing Evidence delivery owners - [`676620c`](https://github.com/morluto/rea/commit/676620cf47d663560afb2d6e1e5a92de0cd18469) Merge branch 'main' into fix/managed-cli-summary-5148 - [`1992c85`](https://github.com/morluto/rea/commit/1992c85cdc78760b33d4548fef30bc10aca7d96b) fix(cli): preserve cleanup recovery and cancellation status - [`42306a1`](https://github.com/morluto/rea/commit/42306a1c17178c85a539ab86d4c78a125ed33198) fix(cli): preserve Evidence-file views when merging upstream - [`db38531`](https://github.com/morluto/rea/commit/db38531ae480008b05fc2c98ab09539d7b18ff64) fix(cli): preserve request-file cancellation after upstream integration - [`7b3ed4d`](https://github.com/morluto/rea/commit/7b3ed4d025edd24d062cde0327a53bd311e174fc) fix(cli): honor queued interrupts during bundle paging - [`c0d3b54`](https://github.com/morluto/rea/commit/c0d3b5434344b546f910eeea402bd4cad6d09292) feat(cli): add durable managed member summaries - [`f0b797d`](https://github.com/morluto/rea/commit/f0b797d2f312f673effd82f177c49745eaf67c2b) Merge remote-tracking branch 'origin/main' into perf/5148-managed-cli-durable-evidence - [`ab78a14`](https://github.com/morluto/rea/commit/ab78a1421c042c7699011fa0c2259745ac0df60f) docs(perf): record latest-main managed workflow verification ### 📊 Changes **48 files changed** (+4671 additions, -196 deletions) <details> <summary>View changed files</summary> 📝 `docs/cli.md` (+16 -1) 📝 `docs/managed-code-analysis.md` (+44 -1) ➕ `experiments/analysis-efficiency/managed-cli-costs.py` (+84 -0) ➕ `experiments/analysis-efficiency/managed-cli-local-control.py` (+44 -0) ➕ `experiments/analysis-efficiency/managed-cli-oracle.py` (+18 -0) ➕ `experiments/analysis-efficiency/managed-cli-runtime.mjs` (+87 -0) ➕ `experiments/analysis-efficiency/managed-cli-shared-read.json` (+72 -0) ➕ `experiments/analysis-efficiency/managed-cli-task.mjs` (+266 -0) ➕ `experiments/analysis-efficiency/managed-cli.json` (+1332 -0) ➕ `experiments/analysis-efficiency/managed-cli.md` (+219 -0) 📝 `src/application/AnalysisProvider.ts` (+3 -0) 📝 `src/application/DirectAnalysis.ts` (+90 -23) 📝 `src/application/EvidenceBundleCommands.ts` (+159 -12) 📝 `src/application/EvidenceBundleFiles.ts` (+24 -18) 📝 `src/application/EvidenceInputResolver.test.ts` (+3 -1) 📝 `src/application/EvidenceInputResolver.ts` (+1 -1) 📝 `src/application/JsonAuthenticationHeadroom.test.ts` (+69 -0) 📝 `src/application/JsonAuthenticationHeadroom.ts` (+58 -20) 📝 `src/application/JsonFiles.ts` (+8 -4) 📝 `src/application/analysisView/AnalysisViewService.ts` (+40 -35) _...and 28 more files_ </details> ### 📄 Description ## Summary Fixes #5148. `inspect-managed-members --detail summary --evidence-bundle FILE` returns selection, source coverage, limitations and counts after atomically preserving complete original Evidence. `inspect-analysis-view --evidence-bundle FILE` authenticates and pages that exact parent after process exit or target deletion. Complete output remains the default; existing destinations are never replaced. CLI and MCP reuse the application/domain projectors. Fresh managed and derived-view data is parsed into independent trees, hashed and sealed using active ancestry/iterators; existing immutable subtrees can be shared. General graph sealing preserves its separate alias/cycle/hidden-field semantics. Low-headroom error projection reuses the authenticated parent without cloning. Heap admission traverses by depth, reserves escaping expansion and avoids a width-sized row queue; canonical comparison streams existing encoder parts. Every bundle reader explicitly binds its owning operation, including both native-matching passes. No new provider, target execution, dependency or MCP schema. Publication/read failures retain completed facts, original causes and exact cleanup ownership. One process primitive dispatches queued callbacks and OS signals. The managed producer checks completion before default delivery; inline/file/bundle views share the command finalizer and real cleanup scope. Existing inline error labels are preserved, and its redundant adapter copy is removed. Publication/authentication/projection checkpoints retain listeners through acceptance. Interrupted committed publication retains its receipt and linked partial summary. Synchronous work is cooperatively cancellable between stages. ## Real completed tasks Official Newtonsoft.Json 13.0.3 net6.0 DLL, SHA-256 `22c649f75fce5be7c7ccda8880473b634ef69ecf33f5d1ab8ad892caf47d5a07`. Independent dnfile/pefile oracle checks all 72 JsonConvert methods' tokens/names/RVAs/signature hashes and sixteen assembly-wide MemberRefs. The task asks identity, selection, source/page coverage, method total and the first eight methods/sixteen references. Full parents and answers match in all twelve alternating cold/warm tasks against clean `main@3dbe314a`. No library code executes or complete CIL behavioral claim. | Whole-task median | Complete | Summary + two pages | | --- | ---: | ---: | | Estimated context tokens | 451,373 | 13,078 | | Cold wall / family CPU seconds | 9.969 / 9.743 | 14.801 / 14.555 | | Cold kernel family peak MiB | 393.3 | 400.1 | | Warm wall / family CPU seconds | 10.339 / 10.097 | 24.141 / 23.842 | | Warm kernel family peak MiB | 401.8 | 407.2 | Context includes question, recipe, argv, actual help and stdout (`cl100k_base` estimate); actual model usage is unmeasured. This opt-in context/portability improvement adds latency/CPU; no general speed or memory saving claim. Each run binds its distinct checkout, source state and entire compiled CLI graph before/after execution. Audits are included and warm compiled-file pages. Cold disables Node compile cache; OS cache is uncontrolled. Kernel family peak includes file cache. Serial one-CPU / 4 GiB guard, no OOM/resource stops or leftovers. An existing native code-composition control also returns the identical answer; its one-run observation and different token scope are recorded. [Reproduction and limits](https://github.com/jaelliot/rea/blob/b2e5baf10bcfb623d00f1db9c2006e3381f0caaf/experiments/analysis-efficiency/managed-cli.md) · [All hashes, trials and ranges](https://github.com/jaelliot/rea/blob/b2e5baf10bcfb623d00f1db9c2006e3381f0caaf/experiments/analysis-efficiency/managed-cli.json). ## Validation Linux x64, pinned Node 24.18.0/npm 11.16.0: - 556 tests across 36 files pass: compiled CLI/all eight collections, Evidence identity/ownership, publication/authentication, bundle comparison, native matching, cancellation and cleanup retry. - Eight new cases fail against the preceding producer/reader behavior and pass restored: graph-sized sealing/admission scratch, CLI export/compare/inspection, actual SDK comparison and native matching's initial read/later reload. No actual OOM is induced. - Four compiled queued-publication cases and eight default-complete/inline-projection cases (SIGINT/SIGTERM × event/actual POSIX signal) fail with their checkpoints removed and pass restored. Two real DLL publication and four real default/inline completion runs preserve identical parents or independently checked summaries and exit 130/143; committed receipts survive where applicable. - All six `npm run check` tasks plus architecture guards pass; all six `npm run docs:check` tasks and five README tests pass. - Expanded domain project: 5,617 passed across 287 files, 3 skipped (overlaps focused tests). Two existing large synthetic cases timed out once in a batch and passed isolated/fresh-shard runs with the same 30-second limit; cause unverified. No production/timeout change for those cases. The native built-in probe is now isolated; an earlier unsplit invocation was manually stopped before its heap ceiling and excluded. - Twelve final bound tasks, native control and clean no-pilot aggregation pass. Tampered-runtime aggregation is rejected and only admitted with its identity guard removed; all 42 measured CLI stderr files are empty. - Real Redux Toolkit 2.2.7 SDK regression passes an independent 180-file/99-node/210-relation oracle through the shared reader. [Receipt](https://github.com/jaelliot/rea/blob/b2e5baf10bcfb623d00f1db9c2006e3381f0caaf/experiments/analysis-efficiency/managed-cli-shared-read.json) is one regression with the existing semantic-node cap, not a paired source-performance or behavioral-equivalence claim. - Clean integration with `main@260405996` passes build, all six static-check tasks, architecture guards and real Newtonsoft/ripgrep SDK tasks with identical parent/answer identities and independent oracles. This is integration validation, not an additional paired performance cohort. - CI encountered one Java-prerequisite cleanup failure and one HTTP socket-close failure in unchanged setup/HTTP paths. The corresponding complete 14-case setup and two-case HTTP files pass separately on both clean baseline main and this candidate. The setup and HTTP retries, all eight built-test shards, portable-report verification and the required CI aggregate passed. Their intermittent CI causes remain unverified, and no production or timeout change was made for them. [Current integration/CI receipt](https://github.com/morluto/rea/pull/5167#issuecomment-6329359638). Reporter executable, foreign OSes, Windows OS signals, full CIL semantics and actual model sessions remain unverified. Initial test-only spy/probe/schema-import issues were corrected before the full passing gates; earlier cohorts are superseded. Current-head Greptile reviewed 48 files with no comments. [CI attempt 3](https://github.com/morluto/rea/actions/runs/39696061434) passed all required checks; optional lanes are explicitly skipped. Earlier cancelled metadata runs are superseded. Codex review of this head could not run because the repository code-review quota is exhausted; one explicit retry returned the same quota message ([automatic](https://github.com/morluto/rea/pull/5167#issuecomment-6329166311), [retry](https://github.com/morluto/rea/pull/5167#issuecomment-6329183749)). Earlier actionable Codex threads are resolved; no current-head Codex pass is claimed. AI assistance: Codex. ## Author readiness Human owner: @jaelliot - [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:43:06 +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#6796
No description provided.