[PR #6163] [CLOSED] feat(environment): apply evidence-gated write effects to the served state #7176

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6163
Author: @morluto
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: cursor/rebase-5600


📝 Commits (2)

  • 95c8c9d feat(environment): render more read tools from the state and describe responses
  • ad8f674 feat(environment): apply evidence-gated write effects to the served state

📊 Changes

71 files changed (+12379 additions, -429 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/references/evidence-workflows.md (+10 -6)
📝 docs/agent-environments.md (+109 -45)
📝 docs/cli.md (+2 -1)
📝 docs/mcp-contracts.md (+1 -1)
➕ docs/specs/agent-environments/state-coverage/plan.md (+32 -0)
➕ docs/specs/agent-environments/state-coverage/spec.md (+94 -0)
➕ docs/specs/agent-environments/state-coverage/tasks.md (+16 -0)
➕ docs/specs/agent-environments/state-coverage/verification.md (+112 -0)
📝 docs/specs/agent-environments/state-serve/spec.md (+1 -6)
📝 docs/specs/agent-environments/state-serve/verification.md (+0 -7)
➕ docs/specs/agent-environments/state-writes/plan.md (+45 -0)
➕ docs/specs/agent-environments/state-writes/spec.md (+406 -0)
➕ docs/specs/agent-environments/state-writes/tasks.md (+22 -0)
➕ docs/specs/agent-environments/state-writes/verification.md (+360 -0)
📝 docs/testing.md (+1 -1)
📝 docs/web-network-captures.md (+87 -27)
📝 src/application/environment/environmentBundle.test.ts (+6 -4)
📝 src/application/environment/environmentBundle.ts (+5 -4)
📝 src/application/environment/environmentReplay.ts (+19 -29)
📝 src/application/environment/environmentSource.ts (+53 -1)

...and 51 more files

📄 Description

Summary

Replacement for fork PR #5600, stacked on the squashed rebase of #5352 (cursor/rebase-5352, 95c8c9d15). Fork force-with-lease to feat/environment-state-writes was rejected because the app token cannot update .github/workflows/ci.yml.

Problem and expected behavior

#5600 could not merge. After rebase it should still serve write tools only where a later read confirms the effect, on top of current main's serving and the #5352 coverage work.

Change and scope

Merged pull/5600/head onto the rebased #5352 tip and kept main's state-file close ownership and part-wise JSON measurement. Write plans, the write gate, and served write answers come from #5600. Squashed to one commit whose parent is the #5352 squash. Not a new provider or target-execution capability. Maintainer scope decision: not applicable.

Follow the contribution scope.

Contract and boundary impact

  • Semantic owner and earliest changed stage: environment state write plans and the served state store, when a confirmed write tool is called.
  • Contribution scope fit and linked maintainer decision: extends existing environment-serve; not applicable.
  • CLI and MCP/tool-catalog contract: confirmed write tools are served and described; unconfirmed writes stay off the catalog.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: write plans are inferred from the capture and served only when later reads confirm them.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): file:// state loads still retain a descriptor whose close failed, as on main.
  • Generated metadata: none committed.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: #5600 write-plan, write-answer, and serve-writes tests, plus main's file-close serve tests kept.
  • Base reproduction or other evidence: npm run typecheck passed on this tree.
  • User-visible CLI/MCP output (if applicable): environment-serve description names confirmed write tools.
  • Remaining proof gaps: the environment test suite was not executed in this rebase.

For evidence-bearing changes:

  • 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 typecheck — passed on the resolved #5600 tree before squash (same tree as ad8f674d2).

Compatibility, safety, and release

  • Breaking changes or migration steps: none intended beyond #5352. --replay-only still replays every tool.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: writes change only the in-memory served state, and only for plans the capture confirmed.

This branch contains the #5352 commit plus this one. Merging it into main also lands #5352. The later fidelity branch cursor/rebase-5699 is based on this tip.

Author readiness

Human owner: @morluto

  • 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.
Open in Web Open in Cursor 

🔄 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/6163 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `cursor/rebase-5600` --- ### 📝 Commits (2) - [`95c8c9d`](https://github.com/morluto/rea/commit/95c8c9d1573fcdf759da4edcf07e86a0a7c826c1) feat(environment): render more read tools from the state and describe responses - [`ad8f674`](https://github.com/morluto/rea/commit/ad8f674d221ff2bb27ed7560d2c06543f496bd3e) feat(environment): apply evidence-gated write effects to the served state ### 📊 Changes **71 files changed** (+12379 additions, -429 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/references/evidence-workflows.md` (+10 -6) 📝 `docs/agent-environments.md` (+109 -45) 📝 `docs/cli.md` (+2 -1) 📝 `docs/mcp-contracts.md` (+1 -1) ➕ `docs/specs/agent-environments/state-coverage/plan.md` (+32 -0) ➕ `docs/specs/agent-environments/state-coverage/spec.md` (+94 -0) ➕ `docs/specs/agent-environments/state-coverage/tasks.md` (+16 -0) ➕ `docs/specs/agent-environments/state-coverage/verification.md` (+112 -0) 📝 `docs/specs/agent-environments/state-serve/spec.md` (+1 -6) 📝 `docs/specs/agent-environments/state-serve/verification.md` (+0 -7) ➕ `docs/specs/agent-environments/state-writes/plan.md` (+45 -0) ➕ `docs/specs/agent-environments/state-writes/spec.md` (+406 -0) ➕ `docs/specs/agent-environments/state-writes/tasks.md` (+22 -0) ➕ `docs/specs/agent-environments/state-writes/verification.md` (+360 -0) 📝 `docs/testing.md` (+1 -1) 📝 `docs/web-network-captures.md` (+87 -27) 📝 `src/application/environment/environmentBundle.test.ts` (+6 -4) 📝 `src/application/environment/environmentBundle.ts` (+5 -4) 📝 `src/application/environment/environmentReplay.ts` (+19 -29) 📝 `src/application/environment/environmentSource.ts` (+53 -1) _...and 51 more files_ </details> ### 📄 Description <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary Replacement for fork PR #5600, stacked on the squashed rebase of #5352 (`cursor/rebase-5352`, `95c8c9d15`). Fork force-with-lease to `feat/environment-state-writes` was rejected because the app token cannot update `.github/workflows/ci.yml`. ## Problem and expected behavior #5600 could not merge. After rebase it should still serve write tools only where a later read confirms the effect, on top of current main's serving and the #5352 coverage work. ## Change and scope Merged `pull/5600/head` onto the rebased #5352 tip and kept main's state-file close ownership and part-wise JSON measurement. Write plans, the write gate, and served write answers come from #5600. Squashed to one commit whose parent is the #5352 squash. Not a new provider or target-execution capability. Maintainer scope decision: not applicable. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). ## Contract and boundary impact - Semantic owner and earliest changed stage: environment state write plans and the served state store, when a confirmed write tool is called. - Contribution scope fit and linked maintainer decision: extends existing environment-serve; not applicable. - CLI and MCP/tool-catalog contract: confirmed write tools are served and described; unconfirmed writes stay off the catalog. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: write plans are inferred from the capture and served only when later reads confirm them. - Target selection, authority, upstream behavior, and cleanup details (if applicable): file:// state loads still retain a descriptor whose close failed, as on main. - Generated metadata: none committed. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: #5600 write-plan, write-answer, and serve-writes tests, plus main's file-close serve tests kept. - Base reproduction or other evidence: `npm run typecheck` passed on this tree. - User-visible CLI/MCP output (if applicable): `environment-serve` description names confirmed write tools. - Remaining proof gaps: the environment test suite was not executed in this rebase. For evidence-bearing changes: - [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 typecheck` — passed on the resolved #5600 tree before squash (same tree as `ad8f674d2`). ## Compatibility, safety, and release - Breaking changes or migration steps: none intended beyond #5352. `--replay-only` still replays every tool. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: writes change only the in-memory served state, and only for plans the capture confirmed. This branch contains the #5352 commit plus this one. Merging it into main also lands #5352. The later fidelity branch `cursor/rebase-5699` is based on this tip. ## Author readiness Human owner: @morluto - [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 - [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, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-fb2387c4-1d12-56e2-b39a-246f74373650?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-fb2387c4-1d12-56e2-b39a-246f74373650&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:56 +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#7176
No description provided.