[PR #4082] [CLOSED] chore(experiments): explore code-friendly browser and Electron investigation #6044

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4082
Author: @N0zoM1z0
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: experiment/browser-codemode-tool-design-20261015


📝 Commits (5)

  • 62a4cb4 docs(experiments): propose code-friendly JavaScript data contracts
  • 25fcdfe chore(experiments): add browser and Electron code-mode pilot
  • 2c2c8df feat(analysis): prototype typed JavaScript references for code composition
  • dec85f4 chore(experiments): retain typed pilot failures and standardize code results
  • b3bdaba chore(experiments): publish shared-snapshot code-mode findings

📊 Changes

147 files changed (+10976 additions, -14 deletions)

View changed files

📝 .oxfmtrc.json (+2 -1)
📝 experiments/analysis-efficiency/agent-trial.py (+7 -0)
📝 experiments/analysis-efficiency/resource-run.py (+11 -6)
➕ experiments/browser-electron-code-mode/README.md (+186 -0)
➕ experiments/browser-electron-code-mode/backend.mjs (+327 -0)
➕ experiments/browser-electron-code-mode/capture-web.mjs (+96 -0)
➕ experiments/browser-electron-code-mode/prepare.py (+101 -0)
➕ experiments/browser-electron-code-mode/prepare_dependencies.py (+66 -0)
➕ experiments/browser-electron-code-mode/results-2026-10-15.md (+200 -0)
➕ experiments/browser-electron-code-mode/review.py (+134 -0)
➕ experiments/browser-electron-code-mode/test_backend.py (+135 -0)
➕ experiments/browser-electron-code-mode/test_review.py (+32 -0)
➕ experiments/browser-electron-code-mode/trial.py (+291 -0)
➕ experiments/codemode-data-contract/README.md (+393 -0)
➕ experiments/codemode-data-contract/acquire-oracle.py (+63 -0)
➕ experiments/codemode-data-contract/client.mjs (+83 -0)
➕ experiments/codemode-data-contract/discovery.mjs (+37 -0)
➕ experiments/codemode-data-contract/freeze-snapshot.py (+91 -0)
➕ experiments/codemode-data-contract/module-reference-probe.mjs (+179 -0)
➕ experiments/codemode-data-contract/prepare.py (+55 -0)

...and 80 more files

📄 Description

Summary

Refs #4063 and #4027. Explore whether typed browser/Electron investigation records make agent-written code useful. This is an experimental branch with real application measurements, preserved failures and reproducible scripts; no general efficiency advantage is claimed.

Problem and expected behavior

Module pages expose IDs and paths, while identities and retained range counts require individual full item reads. A code wrapper alone preserves that integration cost. Add a reusable typed reference query and compare direct calls with actual code over the same available facts.

Change and scope

Extend inspect_analysis_view with {kind:"javascript",collection:"modules",projection:"references",where:{path:"main.js",kind:"javascript-module"},offset:0,limit:64}. Return typed rows with identities, retained source-range counts and observation support, plus independent source coverage and canonical Evidence links. Reuse the existing producer, authentication and retention boundaries.

The experimental harness adds a typed async client, generated narrow discovery, consistent code Result values and an exact-snapshot comparison through public bundle import/export. Existing experimental profiles remain available. Save model actions, usage, outcomes, failures and resource receipts; omit downloadable applications, HARs and full regenerable Evidence.

Contract and boundary impact

  • Semantic owner: existing JavaScript application graph/view domain; no new parser.
  • Scope decision: not applicable to this additive offline read. The executor remains an experimental harness, with no new production target-execution, attachment, injection, mutation or protection-recovery capability. This draft does not request approval to integrate a production executor.
  • CLI/MCP: additive named view, strict filters, exact null/empty paths, stable offsets and typed output; original views remain supported.
  • Evidence: same authenticated parent and artifact digest; page exhaustion remains separate from partial source/semantic coverage. Arbitrary printed code conclusions do not become source Evidence.
  • Providers/platforms: existing static JavaScript and historical HAR workflows, verified locally on Linux. No new provider or installer dependency.
  • Generated metadata: regenerate ignored catalogs/skills normally; no build outputs or binary samples committed. Recorded JSON is excluded from reformatting to preserve frozen task and archive hashes.

Expected effects:

  • Read existing files or captured data.
  • Launch owned REA, model-client and evaluation processes; acquisition uses an owned browser.
  • Run isolated agent-written code over records; no target injection.
  • Change target process memory, registers, files or configuration.
  • Contact model services and the public site during explicit capture acquisition.
  • Recover protected code or work around protections.

Evidence and regression coverage

Executed: build; 135 focused domain/service, CLI/MCP, bridge and schema-profile tests; SDK declaration/type checking; npm run check; npm run docs:check; all seven canonical view examples parsed successfully.

Real Obsidian 1.14.4 verification matched 23 selected module identities and ten external specifiers/counts against original items, preserving 36 unselected files. Structured replies were 338,208 bytes for legacy page/items versus 23,402 bytes for one typed query; this is not a token-saving claim.

The first typed-interface cohort scored direct 2/2 and code 1/2; the successful browser code case only printed raw replies. An adaptive shared-snapshot pair produced identical query Evidence in both arms; the SDK code performed the aggregation correctly, while direct miscounted ten dictionary entries as eleven. A failed baseline and one pair cannot establish an efficiency win. All attempts and costs remain recorded, including the operator-aborted infrastructure attempt.

Results, exact metrics and limitations. Whole owned process families used one CPU, an 8 GiB cap and 6 GiB early stop; no OOM, verified cleanup. Largest local check peak: about 5.87 GiB.

Verification limits and risks

External controlled action protocol, not native Codex MCP-versus-code-host latency. Configured Terra high; single pairs, cache/model latency variation and adaptive changes prevent population-level conclusions. Obsidian facts are producer-consistency checks, not independent extractor validation. No live Electron runtime, debugger, package-install, protection-recovery or large-capacity claim. Historical captures and transient bundles are intentionally not archived; reruns create new frozen inputs.

Author readiness

Human owner: @N0zoM1z0 (PR-author default; readiness declarations pending).

  • 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/4082 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `experiment/browser-codemode-tool-design-20261015` --- ### 📝 Commits (5) - [`62a4cb4`](https://github.com/morluto/rea/commit/62a4cb4ad07fb32af1689ba19e04963c3c5015b3) docs(experiments): propose code-friendly JavaScript data contracts - [`25fcdfe`](https://github.com/morluto/rea/commit/25fcdfe1a44d9a97ecf3aa86c99d2d4d89955cc9) chore(experiments): add browser and Electron code-mode pilot - [`2c2c8df`](https://github.com/morluto/rea/commit/2c2c8df8d192eb2fa5e6e1ac5fe87b739d6033b0) feat(analysis): prototype typed JavaScript references for code composition - [`dec85f4`](https://github.com/morluto/rea/commit/dec85f4cfa74d7812cbaf130abd0769929df2781) chore(experiments): retain typed pilot failures and standardize code results - [`b3bdaba`](https://github.com/morluto/rea/commit/b3bdabab694af1f9801eff7caf75001b92314a58) chore(experiments): publish shared-snapshot code-mode findings ### 📊 Changes **147 files changed** (+10976 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `.oxfmtrc.json` (+2 -1) 📝 `experiments/analysis-efficiency/agent-trial.py` (+7 -0) 📝 `experiments/analysis-efficiency/resource-run.py` (+11 -6) ➕ `experiments/browser-electron-code-mode/README.md` (+186 -0) ➕ `experiments/browser-electron-code-mode/backend.mjs` (+327 -0) ➕ `experiments/browser-electron-code-mode/capture-web.mjs` (+96 -0) ➕ `experiments/browser-electron-code-mode/prepare.py` (+101 -0) ➕ `experiments/browser-electron-code-mode/prepare_dependencies.py` (+66 -0) ➕ `experiments/browser-electron-code-mode/results-2026-10-15.md` (+200 -0) ➕ `experiments/browser-electron-code-mode/review.py` (+134 -0) ➕ `experiments/browser-electron-code-mode/test_backend.py` (+135 -0) ➕ `experiments/browser-electron-code-mode/test_review.py` (+32 -0) ➕ `experiments/browser-electron-code-mode/trial.py` (+291 -0) ➕ `experiments/codemode-data-contract/README.md` (+393 -0) ➕ `experiments/codemode-data-contract/acquire-oracle.py` (+63 -0) ➕ `experiments/codemode-data-contract/client.mjs` (+83 -0) ➕ `experiments/codemode-data-contract/discovery.mjs` (+37 -0) ➕ `experiments/codemode-data-contract/freeze-snapshot.py` (+91 -0) ➕ `experiments/codemode-data-contract/module-reference-probe.mjs` (+179 -0) ➕ `experiments/codemode-data-contract/prepare.py` (+55 -0) _...and 80 more files_ </details> ### 📄 Description ## Summary Refs #4063 and #4027. Explore whether typed browser/Electron investigation records make agent-written code useful. This is an experimental branch with real application measurements, preserved failures and reproducible scripts; no general efficiency advantage is claimed. ## Problem and expected behavior Module pages expose IDs and paths, while identities and retained range counts require individual full item reads. A code wrapper alone preserves that integration cost. Add a reusable typed reference query and compare direct calls with actual code over the same available facts. ## Change and scope Extend `inspect_analysis_view` with `{kind:"javascript",collection:"modules",projection:"references",where:{path:"main.js",kind:"javascript-module"},offset:0,limit:64}`. Return typed rows with identities, retained source-range counts and observation support, plus independent source coverage and canonical Evidence links. Reuse the existing producer, authentication and retention boundaries. The experimental harness adds a typed async client, generated narrow discovery, consistent code `Result` values and an exact-snapshot comparison through public bundle import/export. Existing experimental profiles remain available. Save model actions, usage, outcomes, failures and resource receipts; omit downloadable applications, HARs and full regenerable Evidence. ## Contract and boundary impact - Semantic owner: existing JavaScript application graph/view domain; no new parser. - Scope decision: not applicable to this additive offline read. The executor remains an experimental harness, with no new production target-execution, attachment, injection, mutation or protection-recovery capability. This draft does not request approval to integrate a production executor. - CLI/MCP: additive named view, strict filters, exact null/empty paths, stable offsets and typed output; original views remain supported. - Evidence: same authenticated parent and artifact digest; page exhaustion remains separate from partial source/semantic coverage. Arbitrary printed code conclusions do not become source Evidence. - Providers/platforms: existing static JavaScript and historical HAR workflows, verified locally on Linux. No new provider or installer dependency. - Generated metadata: regenerate ignored catalogs/skills normally; no build outputs or binary samples committed. Recorded JSON is excluded from reformatting to preserve frozen task and archive hashes. Expected effects: - [x] Read existing files or captured data. - [x] Launch owned REA, model-client and evaluation processes; acquisition uses an owned browser. - [x] Run isolated agent-written code over records; no target injection. - [ ] Change target process memory, registers, files or configuration. - [x] Contact model services and the public site during explicit capture acquisition. - [ ] Recover protected code or work around protections. ## Evidence and regression coverage Executed: build; 135 focused domain/service, CLI/MCP, bridge and schema-profile tests; SDK declaration/type checking; `npm run check`; `npm run docs:check`; all seven canonical view examples parsed successfully. Real Obsidian 1.14.4 verification matched 23 selected module identities and ten external specifiers/counts against original items, preserving 36 unselected files. Structured replies were 338,208 bytes for legacy page/items versus 23,402 bytes for one typed query; this is not a token-saving claim. The first typed-interface cohort scored direct 2/2 and code 1/2; the successful browser code case only printed raw replies. An adaptive shared-snapshot pair produced identical query Evidence in both arms; the SDK code performed the aggregation correctly, while direct miscounted ten dictionary entries as eleven. A failed baseline and one pair cannot establish an efficiency win. All attempts and costs remain recorded, including the operator-aborted infrastructure attempt. [Results, exact metrics and limitations](https://github.com/morluto/rea/blob/experiment/browser-codemode-tool-design-20261015/experiments/codemode-data-contract/results-2026-10-15.md). Whole owned process families used one CPU, an 8 GiB cap and 6 GiB early stop; no OOM, verified cleanup. Largest local check peak: about 5.87 GiB. ## Verification limits and risks External controlled action protocol, not native Codex MCP-versus-code-host latency. Configured Terra high; single pairs, cache/model latency variation and adaptive changes prevent population-level conclusions. Obsidian facts are producer-consistency checks, not independent extractor validation. No live Electron runtime, debugger, package-install, protection-recovery or large-capacity claim. Historical captures and transient bundles are intentionally not archived; reruns create new frozen inputs. ## Author readiness Human owner: @N0zoM1z0 (PR-author default; readiness declarations pending). - [ ] 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. --- <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:25 +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#6044
No description provided.