Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
95c8c9d
feat(environment): render more read tools from the state and describe…
cursoragent Oct 21, 2026
ad8f674
feat(environment): apply evidence-gated write effects to the served s…
cursoragent Oct 21, 2026
733833e
feat(environment): model bodiless writes, omitted fields, projected r…
earakely-scale Oct 21, 2026
6f67a11
feat(environment): test and document wider write coverage
earakely-scale Oct 21, 2026
e44adb5
docs(environment): record the write-coverage checks on the current wr…
earakely-scale Oct 21, 2026
a4c4a23
docs(environment): record the re-recorded and end-to-end write-covera…
earakely-scale Oct 21, 2026
6c8f4f7
feat(environment): render more read tools from the state and describe…
cursoragent Oct 21, 2026
378a109
fix(environment): keep rendered documents and quoted samples inside t…
cursoragent Oct 21, 2026
cfb42dd
feat(environment): apply evidence-gated write effects to the served s…
cursoragent Oct 21, 2026
5d0e096
fix(environment): bound and validate write state history
morluto Oct 21, 2026
5b42469
feat(environment): render more read tools from the state and describe…
cursoragent Oct 21, 2026
54c8934
fix(environment): keep rendered documents and quoted samples inside t…
cursoragent Oct 21, 2026
19b50ea
feat(environment): apply evidence-gated write effects to the served s…
cursoragent Oct 21, 2026
a057ea9
fix(environment): bound and validate write state history
morluto Oct 21, 2026
f79f1e1
fix(environment): bound additional collection history
morluto Oct 21, 2026
4a678f1
Merge remote-tracking branch 'live-5600/feat/environment-state-writes…
morluto Oct 21, 2026
7de20bc
fix(environment): credit sent fields, negative sequences, and encoded…
cursoragent Oct 21, 2026
a1076ca
Merge live environment write verification fixes
morluto Oct 21, 2026
d3015d2
test(environment): cover resolved encoded update identities
morluto Oct 21, 2026
cddd3e6
fix: validate timed update observations
morluto Oct 21, 2026
fb6785d
fix(environment): share write overlap and check clocks on earlier calls
cursoragent Oct 21, 2026
d7c5c62
merge: restack environment state writes onto main after #5352
cursoragent Oct 21, 2026
3b34bbd
fix: preserve partial update evidence
morluto Oct 21, 2026
5d00ff3
Merge remote-tracking branch 'live-5600/feat/environment-state-writes…
morluto Oct 21, 2026
067f0fa
fix(environment): keep projected and partial reads out of the write g…
earakely-scale Oct 21, 2026
717ac2c
chore: merge main (8413ec08) into environment state writes
earakely-scale Oct 21, 2026
1074355
chore: merge environment state writes (717ac2c4) into environment wri…
earakely-scale Oct 22, 2026
0061234
chore: merge main (2451e187) into environment write coverage
earakely-scale Oct 22, 2026
70249b3
fix(environment): check the absence a projected read answers, and rea…
earakely-scale Oct 22, 2026
e923fc7
fix(environment): let an unmodelled write explain only the list membe…
earakely-scale Oct 21, 2026
75d7bb0
fix(environment): explain added fields, tie creates to serving's coll…
earakely-scale Oct 21, 2026
cd26a76
docs(environment): state how list reads weigh unmodelled writes, adde…
earakely-scale Oct 22, 2026
2a125b7
chore: merge main (4a4bbab3) into environment state writes
earakely-scale Oct 22, 2026
9517260
chore: merge environment state writes (2a125b71) into environment wri…
earakely-scale Oct 22, 2026
11e3f01
refactor(environment): keep the observing view helpers with the obser…
earakely-scale Oct 22, 2026
cfc43a7
chore: merge environment state writes (11e3f016) into environment wri…
earakely-scale Oct 22, 2026
53a7866
fix(environment): resolve unmodelled writes onto the held collection
cursoragent Oct 22, 2026
329aeed
fix(environment): confirm no write through volatile fields or overwri…
earakely-scale Oct 22, 2026
ccdf091
fix(environment): leave unknown entities unchecked by failed reads, v…
earakely-scale Oct 22, 2026
1c97933
fix(environment): fill a create's path fields from the collection ser…
earakely-scale Oct 22, 2026
90d9022
fix(environment): name unmodelled writes as modelled ones, count fiel…
earakely-scale Oct 22, 2026
54f7d85
fix(environment): note omitted fields only from reads the gate checks
earakely-scale Oct 22, 2026
3ac1136
chore: merge environment state writes (90d90227) into environment wri…
earakely-scale Oct 22, 2026
756c631
fix(environment): let a document replacement overwrite everything und…
earakely-scale Oct 22, 2026
3f1f825
chore: merge the published environment state writes (756c6312)
earakely-scale Oct 22, 2026
caf2acf
chore: merge environment state writes (3f1f825e) into environment wri…
earakely-scale Oct 22, 2026
613048a
chore: merge main (b8c1b453) into environment write coverage
earakely-scale Oct 22, 2026
e21f6c5
chore: merge main (538017d1, #5600 squashed) into environment write c…
earakely-scale Oct 22, 2026
06ec0d4
fix(merge): preserve write coverage with query-aware validation
morluto Oct 22, 2026
f5162bb
fix(environment): align write inference with resolved state facts
morluto Oct 22, 2026
17c5a44
chore: integrate write coverage with current main
gensokyo-dev Oct 22, 2026
8b6e35b
chore: sync write coverage with latest main
N0zoM1z0 Oct 22, 2026
6f726ef
fix(environment): preserve projection and omission evidence across wr…
gensokyo-dev Oct 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(environment): apply evidence-gated write effects to the served s…
…tate

Serve write tools whose later reads confirm the effect, and keep main's
state-file ownership and part-wise reply measurement.

Squashed rebase of #5600 onto the rebased #5352 tip.
  • Loading branch information
cursoragent committed Oct 21, 2026
commit cfb42ddde0a576fa0325b008262aa54e951c5d7a
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ Use `view: {kind: "environment-state"}` with the manifest's `template_rules` to
extract the data those reads observed instead: entity types and identity
fields, entities with recorded values, documents, and per-tool render plans
checked against the recordings. The state comes only from reads before the
first related write; types, identity and list membership are inferences.
first related write; types, identity and list membership are inferences. The
view also gives each state-changing tool a write plan, served only when a later
recorded read confirms its effect and none contradicts it.
`rea environment-serve manifest.json --evidence capture.json` derives that
state at startup, answers read tools from it and serves `data/reset`,
`data/add` and `data/get` on `/agentenv`; write tools are not served. It
replays the capture instead with `--replay-only` or when the state is
unavailable (not derivable, or a catalog over the discovery budget), and its
stopped document's `state` says which applied.
state at startup, answers read tools from it, serves the write tools whose plan
is served, each applying its effect to that state, and serves `data/reset`,
`data/add` and `data/get` on `/agentenv`; other write tools are not served, and
each plan states why in its `reason`. It replays the capture instead with
`--replay-only` or when the state is unavailable (not derivable, or a catalog
over the discovery budget), and its stopped document's `state` says which
applied.
108 changes: 70 additions & 38 deletions docs/agent-environments.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ evidence file's `evidence_id`; otherwise the command refuses with
`invalid_request` before binding. Before binding it derives the
`environment-state` view of the capture with the manifest's `template_rules`,
as `inspect-analysis-view` would, and serves from it: read tools whose views
are state-backed answer from a live state, write tools are not served, and
are state-backed answer from a live state, write tools are served only where
the capture's later reads confirmed their effect, and
`/agentenv` serves `data/reset`, `data/add` and `data/get`. When the state
cannot be derived, or its catalog exceeds the discovery reservation, it logs a
warning with the error code and message and serves replay; `--replay-only` serves replay without deriving. In replay every
Expand Down
7 changes: 1 addition & 6 deletions docs/specs/agent-environments/state-serve/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ this increment: write tools are not served from the state.
download in progress ends with reason `cancelled`, queued calls are answered
`-32000` with reason `cancelled` without running, and a `data/add` whose
file read finished after the cancellation does not replace the state.
- A `file://` read whose descriptor close fails answers `-32000` and keeps the
descriptor in a server-lifetime owner. The next file read retries the close
first and, while it still fails, answers `-32000` without opening the file.
`close` retries it again and rejects while it is still open.
- Bound one `/agentenv` response to 64 MiB of replies (twice the intake
limit). Each reply is measured in bounded JSON parts as it is produced, in
message order, and assembled only when it fits, so a reply past the budget is
Expand Down Expand Up @@ -176,8 +172,7 @@ host or a UNC path, injected https downloads (status, declared and streamed
size, the timeout whether or not the fetcher honours its signal), the default
fetch's refused redirects, arrival-order application across requests, a batch
another request's reset cannot split, cancellation by the server's stop and by
a departed caller, a server that closes while a download is stalled, a
retained state-file close that the next file read and `close` retry, the
a departed caller, a server that closes while a download is stalled, the
response budget, batches and notifications, the card declaration, absent write
tools, a served query `POST`, the per-mode discovery reservation and a
`data/add` that changes the next tool answer over MCP. The mcp-boundary tests serve the state the
Expand Down
7 changes: 0 additions & 7 deletions docs/specs/agent-environments/state-serve/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ The review fixes are covered by these tests, all passing in the runs above:
unchanged. Over loopback HTTP, `close()` of a served state returned while a
download that never answers was in progress, and that download's signal was
aborted.
- File closes: with an injected close failure, `data/add` of a `file://` uri
answered `-32000` without echoing the uri. The descriptor stayed open, and
the next file load closed it before loading. While the close kept failing,
over loopback HTTP the next file load answered `-32000` ("still open") and
an inline `data` part still loaded. `close()` rejected with the unfinished
close, then resolved and closed the descriptor once the close succeeded.
Both tests fail on the previous head, which dropped the descriptor.
- File hosts: `file://remote.example.test/...` and
`file:////remote.example.test/...` are refused with the network-share
message and no failure category; a `file://localhost/...` uri loads.
Expand Down
45 changes: 45 additions & 0 deletions docs/specs/agent-environments/state-writes/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Implementation plan

The branch builds on the state-serving and coverage branches (merged into it).

1. **Write plan types and request bodies.** Add the plan, rule and reason types
beside the state rules, and have the state accumulator lend extraction
parsed request bodies under the same budget, admitted like response bodies.
2. **Field rules.** Add a module that explains an observed entity against the
call that wrote it (echo, copy, path, slug, clock, sequence, unique,
template and constant) and that recognises and formats clock values,
UUIDs and tokens.
3. **Effects.** Add one apply module that both the gate and the server use. It
applies a create, update, delete or document write to a writable state
interface from a plan, a call and a value source: the recorded values in
the gate, the store's generators when served.
4. **Gate.** Add a simulation that:
- classifies every write tool;
- builds each plan from its exemplar;
- walks the timeline over a copy of the initial state;
- checks state-answered reads;
- attributes passes and mismatches;
- learns the insert rule;
- records verdicts.

Extraction runs it after the read gate and returns `writes` and
`write_clock`; the view schema and its unknowns state the write model.

5. **Serving.**
- The loaded state carries the plans and the clock.
- The store gains atomic mutations, the clock and the counter (all reset by
`data/reset` and `data/add`).
- A write answer module validates the body, applies the effect and renders
the response.
- Item reads of missing entities answer recorded 404s.
- The served catalog adds served write tools, with descriptions charged to
the discovery budget.
6. **Export.** Count served write tools in the bundle plan and README.
7. **Tests.** Domain, services, adapters and MCP-boundary coverage as the
spec's acceptance lists.
8. **Documentation.** Document the write model in the environment-state and
serving sections, and record the real-capture results, the AgentEnv run
and the live comparison in `verification.md`.

There are no dependency, provider or REA tool contract changes beyond the
`environment-state` result members, and no new network activity.
Loading