Skip to content

feat(environment): apply evidence-gated write effects to the served state - #5600

Merged
morluto merged 32 commits into
morluto:mainfrom
earakely-scale:feat/environment-state-writes
Oct 22, 2026
Merged

morluto merged 32 commits into
morluto:mainfrom
earakely-scale:feat/environment-state-writes

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An environment served from its state now also serves the write tools whose effects the capture itself confirms:

  • a create adds an entity;
  • an update changes the members the call sends;
  • a delete removes the entity;
  • a document write changes a document.

Later reads, lists and data/get show the change, and data/reset undoes it.

The environment-state view decides which write tools are served. It replays the capture's own timeline on the extracted initial state and checks every later read the served state would answer. A write tool is served only when a later read confirms its effect and none contradicts it. Every other write tool stays unserved, with its reason.

Refs #4933 (design discussion).

Stacked on #5351 and #5352. Both are merged into this branch at their current heads (5a61853 and b4b7ebc), and main is merged in. Until they land, the diff against main includes them; the new work is in:

  • b9fbcd7: implementation;
  • 84291a0: fixes and docs;
  • cbb7b61: tests;
  • the spec folder docs/specs/agent-environments/state-writes/ (spec, plan, tasks, verification).

Problem and expected behavior

Serving from the state was read-only, so every task an environment could support was a lookup. For training, agents need to change the environment, and graders need to check the resulting state rather than the agent's reply.

The expected behaviour:

  • write tools whose effect the capture confirms apply it to the live state, deterministically;
  • the environment answers as the application recorded;
  • every other write tool stays unserved and says why.

Change and scope

  • Write plans (environment-state view).
    • writes holds one plan per state-changing tool, write_clock the instant the served clock starts from.
    • Effects are classified as create, update, delete, document or none by the state type or document the path names.
    • Each plan is built from the tool's first successful call. Field rules explain the written entity:
      • echo, copy, path value, slug;
      • generated identity (sequence, UUID or token);
      • clock in its recorded format;
      • sequence, unique, template, constant.
    • Body members are accepted (stored as sent), fixed (accepted only with the recorded value, because the app transforms them) or required.
    • The response shape is entity, identity, empty or recorded; the insert position is learned from the recorded list order.
  • Gate. The view replays the timeline on a copy of the state:
    • modelled writes apply their effect;
    • an unmodelled write below an entity's path leaves that entity unknown until a read shows it again, and failures it may explain are checked only on the members the modelled writes sent;
    • reads are compared as the read gate compares them, and a 400, 404, 410 or null body counts as absence;
    • plans not served carry a reason: no-state-target, no-call, body-unusable, no-observation, unexplained-change, contradicted, side-effect, unconfirmed or incomplete-entities.
  • Serving.
    • In state mode the catalog adds the served write tools, with descriptions of their effect and body members.
    • A call applies its effect atomically to the live store and answers with a recorded status and a rendered body; refused calls leave the state unchanged.
    • Clock, sequences, UUIDs and tokens are deterministic. Sequences don't reuse deleted values. data/reset and data/add restart them.
    • Reads of a missing entity answer the recorded 400, 404 or 410.
  • List reads. A list line that only pages (limit, offset, …) and listed the whole collection backs membership: "all", and an argument-less list call answers from it. Without this, created entities never appear in many apps' lists.
  • Not included:
    • side effects on counters, relations or copies (a tool that shows them is not served);
    • inputs the app transforms (only their recorded value is accepted);
    • referential rules on delete;
    • filtered or paged list membership;
    • write paths the manifest left literal.

Follow the contribution scope.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the environment-state view (src/domain/analysisView/environmentStateWrite*.ts, EnvironmentStateWriteSimulation.ts) and the environment serve path (src/application/environment/environmentStateWrite*.ts, environmentToolAnswer.ts, the store).
  • Contribution scope fit and linked maintainer decision: a further agent-environment increment of [Design] Project captures into an environment manifest, serve it over streamable HTTP, export agent-environment bundles #4933.
  • CLI and MCP/tool-catalog contract:
    • in state mode the catalog adds the served write tools (readOnlyHint: false);
    • environment-state results gain writes and write_clock;
    • list views may back all membership on paging-only lines;
    • --replay-only is unchanged.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract:
    • written and updated entities cite no records;
    • write answers carry state provenance (create, update, delete, document-write, missing).
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): a served write changes only the environment's in-memory state. There is no new network activity.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): the inspect_analysis_view description gains one sentence; mcp-catalog:check passes.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • 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.

  • Values (94): clocks, UUIDs, tokens, slugs, delimited tokens.
  • Field rules and response shapes (101).
  • Shared apply functions (52).
  • The gate through the view (16): every reason; delete confirmation by 400, 404 or null; learned insert rules; unmodelled writes; observations from later reads.
  • Serving (14): creates, updates and deletes; refusals that leave the state unchanged; determinism across reset and load; missing entities; the catalog; paging-only lines.
  • An MCP boundary test through the built CLI.

50 showcase captures (45 HAR inspections, 5 browser scenarios). 31 write tools served in 16 captures (10 creates, 11 updates, 10 deletes). Of the remaining 152 state-changing tools, 102 name no state type and 50 are modelled but not served, each with its reason. For example:

  • deleted Airbyte sources and EspoCRM tasks stay readable;
  • Immich item reads show fields the create response lacked;
  • Sonarr lists new tags in a second collection;
  • Linkding's bundle create and patch are checked only by a list taken after the bundle was deleted.

An in-process smoke applied all 31 served tools and read every created or updated entity back from the state.

End to end on a randomly chosen published environment (NetBox). The environment was exported with this branch and run in AgentEnv framework 0.9.1334. Four write tasks were graded by env_outcome_verifier through data/get, so the grade comes from the state, not the agent's reply:

Task gpt-oss-120b GLM-5.3-Flash
Create a site in the Copper Valley region 1.0 1.0
Update a seeded site 1.0 1.0
Delete one seeded site 1.0 1.0
Create a site, then update it 1.0 1.0

The bundle's 12 retrieval tasks: 12/12 for both models.

Against the live application. NetBox 4.7.3 ran with the capture's own seed, and one scenario ran against the live API and the served environment. 11 of 13 steps were equal, with only created/last_updated normalised:

  • generated ids 5, 6 and 7 (not reusing 5), URLs, region objects;
  • name order after creates, patch results, the 404 body.

The difference is NetBox's 409 when deleting a site that devices reference: the served delete removes the entity alone. The capture never showed that rule, and it is listed as not modelled.

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.
Representative output (NetBox capture, built CLI, MCP client)
tools 42 (39 reads + post_dcim_sites, patch_dcim_sites_by_id, delete_dcim_sites_by_id)
list before: Blue Heron Kitchen Closet, Copperfield Annex, Lighthouse Rota Exchange, Saltmarsh Depot Edge   state {view: list, membership: all}
post_dcim_sites {name: Tide Gauge Annex, ...} -> 201, state {view: create, id: "5"}, url .../api/dcim/sites/5/, created 2026-10-20T05:48:41.000000Z
get_dcim_sites_by_id {id: "5"} -> state {view: item}; get_dcim_sites {} -> 5 sites, count 5
post_dcim_sites {..., status: "active"} -> isError: "Member status is accepted only with the value the capture sent ..."
patch_dcim_sites_by_id {id: "5", body: {description, facility}} -> state {view: update}, last_updated +3 s
delete_dcim_sites_by_id {id: "5"} -> 204; get_dcim_sites_by_id {id: "5"} -> 404 {"detail": "No Site matches the given query."}, state {view: missing}
next create -> id 6 (not 5); data/reset -> {}; same first create -> id 5, same timestamp

Validation performed

At cbb7b61 and again after merging the base branches and main:

  • Static checks: npm run build:cached, check:fast, format:check, knip, scan:todos, docs:check, verify:test-discovery and mcp-catalog:check passed.

  • Duplication: npm run jscpd at 3.44%, under the 3.5% gate.

  • Domain and services: npx vitest run --project domain --project services: 7442 passed, 5 pre-existing skips.

  • Boundaries: npm run test:prepare, then npm run test:focused -- the write MCP boundary, the serve MCP, CLI and process boundaries, the export CLI, the analysis-view CLI and MCP and the compact schema boundaries, and the contract description tests: 72 passed.

  • After the latest main merge (only the shared description string conflicted): the contracts, analysis-view and environment tests (857 passed) and those boundaries (53) passed again.

  • Review round (head df2bded): merged feat(environment)!: serve the environment state by default #5351 at c00fde4, feat(environment): render more read tools from the state and describe responses #5352 at f6c756a and main at 1629266 (trial merge with current main is clean), then fixed the 11 Greptile findings in 82556cd, 138ea4b and 6d21b62 (the batch-limit one was feat(environment)!: serve the environment state by default #5351 code, fixed there in c00fde4). check:fast, format:check, knip, scan:todos, docs:check, verify:test-discovery, verify:module-boundaries and mcp-catalog:check passed; jscpd 3.47%; domain and services 7463 passed (5 pre-existing skips); the focused boundary set 75 passed; conformance 279 passed. The pinned replay card digest moved only because feat(environment): render more read tools from the state and describe responses #5352 quotes summary field names (un-quoting reproduces the old digest). The stricter gate left the write verdicts over the 50 showcase captures unchanged plan by plan, and the in-process smoke again applied all 33 served write tools.

  • Review round 2 (head 7056f5f): fixed Greptile's 5 follow-up findings in 2086da6 (checked lines matched as serving matches calls, increments and slugs held for every call, insert rules still learned after an item read, the gate running serving's document body check, decoded parent path values on served creates); each new test fails on df2bded. Gates as above passed again (domain and services 7468, 5 pre-existing skips; boundaries 75; conformance 279; jscpd 3.47%); verdicts over the 50 captures unchanged plan by plan; smoke 33/33.

  • Review round 3 (head db8df45): fixed Greptile's 2 findings on round 2 in db8df45: checked lines keep the path as spelled (replay prefers verbatim spellings), and later slug rules are checked against the values earlier calls recorded. Both new tests fail on 7056f5f. Gates passed again (check:fast, format, knip, docs, discovery, boundaries, catalog; domain and services 7470 with 5 pre-existing skips; boundaries 75; conformance 279; jscpd 3.46%); verdicts over the 50 captures unchanged plan by plan; smoke 33/33.

  • Review round 4 (head 5327e59): a read's checked line is now chosen as replay chooses the line for its call (verbatim or decoded parameters, verbatim first, then recorded order), and a list is compared from that line's collection; the new test fails on db8df45. Gates passed again (domain and services 7471 with 5 pre-existing skips; boundaries 75; conformance 279; jscpd 3.46%); verdicts unchanged plan by plan; smoke 33/33.

  • Review round 5 (head b6c3b16): Greptile's review of feat(environment): compare an environment with probe captures of its application #5699, which builds on this branch, found four more gate and serving gaps, fixed here.

    • A document write at another path is unmodelled.
    • A create picks the verbatim-spelled collection.
    • A missing entity is answered with a recorded 2xx null.
    • data/add refuses a document whose data/get form would pass 32 MiB.
    • Each new test fails on 5327e59.
    • Gates passed again (domain and services 7475, 5 pre-existing skips; boundaries 75; conformance; jscpd 3.46%), the verdicts over the 50 captures were unchanged, and the smoke ran 33/33.
  • Follow-up (head f2b9535): a 2xx null now answers a missing entity only for reads, so a write of a missing entity never reports success (Greptile). Its test fails on b6c3b16; domain and services 7476 passed, and the smoke ran 33/33.

  • Review round 6 (head fc403d9): merged the serving branch at 25b6622 and 6b8db19 and the coverage branch at 665112e, which bring main 335c042. The contract text conflicted only where this branch adds its write sentence; in the store this branch's own size check was kept. Gates passed (domain and services 7605, 5 pre-existing skips; boundaries 75; conformance; jscpd 3.45%), the verdicts over the 50 captures are unchanged, and the smoke ran 33/33.

  • Review round 7 (head 1d1c478): fixed Greptile's 4 findings on round 6 in 1d1c478. A read whose body no longer holds the entity or list, or that shows an entity without its required fields, now contradicts the writes it checks. A write whose effect a later write replaces is no longer confirmed by reads of that later state. Sequences skip values the state started with. An emptied collection keeps its spelling for creates. The same commit fixes Greptile's report on feat(environment): compare an environment with probe captures of its application #5699 that the gate confirmed an entity without a field serving requires. All 5 new tests fail on fc403d9. Gates passed (check:fast, format, knip, todos, docs, discovery, module boundaries, catalog, no oxlint warnings; domain and services 7610, 5 pre-existing skips; boundaries 75; conformance; jscpd 3.45%). Over the 50 captures, only Linkding changed: its bundle create and patch are now unconfirmed, because the one list that checked them was taken after the bundle was deleted. That leaves 31 served write tools (10 creates, 11 updates, 10 deletes), and the smoke ran 31/31.

  • Review round 8 (head dc5e2aa): fixed Greptile's 2 findings on round 7.

    • An update's effect is every field it sent or changed, derived ones included, and an increment adds to its field rather than overwriting it. A PATCH that bumps a version stays confirmed after a PUT that keeps the version.
    • A reset or load starts from the collection spellings of the state it installs.
    • Both new tests fail on 1d1c478. Gates passed: domain and services 7612 (5 pre-existing skips), boundaries 75, conformance 279, jscpd 3.45%, no oxlint warnings.
    • The 50-capture verdicts are unchanged plan by plan, and the smoke ran 31/31.
  • Review round 9 (head fe8ab58): fixed Greptile's 3 findings on round 8; two were raised on feat(environment): compare an environment with probe captures of its application #5699 against this branch's code.

    • Later writes erase the fields they overwrite from earlier effects, and an effect with nothing left is dropped.
    • A recorded outcome erases what earlier writes changed on its entity.
    • A reset or load keeps the Evidence's own collection spellings.
    • All 3 new tests fail on dc5e2aa. Gates passed: domain and services 7615 (5 pre-existing skips), boundaries 75, conformance 279, jscpd 3.45%, no oxlint warnings.
    • The 50-capture verdicts are unchanged plan by plan, and the smoke ran 31/31.
  • Review round 10 (head 73c0e9b): fixed Greptile's finding on feat(environment): compare an environment with probe captures of its application #5699 about this branch's store: a create prefers a held collection over an equally fitting Evidence-only spelling. Its test fails on fe8ab58. Gates passed: domain and services 7616, boundaries 75, conformance, jscpd 3.45%, no oxlint warnings. Verdicts are unchanged and the smoke ran 31/31.

    • fe8ab58's CI run failed only in the PE-resources acceptance test (tests/acceptance/applications/peResources.test.ts), which timed out at 30 s. This branch does not touch it, and it passes on main.
  • Review round 11 (head 6d28aa7): fixed six findings Greptile raised on feat(environment): list every entity on a list's whole lines #5787 against this branch's code, in 9f513d0:

    • a read with no query on a whole list is checked on the paging line serving answers it from, and a line whose query repeats a name is never checked;
    • a read made while a write to its targets was still running checks nothing;
    • a later call that stores a member otherwise than the plan refuses the plan;
    • a collection the capture listed empty keeps its spelling for creates;
    • containsDelimited no longer overflows the stack on wide arrays;
    • the guide counts the confirmed write tools among the served ones.
    • Attribution moves to environmentStateWriteAttribution.ts and the create's collection choice to environmentStateCollections.ts, to stay under the line limit.
    • Merged morluto's b224462 (main and the export-failure CLI test) in 6d28aa7.
    • All six new tests fail on 73c0e9b. Gates passed: domain and services 7667 (5 pre-existing skips); boundaries 76 plus the new export-inputs CLI test (4); conformance 279; jscpd 3.44%; no oxlint warnings.
    • The 50-capture verdicts are unchanged plan by plan, and the smoke ran 31/31.
  • Review round 12 (head 3580d85): fixed five findings Greptile raised here and one on feat(environment): compare an environment with probe captures of its application #5699 against this branch's code, and merged main d8a9673:

    • a passing read confirms only the writes it shows something of;
    • document writes join the effect tracking, so a replacement overwrites an earlier merge;
    • a read a write's effect was learned from still contradicts the other writes it exercises;
    • an item read names its entity as serving does, percent-decoded spellings included;
    • a line repeating a query name with one value stays checkable;
    • a call naming a page the collection has outgrown answers from its recording (page-exceeded), and the gate checks nothing by it.
    • Each new test fails on the previous head. The 50-capture verdicts are unchanged plan by plan, and the smoke ran 31/31.
  • Review round 13 (head 43d98ea): fixed four findings Greptile raised on feat(environment): list every entity on a list's whole lines #5787 against this branch's code:

    • a create that answers with its id alone is observed only through a read of that id;
    • a later call that first sends the path's id adds the identity member to the plan;
    • the copy search walks a request body by index, so 500,000 zeros take 74 ms rather than 63 s;
    • the sent values of fixed members a plan keeps count against the view's allowance.
    • Each new test fails on the previous head. The verdicts are unchanged plan by plan, and the smoke ran 31/31.
  • Review round 14 (head 325c128): fixed six waves of findings Greptile raised against this branch's code, here and on feat(environment): compare an environment with probe captures of its application #5699, feat(environment): list every entity on a list's whole lines #5787 and feat(environment): answer list filters, search, sorting and paging from the state #5800, in 264ce41, 0ae6440, 466ed8b, 7cef2fb, 45a5c8b and 325c128:

    • a passing read that shows nothing of a write leaves it pending, and interference is weighed per write and per target the read covers where the tool's effect survives, so a write made after an unmodelled one is still contradicted, by an item read as well, while one an unmodelled write followed is checked on its members only;
    • a read begun while a write to an unknown entity still ran neither checks nor resynchronises it;
    • a later create must keep the forms serving generates: sequences in order, clocks in their format, unique values as UUIDs;
    • a document replacement below the root overwrites only its object, later document calls write at the plan's object, and only document pointers cover the members under them;
    • item reads, updates and deletes name their entity as serving does, decoding the id once;
    • an update's identity member never takes a rule; a plan that uses a member as both identity and fixed member, or fixes it at different values, is refused, as is an update a later read shows dropped a field (a write's own response may leave fields out);
    • a _start–_end range bounds a page as limit does, and a zero size is no bound by itself only where the line's recording listed items under it, the line's other bounds still applying;
    • a derived state data/get would write past 32 MiB is not served.
    • The paging rules moved to environmentStatePaging.ts (6257de9) and the document write to environmentStateWriteDocument.ts, to keep files under the line limit.
    • Each new test fails on its previous head. Gates passed on 325c128: check:fast, format, knip, todos, docs, discovery, module boundaries and catalog, with no oxlint warnings in the changed files; domain and services 7748 (5 pre-existing skips); environment boundaries 63; conformance 265; jscpd 3.44%.
    • The 50-capture verdicts are unchanged plan by plan, and the smoke ran 31/31.
  • Review round 15 (head 717ac2c): morluto restacked this branch onto main after feat(environment): render more read tools from the state and describe responses #5352 and added fixes through 3b34bbd (5d00ff3). Merged main 8413ec0 in 717ac2c, with no conflict.

    • Gates passed: check:fast, format, knip, todos, docs, discovery, module boundaries and catalog; domain and services 7827 (5 pre-existing skips); environment boundaries 64; jscpd 3.47%.
    • CI shard 3 failed on 5d00ff3 in the client-configuration diagnostics acceptance test's JVM cleanup (cleanup_incomplete). That test passes locally.
    • The 50-capture verdicts are unchanged plan by plan, and the smoke ran 31/31.
  • Review round 16 (head 3f1f825): fixed the Greptile findings raised against this branch's code on the stacked PRs.

    • e923fc7 and 75d7bb0, replayed onto the restacked branch:
      • an older change elsewhere no longer excuses a newer write that a failed list shows undone;
      • an update explains a field it added when the observing view had shown the entity;
      • a create is tied to the collection serving picks;
      • write descriptions quote member names and stay within the description budget;
      • a request body is indexed once per explanation, so the wide-body test runs in about 60 ms instead of 36.8 s.
    • ccdf091:
      • a failed read that is no absence leaves an unknown entity unknown;
      • volatile fields check no write;
      • a call on an unknown entity adds nothing to a built plan;
      • a later update that does not answer with its entity is observed only by a read that shows every learned clock.
    • 1c97933 fills a create's path fields from the collection serving selects.
    • 90d9022:
      • unmodelled writes name entities and collections as modelled writes do;
      • an update's answer counts the fields its rules write;
      • a member that a later call first stores keeps that call's JSON type (the body's new kinds).
    • Merged main 4a4bbab in 2a125b7, which brings main's fix for the client-configuration cleanup_incomplete CI failure. Merged morluto's 53a7866 and 329aeed/756c6312 in 3f1f825; where fixes overlapped, one copy is kept.
    • Each new test fails on its previous head. Gates passed on 3f1f825: check:fast, format, knip, todos, docs, discovery, module boundaries and catalog; domain and services 7880 (5 pre-existing skips); environment boundaries 64; jscpd 3.41%. The smoke ran 31/31.
    • One plan changed across the 50 captures. Gitea's issue PATCH is still served, but no longer accepts state or stamps closed_at. The only call that closed the issue came after an unmodelled comment delete under it, so that call is no longer learned from (ccdf091).

Details, including the per-capture verdict table, are in docs/specs/agent-environments/state-writes/verification.md.

Compatibility, safety, and release

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.

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.

🤖 Generated with Claude Code

Current blocker verification

The combined branch retains the author's 7de20bc9e fixes for sent-member provenance, negative sequence continuation, deleted-target absence checks and encoded update observations. Target resolution prefers live entities before removed-target fallback, and observation matching uses the same owner. Distinct tests cover encoded collection aliases and the exact resolved raw ID rather than deriving a new identity from the path. The earlier generation-exhaustion refusal remains typed and precedes mutation/write commitment.

The additional collection-history fix indexes baseline collection spellings once at restart/load/reset and budgets only newly generated path history. Admission happens before mutation; rejected insertions leave state unchanged. Loaded source collections and sequence facts remain available after deletion/reinsertion. A canonical index removes the prior scan of all baseline entities on every new path. The 1 MiB allowance is deterministic logical accounting for generated history (UTF-8 keys plus explicit bookkeeping allowances), not a total-store or measured OS-memory bound.

The combined source passed 116/116 focused tests, check:fast, format:check and git diff --check using Node 24.18.0/npm 11.16.0. docs:check also passed on the final tree (README consistency 5/5), and the pre-push fast gate passed. No provider was executed.

Independent review covered these owner changes. For the history-index change only, a matched 1,000 insert/delete sample recorded baseline 14.57 ms / 23,867 microseconds CPU versus candidate 9.98 ms / 16,914 microseconds CPU; these are host-specific samples, not a universal speed claim, and the later correctness fixes were not separately benchmarked. Vitest/V8 RSS was noisy; process-family memory and agent-token costs were not measured. The documentation records the limits. This pass is not a new full review of the entire reconstructed PR or a real-provider run. Normal merges preserve the author's intervening branch updates; no history rewrite was used.

Additional owner-boundary verification

Update observations now carry the selected read view's field coverage. A summary that does not cover a required learned clock cannot displace useful partial write-response facts. Facts outside a later view remain available from the response; omission counts as removal only within the read's declared coverage. Missing generated values remain absent in simulation rather than becoming synthetic nulls. This keeps incomplete evidence explicit while preserving the timing and clock-rule checks.

The fix was normally merged with the author's intervening restack, preserving both histories. On exact live head 5d00ff3c, 218 focused simulation, explanation and application tests passed using Node 24.18.0. check:fast, format:check, diff checks and the push gate passed. Regressions cover an abbreviated item view after a richer partial write response, covered removals, and incomplete clock observations. The history-budget and earlier target/provenance fixes remain. No provider execution or new resource measurements were performed.

@earakely-scale
earakely-scale marked this pull request as ready for review October 20, 2026 18:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-20T18:28:54.396124Z 52b6b78 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest change appears safe to merge; no new blocking issue was found.

Summary

The PR serves write tools whose effects later captured reads confirm. The latest change fixes the clock fallback when a capture contains an unusable duration.

  • Captured reads gate which write tools the environment serves.
  • Confirmed write calls change the environment’s live state.

Reviews (38) · Last reviewed commit: "fix(environment): start the served clock..." · Reviewed by Greptile

Comment thread docs/agent-environments.md Resolved

morluto commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Maintainer thread pass (inventory):

  • Greptile: 42/42 root findings already have @earakely-scale "Fixed in …" replies; Greptile confidence is 5/5 on head 325c128f.
  • Codex: no inline finding threads. Summary shows code-review Failed (usage limits / credits), not concrete unresolved Codex comments — gate "Codex clear" still blocked on that until a successful re-review after rebase.
  • Resolve: cursor-github has no resolveReviewThread / GraphQL surface here, so I cannot mark threads resolved via API. Posting per-thread maintainer acks next. UI resolve can wait until after rebase onto main (incl. 166fb082).
  • Rebase: Update-branch remains 403 on the fork; not launching another rebase agent (parent CloudAgent already handling).

earakely-scale and others added 4 commits October 21, 2026 22:04
…ving selects

The gate built a later create's path fields from the recorded request path,
while serving fills them from the held collection it selects for that path,
so a read showing the other spelling's parent could confirm a create serving
cannot reproduce. Rules still learn from the recorded path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds updates write, and keep later members' types

An unmodelled write below an item path names its entity through itemTarget,
and one at or above a collection resolves the held collection, as modelled
writes do, so an encoded spelling no longer hides the entity it changed.
An update's answer counts the fields its rules write, other than increments,
as available, so a field only the update writes no longer makes it
incomplete-entities. A member a later call first stores keeps that call's
JSON type in the body's kinds, which the body check falls back to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er its object

A replacement claims only the members it wrote or removed, but it now
overwrites every earlier effect under its object, so a merge that wrote
the object it replaces loses its confirmation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides named unmodelled writes as modelled ones do and dropped volatile
fields from members-only checks; this keeps the taint that also resolves
collection-level writes through heldCollection, and one volatile filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a date can hold

A record timed past the range of a date no longer leaves the served clock
without a start, which the store read as zero and stamped writes in 1970;
the clock starts after the latest record a date can hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…lity

Both branches fixed the same two findings. Write descriptions were already
quoted and sampled identically; this keeps morluto#5600's wording. For a create's
collection, this branch's choice through serving's candidates and order now
applies to every create, so morluto#5600's held-only heldCollection is dropped
here. The simulated state's serving order moves to its own module to keep
the checks under the line limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
… a tied create's path fields

An identifier equal on both sides can name different entities once the
probe's mapping gives the live value another environment counterpart, so
the comparison now reports it rather than counting it equal. Tests cover a
tied create whose parent serving decodes from the collection it selects,
which morluto#5600's fix to a create's path fields settles here too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…tion of unmodelled writes

This keeps the read checks under the line limit after morluto#5600's additions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…ueries

This brings in morluto#5600 at 11e3f01. A list check renders query answers with
their totals and, when it fails, reports the members alone accounting for
the difference, so it does both. writtenFieldChecks moves to the
attribution module to keep the checks under the line limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…ueries

This brings in morluto#5600 at 90d9022. writtenFieldChecks, which this branch
keeps in the attribution module, takes morluto#5600's rule that volatile fields
check no write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…ueries

This brings in morluto#5600 at 3f1f825.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…e assigned values

Update evidence carries both the type's other entities and the fields the
observing view had shown. With morluto#5600's additions the write effects and
explanations outgrew the line limit, so the checks a recorded update call
must reproduce move to environmentStateWriteCalls.ts, and freshUuid and the
generated rule kinds to environmentStateWriteGenerated.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale

Copy link
Copy Markdown
Contributor Author

@morluto #5600 is ready for a merge pass: on 4bc6002, CI is green, it merges cleanly, Greptile scores it 5/5, and every review thread is resolved. Codex's review keeps failing on usage limits rather than findings. Could you merge it, or retrigger Codex if you'd like that gate first? #5699, #5787, #5800, #6136, #6138 and #6169 are stacked behind it.

@morluto
morluto merged commit 538017d into morluto:main Oct 22, 2026
40 checks passed
@morluto

morluto commented Oct 22, 2026

Copy link
Copy Markdown
Owner

no need to retrigger! lgtm

cursor Bot pushed a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
Keep probe comparison, paging, and tied-create behavior on main after morluto#5600. Capture parsing keeps field-path errors and records whether a probe kept request and response bodies.

Co-authored-by: morluto <morluto@users.noreply.github.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…ist lines

morluto#5600 landed on main as a squash, so this merge takes 3f1f825, the write-plan
commit this branch last merged, as its base.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…ist queries

morluto#5600 landed on main as a squash, so this merge takes 3f1f825, the write-plan
commit this branch last merged, as its base.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…rite assigned values

morluto#5600 landed on main as a squash, so this merge takes 3f1f825, the write-plan
commit this branch last merged, as its base.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…iew clock spelling

morluto#5600 landed on main as a squash, so this merge takes 3f1f825, the write-plan
commit this branch last merged, as its base.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Oct 22, 2026
…rite coverage

morluto#5600 landed on main as a squash, so this merge takes 3f1f825, the write-plan
commit this branch last merged, as its base.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
morluto added a commit that referenced this pull request Oct 22, 2026
…application (#5699)

* chore: restack environment fidelity onto main

Keep probe comparison, paging, and tied-create behavior on main after #5600. Capture parsing keeps field-path errors and records whether a probe kept request and response bodies.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(environment): keep served collection order with the fidelity checks

The tied-create collection order lives with the checks that match encoded parents. The write simulation reads field checks from that attribution, and taint uses the same segment match.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(environment): translate an object's keys only when it is keyed by learned ids

Differ.object mapped every key through the probe's id map, so a field named
like a learned id was compared with another field, and a real rename could
pass as a mapped key. Keys now translate only for an object keyed by
learned ids as learning reads one: a key both sides share needs every key
evidently an id, and otherwise each entry is an entity or each key evidently
an id. Any other object compares field by field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
@morluto morluto mentioned this pull request Oct 25, 2026
3 tasks done
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants