[PR #3742] feat(experiments): prototype Electron IPC effect attribution #5874

Open
opened 2026-10-31 01:10:06 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3742
Author: @JNTMTMTM
Created: 10/14/2026
Status: 🔄 Open

Base: main ← Head: codex/electron-feature-path-prototype


📝 Commits (5)

  • a6acdfe feat(experiments): prototype Electron IPC effect attribution
  • bf464ab fix(experiments): retain cleanup ownership and capture evidence
  • eaf931b test(cli): batch selected client profile readiness checks
  • c05c082 Merge remote-tracking branch 'origin/main' into sweep/3742
  • e732f61 test(experiments): verify macOS head and gate Electron Node regressions

📊 Changes

17 files changed (+3272 additions, -0 deletions)

View changed files

📝 .github/workflows/ci.yml (+4 -0)
➕ experiments/electron-feature-path/README.md (+268 -0)
➕ experiments/electron-feature-path/fixture/main.cjs (+60 -0)
➕ experiments/electron-feature-path/fixture/preload.cjs (+7 -0)
➕ experiments/electron-feature-path/fixture/renderer.html (+7 -0)
➕ experiments/electron-feature-path/fixture/renderer.js (+8 -0)
➕ experiments/electron-feature-path/mcp-lifecycle.mjs (+208 -0)
➕ experiments/electron-feature-path/mcp-lifecycle.test.mjs (+425 -0)
➕ experiments/electron-feature-path/recorder.mjs (+225 -0)
➕ experiments/electron-feature-path/recorder.test.mjs (+503 -0)
➕ experiments/electron-feature-path/trace-contract.mjs (+90 -0)
➕ experiments/electron-feature-path/trace-contract.test.mjs (+308 -0)
➕ experiments/electron-feature-path/verifier-run.mjs (+119 -0)
➕ experiments/electron-feature-path/verifier-run.test.mjs (+322 -0)
➕ experiments/electron-feature-path/verify-mcp.mjs (+459 -0)
➕ experiments/electron-feature-path/verify-mcp.test.mjs (+205 -0)
📝 tests/boundary/filesystem/ciFeedback.test.ts (+54 -0)

📄 Description

Summary

An isolated, unregistered fixture experiment associates one selected main IPC invocation with a selected file-write call in its async context. It preserves invocation/effect identity and unknown lifetime; it does not establish UI causality, renderer/preload execution, cross-process tracing or native calls. No production tools, arbitrary-app injection or package integration are added.

Maintainer scope decision: pending / integration hold. Tracker #4027 now tracks this proposal, but grants no runtime authority or scope approval. The latest human review's hold remains. CI success and existing human readiness declarations do not replace that decision; this PR must not be merged or enabled without it.

Current verification and changes

Validated the merged head c05c082bf700f719c4efd5f60f103bf45b293292 on 2026-10-15 in a fresh worktree, preserving the original checkout. Follow-up head e732f6199940233345b69c6cde28a5441c893d25 changes only the experiment README, CI and a CI regression; all runtime, recorder, fixture and verifier bytes are unchanged from the real-provider runs.

The audit found that Vitest discovers .test.ts, while CI never ran the experimental .test.mjs. Build package now runs all five experiment files in a separate uncached step after test:prepare builds their required runtime. The existing build/required gate propagates failures. No timeout changes, retries, weakened assertions or automatic Electron installation. A workflow regression failed before this step was added and verifies preparation order plus required-gate rejection of failed/cancelled/skipped/missing builds.

Host/tools: macOS 27.0.1 (26A434), arm64; Node 24.18.0 / npm 11.16.0; MCP client/server 2.3.1; existing explicitly selected Electron 44.4.3. Electron executable SHA-256: 52591945c62a357a093d45bab2a13ef95636e5e16c40ea960e428123ce58365e. No host security settings changed.

Executed locally:

  • npm ci and npm run build:cached: passed.
  • node --test experiments/electron-feature-path/*.test.mjs: 61 passed / 0 failed / 0 skipped. Includes actual installed-SDK cancellation, retained-owner subprocess and real-MCP failed-capture/checkpoint-collision cases.
  • npm run test:focused -- tests/boundary/mcp/electronMcp.test.ts tests/boundary/browser/electronActiveHook.test.ts tests/boundary/cli/electronCli.test.ts: 16 passed / 0 failed / 0 skipped.
  • Five related CI workflow/selection/cache/report/gate files: 254 passed / 0 failed / 0 skipped.
  • npm run check, npm run docs:check (5 README cases), npm run verify:test-discovery (1,321 unique Vitest files), pre-commit formatting/lint, pre-push npm run check:fast, and git diff --check: passed. Existing bundler/lint warnings remain.
  • Real stdio MCP baseline, prototype and --cancel-after-ready: passed, then repeated with a local SDK JSON-message recorder. Every run used a new absolute directory/profile and the explicit existing Electron executable.
  • Actual compiled node scripts/rea.mjs capture-electron-scenario ABS_REQUEST_JSON --json: separate baseline/prototype fixture runs passed.
  • npm pack --dry-run --ignore-scripts --json: 1,678 files, zero experimental files. Actual TypeScript build-file inventory (1,989 inputs), runtime/source import search and the 207-tool catalog also exclude the experiment.

Evidence, ownership and limitations

Both normal surfaces produced exactly fixture exported\n; baseline retained zero experimental events, prototype four. The selected fulfilled file effect shares the invocation ID, selected output path and active handler context. It remains fixture-probe async-context authority with unknown UI association. Nine source digests and the executable digest remained unchanged, including after the CLI runs.

Normal MCP runs preserve a parsed complete static-parent checkpoint and final four-record Evidence bundle, plus separate before/after export requests/replies. The historical automated “Failed runs lose complete analysis” finding is covered by the unconditional pre-capture checkpoint and the executed real-MCP failure/collision regressions.

Cancellation observed fixture readiness, sent notification for the actual request ID, received an independent session-drain acknowledgement and checked run-token process absence against the prelaunch identity baseline: cleaned: true, signaled: false. The recorded run preserved 14 unrelated unreadable-process observations. The suppressed/unavailable capture reply is not cleanup proof. Cancellation retains the complete checkpoint; no final capture reply or post-drain bundle is fabricated. No run required unresolved owner retention.

Complete-workflow samples include discovery, schema checks, analysis, follow-ups, evidence exports and cleanup. Unrecorded baseline/prototype MCP runs: 7.28 / 7.33 s elapsed, 8.48 / 8.67 s child wait4 CPU, 1,332 / 1,437 MiB sampled summed family RSS. SDK-recorded repeats: 6.91 / 6.11 s, 8.24 / 7.64 s CPU, 1,405 / 1,419 MiB RSS. CLI baseline/prototype: 2.30 / 2.87 s, 2.76 / 3.03 s CPU, 881 / 852 MiB RSS. These are fresh-process/profile samples on a prepared build with warm filesystem; no performance improvement is claimed.

RSS sampling is 30 ms plus ps time, may miss peaks/short children and counts shared pages multiple times. wait4 descendant accounting depends on OS/reaping. The local recorder retains parsed SDK messages until exit; its cost is included. tokenx 1.3.0 estimates serialized request/reply values, including initialization, catalog and follow-ups: baseline 789 / 1,094,470, prototype 786 / 1,094,462; catalog alone 974,771. These are heuristics, not actual model tokens/billing. No model is called by the verifiers; agent rendering/prompt/reasoning, hosted CI resources, OS-cold and warm-session costs remain unmeasured. Some probes overlapped CI regression work.

Raw logs and large evidence remain local under outputs/macos-c05c082-20261015/ in the task workspace, including selections/digests, raw tool replies, parsed SDK JSON messages (not original wire bytes), CLI requests/results, checkpoints/bundles, command metrics and independent evidence-audit.json. No binaries, dist, dependencies, profiles or environment credentials are committed. The README verification record gives the exact local evidence root and measurement limits.

Historical evidence and remaining gaps

Earlier macOS records and the Windows test-only/hosted-CI results for eaf931bb99cffb7ac607e752e4b8a0ee46807f08 remain historical, separately labeled in the README; they do not validate the later main merge. The earlier intermittent Windows module-trace timeout root cause remains unconfirmed. No new Windows/Linux Electron, arbitrary-app, renderer/preload, cross-process or native-call proof is claimed.

Current CI / automated review

Pushed without force. CI run 38767674862 completed successfully: all 35 jobs passed, including the five built-test shards, Source tests, Windows capability/package lane, Apple artifact lane, portable aggregation and CI required. The new experiment step actually ran 61 passed / 0 failed / 0 skipped. The run is associated with exact PR head e732f6199940233345b69c6cde28a5441c893d25; GitHub executed synthetic merge adfb29f1831430bafaebebe7eb8ccad248fdb829 against base 5b16f2431062eea6ffd245a9e05512790007cb13. The local experiment suite was also rerun directly on final head: 61 / 0 / 0. Greptile Review passed at that head (5/5), with no new inline findings. The earlier Codex review-limit notice does not establish an additional review. The human maintainer scope hold remains unresolved. No merge or human readiness attestation is performed by this verification.

Author readiness

Human owner: @JNTMTMTM

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

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/3742 **Author:** [@JNTMTMTM](https://github.com/JNTMTMTM) **Created:** 10/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/electron-feature-path-prototype` --- ### 📝 Commits (5) - [`a6acdfe`](https://github.com/morluto/rea/commit/a6acdfe7fd423741256adf2e2259b2ce834816e9) feat(experiments): prototype Electron IPC effect attribution - [`bf464ab`](https://github.com/morluto/rea/commit/bf464ab7b6aec967a1ff649cbf7244ed7b6164a8) fix(experiments): retain cleanup ownership and capture evidence - [`eaf931b`](https://github.com/morluto/rea/commit/eaf931bb99cffb7ac607e752e4b8a0ee46807f08) test(cli): batch selected client profile readiness checks - [`c05c082`](https://github.com/morluto/rea/commit/c05c082bf700f719c4efd5f60f103bf45b293292) Merge remote-tracking branch 'origin/main' into sweep/3742 - [`e732f61`](https://github.com/morluto/rea/commit/e732f6199940233345b69c6cde28a5441c893d25) test(experiments): verify macOS head and gate Electron Node regressions ### 📊 Changes **17 files changed** (+3272 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+4 -0) ➕ `experiments/electron-feature-path/README.md` (+268 -0) ➕ `experiments/electron-feature-path/fixture/main.cjs` (+60 -0) ➕ `experiments/electron-feature-path/fixture/preload.cjs` (+7 -0) ➕ `experiments/electron-feature-path/fixture/renderer.html` (+7 -0) ➕ `experiments/electron-feature-path/fixture/renderer.js` (+8 -0) ➕ `experiments/electron-feature-path/mcp-lifecycle.mjs` (+208 -0) ➕ `experiments/electron-feature-path/mcp-lifecycle.test.mjs` (+425 -0) ➕ `experiments/electron-feature-path/recorder.mjs` (+225 -0) ➕ `experiments/electron-feature-path/recorder.test.mjs` (+503 -0) ➕ `experiments/electron-feature-path/trace-contract.mjs` (+90 -0) ➕ `experiments/electron-feature-path/trace-contract.test.mjs` (+308 -0) ➕ `experiments/electron-feature-path/verifier-run.mjs` (+119 -0) ➕ `experiments/electron-feature-path/verifier-run.test.mjs` (+322 -0) ➕ `experiments/electron-feature-path/verify-mcp.mjs` (+459 -0) ➕ `experiments/electron-feature-path/verify-mcp.test.mjs` (+205 -0) 📝 `tests/boundary/filesystem/ciFeedback.test.ts` (+54 -0) </details> ### 📄 Description ## Summary An isolated, unregistered fixture experiment associates one selected main IPC invocation with a selected file-write call in its async context. It preserves invocation/effect identity and unknown lifetime; it does not establish UI causality, renderer/preload execution, cross-process tracing or native calls. No production tools, arbitrary-app injection or package integration are added. Maintainer scope decision: **pending / integration hold**. [Tracker #4027](https://github.com/morluto/rea/issues/4027) now tracks this proposal, but grants no runtime authority or scope approval. The latest human review's hold remains. CI success and existing human readiness declarations do not replace that decision; this PR must not be merged or enabled without it. ## Current verification and changes Validated the merged head `c05c082bf700f719c4efd5f60f103bf45b293292` on 2026-10-15 in a fresh worktree, preserving the original checkout. Follow-up head **`e732f6199940233345b69c6cde28a5441c893d25`** changes only the experiment README, CI and a CI regression; all runtime, recorder, fixture and verifier bytes are unchanged from the real-provider runs. The audit found that Vitest discovers `.test.ts`, while CI never ran the experimental `.test.mjs`. Build package now runs all five experiment files in a separate uncached step after `test:prepare` builds their required runtime. The existing build/required gate propagates failures. No timeout changes, retries, weakened assertions or automatic Electron installation. A workflow regression failed before this step was added and verifies preparation order plus required-gate rejection of failed/cancelled/skipped/missing builds. Host/tools: **macOS 27.0.1 (26A434), arm64; Node 24.18.0 / npm 11.16.0; MCP client/server 2.3.1; existing explicitly selected Electron 44.4.3**. Electron executable SHA-256: `52591945c62a357a093d45bab2a13ef95636e5e16c40ea960e428123ce58365e`. No host security settings changed. Executed locally: - `npm ci` and `npm run build:cached`: passed. - `node --test experiments/electron-feature-path/*.test.mjs`: **61 passed / 0 failed / 0 skipped**. Includes actual installed-SDK cancellation, retained-owner subprocess and real-MCP failed-capture/checkpoint-collision cases. - `npm run test:focused -- tests/boundary/mcp/electronMcp.test.ts tests/boundary/browser/electronActiveHook.test.ts tests/boundary/cli/electronCli.test.ts`: **16 passed / 0 failed / 0 skipped**. - Five related CI workflow/selection/cache/report/gate files: **254 passed / 0 failed / 0 skipped**. - `npm run check`, `npm run docs:check` (5 README cases), `npm run verify:test-discovery` (1,321 unique Vitest files), pre-commit formatting/lint, pre-push `npm run check:fast`, and `git diff --check`: passed. Existing bundler/lint warnings remain. - Real stdio MCP baseline, prototype and `--cancel-after-ready`: passed, then repeated with a local SDK JSON-message recorder. Every run used a new absolute directory/profile and the explicit existing Electron executable. - Actual compiled `node scripts/rea.mjs capture-electron-scenario ABS_REQUEST_JSON --json`: separate baseline/prototype fixture runs passed. - `npm pack --dry-run --ignore-scripts --json`: 1,678 files, **zero experimental files**. Actual TypeScript build-file inventory (1,989 inputs), runtime/source import search and the 207-tool catalog also exclude the experiment. ## Evidence, ownership and limitations Both normal surfaces produced exactly `fixture exported\n`; baseline retained zero experimental events, prototype four. The selected fulfilled file effect shares the invocation ID, selected output path and active handler context. It remains fixture-probe async-context authority with unknown UI association. Nine source digests and the executable digest remained unchanged, including after the CLI runs. Normal MCP runs preserve a parsed complete static-parent checkpoint and final **four-record Evidence bundle**, plus separate before/after export requests/replies. The historical automated “Failed runs lose complete analysis” finding is covered by the unconditional pre-capture checkpoint and the executed real-MCP failure/collision regressions. Cancellation observed fixture readiness, sent notification for the actual request ID, received an independent session-drain acknowledgement and checked run-token process absence against the prelaunch identity baseline: **`cleaned: true`, `signaled: false`**. The recorded run preserved 14 unrelated unreadable-process observations. The suppressed/unavailable capture reply is not cleanup proof. Cancellation retains the complete checkpoint; no final capture reply or post-drain bundle is fabricated. No run required unresolved owner retention. Complete-workflow samples include discovery, schema checks, analysis, follow-ups, evidence exports and cleanup. Unrecorded baseline/prototype MCP runs: **7.28 / 7.33 s** elapsed, **8.48 / 8.67 s** child wait4 CPU, **1,332 / 1,437 MiB** sampled summed family RSS. SDK-recorded repeats: **6.91 / 6.11 s**, **8.24 / 7.64 s CPU**, **1,405 / 1,419 MiB RSS**. CLI baseline/prototype: **2.30 / 2.87 s**, **2.76 / 3.03 s CPU**, **881 / 852 MiB RSS**. These are fresh-process/profile samples on a prepared build with warm filesystem; no performance improvement is claimed. RSS sampling is 30 ms plus `ps` time, may miss peaks/short children and counts shared pages multiple times. wait4 descendant accounting depends on OS/reaping. The local recorder retains parsed SDK messages until exit; its cost is included. `tokenx` 1.3.0 estimates serialized request/reply values, including initialization, catalog and follow-ups: baseline **789 / 1,094,470**, prototype **786 / 1,094,462**; catalog alone **974,771**. These are heuristics, **not actual model tokens/billing**. No model is called by the verifiers; agent rendering/prompt/reasoning, hosted CI resources, OS-cold and warm-session costs remain unmeasured. Some probes overlapped CI regression work. Raw logs and large evidence remain local under `outputs/macos-c05c082-20261015/` in the task workspace, including selections/digests, raw tool replies, parsed SDK JSON messages (not original wire bytes), CLI requests/results, checkpoints/bundles, command metrics and independent `evidence-audit.json`. No binaries, dist, dependencies, profiles or environment credentials are committed. The [README verification record](https://github.com/JNTMTMTM/rea/blob/e732f6199940233345b69c6cde28a5441c893d25/experiments/electron-feature-path/README.md#current-macos-verification--2026-10-15) gives the exact local evidence root and measurement limits. ## Historical evidence and remaining gaps Earlier macOS records and the Windows test-only/hosted-CI results for `eaf931bb99cffb7ac607e752e4b8a0ee46807f08` remain historical, separately labeled in the README; they do not validate the later main merge. The earlier intermittent Windows module-trace timeout root cause remains unconfirmed. No new Windows/Linux Electron, arbitrary-app, renderer/preload, cross-process or native-call proof is claimed. ## Current CI / automated review Pushed without force. [CI run 38767674862](https://github.com/morluto/rea/actions/runs/38767674862) completed **successfully: all 35 jobs passed**, including the five built-test shards, Source tests, Windows capability/package lane, Apple artifact lane, portable aggregation and CI required. The new experiment step actually ran **61 passed / 0 failed / 0 skipped**. The run is associated with exact PR head `e732f6199940233345b69c6cde28a5441c893d25`; GitHub executed synthetic merge `adfb29f1831430bafaebebe7eb8ccad248fdb829` against base `5b16f2431062eea6ffd245a9e05512790007cb13`. The local experiment suite was also rerun directly on final head: **61 / 0 / 0**. **Greptile Review passed at that head (5/5), with no new inline findings.** The earlier Codex review-limit notice does not establish an additional review. The human maintainer scope hold remains unresolved. No merge or human readiness attestation is performed by this verification. ## Author readiness Human owner: @JNTMTMTM - [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. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5874
No description provided.