Repository navigation
feat(environment): serve creates whose answers show less than reads, and whole-object updates #7080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
morluto
merged 4 commits into
morluto:main
from
earakely-scale:feat/environment-write-views
Oct 25, 2026
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2f807ef
feat(environment): take created entities' read-backs and re-derived u…
earakely-scale 421d241
docs(environment): record the write-views verification
earakely-scale dc4db90
fix(environment): reconcile write views without hiding contradictions
morluto 1cfc598
fix(environment): reject incompatible slug-only saves
morluto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Implementation plan | ||
|
|
||
| 1. **Read-backs.** A create's observation looks for the first read of its entity before the next write; an item read's | ||
| fields and clock spellings are taken when it agrees otherwise, and the read observes; a list read adds fields only. The plan's observation records the | ||
| read and its shape, and serving merges the same objects. | ||
| 2. **Sent members.** An update's sent member stored as a fresh clock after it sent back the held one is a `clock`; one | ||
| stored as the slug of another member stored as sent is a `slug`. | ||
| 3. **Schema, tests and docs.** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Writes whose answers show the entity otherwise than reads, and whole-object updates | ||
|
|
||
| Issue: https://github.com/morluto/rea/issues/4933 | ||
|
|
||
| ## Outcome | ||
|
|
||
| Agents built environments from a prompt for five applications the prompt flow had never seen (Vikunja, Ghost, EspoCRM, | ||
| Paperless-ngx and Miniflux). Two write-model gaps withheld most of their creates and edits: | ||
|
|
||
| - **A create's answer is another view of the entity than its reads.** Paperless answers a tag create without the | ||
| `document_count` its item read shows. EspoCRM answers a contact create without nine fields its item read shows. | ||
| Vikunja answers a label create with a partial `created_by` and clocks to the nanosecond, where reads show the full | ||
| user and whole seconds. Ghost answers a tag create without the `count` its list shows. The state built the entity from | ||
| the answer alone, so the read-back contradicted the create. | ||
| - **A whole-object update sends back what the application derives.** Paperless's UI sends the tag's old `slug` with a | ||
| new name, and the application slugs the name anew. Ghost's UI sends the `updated_at` it read, and the application | ||
| stamps a new one. The update was withheld as `unexplained-change`, or its first call's value was pinned so that later | ||
| calls conflicted. | ||
|
|
||
| ## Behaviour | ||
|
|
||
| - **Read-backs.** When the first read of a created entity before the next write shows fields the create's answer lacks, | ||
| or spells its clocks to another precision, the observed entity takes them, and the plan records the read | ||
| (`observation.read`, with its shape). | ||
| - An item read that agrees with the answer otherwise lends its fields and its clock spellings (whole seconds of a | ||
| nanosecond clock), and no longer confirms the create. One that disagrees on another value still checks the create, | ||
| which it contradicts. | ||
| - A list read, which may show fewer keys of an object, only adds fields the answer lacks and still checks the create. | ||
| - A read that shows nothing new leaves the observation as it was and still confirms the create. | ||
| - Serving merges the same two recorded objects, so a served create answers in its answer's shape and stores the | ||
| fields of both. | ||
| - **Restamped clocks.** An update member sent back as the clock the entity held, and stored as a fresh clock near the | ||
| call, is a `clock` rule, accepted with any value. | ||
| - **Re-derived slugs.** An update member stored as the slug of another member the call stored as sent is a `slug` rule | ||
| from that member, accepted with any value. | ||
|
|
||
| Plans and views that need none of this are unchanged. | ||
|
|
||
| ## Acceptance | ||
|
|
||
| - The held-out recordings serve EspoCRM's contact create and Paperless's tag edit. | ||
| - A create whose item read-back disagrees with its answer on another value is still contradicted. | ||
| - No write tool of the 69 recorded captures goes from served to withheld. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Tasks | ||
|
|
||
| - [x] Take a create's read-back fields into its observation, and serve the same merge. | ||
| - [x] Learn restamped clocks and re-derived slugs for sent update members. | ||
| - [x] Add view and serving tests that fail without the change. | ||
| - [x] Document the observation member and the rules. | ||
| - [x] Measure the held-out and recorded captures. | ||
| - [x] Run static, formatting, documentation and test gates. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Verification | ||
|
|
||
| Executed on macOS with Node v24.22.1 at `2f807efb` (main `8e6a9578` and this branch). | ||
|
|
||
| ## Gates | ||
|
|
||
| - `npm run check` (build, typecheck, format, lint, typed lint, module boundaries, architecture guards) and | ||
| `npm run docs:check`: passed. | ||
| - `npx vitest run --project domain --project services --project adapters`: 17,624 passed, 25 skipped, 1 failed ("stops | ||
| Inspector target authorization after the current stat settles"), which fails the same way on main in this environment. | ||
| - `npm run test:focused --` the analysis-view, environment build, compare, export and serve CLI boundaries, the | ||
| analysis-view, environment bundle, serve and served-writes MCP boundaries, tool schema validity, output schema profile | ||
| and MCP schema validation: 12 files, 106 passed. | ||
| - The eight new view and serving tests fail on main and pass here. | ||
|
|
||
| ## Recorded captures | ||
|
|
||
| The 69 recorded captures and the five held-out agent recordings, built as environment-state views on main and on this | ||
| branch: | ||
|
|
||
| | Captures | Served on main | Served here | Served to withheld | | ||
| | ----------------------------------------- | -------------- | ----------- | ------------------ | | ||
| | 69 recorded | 132 | 132 | none | | ||
| | 5 held-out (20 write tools with a target) | 8 | 10 | none | | ||
|
|
||
| - **Now served:** EspoCRM's contact create (its read-back adds nine fields the answer lacks) and Paperless's tag edit | ||
| (the stale slug is slugged anew from the name). | ||
| - **Past the read-back, withheld by other gaps:** | ||
| - Paperless's tag create: its list's `all` member lists every id, which state rendering does not model. | ||
| - Ghost's tag create and edit: the state does not list the created tags in Ghost's tag lists. | ||
| - **Still contradicted:** Vikunja's label create, whose item read-back shows a fully loaded `created_by` where the answer | ||
| showed a partial one. | ||
| - Three plans of the recorded captures (Airbyte, BookStack, PhotoPrism) now record a read-back; their served state is | ||
| unchanged. | ||
|
|
||
| ## Served write tasks | ||
|
|
||
| The held-out round's write tasks, rebuilt from the same agent recordings with this branch, with | ||
| `fireworks_ai/gpt-oss-120b` and `fireworks_ai/glm-5p3-flash`: | ||
|
|
||
| | Application | Main (gpt-oss, GLM) | This branch (gpt-oss, GLM) | | ||
| | ---------------------------------------------- | ------------------- | -------------------------- | | ||
| | EspoCRM contacts: create, update email, delete | 0/3, 0/3 | 1/3, 1/3 (create) | | ||
| | Paperless tags: create, rename, delete | 1/3, 1/3 | 1/3, 2/3 (rename with GLM) | | ||
|
|
||
| - gpt-oss's rename did not apply. Its trajectory was not kept, so the cause is unconfirmed. A served `PUT` requires | ||
| every member the recorded call sent (about 14 here), and GLM sent them all. | ||
| - EspoCRM's served update accepts only the members its recording edited, so the email change is refused, as on main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.