Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
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
717ac2c
chore: merge main (8413ec08) into environment state writes
earakely-scale Oct 21, 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
11e3f01
refactor(environment): keep the observing view helpers with the obser…
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
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
4bc6002
fix(environment): start the served clock from the records whose times…
earakely-scale 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
fix(environment): let a document replacement overwrite everything und…
…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>
  • Loading branch information
earakely-scale and claude committed Oct 22, 2026
commit 756c6312574878a37c895efbbf0cc046bee2bb4d
46 changes: 39 additions & 7 deletions src/domain/analysisView/EnvironmentStateWriteSimulation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,37 @@ describe("what a read shows of a write", () => {
});
});

it("confirms no document write a later replacement overwrote", () => {
const rows: TimedCaptureRow[] = [
["GET", "/api/settings", { theme: "light", lang: "en" }],
[
"PATCH",
"/api/settings",
{ theme: "dark", lang: "en" },
200,
{ theme: "dark" },
],
[
"PUT",
"/api/settings",
{ theme: "blue", lang: "fr" },
200,
{ theme: "blue", lang: "fr" },
],
["GET", "/api/settings", { theme: "blue", lang: "fr" }],
];
expect(gated(rows, "patch_settings")).toMatchObject({
served: false,
checked_record_ordinals: [],
});
expect(gated(rows, "put_settings")).toMatchObject({
served: true,
checked_record_ordinals: [3],
});
});
});

describe("document writes later writes overwrite", () => {
it("confirms no document replacement a later merge overwrote", () => {
const rows: TimedCaptureRow[] = [
["GET", "/api/settings", { theme: "light", lang: "en" }],
Expand Down Expand Up @@ -859,24 +890,25 @@ describe("what a read shows of a write", () => {
});
});

it("confirms no document write a later replacement overwrote", () => {
it("confirms no document merge a later replacement of its object overwrote", () => {
const rows: TimedCaptureRow[] = [
["GET", "/api/settings", { theme: "light", lang: "en" }],
["GET", "/api/settings", { prefs: { lang: "en" }, theme: "light" }],
[
"PATCH",
"/api/settings",
{ theme: "dark", lang: "en" },
{ prefs: { lang: "fr" }, theme: "light" },
200,
{ theme: "dark" },
{ prefs: { lang: "fr" } },
],
// The replacement holds `lang`, so it replaces all of `prefs`, which the merge wrote.
[
"PUT",
"/api/settings",
{ theme: "blue", lang: "fr" },
{ prefs: { lang: "de" }, theme: "light" },
200,
{ theme: "blue", lang: "fr" },
{ lang: "de" },
],
["GET", "/api/settings", { theme: "blue", lang: "fr" }],
["GET", "/api/settings", { prefs: { lang: "de" }, theme: "light" }],
];
expect(gated(rows, "patch_settings")).toMatchObject({
served: false,
Expand Down
4 changes: 3 additions & 1 deletion src/domain/analysisView/environmentStateWriteAttribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ export class WriteEffects {
};
/** Set when the fields are a document's pointers. */
readonly pointers?: boolean;
/** What the write overwrites of earlier effects, when more than the fields it claims. */
readonly overwrites?: readonly string[];
},
): void {
const [entity, collection] = effect.targets as [string, string?];
Expand All @@ -219,7 +221,7 @@ export class WriteEffects {
{
whole,
fields: new Set(
changed.filter(
(effect.overwrites ?? changed).filter(
(field) => !effect.changed?.accumulated.includes(field),
),
),
Expand Down
4 changes: 4 additions & 0 deletions src/domain/analysisView/environmentStateWriteDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,13 @@ export const applyDocument = (
before: value!,
after: written.value,
});
const replaced = draft.plan.merge === "merge" ? undefined : pointer;
return {
kind: "applied",
targets: [documentTarget(tool)],
...(fields === undefined ? {} : { fields, pointers: true }),
...(fields === undefined || replaced === undefined
? {}
: { overwrites: [replaced] }),
};
};
2 changes: 2 additions & 0 deletions src/domain/analysisView/environmentStateWriteEffects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ export type EffectResult =
readonly fields?: readonly string[];
/** Set when the fields are a document's pointers, each covering the members under it. */
readonly pointers?: boolean;
/** A document replacement's object, as a pointer: it overwrites every earlier effect under it, though it claims only its members. */
readonly overwrites?: readonly string[];
/** The fields an update sent or changed, derived ones included, and those of them its increments add to. */
readonly changed?: {
readonly fields: readonly string[];
Expand Down
Loading