[PR #4121] [MERGED] fix(javascript): declare owned analysis worker effects #6072

Closed
opened 2026-10-31 01:11:38 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/javascript-analysis-effects


📝 Commits (1)

  • c68428d fix(javascript): declare owned analysis worker effects

📊 Changes

6 files changed (+427 additions, -2 deletions)

View changed files

📝 docs/mcp-contracts.md (+4 -1)
➕ docs/verification/javascript-analysis-effects-2026-10-15.json (+249 -0)
➕ docs/verification/javascript-analysis-effects-2026-10-15.md (+121 -0)
📝 src/contracts/toolEffects.ts (+5 -1)
📝 tests/boundary/mcp/electronMcp.test.ts (+42 -0)
📝 tests/boundary/mcp/toolSchemaValidity.test.ts (+6 -0)

📄 Description

Summary

analyze_javascript_application launches an owned REA worker and stages temporary source files, but advertised only session effects. Declare launchesProcess and writesFilesystem in the canonical contract so tools/list reports openWorldHint: true and binary_session exposes both effects.

Fixes #3867. Part of #4027 and the shared-contract priorities in #4091.

Problem and expected behavior

Even a single-source analysis needs a child process and writable private temporary storage. Clients should discover those requirements before calling it. The worker analyzes inert source; non-destructive and idempotent hints remain accurate.

Change and scope

Correct the shared TOOL_EFFECTS record. SDK registration and CapabilityInventory already consume that owner directly. Document the existing internal work and verify the public catalog and session inventory.

Contract and boundary impact

  • Semantic owner: canonical tool effects, before SDK/catalog and session projection.
  • Maintainer scope decision: not applicable to correcting metadata for existing internal work; target authority is unchanged.
  • CLI/MCP: inputs, results and Evidence identities remain compatible. MCP clients receive accurate process/file hints and may adjust confirmation behavior.
  • Platform/provider: shared metadata; no bridge or engine behavior changes.
  • Cleanup: existing owned worker/private-root lifecycle remains responsible for temporary work.
  • Generated catalogs/skills are regenerated and checked, remain ignored; no dependencies, binaries or downloadable applications included.

Expected effects of the existing analysis workflow:

  • Read existing files or captured data.
  • Launch or attach to a process (owned REA analysis worker).
  • Change process memory, registers, files, or configuration (private temporary source files).

Evidence and regression coverage

Original contract: 2 metadata assertions failed, 18 tests passed. Actual stdio MCP independently returned openWorldHint: false and only [mutatesSession, idempotent]. After correction, stdio MCP returns the two missing effects and openWorldHint: true, with the same 207-tool catalog.

Official Obsidian 1.14.4 ASAR, selected package.json/main.js: before/after reads returned identical parent/view Evidence, 23 module facts and exact CLI/MCP parity. Selected-schema task BPE remained 16,548 (204,093 with the full name/description/inputSchema catalog projection). Static counts exclude annotations, separate metadata probes and hosted-model usage. One pair establishes no performance improvement or equivalence bound. Full verifier: 30.470 → 31.059 s wall, 29.940 → 30.663 s CPU, 1,551,282,176 → 1,584,574,464 B peak cgroup memory. One CPU/8 GiB, clean scopes, no OOM; cache/host timing uncontrolled.

Reproduction code, source hashes, compact records and measurement limits.

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- src/contracts/toolEffects.test.ts tests/boundary/mcp/electronMcp.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts: 27 passed, including SDK-converted schemas and actual session projection.
  • npm run check: passed typecheck, lint, format, knip, module boundaries and architecture guards.
  • npm run docs:check: passed, including 5 consistency tests.
  • Public stdio MCP metadata probes and existing real module-reference verifier with CLI parity/tiktoken: passed before and after; the baseline metadata was the defect.
  • git diff --check: passed.

Compatibility, safety, and release

Additive truthful metadata for existing work. Local proof is Linux x64 static shipped-artifact analysis with Node 24.18.0/npm 11.16.0. Live Electron, macOS/Windows runtime and hosted-agent behavior were not exercised locally.

Author readiness

Human owner: @N0zoM1z0

The session explicitly authorized implementation, validation, ready PRs and merging, including waiving manual declarations. The agent reviewed the diff and evidence. A human final-diff review is not asserted; these declarations remain unchecked.

  • 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.
  • Tests cover changed observable behavior.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible 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/4121 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/javascript-analysis-effects` --- ### 📝 Commits (1) - [`c68428d`](https://github.com/morluto/rea/commit/c68428d277217d07b67e7608f1609886e5691b0d) fix(javascript): declare owned analysis worker effects ### 📊 Changes **6 files changed** (+427 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/mcp-contracts.md` (+4 -1) ➕ `docs/verification/javascript-analysis-effects-2026-10-15.json` (+249 -0) ➕ `docs/verification/javascript-analysis-effects-2026-10-15.md` (+121 -0) 📝 `src/contracts/toolEffects.ts` (+5 -1) 📝 `tests/boundary/mcp/electronMcp.test.ts` (+42 -0) 📝 `tests/boundary/mcp/toolSchemaValidity.test.ts` (+6 -0) </details> ### 📄 Description ## Summary `analyze_javascript_application` launches an owned REA worker and stages temporary source files, but advertised only session effects. Declare `launchesProcess` and `writesFilesystem` in the canonical contract so `tools/list` reports `openWorldHint: true` and `binary_session` exposes both effects. Fixes #3867. Part of #4027 and the shared-contract priorities in #4091. ## Problem and expected behavior Even a single-source analysis needs a child process and writable private temporary storage. Clients should discover those requirements before calling it. The worker analyzes inert source; non-destructive and idempotent hints remain accurate. ## Change and scope Correct the shared `TOOL_EFFECTS` record. SDK registration and `CapabilityInventory` already consume that owner directly. Document the existing internal work and verify the public catalog and session inventory. ## Contract and boundary impact - Semantic owner: canonical tool effects, before SDK/catalog and session projection. - Maintainer scope decision: not applicable to correcting metadata for existing internal work; target authority is unchanged. - CLI/MCP: inputs, results and Evidence identities remain compatible. MCP clients receive accurate process/file hints and may adjust confirmation behavior. - Platform/provider: shared metadata; no bridge or engine behavior changes. - Cleanup: existing owned worker/private-root lifecycle remains responsible for temporary work. - Generated catalogs/skills are regenerated and checked, remain ignored; no dependencies, binaries or downloadable applications included. Expected effects of the existing analysis workflow: - [x] Read existing files or captured data. - [x] Launch or attach to a process (owned REA analysis worker). - [x] Change process memory, registers, files, or configuration (private temporary source files). ## Evidence and regression coverage Original contract: **2 metadata assertions failed, 18 tests passed**. Actual stdio MCP independently returned `openWorldHint: false` and only `[mutatesSession, idempotent]`. After correction, stdio MCP returns the two missing effects and `openWorldHint: true`, with the same 207-tool catalog. Official Obsidian 1.14.4 ASAR, selected `package.json`/`main.js`: before/after reads returned identical parent/view Evidence, 23 module facts and exact CLI/MCP parity. Selected-schema task BPE remained **16,548** (204,093 with the full name/description/inputSchema catalog projection). Static counts exclude annotations, separate metadata probes and hosted-model usage. One pair establishes no performance improvement or equivalence bound. Full verifier: **30.470 → 31.059 s wall**, **29.940 → 30.663 s CPU**, **1,551,282,176 → 1,584,574,464 B peak cgroup memory**. One CPU/8 GiB, clean scopes, no OOM; cache/host timing uncontrolled. [Reproduction code, source hashes, compact records and measurement limits](https://github.com/morluto/rea/blob/fix/javascript-analysis-effects/docs/verification/javascript-analysis-effects-2026-10-15.md). - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:focused -- src/contracts/toolEffects.test.ts tests/boundary/mcp/electronMcp.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts`: **27 passed**, including SDK-converted schemas and actual session projection. - `npm run check`: passed typecheck, lint, format, knip, module boundaries and architecture guards. - `npm run docs:check`: passed, including **5 consistency tests**. - Public stdio MCP metadata probes and existing real module-reference verifier with CLI parity/tiktoken: passed before and after; the baseline metadata was the defect. - `git diff --check`: passed. ## Compatibility, safety, and release Additive truthful metadata for existing work. Local proof is Linux x64 static shipped-artifact analysis with Node 24.18.0/npm 11.16.0. Live Electron, macOS/Windows runtime and hosted-agent behavior were not exercised locally. ## Author readiness Human owner: @N0zoM1z0 The session explicitly authorized implementation, validation, ready PRs and merging, including waiving manual declarations. The agent reviewed the diff and evidence. A human final-diff review is not asserted; these declarations remain unchecked. - [ ] 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 - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked. - [x] Tests cover changed observable behavior. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible MCP changes include representative output. - [x] 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>
bsakaguchi 2026-10-31 01:11:38 +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#6072
No description provided.