[PR #6136] [MERGED] feat(environment): serve writes whose values the application renames or regenerates #7152

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6136
Author: @earakely-scale
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @gensokyo-dev

Base: main ← Head: feat/environment-write-assigned-values


📝 Commits (10+)

  • ad439bd feat(environment): extract the initial state a capture's reads observed
  • 7a668b7 Merge main into feat/environment-state-view
  • f2c9a2e fix(environment): bound state at redacted writes; infer identity only from items
  • 2999128 fix(environment): keep first sightings, one list pointer and linear field unions
  • a5c7b92 fix(environment): keep post-write values and partial lists out of the initial state
  • 4e93547 docs(environment): scope item-shaped and deleted written paths out of documents
  • aba9cb1 fix(environment): count writes in flight when a value changes between reads
  • 856c8c0 Merge main into feat/environment-state-view
  • 55480bd chore: merge main (5fa4defc) into environment state view
  • 9fee36d fix(environment): catch cross-tool changes across writes; read only item totals

📊 Changes

21 files changed (+1531 additions, -163 deletions)

View changed files

📝 docs/agent-environments.md (+1 -1)
📝 docs/specs/agent-environments/state-writes/spec.md (+35 -10)
➕ docs/specs/agent-environments/write-assigned-values/plan.md (+9 -0)
➕ docs/specs/agent-environments/write-assigned-values/spec.md (+48 -0)
➕ docs/specs/agent-environments/write-assigned-values/tasks.md (+9 -0)
➕ docs/specs/agent-environments/write-assigned-values/verification.md (+60 -0)
➕ src/application/environment/environmentStateAssignedCoverage.test.ts (+62 -0)
📝 src/application/environment/environmentStateWriteAnswer.test.ts (+89 -0)
📝 src/application/environment/environmentStateWriteAnswer.ts (+16 -0)
📝 src/domain/analysisView/environmentStateView.ts (+5 -0)
📝 src/domain/analysisView/environmentStateWriteApply.test.ts (+107 -3)
📝 src/domain/analysisView/environmentStateWriteApply.ts (+49 -2)
➕ src/domain/analysisView/environmentStateWriteCalls.ts (+137 -0)
➕ src/domain/analysisView/environmentStateWriteCopies.ts (+86 -0)
📝 src/domain/analysisView/environmentStateWriteEffects.ts (+22 -51)
📝 src/domain/analysisView/environmentStateWriteExplain.test.ts (+334 -0)
📝 src/domain/analysisView/environmentStateWriteExplain.ts (+62 -96)
➕ src/domain/analysisView/environmentStateWriteGenerated.ts (+201 -0)
📝 src/domain/analysisView/environmentStateWriteRules.ts (+6 -0)
📝 src/domain/analysisView/environmentStateWrites.test.ts (+71 -0)

...and 1 more files

📄 Description

Summary

Refs #4933. Explain and locally serve captured writes where the application stores a create member under another name, replaces a version UUID, or renews nested child UUIDs. No new target execution or remote application writes. Shared domain/application rules serve both CLI and MCP, with retained Evidence ordinals and existing fail-closed checks.

Integrated latest author 7f99adf6 onto main including #6169. Independent Codex review found two concrete defects, now fixed at the explanation owners: every text occurrence must rebuild an accepted copy, and scalar generation is withheld when its new UUID is shared with another output field. Unsupported scalar/nested links remain unexplained rather than being silently disconnected. Existing nested-only renewal and isolated UUID generation remain supported.

Executed validation

  • 742 related source tests passed, including three new capture→state→serving guards that all fail before the follow-up fixes and pass after them. Existing malformed-body, permission, capacity, state identity, omission and projection tests remain covered.
  • 67 CLI/MCP boundary tests passed on the integrated feature; a final focused rebuild of serving and named schema validity is recorded in the merge follow-up.
  • Full static checks and docs check passed on the integrated feature; final fix-head checks/discovery are recorded in the merge follow-up. Initial final-check formatting failure was corrected, not ignored.
  • Local Codex CLI review reproduced the two findings with in-memory production functions; final targeted source review found no further definite regression. Automated review is not a human attestation.
  • Five immutable public capture datasets (Directus/Homebox/Mealie/Keycloak/Shlink) ran through real compiled CLI and stdio MCP with named schema validation, exact adapter fact/Evidence-ID parity and source-byte SHA-256 checks. The only cross-version Evidence change was Shlink's expected customSlug acceptance + shortUrl template; its unconfirmed write remains unserved, and all served-tool verdicts are unchanged.
  • Complete five-capture fresh-process task: main baseline 26.21 s wall / 41.16 s CPU / 1214 MiB sampled process-family RSS; integrated candidate 23.33 s / 37.59 s / 1173 MiB. One pair with uncontrolled host/filesystem warmth: no speedup claim. RSS is sampled every 500 ms, not an exact peak. No model-token reduction claim or added cache.

Limitations

Public-capture checks cover retained-data analysis, not live application persistence, the author's entire historical 50-capture census, or real provider/Windows behavior. Full historical author experiments remain in docs/specs/agent-environments/write-assigned-values/verification.md and were not independently rerun in full. Scalar UUID relations across output fields are deliberately withheld until a shared generation model can preserve them.

Author readiness

Human owner: @earakely-scale

  • 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/6136 **Author:** [@earakely-scale](https://github.com/earakely-scale) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `feat/environment-write-assigned-values` --- ### 📝 Commits (10+) - [`ad439bd`](https://github.com/morluto/rea/commit/ad439bd2f26c61b442dcf758c2bb149e49657929) feat(environment): extract the initial state a capture's reads observed - [`7a668b7`](https://github.com/morluto/rea/commit/7a668b73f4783b42eb0e8ce1eeff079f86d53e22) Merge main into feat/environment-state-view - [`f2c9a2e`](https://github.com/morluto/rea/commit/f2c9a2e4462a7162224bec209f21dfa2622abe39) fix(environment): bound state at redacted writes; infer identity only from items - [`2999128`](https://github.com/morluto/rea/commit/2999128baedceabc738e9a5aa69bfcfec39a55f1) fix(environment): keep first sightings, one list pointer and linear field unions - [`a5c7b92`](https://github.com/morluto/rea/commit/a5c7b9236c48094bc4af24ae055e8d67e3968477) fix(environment): keep post-write values and partial lists out of the initial state - [`4e93547`](https://github.com/morluto/rea/commit/4e93547c846444e891e2a2267425c316e6ee5218) docs(environment): scope item-shaped and deleted written paths out of documents - [`aba9cb1`](https://github.com/morluto/rea/commit/aba9cb15c8836b7592a51743d79bceab4dfd99af) fix(environment): count writes in flight when a value changes between reads - [`856c8c0`](https://github.com/morluto/rea/commit/856c8c0b50ec11e4ba96cb6172b7cfe01ef6829f) Merge main into feat/environment-state-view - [`55480bd`](https://github.com/morluto/rea/commit/55480bdf7e3275e3be8903e53baabe28be81a9a9) chore: merge main (5fa4defc) into environment state view - [`9fee36d`](https://github.com/morluto/rea/commit/9fee36d3155145fa8e568b34713e0e68c7675216) fix(environment): catch cross-tool changes across writes; read only item totals ### 📊 Changes **21 files changed** (+1531 additions, -163 deletions) <details> <summary>View changed files</summary> 📝 `docs/agent-environments.md` (+1 -1) 📝 `docs/specs/agent-environments/state-writes/spec.md` (+35 -10) ➕ `docs/specs/agent-environments/write-assigned-values/plan.md` (+9 -0) ➕ `docs/specs/agent-environments/write-assigned-values/spec.md` (+48 -0) ➕ `docs/specs/agent-environments/write-assigned-values/tasks.md` (+9 -0) ➕ `docs/specs/agent-environments/write-assigned-values/verification.md` (+60 -0) ➕ `src/application/environment/environmentStateAssignedCoverage.test.ts` (+62 -0) 📝 `src/application/environment/environmentStateWriteAnswer.test.ts` (+89 -0) 📝 `src/application/environment/environmentStateWriteAnswer.ts` (+16 -0) 📝 `src/domain/analysisView/environmentStateView.ts` (+5 -0) 📝 `src/domain/analysisView/environmentStateWriteApply.test.ts` (+107 -3) 📝 `src/domain/analysisView/environmentStateWriteApply.ts` (+49 -2) ➕ `src/domain/analysisView/environmentStateWriteCalls.ts` (+137 -0) ➕ `src/domain/analysisView/environmentStateWriteCopies.ts` (+86 -0) 📝 `src/domain/analysisView/environmentStateWriteEffects.ts` (+22 -51) 📝 `src/domain/analysisView/environmentStateWriteExplain.test.ts` (+334 -0) 📝 `src/domain/analysisView/environmentStateWriteExplain.ts` (+62 -96) ➕ `src/domain/analysisView/environmentStateWriteGenerated.ts` (+201 -0) 📝 `src/domain/analysisView/environmentStateWriteRules.ts` (+6 -0) 📝 `src/domain/analysisView/environmentStateWrites.test.ts` (+71 -0) _...and 1 more files_ </details> ### 📄 Description ## Summary Refs #4933. Explain and locally serve captured writes where the application stores a create member under another name, replaces a version UUID, or renews nested child UUIDs. No new target execution or remote application writes. Shared domain/application rules serve both CLI and MCP, with retained Evidence ordinals and existing fail-closed checks. Integrated latest author 7f99adf6 onto main including #6169. Independent Codex review found two concrete defects, now fixed at the explanation owners: every text occurrence must rebuild an accepted copy, and scalar generation is withheld when its new UUID is shared with another output field. Unsupported scalar/nested links remain unexplained rather than being silently disconnected. Existing nested-only renewal and isolated UUID generation remain supported. ## Executed validation - 742 related source tests passed, including three new capture→state→serving guards that all fail before the follow-up fixes and pass after them. Existing malformed-body, permission, capacity, state identity, omission and projection tests remain covered. - 67 CLI/MCP boundary tests passed on the integrated feature; a final focused rebuild of serving and named schema validity is recorded in the merge follow-up. - Full static checks and docs check passed on the integrated feature; final fix-head checks/discovery are recorded in the merge follow-up. Initial final-check formatting failure was corrected, not ignored. - Local Codex CLI review reproduced the two findings with in-memory production functions; final targeted source review found no further definite regression. Automated review is not a human attestation. - Five immutable public capture datasets (Directus/Homebox/Mealie/Keycloak/Shlink) ran through real compiled CLI and stdio MCP with named schema validation, exact adapter fact/Evidence-ID parity and source-byte SHA-256 checks. The only cross-version Evidence change was Shlink's expected customSlug acceptance + shortUrl template; its unconfirmed write remains unserved, and all served-tool verdicts are unchanged. - Complete five-capture fresh-process task: main baseline 26.21 s wall / 41.16 s CPU / 1214 MiB sampled process-family RSS; integrated candidate 23.33 s / 37.59 s / 1173 MiB. One pair with uncontrolled host/filesystem warmth: no speedup claim. RSS is sampled every 500 ms, not an exact peak. No model-token reduction claim or added cache. ## Limitations Public-capture checks cover retained-data analysis, not live application persistence, the author's entire historical 50-capture census, or real provider/Windows behavior. Full historical author experiments remain in docs/specs/agent-environments/write-assigned-values/verification.md and were not independently rerun in full. Scalar UUID relations across output fields are deliberately withheld until a shared generation model can preserve them. ## Author readiness Human owner: @earakely-scale - [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:45:46 +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#7152
No description provided.