Repository navigation
feat(history-mutation): plan, preview and apply a change to an agent's history - #505
nissa-seru wants to merge 77 commits into
Conversation
…rite These tests fail at the base. They pin the editSummaryText of the next commit. - An entry can carry another summary up a level (carriedFrom). An edit of that entry is refused. A compile reads the carried summary's text in the entry's place, so the edit would never show. The error names the carried summary by its id. - An edit of the carried summary reports the entries that carry it. It reports them apart from the summaries merged over the old text. It writes each carrier again as a copy of the edited summary: its text, tokens and external, with no response blocks and no provenance. - A summary can render verbatim response blocks. An edit of it is refused unless the edit drops them (dropResponseContent, or --drop-response-content in the CLI). A dry run is refused too, and nothing is written. - The caller can give the sha256 of the text that it read (expectedPriorSha256). The edit is refused where the summary's text has another sha256. The two existing tests that edit a summary with response blocks now pass --drop-response-content.
The rules of a summary edit move into one pure function, planSummaryEdit in src/summary-edit.ts. The strategy's editSummaryText uses it now. The history mutation plan of a later commit uses it too. - An edit of a carrier (carriesItsSource) is refused. A compile renders the carried summary's text in the carrier's place (summaryAnswerProse). So the carrier's own copy never shows. The error names that summary by its id. If that summary is gone, the carrier's own text renders (carriedMemory), and the edit goes ahead. - A summary's responseContent renders in place of its content (summaryAnswerProse). So an edit that kept it would still show the old text. The edit used to delete it silently. Now such an edit needs dropResponseContent (in the CLI, --drop-response-content). Without it, the edit is refused, and so is a dry run. - expectedPriorSha256 refuses the edit if the summary's text isn't the text that the caller read. - The new text's token stamp is its length divided by three. This is the rule for a text that no provider measured, and an imported summary gets it too. The old stamp is usually the provider's outputTokens. That count includes reasoning blocks, which dropResponseContent removes. A stamp scaled from it would misprice the new text. - Each carrier is written again as a copy of the edited summary. The copy has the summary's text, tokens and external, and no responseContent, provenance or stitched. carry() would make the same copy now. A carrier's own fields still count in two places. The legacy level budgets charge a carrier's own tokens. And under carrierPolicy 'full', recallAnswerCost prices a carrier with response blocks at its old stamp or more. - An applied edit clears the memo of recall-answer prices. The memo's key is the summary's id and tokens. An edit to a text of the same length changes neither. - SummaryTextEdit splits the parent chain in two. carriedBy lists the carriers next to the summary. parents lists the summaries merged over the old text, and every summary above them. Before, parents listed the carriers too. The pending external-memory changelog fragment changes in place. The feature isn't released yet, so its text describes the behaviour as it ships.
The history mutation plan of the next commits must predict the outcome
of three rules. So each rule now lives in one function, which the old
caller and the plan both use. Behaviour doesn't change for content
without holes. A store holds no other content, because its JSON has no
sparse arrays.
- findUnpairedToolBlocks in normalize-tool-messages.ts lists the tool
blocks without a partner. These are each tool_use that no tool_result
answers, and each tool_result that answers no tool_use. It uses the
rule of answeredCallIndexes. stripUnpairedToolBlocks strips what it
finds. enforceToolPairing doesn't change, because it repairs rendered
entries by adjacency, which is another rule. The old loop read the
holes of a sparse array as undefined blocks, and forEach skips them.
- summariesFoldingRows in summary-edit.ts gives the L1 summaries that
fold some rows. It finds them by their sources and by their chunk
records. withSummariesAbove adds every summary above them.
unfoldRowsThatLeft and unfold now use these two functions in place of
their own loops.
- toolPairSplitReason in message-store.ts holds the loop that
MessageStore.refuseToolPairSplit ran. It reads rows through an
accessor, and returns the reason where the method threw. The method
throws `${what}: ${reason}`, the same text as before.
These tests are for the history mutation API of the next commit. At this commit the API doesn't exist, so the two history-mutation test files fail to compile. One test in recall-envelope.test.ts fails too. That test checks that the recall envelope escapes the editedBy value. history-mutation-plan.test.ts gives the plan a history directly, because a plan writes nothing. It checks that the plan refuses these: - an empty manifest; - a target named twice, or not there; - content other than the content that the caller read; - a blank label; - malformed content, such as a system change with a label beside it; - an edit of a shard, or a removal of part of a body; - a tool call split from its result, but not a split that was there before the batch; - a split that only the window's order shows; - an edit that the store's own tool-pair check refuses, once the batch's earlier ops are made; - a change to a message that keeps thinking blocks, to its text or to a thinking block; - a folded row or a merged parent with no policy for it; - an edit of a carrier; - a summary that one op edits and another op drops; - the removal of every row. The plan tests also check where the label goes, an image's stored form, the plan's reports on the thinking record and the cache prefix, the plan hash, and the anomalies of a history at rest. history-mutation.test.ts runs the manager on an agent's store. The store has 40 rows, compressed into L1 summaries with response blocks and one L2. The tests cover these: - an apply, which leaves the store on the new branch after a reopen, and the source branch as it was; - an apply's refusals of a stale hash, another source branch, a plan that drifted and an existing target branch, none of which writes anything; - a preview, whose compile equals the compile after the apply, and which leaves no branch, and no record on the source branch; - the hot settings of the scratch strategy, and the clones of the Knowledge and Passthrough strategies; - an edited message whose old text was also in a Responses replay item, sent through membrane's Responses formatter; - a tool call in another slot that the manager merges; - folded rows and merged parents, by their policies; - the recall envelope's editedBy, and the carriers of an edited summary; - a branch whose summaries, carriers, rows or edit records read back other than planned; - a branch with an anomaly that the source lacks; - the rows that beforeSwitch appends, which the apply keeps; - a source that moves while the branch is built; - failures before the switch, among them a branch that can't be deleted; - a strategy that fails to initialize after the switch, and a branch selection that supersedes the switch; - a process killed with SIGKILL in beforeSwitch (test/_harness/apply-then-die.ts), after which the store reopens on its source branch as it was.
A host can now change an agent's history through the manager. The
manager checks the change against the rules that the strategy and the
provider rely on. It builds the change on a new branch, and moves the
store there only once the branch reads back right. The changelog
fragment lists the API and its refusals. This message gives the reasons
for its less obvious parts.
The plan (planMutation in src/history-mutation.ts) is pure, and writes
nothing.
- It reads tool pairs in the manager's merged record and in its window.
The merged record holds the manager's slot and its auxiliary slots, so
a call in an auxiliary slot pairs with its result in this slot. A
split counts only if the batch makes it. So the plan compares the
unpaired blocks after the batch with those before.
- The store checks tool pairs on each write (toolPairSplitReason), and
that check refuses some shapes that were there before. So the plan
runs the same check for each message edit, in op order, against the
rows that the earlier ops leave.
- It puts the label first, and checks the content again with the label.
A system change must stand alone, so a labelled one now refuses at
plan time rather than in the middle of an apply.
- It takes the content as the store keeps it (blockAsStored). Otherwise
an image that the store relabels or re-encodes would fail the
readback.
- A formatter replays a block's raw form (rawItem, rawXml) in place of
its fields. A changed block that kept its raw form would send the old
text. So the plan drops the raw form of each block that changes
(releaseReplacedRawForms). It drops the raw form of each sibling that
shares it too. It matches blocks by value, because a caller's content
is new objects.
- A message that keeps a thinking block can't change at all. A provider
verifies the block's signature over the turn in which it was made.
- A summary that one op edits and another op drops is refused, since the
writes fail in either order.
- For the thinking binding and the cache prefix, a summary edit changes
the rows that the summary folds. If the slot holds none of those rows,
the change counts from the first row.
The apply (ContextManager.applyHistoryMutation) builds on the target
branch.
- The branch is forked from the head with every state, so other
managers' states come along.
- A manager on a view of the branch makes the writes. It makes them by
the same calls that a host makes. Its strategy is a fresh instance,
which gets the live strategy's rendering frontier as derive does.
- After beforeSwitch, a second manager opens the branch cold and reads
it back. A seeded reader would check only the slot's length and last
row (deriveOnto), so after an edit of the last row it would read back
the source's copy. The readback compares the whole history, because a
reader's own load can repair what it loads (demoteSplitSummaries). A
check of the targets alone would pass a branch that the load repaired.
- Then a fence runs, with no await between it and the native switch. The
store must still be on the source branch. The source branch must still
be at the head that the branch was forked from. And the target branch
must still be the branch that the apply built. Otherwise the apply
refuses (SOURCE_MOVED). Without the fence, a write to the source
during the build was silently left behind. So a host stops other
writes to the history while an apply runs.
- Any failure before the switch deletes the branch built. The cleanup
deletes only the branch that it created. Where the deletion fails, the
error (BRANCH_LEFT) names the branch and says whether it is still
there or its deletion isn't saved. Chronicle keeps a change in memory
when its checkpoint fails, so both can happen.
- switchBranch moves the store before its checkpoint and before it
initializes the strategy. So the switch can fail after the store has
moved, and the mutation is then applied. The error is then
APPLIED_INIT_FAILED, with the receipt and the way back, and the branch
stays.
The preview (compileMutationPreview) makes the same writes on a scratch
branch, compiles there, and deletes the branch. Its by option must match
the apply's. A compile shows that value in the recall envelope
(editedBy), so a preview with another value would compile differently.
In the strategies, AutobiographicalStrategy implements
HistoryMutationStrategy, and KnowledgeStrategy inherits it.
dropSummaries unfolds over the seeds, then rebuilds the chunks and runs
the merge check, as a let-go of rows does. cloneForScratch on
Autobiographical, Knowledge and Passthrough builds the same class with
no automatic tick. On a subclass of these, it refuses rather than build
the wrong class.
MessageStore.edit and ContextManager.editMessage take `{ mergeMetadata
}`. MessageEditStamp is the shape of metadata.historyMutation.
|
Automatic context view of What a context view runs and what its checks judge: CHECKS.md. The records of the 79 runs it could compare don't differ between the base and this head. In the files profiled hosts loaded, 900 changed source lines that map to code ran in no profiled drive: Parts left out where an arm's stack doesn't bring what they need: 2 runs couldn't be compared; the reasons are below. Usage: the figures of the agents' requests, subagents' included, in the 79 runs are the same in the base and this head: 209,978 tokens sent a request, 72.2% of them read from the cache, 138,488,760 written to it, 3,969,133 output, 24 thinking blocks dropped, USD 0.5588 at list price a priced request and 123 requests with no list price. The figures are the stand-in's model of each provider's published caching and token rules, not a measurement. Two drives of one tree have given the same figures, so a difference between the arms comes from what differs in the code each arm ran. A list price is what each arm's host prices those figures at with its own table (connectome-host's Runs that couldn't be compared (2)This head couldn't be compared at This head couldn't be compared at Upgraded runs beside their fresh twins
A run that writes its own history first, as a fresh twin does, is shown without that history's requests, so its figures are its workload's alone, as the upgraded runs' are. Changed source lines and deletions not seen to run, by file
Held the same in base and head: connectome-host |
|
Automatic review of About these findingsThe findings below came from reading this PR and relevant code; not a holistic understanding of the project's functional intent and its architecture choices. Finding precision is higher for flagging issues than identifying ideal changes/fixes. This review prioritizes recall - minor findings (in particular) may be nits. Before actioning a finding, consider the relevant code from first principles given the functional+architectural intent. In particular, when considering adding machinery/logic, scrutinize whether the incremental value of such pays rent for the complexity it adds to the codebase - kudzu has a direct negative impact on our future ability to work with the codebase. Consider explicitly mentioning which findings you accept/decline (by code-formatted numerical id) and why; this enables future rounds of automated review to take your notes into account. Findings, most severe first:
Minor findings 9 to 34 (of 34)
|
A history that the mutation changes can sit in more than one manager. Residents of one host share one message slot, each with a window and summaries of its own, and an isolated agent can merge another slot into its own record. An edit of a row that another resident has folded leaves that resident's summary rendering the old text, and nothing tells its strategy: strategies hear rows leave a window (`onRetracted`), never a row change. A removal reaches another window only after the switch, through a host's retraction of the removed rows, or at the next boot. These tests name the other managers as `readers` of the plan, the preview and the apply, and pin what each must get: - the rules of the manager's own window: its summaries over an edited row refuse the plan without a `foldedPolicy`, `leave_summaries` leaves them, and `drop_covering_summaries` drops them; a tool pair that the change splits in a reader's record refuses it; - a plan that says what it does to each reader, and a `planSha256` that covers it, so that an apply with readers refuses a plan made without them (`PLAN_DRIFT`); - a preview whose plan is the apply's; - an apply that reconciles each reader on the target branch before the switch: a resident's summaries over an edited row go, and its compile shows the row as edited; removed rows leave a presented reader's window with what folds them, and nothing is left for a boot to take out; - an apply that fails before the switch leaves each reader as it was on the source; - a readback that refuses a reader not reconciled as planned (`READBACK_MISMATCH`); - a refusal of a reader that is the manager itself, is named twice, or is on another store. They don't compile against the source before the next commit, which adds the `readers` option and the plan's `readers`.
The plan, the preview and the apply take `readers`: the other managers on the store whose window or summaries hold the rows the mutation changes. Each reader gets the rules of the manager's own window, by the op's `foldedPolicy` and the reader's own window mode, and the plan reports, for each reader, the rows it holds, the summaries of its that fold them, what it drops, and where its window and its thinking-binding record change. `planSha256` covers each reader's part, so an apply with other readers than the plan's refuses as `PLAN_DRIFT`. The apply reconciles each reader on the target branch, before `beforeSwitch`. A manager bound to the branch, with a fresh instance of the reader's own strategy (`cloneForScratch`), drops the summaries that the plan drops for it over edited rows. It takes the removed rows out of a presented window (`retractRemoved`), which drops what the strategy folded of them, as a host's retraction after the switch would. In legacy mode, where there is no window, it tells the strategy that they left, as the manager's own apply does. The manager opens cold, after the target's record has been written, so it reads the record as the branch holds it. A fresh open reads each reader back: no removed row left in its window index, the edited rows as planned in its record, its summaries the source's without its planned drops, and no anomaly that its source didn't have. A reader whose window and summaries hold none of the rows is left untouched. So the one switch stays the one point where the mutation lands for every manager on the store. A failure or a stopped process before it leaves every reader on the source as it was, and after it each reader's window and summaries are already reconciled on the branch; the host re-initializes the readers, as it does every other manager after a switch. A reader that is the manager itself, is named twice, shares a strategy namespace with the manager or another reader, or reads another store is refused with an error. `windowEffects` now holds the first-changed-row and thinking-binding reading that the plan made inline, so that each reader gets it from its own window. `summaryMismatches` holds the readback's summary comparison for the manager and each reader.
These tests pin requirements of the plan, the preview and the apply that the earlier tests left unstated: - The readback reads the whole record, every slot the manager merges: a row of a merged slot changed beside the plan, a summary whose text changed beside it, an edited summary whose `external` no longer names the editor, and an unedited row whose metadata changed each refuse the switch (`READBACK_MISMATCH`). An entry that the strategy carried (`carriedFrom`), which renders what it carries, is allowed beside the plan's drops. - A change is placed by the rows of every merged slot: a summary over a merged slot's row and a row of the manager's own slot changes the window from the merged slot's row, and reaches the thinking-binding record there. - An apply whose switch selected the branch and was then superseded by a switch back to the source keeps the branch and reports `APPLIED_INIT_FAILED` with the receipt, as it does for a switch to any other branch. - A preview or an apply asked for while a sharded `addMessage` stores its shards is refused, and makes no branch. - A preview or an apply with a blank `by` is refused. - Content that replaces a message gives up a raw form that its kept blocks share once they stand in another order, and an opaque carrier whose text changed gives up its item. - `editSummaryText` writes the carriers before the summary, so a write that fails leaves the summary as it was, and the same edit can be asked for again. It refuses an edit of a summary that the stored summaries no longer hold. - The recall answer's price follows who edited the text, and a stored `by` that isn't a string names no one in the envelope. - `BRANCH_LEFT` tells the caller to switch the store off a branch it is on before deleting it, and doesn't repeat a failure listed beside it. A tool-pair refusal doesn't advise changing a message in a merged slot. The spawned child of the stopped-process test has a time limit, so the suite can't wait on it forever.
The readback compared summary ids and the rows of the manager's own slot. It now compares the whole record, every slot the manager merges: each row's content, participant and metadata, where an edited row's metadata is its old metadata with the edit's stamp. Each kept summary must render as it did, by its text and response blocks, and each edited summary and carrier must name the editor in `external`. Values are compared as the store gives them back (`storedJson`), so a lone surrogate half in a stamp doesn't refuse a valid apply. A new entry that carries (`carriedFrom`) a summary the branch holds, and renders what it renders, is allowed: a drop's or a let-go's merge check can write one under `carryStrandedSummaries`. The plan placed a change by the rows of the manager's own slot. A summary can fold a merged slot's rows beside its own, so the first changed row and the thinking-binding reach are now read from the record. The switch's failure handler deleted the built branch whenever the store was on the source afterwards. A switch that selected the branch and was then superseded by one back to the source looks the same, though the mutation is applied. The branch generation (`observeStoreBranch`) tells the two apart: the handler deletes the branch only when the generation didn't move. The preview and the apply now refuse while a sharded `addMessage` stores its shards, as `fork`, `derive` and `branchAt` do: the branch would hold only the shards stored so far. Each reader of an apply is checked the same way. Both refuse a blank `by`, which an edit records and an envelope shows. `releaseReplacedRawForms` kept the raw forms of kept blocks in any order, and a raw form that they share replays the old order. Kept blocks out of the old order are now moved blocks (`releaseSharedRawFormsOnMove`). An opaque carrier whose text changed kept its item, which replayed the old content. A changed block now gives up every raw form. `editSummaryText` wrote the summary first, then its carriers, and changed each in memory before its write. It now writes each carrier first and the summary last, and changes an entry in memory only after its write. A compile reads the text from the summary, so a write that fails leaves the summary that a compile reads as it was, and the same edit can be asked for again. It refuses, before writing, a summary or carrier that the stored summaries no longer hold, where a write would only have logged it. The recall answer's price memo is keyed by `external.by` too, so another instance's edit isn't priced at the old editor's length. The envelope names no one for a stored `by` that isn't a string. `BRANCH_LEFT` tells the caller to switch the store off a branch it is on before deleting it, and its own message doesn't repeat a failure listed beside it. A tool-pair refusal no longer advises changing a message in a merged slot, which the mutation can't target. The docs say where a failure leaves the store: where it was, which is the source branch unless something else moved it (`SOURCE_MOVED`), and that a stopped process leaves the branch it was building. The `external` and `carriedFrom` docs say what this change renders and keeps in step.
These tests pin requirements that a review of the readers round found unmet. The plan's sha256 covers everything the plan reports: each reader's part, where the manager's own window and thinking record change, and each summary that it drops, as the strategy holds it. A summary edited between the plan and the apply then refuses the apply as PLAN_DRIFT, where the apply would have dropped the new text. A plan that drifted is reported as PLAN_DRIFT before the violations of the plan made now. A reader holds a row where its window holds it, before its view filter: a presented row that the filter hides still leaves the reader's window. A reader's thinking reach and KV boundary come from the rows that it sent, so a row that only another resident was shown changes neither. The same holds for the manager's own plan. The apply reconciles and reads back every reader that it is given, and a reader whose share is empty is read back too: a row changed in a slot that only the reader merges refuses the apply. A reader whose strategy keeps no summaries and has no onRetracted hook is reconciled through a PassthroughStrategy. A reader that keeps summaries, or hears rows leave its window, and gives no usable cloneForScratch is refused before anything is written, as are two managers with one strategy namespace. The apply waits for a reader's strategy to let go of the removed rows before it goes on. A legacy reader refuses a removal of rows that it folds, unless the op's policy drops what folds them. A reader that stores the shards of a sharded addMessage refuses the apply. The readback compares each field of a row and of a summary as the store keeps it, so a lone surrogate half doesn't read as a change, and a changed shard index, response block or attribution does. An edited summary must read back as the edit writes it, with no response blocks that the edit didn't keep. A new entry stands only as the strategy's carry of a summary that the branch holds. editSummaryText writes a summary and its carriers in one write. A write that fails leaves both as they were, in memory, in the store and in a compile, and the same edit can be asked for again. The edit is refused where the stored summaries aren't as the strategy holds them: a summary or a carrier gone, or a newer text that another handle wrote. A summary edited again by the same editor, with text of the same length, is priced by its new text. Content that replaces a message keeps a shared raw form, or a reasoning pairing, only where its blocks stand as they stood, with nothing inserted between them. A repeated block is matched by its place. A tool_attempt keeps the rawXml that is its content. A native switch that didn't happen deletes the branch that was built, even where another selection moved the store meanwhile. The error of a switch that a later selection superseded carries the receipt. A preview or an apply with no `by`, a null one or a blank one gets the refusal, not a TypeError. A preview's refusal of a reader names the preview.
The plan's sha256 now covers the whole plan as it reports it, with each summary that it drops as the strategy holds it. Before, it hashed the targets' hashes, the drops by id, and part of each reader's share. A reader's thinking binding or window could then change, or a summary to be dropped could be edited, and the apply would still accept the old sha256. Hashing what the plan reports also removes the separate list of hashed fields. An apply checks PLAN_DRIFT before the violations of the plan that it makes, so a caller whose history changed is told so, and gets the new plan. A reader holds a row where its window holds it, before its view filter (`HistoryState.window`). The filtered view had missed a presented row that the filter hides, and the apply then skipped the reader. A changed message counts toward a window's KV boundary and thinking reach only where that manager's view holds it, since a row that the manager never sent changes nothing that it sent. The apply now reconciles and reads back every reader that it is given, not only those whose share is non-empty, so a change that beforeSwitch makes in a slot that only a reader merges is seen. That puts every reader's strategy on the branch. A strategy that keeps no summaries and has no onRetracted hook has nothing to let go of, so a PassthroughStrategy reconciles its window there: WindowedPassthroughStrategy has no cloneForScratch, and a PassthroughStrategy subclass's throws. A reader whose strategy keeps summaries, or hears rows leave its window, must give a usable cloneForScratch. It is refused at the plan, the preview and the apply, before anything is written. After it takes the removed rows out of a presented reader's window, the apply waits for the strategy calls that this made, since onRetracted is fire and forget and a strategy may let go after an await. The readback compares rows and summaries field by field, as the store keeps them (storedJson), on both sides. A row's content, metadata and every other field (shards, body group, timestamp) must be the source's, or the planned edit's. A kept summary's every field must be the source's. Its `parentId` and `mergedInto` may only lose a pointer to a dropped summary, or point to the strategy's carry of it. An edited summary or carrier must be the source's with the edit's text and tokens, its `external` naming the editor, and no response blocks, provenance or split record. A new entry must be the carry of a summary that the branch holds: one source, one level up, the same memory, and the source marked as merged into it, as the strategy's carry writes it. editSummaryText first refuses where the stored summaries aren't as the strategy holds them (storeWrittenElsewhere), where it had compared ids only and could overwrite a newer entry with a stale one. It then writes the summaries in one write. Writing the carriers first and the summary last had left a durable carrier with the new text over a source with the old one when the second write failed. Where that one write throws, memory takes the new summaries only if the store reads back holding them. releaseReplacedRawForms keeps a shared raw form, or a reasoning pairing, only where its kept blocks stand in the new content as they stood, with nothing between them. Blocks are matched by place. Before, one inversion anywhere released every kept block, a block inserted between two shared parts kept their form, and a repeated block read as moved. A changed or new block gives up its rawXml only where the XML formatter replays it (tool_use, tool_result), so a tool_attempt keeps the XML that is its content. A failed switch deletes the branch that it built exactly when the native switch to it didn't happen, which selectBranch now reports. The branch generation had also moved for another manager's selection, so a switch that never happened could read as applied. A missing or null `by` gets the editor refusal, not a TypeError. A preview's reader refusals name compileMutationPreview. The texts say that the recall price reads `external.by`, that a removal's default for a reader depends on its window mode, that SOURCE_MOVED comes only after the build and its readback pass, and which refusals the preview, the apply and the readers add. Internal comments that weren't contracts went.
These tests pin requirements that a review of the round found unmet. Chronicle selects a branch and then saves the selection, and a failed save leaves the selection in effect. A switch whose save fails, with the branch file made unwritable, is then a switch: the apply's error is APPLIED_INIT_FAILED with the receipt, the store is on the branch that it built, which it keeps, the manager refuses work until it is initialized there, and sync() saves the switch, so a reopened store is on that branch. A switchBranch() whose save fails leaves the store on the branch, says so, and leaves the manager refusing work until setStrategy(). A summary that the plan drops, edited since through another handle, refuses the apply as PLAN_DRIFT, for the manager's own summaries and for a reader's. A plan that has become invalid since, with the same targets, refuses as PLAN_DRIFT too: here a reader stored the result that a removed tool call was missing. An edited row that the edit brings into a view is where that view's KV boundary moves, for the manager and for a reader. The readback refuses a branch where a window differs from its source's other than the plan says: a kept row that left it, one that moved in it, or a row that it didn't hold. Each holds for the manager's window and for a reader's, and each window on the source stays as it was. editSummaryText refuses without writing where reading the stored summaries to compare them fails. A summary write that lands and then throws leaves the strategy holding what the store holds, so asking for the edit again finds the new text.
selectBranch took any error of the native switch for a refusal. Chronicle 0.7.0's switch_branch selects the branch, then checkpoints the selection, and returns the checkpoint's error with the selection still in effect. A switch that the store made could then read as refused: the apply tried to delete the branch that the store was on, and reported BRANCH_LEFT with advice to switch away. Now an error after which the store is on the requested branch is a switch: the manager is invalidated and the branch generation moves, as after any switch, and the call rejects, saying that the switch took effect and that sync() saves it. The apply then reports APPLIED_INIT_FAILED with its receipt. A switchBranch() or fork() whose checkpoint fails had left the manager initialized for the branch that the store left; it now refuses work until setStrategy(). The plan's sha256 takes each summary that it drops as the store holds it (historyMemory's `stored`), where it took the strategy's copy in memory. A summary edited through another handle between the plan and the apply then refuses the apply as PLAN_DRIFT, where the apply dropped it with the newer text unseen. The strategy reads its stored summaries only where another write moved them since it last held them as stored. Each entry is hashed in its stored form, so the copy in memory and the stored one hash alike. The sha256 also covers the plan's validity and its violations, which the plan reports, so a plan that has become invalid since refuses as PLAN_DRIFT, with the plan made now. An edited row counts toward a window's KV boundary where the view holds it before the edit or after it. Each manager's state carries its view filter for that. A row that the edit brings into the view is placed just before the next row of the window that the view holds. Before, an edit that made a hidden row visible moved no boundary, though the next compile sent the row. The readback checks each presented window too, the manager's and each reader's: it must hold the source window's rows, less the removed ones, each at its ordinal, and no other row. A row that beforeSwitch writes is stored, not presented, so it passes. A legacy window is the record, which the record check covers. editSummaryText's check of the stored summaries refuses where reading them fails, where storeWrittenElsewhere answered "not written elsewhere" and the edit's whole-state write could overwrite a newer entry. The let-go's check, which only asks whether to read the summaries again, keeps that answer. The doc no longer says that a failed write leaves the summaries as they were: a write that throws may have landed, and the strategy then holds the new text.
|
This answers the review of Details for agentsHead
Runs at — Paloma-2644 |
|
/review — Paloma-2644 |
|
Automatic context view of What a context view runs and what its checks judge: CHECKS.md. The records of the 79 runs it could compare don't differ between the base and this head. In the files profiled hosts loaded, 1,189 changed source lines that map to code ran in no profiled drive: Parts left out where an arm's stack doesn't bring what they need: 2 runs couldn't be compared; the reasons are below. Usage: the figures of the agents' requests, subagents' included, in the 79 runs are the same in the base and this head: 209,978 tokens sent a request, 72.2% of them read from the cache, 138,488,760 written to it, 3,969,133 output, 24 thinking blocks dropped, USD 0.5588 at list price a priced request and 123 requests with no list price. The figures are the stand-in's model of each provider's published caching and token rules, not a measurement. Two drives of one tree have given the same figures, so a difference between the arms comes from what differs in the code each arm ran. A list price is what each arm's host prices those figures at with its own table (connectome-host's Runs that couldn't be compared (2)This head couldn't be compared at This head couldn't be compared at Upgraded runs beside their fresh twins
A run that writes its own history first, as a fresh twin does, is shown without that history's requests, so its figures are its workload's alone, as the upgraded runs' are. Changed source lines and deletions not seen to run, by file
Held the same in base and head: connectome-host |
|
Automatic review of About these findingsThe findings below came from reading this PR and relevant code; not a holistic understanding of the project's functional intent and its architecture choices. Finding precision is higher for flagging issues than identifying ideal changes/fixes. This review prioritizes recall - minor findings (in particular) may be nits. Before actioning a finding, consider the relevant code from first principles given the functional+architectural intent. In particular, when considering adding machinery/logic, scrutinize whether the incremental value of such pays rent for the complexity it adds to the codebase - kudzu has a direct negative impact on our future ability to work with the codebase. Consider explicitly mentioning which findings you accept/decline (by code-formatted numerical id) and why; this enables future rounds of automated review to take your notes into account. Findings, most severe first:
Minor findings 4 to 38 (of 38)
Raised before, still answered (4)
|
These tests pin requirements that a review of the head found unmet. The apply waits for its own strategy on the branch to let go of the rows that it removes before it goes on, as it already waited for each reader's: a let-go held under the test's control holds the apply, so beforeSwitch runs after it. A let-go that fails on the branch refuses the apply, the store stays on its source, and the built branch is deleted. A strategy that doesn't hear rows leave (no onRetracted) still loses each summary that the plan drops. The readback refuses a removed row that keeps a place in the manager's own window, as it refused one in a reader's. It refuses an edited summary whose `external` holds anything but who made the edit, its note and when, and a new carry where the plan neither drops summaries nor removes rows. The plan's sha256 changes where a summary that it edits has a newer stored form. A preview refuses while a reader stores the shards of a sharded addMessage, as an apply does. A preview names the editor that it was asked with, though the caller changes that object while the preview runs. The receipt's toSequence is the branch's head at the switch, before the manager's own initialization there writes. Where reading the source's head fails after the branch is made, the apply deletes the branch. An invalid plan's error names each violation, and PLAN_DRIFT says that the history, the manifest or the readers changed. A summary write that throws says whether it landed. A summary edit refuses where an entry that carries the summary renders response blocks. Content that replaces a message keeps a raw form that the old content didn't hold. A strategy prices a summary by its text again once it takes up summaries that another handle wrote. Tightened: the reader's let-go test holds the let-go under its control in place of a 20 ms sleep; the checkpoint test makes the branch file unwritable around the create and the delete, saves, and reopens; the replay test shows that the stale form would send the old text; the drop test checks the plan's drops; the one-write test counts the retry's writes; the newer-text case changes the text alone; the carrier refusal is tried with apply too.
The manager that builds the change on the branch now waits for the onRetracted calls that its own removals start, as it waited for a reader's. It also refuses when one of those calls fails. tellRetracted logs a failed call and goes on, as it does for a live manager, so the apply couldn't see one: a strategy that kept its own record of the let-go could miss it, and the apply still switched. A staging manager now records each failure, and the apply refuses before the switch. Each staging manager now makes the plan's drops itself: after a presented window's let-go, it drops each summary that the plan drops and its strategy still holds (dropSummaries). A let-go drops what folds the rows of the window, and only where the strategy hears it, so a legacy strategy with no onRetracted, or a reader whose summary folds a row that its window doesn't hold, kept a planned drop, and the readback refused a valid apply. A legacy strategy was told that the rows left (onRetracted) only to make those drops, so it no longer is. The readback requires exactly the planned state, so the drop can't hide another change. The readback accepts a new carry (a summary's copy a level up, which the strategy's merge check writes) only where the plan drops summaries or removes rows, since a carry comes from one of those. It checks each removed row's ordinal in the manager's own window, as in each reader's. An edited summary's `external` must hold who made the edit, its note and a time, and nothing else. The plan's sha256 covers each summary that it edits, and its carriers, in their stored form, as it covered the summaries that it drops. A preview refuses while a reader stores shards, as an apply does. Preview and apply copy `by` when they check it and write the copy. The receipt's toSequence is read at the switch. The source's head is read inside the cleanup's reach. An invalid plan's error lists each violation, and PLAN_DRIFT names the manifest and the readers beside the history. editSummaryText's write that throws now says that it landed, or that it may have, with the store's error as its cause. RESPONSE_CONTENT_SHADOW counts the response blocks of each entry that carries the summary too, since the edit rewrites those entries as copies. loadPersistedState clears the price memo, since summaries that it takes up from another handle can change text and keep their id and tokens. An edited block that matches no block of the old content loses only the raw forms that the old content held, an opaque carrier's item among them, since a copy of one would replay the old content. A raw form that the old content didn't hold is the caller's and stays. Before, every such block lost its raw forms, so an edit that added or replaced an opaque Responses item left an empty text block in its place. A clone refusal no longer offers a strategy option that a reader can't take; a manager's own scratch says to give one. Docs: tool pairs are read in record order and in the view, editedBy appears where `external.by` isn't blank, the edit event carries content alone, and the new exports are listed. Comments on internals go.
|
This answers the review of Details for agentsHead
Runs at — Paloma-2644 |
|
/review — Paloma-2644 |
|
Automatic context view of What a context view runs and what its checks judge: CHECKS.md. The records of the 79 runs it could compare don't differ between the base and this head. In the files profiled hosts loaded, 1,220 changed source lines that map to code ran in no profiled drive: Parts left out where an arm's stack doesn't bring what they need: 2 runs couldn't be compared; the reasons are below. Usage: the figures of the agents' requests, subagents' included, in the 79 runs are the same in the base and this head: 209,978 tokens sent a request, 72.2% of them read from the cache, 138,488,760 written to it, 3,969,133 output, 24 thinking blocks dropped, USD 0.5588 at list price a priced request and 123 requests with no list price. The figures are the stand-in's model of each provider's published caching and token rules, not a measurement. Two drives of one tree have given the same figures, so a difference between the arms comes from what differs in the code each arm ran. A list price is what each arm's host prices those figures at with its own table (connectome-host's Runs that couldn't be compared (2)This head couldn't be compared at This head couldn't be compared at Upgraded runs beside their fresh twins
A run that writes its own history first, as a fresh twin does, is shown without that history's requests, so its figures are its workload's alone, as the upgraded runs' are. Changed source lines and deletions not seen to run, by file
Held the same in base and head: connectome-host |
|
Automatic review of About these findingsThe findings below came from reading this PR and relevant code; not a holistic understanding of the project's functional intent and its architecture choices. Finding precision is higher for flagging issues than identifying ideal changes/fixes. This review prioritizes recall - minor findings (in particular) may be nits. Before actioning a finding, consider the relevant code from first principles given the functional+architectural intent. In particular, when considering adding machinery/logic, scrutinize whether the incremental value of such pays rent for the complexity it adds to the codebase - kudzu has a direct negative impact on our future ability to work with the codebase. Consider explicitly mentioning which findings you accept/decline (by code-formatted numerical id) and why; this enables future rounds of automated review to take your notes into account. Findings, most severe first:
Minor findings 5 to 35 (of 35)
Raised before, still answered (1)
|
These tests pin requirements that a review of the head found unmet. The plan refuses a manifest whose ops aren't of a known kind, or whose fields haven't their types or allowed values, as MALFORMED_OP naming the op, and plans nothing. It refuses where a strategy's summaries in memory, the manager's or a reader's, aren't the ones the store holds, as STALE_MEMORY naming the reader: summaries written through another handle refuse a plan until the manager is initialized again. Content that replaces a message keeps an item that has an old id and new contents, as the caller's. Rows that an edit brings into the view are placed in window order, whatever the manifest's order. An edited message's planned sha256 is of its content as the store keeps it, a lone surrogate written as U+FFFD. The apply builds and switches to the target branch it was asked for, though the caller changes its options while it runs. A reader whose cloneForScratch gives no strategy is refused when it plans. A let-go that fails on the branch with no reason refuses the apply too. Where a later run of a removal fails, the preview and the apply wait for the let-go that an earlier run started before they delete the branch. A failed read in the switch's own bookkeeping leaves the manager uninitialized, so nothing reads the target through the source's strategy state. The test of a failed create shows that the native create ran, and left its branch in memory, before the cleanup deleted it.
The plan checks the manifest at runtime first. Each op is an object of a known kind, each field has its type, and each policy is one that the kind allows. An op of an unknown kind fell through the plan's switch, so the plan was valid with no targets, and an apply would build and switch to an unchanged branch. A policy was compared against two of its values, and a field was read without a check of its type. Each failure now refuses as MALFORMED_OP, naming the op and the field, and a malformed manifest plans nothing. The plan refuses where a strategy's summaries in memory, the manager's own or a reader's, aren't the ones the store holds (STALE_MEMORY). historyMemory reads the stored summaries only where another write moved them, so this is an identity check. Before, the plan walked the inventory in memory, so where another handle had merged summaries since, the apply's drop on the branch could take a parent that the plan never listed. A changed block that matches no old block loses a raw form only where the old content held that form, compared by value. Compared by `type:id`, an item that kept an old id and had new contents was taken for a stale copy and lost. A removal retracts its rows and waits for the retraction calls in either window mode, since a legacy window's retraction writes nothing. A failed retraction call refuses the apply whatever it fails with, `undefined` included. Where a later run of a removal fails, the preview and the apply wait for the retraction calls that earlier runs started before they delete the branch, so none runs on against a deleted branch. `selectBranch` invalidates the manager before its caller's bookkeeping, as its comment says, so a failed read there leaves the manager uninitialized. The apply keeps the target branch it was given at its start. A reader whose cloneForScratch returns no strategy is refused when it plans. A row that an edit brings into the view is placed among others that enter before the same row by window order. An edited message's planned sha256 is of its content in its stored form. Docs: a removal from a presented window drops what folds it by default; the KV boundary is an estimate that errs early; `editedBy` appears where `external.by` isn't empty; the exported types are named; a write that throws holds the new text only where the read back found it; `droppedResponseBlocks` is the most on one entry; a reader needs a cloneForScratch of its own; a changed copy of an opaque carrier loses its item. The response-block refusal says that the edit drops the blocks.
|
This answers the review of Details for agentsHead
Also in this round: a removal waits for its let-gos in either window mode, since a legacy window's retraction writes nothing. Runs, each on a clean checkout: at — Paloma-2644 |
|
/review — Paloma-2644 |
These tests answer the automatic review of b89d662. An unlisted namespace whose uncompressed chunk record holds a removed row refuses the plan, and one whose record holds an edited row doesn't. A legacy reader hears only the removed rows that it held. An apply goes through where reading the sequence throws once just after the switch. Where a cleanup fails after another plan's refusal, the error names only this plan's BRANCH_LEFT.
These fixes answer the automatic review of b89d662. - The unlisted-reader check counts an uncompressed chunk record that holds a removed row, since the apply would leave that record with ids that no row has. - A legacy reader's onRetracted hears only the removed rows that it held. - onRetracted's contract and AutobiographicalStrategy's doc say that a history mutation calls the hook in legacy mode too, and waits for it, so that a rejection fails the mutation. - The switch's callback can't fail, so a landed switch always moves the branch generation. - A cleanup that fails copies violations only from this plan's own refusal. - Each refusal before the build says that nothing is written, and how to go on. Each refusal after the build says that the apply deletes its branch and doesn't switch. A failed branch creation says so too. - cloneForScratch's doc names the passthrough that stands in for a reader with no summaries and no onRetracted.
|
This answers the automatic review of Details for agentsHead
Runs, each on a clean checkout: At — Paloma-2644 |
Anarchid
left a comment
There was a problem hiding this comment.
Nightly dual review · round R2 at 9dbc7c0 · reviewers: Codex gpt-5.6-sol (xhigh) and Claude claude-opus-5-5, merged and every claim re-verified by the Claude leg · posted by the maintainer's campaign runner. Verdict: CHANGES_REQUESTED (the formal review event is left to the maintainer). Finding ids R2-n are stable; cite them in fix commits.
Reviewed at 9dbc7c0 against main 87cbd1b
Dual review, round R2 · reviewers: Codex gpt-5.6-sol (xhigh) and Claude claude-opus-5-5, merged, with every claim re-checked by the Claude leg. Verdict: CHANGES_REQUESTED. Finding ids R2-n are stable; cite them in fix commits.
Verdict: changes requested (0 blockers, 1 major, 2 minors, 2 nits)
The history-mutation work itself is in good shape. All six R1 findings are fixed. The two R1 repros now fail closed at plan time, and the unlisted-reader check finds a resident even when its manager isn't open in the process. On a live store, the plan and the preview are safe to run beside a running agent. The apply is safe once the host has stopped the agents' turns, and it can be undone: the source branch is untouched, and switching back restores every state byte for byte (details below). What blocks approval at this head is that it isn't the code that will merge. It carries older copies of #506 (editSummaryText) and #507 (selectBranch), and both have moved on since. If this head merged as it is, it would ship a breaking change to a released API with no breaking fragment, plus two editSummaryText defects that #506 has already fixed (R2-1).
One process note. Since R1 the automated review rounds have kept finding should-fix items (5, 9, 8, then 4 at b89d662f), and the head 9dbc7c08 hasn't had an automated round of its own. The change is +6.2k lines. After #506/#507 land and main merges in, please give the merge resolution one more review round, automated or ours.
Round-1 findings
| R1 | Disposition | Evidence at this head |
|---|---|---|
| R1-1 omitted reader not detected | Fixed | unlistedNamespaces (src/context-manager.ts:4807-4830) scans listStates() for <ns>/autobio:summaries, <ns>/autobio:chunks and <ns>/window, and planMutation refuses with UNLISTED_READER (src/history-mutation.ts:704-720). The R1 two-resident repro now refuses with "namespace agents/Bea isn't among the readers, and its summaries L1-0 fold rows the change reaches". A variant where the second resident's manager is never opened refuses the same way, because Chronicle's state_ids() lists persisted registrations (v0.8.0 src/state/manager.rs:2026). ignoreNamespaces works and planSha256 covers it. A strategy that keeps its summaries under other state ids isn't detected; the README and the changelog say so and tell the caller to pass it as a reader. |
| R1-2 tool-pair check ignores the view filter | Fixed | viewAfter (src/history-mutation.ts:645-651) re-runs viewKeeps over the edited window for both the manager and its readers. The window is presented(merged) and the view is filter(window) (src/context-manager.ts:775-804), so the two are built the same way. The R1 repro now refuses at plan time (TOOL_PAIR_SPLIT), with the store on main and no branch left. |
| R1-3 cleanup reads unguarded | Fixed | Each read is guarded (src/context-manager.ts:5116-5145), and every outcome throws HistoryMutationError with BRANCH_LEFT. Pinned by test/history-mutation.test.ts:2469. |
| R1-4 docs silent on what stays in the store | Fixed | The changelog, the README and the preview's doc (src/context-manager.ts:4840-4848) say that the source branch and the log keep the earlier text, that a redaction isn't an erasure, and that a crashed preview leaves preview-mutation/<id>. |
R1-5 HistoryMutationStrategy doc vs type |
Fixed | HistoryMemorySource is split out (src/types/strategy.ts:3331) and exported, and HistoryMutationStrategy extends it. |
R1-6 editedBy on imported memories |
Fixed | Renamed to writtenBy (src/recall-envelope.ts:48). A carrier's envelope now names the writer of the text it renders (attributed, src/strategies/autobiographical.ts:23845). |
Blockers
None.
Major
R2-1. This head carries older copies of #506 and #507, and both have diverged. Merging it as it is ships a breaking change to a released API with no breaking fragment, plus two defects that #506 has fixed. Claude: the divergence and the fragment. Sol: the two defects, which Claude then traced to #506.
editSummaryText was released in 0.29.0 (2026-11-28). At this head it refuses a summary with response blocks unless dropResponseContent is set, where 0.29.0 deleted the blocks without being asked (src/summary-edit.ts:55; the base has no dropResponseContent at all). It also refuses an edit of a carrier, and makes SummaryTextEdit.carriedBy required (src/types/strategy.ts:3285). That last part is a compile break for any strategy that implements ExternalMemoryStrategy. The only breaking fragment for this is changelog.d/506-edit-summary-text.breaking.md, on #506. Beyond that, the copy carried here has two defects that #506 at 8f84f251 has already fixed:
- (a) A dry run skips the stale-store check that the apply makes.
if (!options.apply) return edit;(src/strategies/autobiographical.ts:16050) runs beforestoreWrittenElsewhere(true)(:16051-16053). A UI that dry-runs an edit against summaries that another handle has since rewritten gets a plan back, and then the same edit withapply: truerefuses. #506 runs the check first (its:16064-16067). - (b) A write whose outcome is unknown leaves the strategy serving the old text. Suppose the write throws and the readback throws too. Then
landedisfalse(:16067-16072), memory keeps the old text, and the strategy stays usable. Each later compile renders the pre-edit text while the store may hold the new one. For a redaction, that means the unredacted text goes on being sent, unless the caller acts on the error's advice to re-initialize. #506 treats an unknown outcome as its own case and setsloadedBranchIdentity = null, so the strategy refuses work until it is re-initialized (its:16081-16094). The history-mutation apply itself doesn't hit this: it edits through a staging strategy on the built branch (src/context-manager.ts:5258-5260), and a throw there deletes that branch. So the exposure is the publiceditSummaryText.
selectBranch has diverged as well. #507 at 4db95b3a now throws InitializationSupersededError from inside the failed-native-switch path, names the created branch where the store refuses the selection, and adds a reconciliation check after an unsaved switch. This PR's apply depends on the selected callback that it threads into its own older copy (src/context-manager.ts:2893, used at :5084-5096). That callback decides whether a failed switch deletes the built branch or reports APPLIED_INIT_FAILED. When the two are merged, selected has to sit exactly where the store is known to have moved in #507's version, and that placement is a new piece of code that nobody has reviewed yet.
- Failure scenario. #505 merges first, as the "Merges after #506 and #507" line asks it not to, and 0.30.0 ships. Hosts get a changed
editSummaryTextcontract and a type break with no breaking note, plus the two defects above. #506 and #507 then conflict with main. - Fix. Land #506 and #507 first, merge main, and take their versions of
summary-edit.ts,editSummaryTextandselectBranch. Re-threadselectedinto #507'sselectBranchand keep the apply's tests for a failed or unsaved switch passing on chronicle 0.7 and 0.8. Then ask for a review of the merge resolution. If the order has to change, copy #506's breaking fragment and its two fixes here first.
Minor
R2-2. The writtenBy byte change now reaches released stores, but it is filed under .added. src/recall-envelope.ts:47-48, changelog.d/history-mutation.added.md:154-162. Claude: severity and fragment kind. Both reviewers: the disclosure itself is accurate.
Since 0.29.0, importExternalMemory and editSummaryText have been released, and both stamp external.by. So a 0.29.0 store under recallEnvelope: 'xml' that holds an imported or edited memory will render new bytes on its first compile after upgrading. That costs one cache miss, and the changelog notes that quarantine entries keyed by those requests stop matching. The text is accurate and complete. It just sits in an .added fragment, so readers scanning the release notes for what changed under them won't find it. (This also supersedes R1's verified-fine "release state" item, which was true before 0.29.0 shipped.)
- Fix. Move that bullet into a
history-mutation.changed.mdfragment that opens by naming who it affects: "Hosts withrecallEnvelope: 'xml'and imported or edited memories: …".
R2-3. "Read back from a fresh open" overstates the readback. README.md:118, changelog.d/history-mutation.added.md:61 and :109, and the applyHistoryMutation doc (src/context-manager.ts:4919, :4952). Sol-only; verified.
The readback is a new ContextManager with a cold strategy, built over this.store.view(branch) (src/context-manager.ts:5179-5197). That is the same native store, with its in-memory state and caches. The store isn't closed and reopened, and sync() runs only after the readback (:5064). The check does what it should (a cold strategy load of the branch's logical state), but "fresh open" suggests it also checks what a restart would read, and it doesn't.
- Fix. Say "a new manager with a cold strategy, on a view of the branch". Or, if a durability check is wanted, sync first and open a second handle on the store.
Nit
R2-4. The undo path isn't written down. I checked it on two residents with an apply that dropped a summary. After switchBranch(receipt.sourceBranch) and setStrategy(getStrategy()) on the other resident, all seven states (messages, both residents' summaries, chunk records and windows) hash the same as before the apply. The source head is unmoved by the apply, and only the re-initialization's own writes advance it afterwards. One sentence would settle this for every host author: "To undo, switch to receipt.sourceBranch and re-initialize every other manager; what the agents wrote on the target since stays on the target." It could go in the README and on HistoryMutationReceipt.
R2-5. The options aren't checked at runtime, while the manifest is. src/context-manager.ts:4820 and src/history-mutation.ts:706 test ignore.includes(namespace). From JavaScript, ignoreNamespaces: 'agents' (a string, not an array) does a substring match and silently skips every unlisted agents/* namespace, which bypasses UNLISTED_READER. TypeScript callers can't do this. Given how strictly MALFORMED_OP checks the manifest, an Array.isArray check plus a string check on each ignoreNamespaces and readers entry would make the two match.
Verified fine
- Tests and CI. At head, with a lockfile install (chronicle 0.8.0, membrane 0.9.0, typescript 7.0.2) on Node 22.22.1:
tscis clean, and the full suite runs 4,957 tests, with 4,955 passing, 0 failing and 2 skipped (the chronicle-0.7-only failed-checkpoint cases). All 12 CI checks are green, including the chronicle 0.7.0 and 0.8.0 floor jobs and the macOS jobs. - Plan and preview beside a live agent. The plan reads only: building a
WindowIndexfor an unlisted namespace reads its state and registers nothing (src/window-index.ts:645-653). A preview leaves onlymaininlistBranches(), doesn't movemain's head, and makes no provider call. Staging managers get no membrane (src/context-manager.ts:5186-5197). - The apply on a live store. The apply wrote nothing to the source branch: its head was unchanged after the apply. It made no provider call. After the switch, a resident that hasn't been re-initialized refuses
compileandtick("requires reinitialization for the current branch generation"). ItsaddMessagestill lands, on the new branch, and after re-initialization that row is stored and compiled, so nothing is lost. Sequences are per branch, so the target's records don't skew the source. - Chronicle semantics on both admitted lines. On v0.8.0,
switch_branchsaves before it selects, and a failed checkpoint leaves the source current.delete_branchrestores the branch when its checkpoint fails (src/store.rs:3301-3358).selectBranchat this head tells "not moved" from "moved, unsaved", anddeleteBuiltBranchworks out its message from what the store actually holds, so theBRANCH_LEFTtext is right on both 0.7 and 0.8. - The unlisted check's reach.
KnowledgeStrategyinherits the autobiographical state ids. Message ids are Chronicle record ids (appendToStateJsonWithIdentity,src/message-store.ts:801-811), so a namespace on another slot can't collide with this one's rows. An ignored namespace's states aren't read. - Scratch strategies. The built-in
cloneForScratchinstances don't compress on their own, and they get no membrane.beforeCompile,beforeSwitchand a customcloneForScratchare caller code: their effects outside the store aren't rolled back when the branch is deleted, which is what anyone would expect. - Agent-framework. On main (
0c39d028, 0.36.0), AF admits context-manager^0.29.0and has no history-mutation consumer yet.
Method
Two independent passes, merged after the Claude leg re-checked every claim. Sol (Codex gpt-5.6-sol, reasoning effort xhigh, read-only sandbox, no network) got the head, the R1 review, the PR description, the installed dependencies, Chronicle's tags and agent-framework main. It ran for about 13 minutes and 212 commands (7.75M input tokens, 7.42M of them cached; 36k output tokens). Its sandbox couldn't create stores, so it ran tsc and the pure tests only, and it couldn't check CI or #506/#507. Claude checked out the head, installed from the lockfile, ran tsc and the full suite, and read Chronicle v0.7.0/v0.8.0 and agent-framework main. It fetched the heads of #506 (8f84f251) and #507 (4db95b3a) to compare them, and it ran four small scripts: the two R1 repros at this head, the R1-1 repro with the second resident's manager never opened, and a live-store/undo probe.
- Found by both: every R1 disposition; the apply's semantics on chronicle 0.7 and 0.8; undo through the source branch; the
writtenBydisclosure being accurate. - Sol only: R2-1 (a) and (b), and R2-3. Sol rated (b) major on its own. Here it is folded into R2-1, because #506 already fixes it and the mutation's own path can't reach it.
- Claude only: R2-1's divergence from #506/#507, the missing breaking fragment and the
carriedBytype break; R2-2; R2-4; R2-5; the test and CI runs; the live-store and undo probe; the dormant-resident check. - Not done: a real agent's store, a provider call, and a host-side integration (none exists yet). The merge of #506/#507 into this branch doesn't exist yet, so it is unreviewed.
This test answers R2-5 of the nightly review of 9dbc7c0. From JavaScript, ignoreNamespaces given as a string, or with an entry that isn't a string, and readers given as something other than an array of managers, are refused before anything is written, in the plan, the preview and the apply.
These changes answer R2-2 to R2-5 of the nightly review of 9dbc7c0. - R2-5: the plan, the preview and the apply refuse readers that aren't an array of managers, and ignoreNamespaces that aren't an array of strings, before anything is written. A string given as ignoreNamespaces matched by substring and passed every unlisted namespace that it held. - R2-2: the writtenBy change moves to its own changed fragment, which opens with the hosts that it reaches: hosts with recallEnvelope 'xml' and memories that 0.29.0 imported or edited. - R2-3: the README, the changelog and applyHistoryMutation's doc say that a new manager with a cold strategy reads the branch back, on a view of it, not a fresh open. - R2-4: the README and HistoryMutationReceipt say how to undo an apply: switch the store to the receipt's source branch and re-initialize every other manager.
|
Thank you for round R2. The head is now
Details for agentsCommits: Runs, each on a clean checkout: at — Paloma-2644 |
These tests answer R1-1, R1-4 and R1-5 of the nightly review of 8f84f25. An edit of a merge's sources made while the merge's call is out keeps its text, in memory and in the store, and no merge written from the old text lands. A merge marks the summaries that it holds as merged where their objects were replaced, with the same text, while the call was out. A write that throws after the store took part of it leaves the strategy refusing work. The dry run's apply hint says that its sha256 replaces any given before.
These fixes answer R1-1 and R1-3 to R1-5 of the nightly review of 8f84f25. - R1-1: editSummaryText replaces the summaries that it rewrites, where 0.29.0 changed them in place, and a merge marked the copies that it took when it started. So a merge whose call was out wrote its sources' old text back over an edit. A merge now notes what each source held when it started, and a source whose text or response blocks changed while the call was out overtakes it: its summary isn't written, since it was written from the old text. And a merge marks the summaries that it holds, not the copies that it took. - R1-4: after a write that throws, the read back is compared with the summaries as they were too, and a store that holds neither leaves the strategy refusing work until it is initialized again. - R1-3: the fixed fragment says that a store that 0.29.0 edited keeps its parted carriers until the summary is edited again. - R1-5: the dry run's apply hint says to run the same command with --apply, with its sha256 in place of any given before.
These tests answer R1-1, R1-2 and R1-4 of the nightly review of 4db95b3. Where saving a branch that fork(), branchAt() or derive() created fails and the store keeps the branch, the error names it. A store's failed switch that starts a newer initialization before it throws is reported as superseded, and the newer initialization stands. A write that a read after a failed switch starts is refused. Where moving the branch generation fails after a kept switch, the error says that the selection may not be saved.
These fixes answer R1-1, R1-2 and R1-5 of the nightly review of 4db95b3. - R1-1: selectBranch takes the attempt it compares against before the native switch, and fences the manager across the native call and the reads after a failure, which a store's wrapper can re-enter. A refusal that leaves the store on its branch gives the fence back, and the attempt isn't moved, so work already stamped isn't cancelled. - R1-2: fork(), branchAt() and derive() make their branch through one helper. Where the native call throws and the store holds the branch all the same, as chronicle 0.6 and 0.7 keep a branch whose creation checkpoint fails, the error names it, with the native error as its cause. - R1-5: the doc, a comment and the fragment say that chronicle 0.8 keeps the open store on its branch, rather than that it undoes the selection.
These tests answer R2-1, R2-3 and R2-4 of the nightly review of 16b70e9. Where a store's wrapper finishes a newer initialization before its switch moves the store and throws, the manager refuses work on the branch that nothing initialized it on. A fork() to a branch that exists gives the store's own error, without "was created". The skip reason and a test name say that chronicle 0.8 keeps the open store on its branch.
These fixes answer R2-1, R2-2 and R2-5 of the nightly review of 16b70e9. - R2-1: the manager remembers which branch the store was on when an initialization was marked ready. Where a failed switch finds a newer initialization ready, and the store has since left that branch, the call fences the manager before it reports the supersession. - R2-2: the error for a branch kept unsaved says that once the store can write, sync() saves it or the store's deleteBranch() removes it, and that a store that lost durability saves nothing until it is opened again, which drops the branch. - R2-5: the changelog fragment and the docs of fork(), branchAt() and derive() say that each rejects with an error that names a branch that a failed save left in the store.
Anarchid
left a comment
There was a problem hiding this comment.
Nightly dual review · round R3 at f0b68e7 · reviewers: Codex gpt-5.6-sol (xhigh) and Claude claude-opus-5-5, merged and every claim re-verified by the Claude leg · posted by the maintainer's campaign runner. Verdict: CHANGES_REQUESTED (the formal review event is left to the maintainer). Finding ids R3-n are stable; cite them in fix commits.
Reviewed at f0b68e7 against main 87cbd1b
Dual review, round R3 · reviewers: Codex gpt-5.6-sol (xhigh) and Claude claude-opus-5-5, merged, with every claim re-checked by the Claude leg. Finding ids R3-n are stable; cite them in fix commits.
Verdict: changes requested (0 blockers, 2 majors, 0 minors, 3 nits)
The history-mutation work is ready. R2-2 to R2-5 are fixed. The apply is safe on a live store once the host has stopped the agents' turns, and an undo restores every state byte for byte (details under "Verified fine"). This head still can't merge as it stands, though. R2-1 is open, as agreed, and the gap has grown. #506 and #507 have each gained commits since R2. One of #506's new fixes is for a defect in the editSummaryText this head carries, and that defect makes the carried copy worse than the released 0.29.0, not just older than #506 (R3-1).
Nothing stops this head merging today: GitHub shows it mergeable, and all 12 checks are green. The "Merges after #506 and #507" line in the description is the only guard.
Round-2 findings
| R2 | Disposition | Evidence at this head |
|---|---|---|
| R2-1 older copies of #506 / #507 | Not fixed (waits on #506/#507, as agreed). Wider than at R2 | Both siblings are still open and have moved on. #506 went from 8f84f251 to c1347e5d, adding 24f5e5b5 and c1347e5d ("keep an edit made while a merge's call is out"). #507 went from 4db95b3a to e113750f, with four more commits. This head's types already match #506 (SummaryTextEdit.carriedBy, SummaryTextEditOptions, src/types/strategy.ts:3267-3321). It still lacks #506's three fragments (506-edit-summary-text.{added,breaking,fixed}.md), its stale-store check ahead of the dry-run return (head src/strategies/autobiographical.ts:16050-16053), its handling of a write with an unknown outcome (head :16067-16077), and its in-flight merge guard (R3-1). The selectBranch here is the older one (src/context-manager.ts:2857-2917, selected?.() at :2893). See R2-1 below for what the re-thread has to handle. |
R2-2 writtenBy filed under .added |
Fixed | changelog.d/history-mutation.changed.md:1-11 opens with "Hosts with recallEnvelope: 'xml' and imported or edited memories:", and the bullet has left .added. changed is one of the kinds that CONTRIBUTING.md:101 allows. |
| R2-3 "fresh open" overstates the readback | Fixed in everything that ships | README.md:118, changelog.d/history-mutation.added.md:61-62 and :110-111, and the JSDoc at src/context-manager.ts:4932-4933 and :4966-4967 now say "a new manager with a cold strategy, on a view of the branch". No "fresh open" is left in src/, the README or changelog.d/. The PR description still says it (R3-3). |
| R2-4 undo path not written down | Fixed | README.md:118 and the HistoryMutationReceipt JSDoc (src/history-mutation.ts:1003-1009). Probed at this head (see "Verified fine"): the text is accurate. One wording nit (R3-4). |
| R2-5 options not checked at runtime | Fixed (one residue, R3-2) | readersOf (src/context-manager.ts:4777-4780) and unlistedNamespaces (:4816-4820) run in the plan (:4768), in the preview before createBranch (:4896-4897), and in the apply before createBranch (:5002-5004). Probed: ignoreNamespaces: 'agents', [1], readers: {0: b, length: 1}, [null], [b, b] and [a] each throw on plan. The string forms of both options also throw on preview and apply. listBranches() stays main@122 throughout. The substring bypass is closed. |
The six R1 fixes are all still in place.
Blockers
None.
Major
R2-1 (open, carried from R2). The text and the fix are as in R2. Since R2, the re-thread of selected into #507's selectBranch has become more exact. #507's failed-native-switch path (e113750f:src/context-manager.ts, the initializationAttempt !== before branch) reads now. It then throws InitializationSupersededError before it checks where the store is. If the store has reached the target at that point and selected doesn't fire, the apply takes the switch as not made. It then tries to delete the branch the store is on (src/context-manager.ts:5107-5110). Chronicle refuses that deletion, so the store isn't harmed, but the caller gets BRANCH_LEFT instead of APPLIED_INIT_FAILED with a receipt. Fire selected right after a native switch succeeds, and on the failed path wherever now?.name === name (the superseded branch included). Don't fire it for a same-source refusal or for an unexpected branch. Then re-run the apply's tests of failed, unsaved and superseded switches on chronicle 0.7 and 0.8. Both reviewers: the divergence. Sol: the re-thread rule.
The author can do this now, without waiting on a merge decision. Merge the current heads of #506 and #507 into this branch, so the head becomes the code that will merge. Once they land, the PR diff shrinks back to the mutation alone. Until then, a draft status, or a do-not-merge label, would make the order hold mechanically.
R3-1. The editSummaryText carried here loses an edit to a merge whose model call is out. That is a regression against the released 0.29.0, and #506 fixed it at c1347e5d. src/strategies/autobiographical.ts:16056-16060, :15752-15754, :7582-7586 and :7607-7611. Claude only. Sol noted that this head lacks #506's in-flight merge guard, and read the effect as the stale-L2 case below.
Here is how the edit gets lost. On main, editSummaryText sets entry.content = body in place. At this head it replaces each summary it rewrites with a new object (this.summaries.map(...), :16056-16060). A merge, though, holds the sources objects that it took when it started. After its call returns it runs this.setMergedInto(source, newEntry.id) (:15753) on each of them. setMergedInto sets mergedInto on that stale object and calls writeStoredSummary(entry) (:7582-7586). That writes storedJson(entry), old text and old response blocks included, over every stored copy with that id (:7607-7611). So the merge writes the old text back over the edit, in the store and in memory. #506 fixes it with mergeSourceText plus a text check in mergeOvertakenDuringCall (c1347e5d:src/strategies/autobiographical.ts:2375, :9995), and with setMergedInto(this.summaryById(source.id) ?? source, …) (:15786).
- Reproduced. I ran #506's own new test, "keeps an edit of a merge's source made while the merge's call is out", against this head's source. It fails with
L1-0 keeps its edit in memory: actual 'native memory 0'. With the asserts logged instead of thrown, the three merge sourcesL1-0..L1-2hold their old text in memory and in the store. The other seven L1s keepEDITED …. The same test on main's source keeps all ten edits, in memory and in the store. Only its last assert fails there: the L2 written from the old text lands, which is the 0.29.0 defect that #506 also fixes. #506's two other new tests (summaries replaced while the call is out; a store that reads back as neither the old summaries nor the new) also fail at this head. - Failure scenario. This head merges first and ships. A host redacts an L1 through the public
editSummaryTextwhile a background merge over that L1 is out. The merge returns and restores the unredacted text to the store and the strategy. The next compile sends it, and a restart reads it too. In 0.29.0 the same race keeps the redaction in the L1. Only the new L2 summarizes the old text there. - What it doesn't reach.
applyHistoryMutationis unaffected. It edits through a staging strategy on the built branch, which has no membrane and so no merge in flight. A merge out on the live strategy across an apply is discarded after the switch byisCompressionBranchCurrent(:5724-5733). I probed the compression case directly (see "Verified fine"). - Fix. The fix is part of R2-1's: take #506's
editSummaryText,mergeOvertakenDuringCallandsetMergedIntocall site. If the order has to change, these three hunks ofc1347e5dare the minimum to copy here, with #506's fragments.
Minor
None.
Nit
R3-2. The new shape checks pass sparse arrays. src/context-manager.ts:4777-4780 and :4816-4820. Array.prototype.some and every skip holes. So readers: [, b] or new Array(1) passes the check, then throws a raw TypeError: Cannot read properties of undefined (reading 'store') at :4784 instead of the documented refusal. ignoreNamespaces: new Array(1) is accepted, and [...given] (:4842) hands [undefined] to the plan hash. I probed both. Neither writes anything, and neither bypasses UNLISTED_READER. The fix is to check Array.from(given) (or [...given]) instead of given. Sol-only; verified.
R3-3. The PR description still has two stale claims. It says that the apply "reads that branch back from a fresh open", the wording that R2-3 replaced in the code and docs. Its Chronicle paragraph also says that "createBranch, switchBranch and deleteBranch keep their change in memory when their checkpoint fails". That holds for 0.7 only. On 0.8, the lockfile's version, a failed create is undone (undo_create), a failed switch leaves the old selection, and a failed delete restores the branch (chronicle v0.8.0:src/store.rs:3275-3360). The code already handles both lines; only the prose is stale. Sol-only; verified.
R3-4. The README's new undo sentence breaks the paragraph's flow, and "switch the store" could be read as a native switch. At README.md:118 the undo sentence now sits between "…and only then moves the store to that branch." and "So a failure or a stopped process before that leaves the store where it was…". So "before that" now points to the undo. Move the undo sentence after the stopped-process sentences, or to the end of the paragraph. Also, "switch the store to receipt.sourceBranch and re-initialize every other manager" is right only if the switch goes through a manager's switchBranch. After a native store.switchBranch, the manager that applied is stale as well. It fails closed, refusing work until it is re-initialized. "call switchBranch(receipt.sourceBranch) on the manager that applied it" says it exactly. The same applies to the receipt's JSDoc (src/history-mutation.ts:1005). Claude-only.
Verified fine
- Tests and CI. All 12 checks are green at
f0b68e75, including the chronicle 0.7.0 and 0.8.0 floors and macOS. Locally, with a lockfile install (chronicle 0.8.0, membrane 0.9.0, typescript 7.0.2) on Node 22.22.1,tscis clean and the full suite runs 4,958 tests: 4,956 pass, 0 fail, and 2 are skipped. The two skipped are the tests that need a chronicle that keeps a switch whose checkpoint fails, which is 0.7's behaviour; the 0.7.0 CI floor job runs them. - Plan and preview beside a live agent. A preview leaves only
maininlistBranches(), doesn't movemain's head, and makes no provider call. Staging managers write throughstore.view(branch), and that is a separateJsStoreobject. The branch generation is keyed by the store object (src/branch-generation.ts:11-39), so the preview's writes don't invalidate the live managers. - The apply on a live store. Re-probed at this head with two residents and a redaction that drops a summary. The apply made no provider call, and
main's head was unchanged after it. Nothing awaits between thehistoryState()read (src/context-manager.ts:5003) andcreateBranch(:5025), so the branch forks from exactly the planned state. Nothing awaits between the fence (:5070-5077) and the native switch either. A reader not re-initialized after the switch refusescompileandtick. ItsaddMessagelands on the store's current branch, as after anyswitchBranch, and after re-initialization that row is stored and compiled. - A compression in flight across an apply (new probe). I started an L1 compression whose model call (3 s) held the unredacted row, and ran the apply that redacts that row while the call was out. The call returned after the switch, and its result was discarded: none of the target's summaries came from it. The next compression on the target was of the redacted row. Its request held
REDACTEDand not the old text. So a background summarizer can't carry the old text onto the target. The gate isisCompressionBranchCurrent(src/strategies/autobiographical.ts:5724-5733), which compares the branch name and generation. - Undo. After
switchBranch(receipt.sourceBranch)on the applying manager andsetStrategy(getStrategy())on the other resident, all seven states hash as they did before the apply: messages, both residents' summaries, their chunk records and their windows.main's head moves 122 → 124, from the re-initializations' own writes only. The undo is logical, as the README says. The target branch stays in the registry, its records stay in the log, and a later apply needs a newtargetBranch. - Failure paths. A failure before the switch closes the staging managers and deletes the built branch (
src/context-manager.ts:5080-5085). Once the store has reached the target,selectedstops the deletion and givesAPPLIED_INIT_FAILEDwith the receipt (:5097-5123). Chronicle v0.7 selects before its checkpoint (v0.7.0:src/store.rs:3157-3168). v0.8 checkpoints before it selects, and it restores a branch whose deletion it can't save (v0.8.0:src/store.rs:3297-3358).deleteBuiltBranchworks out its message from what the store holds, so it is right on both. - Reader edge cases. These are refused before any write: the manager itself, a reader named twice, a reader on another store, and two managers with one namespace (
src/context-manager.ts:4782-4786). A reader on another slot of the same store is accepted on purpose, and tests cover it.ignoreNamespacesnaming the manager's own namespace, or a listed reader's, does nothing, because listed namespaces are taken out first (:4821-4833). Ignoring a namespace that does hold the row makes the plan valid, as documented. - Agent-framework.
main(9868e101, 0.36.0) admits context-manager^0.29.0and calls none of the five history-mutation methods yet. So nothing downstream depends on this head.
Method
Two independent passes, merged after the Claude leg re-checked every claim. Sol (Codex gpt-5.6-sol, reasoning effort xhigh, read-only sandbox, no network) got the head, the R1 and R2 reviews, the author's R2 reply, the PR description, the installed dependencies, Chronicle's v0.7.0/v0.8.0 tags, the heads of #506 (c1347e5d) and #507 (e113750f), and agent-framework main. It ran for about 10 minutes and 40 commands (5.08M input tokens, 4.91M of them cached; 25k output tokens, 15k of them reasoning). Its sandbox couldn't create stores, so it ran tsc --noEmit and the pure planner tests only, and it couldn't check CI. Claude checked out the head, installed from the lockfile, built it and ran the full suite, and checked CI and the state of #506/#507. It ran these probes: R2's live-store/undo probe and its omitted-reader repro at this head, an option-shape probe (dense and sparse), a probe of a compression in flight across an apply, and #506's three new external-memory tests against this head's source and main's.
- Found by both: R2-1 still open, and how #506/#507 have diverged; the dispositions of R2-2, R2-3 (shipped text), R2-4 and R2-5; the apply writing nothing to the source branch; undo being logical, through the source branch.
- Sol only: R3-2 and R3-3; the rule for where
selectedmust fire in #507'sselectBranch; a stale manager'saddMessagelanding on the current branch (which Claude's probe confirmed). - Claude only: R3-1 (by running #506's tests against this head and against main); R3-4; the full suite and CI; the in-flight compression probe; the undo re-probe at this head.
- Not done: a real agent's store, a provider call, or a host integration (none exists yet). The merge of #506/#507 into this branch doesn't exist yet, so it is unreviewed.
This answers R2-1 and R3-1 of the nightly review of f0b68e7: this branch now carries the current head of anima-research#506 rather than an earlier copy of it. The merge takes that pull request's summary-edit.ts, editSummaryText, external-memory scripts and tests, and its three changelog fragments. It keeps this branch's summariesFoldingRows and withSummariesAbove in summary-edit.ts, and HistoryMemorySource and HistoryMutationStrategy beside ExternalMemoryStrategy.
This answers R2-1 of the nightly review of f0b68e7 for anima-research#507: this branch now carries that pull request's current selectBranch, fork(), branchAt() and derive(), and its changelog fragment. The apply's selected callback is threaded into that selectBranch as the review asks: it fires once the store is known to be on the asked branch, after the native switch succeeds and after a failed one that left the store there, a superseded one included. It doesn't fire for a refusal that leaves the store on its branch, or for another branch.
This answers R2-1 and R2-2 of the nightly review of c1347e5. The test of an edit made while a merge's call is out now asserts that the edit survives and that the merge lands over the edited sources, which it marks as merged. It no longer asserts that no merge from the old text lands: an L2 is written from the raw rows under its L1s, which the edit leaves as they were.
This answers R2-1 to R2-5 of the nightly review of c1347e5. - R2-1 and R2-2: the check that an edit overtakes a merge compared the sources' own text, which a merge's request doesn't show: an L2 replays the raw rows under its L1s, and an L3 or higher shows its sources' children. So it threw away L2 merges whose input hadn't changed, missed L3 merges whose input had, and left a merge it threw away unqueued, which stalled merging. The check is gone. The merge marks the summaries that the strategy holds, which is what keeps an edit made while its call is out, as in 0.29.0. editSummaryText stays a method for a strategy with no compression in progress, as ExternalMemoryStrategy says. - R2-3: the fixed fragment limits that to an edit through the same strategy. - R2-4: the added fragment says what the dry run prints now. - R2-5: the fragments are rewrapped, and a comment says why the merge marks the held summaries.
This keeps this branch on the current head of anima-research#506, whose round R2 drops the check that an edit overtakes a merge, and keeps the merge's mark of the summaries that the strategy holds.
These tests answer R2-1, R3-1 and R3-2 of the nightly review of f0b68e7, with the editSummaryText fixes and the selectBranch fix merged in. - An apply whose native switch lands and throws, and which a newer selection supersedes during the read after it, says that the mutation is applied, carries its receipt, and keeps its branch. - readers and ignoreNamespaces with a hole are refused. - The copies of the editSummaryText and selectBranch tests that this branch kept from before they moved to their own pull requests are removed: those pull requests' tests, now merged in, cover them.
These fixes answer R2-1, R3-2 and R3-4 of the nightly review of f0b68e7. - R2-1: the merge of the selectBranch fix left a block of this branch's older selectBranch, which threw before the supersession check. It is removed, so selectBranch is that pull request's, with the apply's selected callback. - R3-2: readers and ignoreNamespaces are checked through Array.from, so a hole is refused, not skipped. - R3-4: the README's undo sentence ends its paragraph, and it and the receipt's doc say to call switchBranch(receipt.sourceBranch) on the manager that applied it.
|
Thank you for round R3. I took your suggestion. This branch now merges in the current heads of #506 (
As you asked, an automated review round of the merge resolution follows. Details for agentsCommits: the merges Runs, each on a clean checkout, Node v24.22.3, from the lockfile: at — Paloma-2644 |
|
/review — Paloma-2644 |
|
Automatic context view of What a context view runs and what its checks judge: CHECKS.md. The records of the 79 runs it could compare don't differ between the base and this head. In the files profiled hosts loaded, 1,503 changed source lines that map to code ran in no profiled drive: Parts left out where an arm's stack doesn't bring what they need: 2 runs couldn't be compared; the reasons are below. Usage: the figures of the agents' requests, subagents' included, in the 79 runs are the same in the base and this head: 210,077 tokens sent a request, 72.2% of them read from the cache, 138,500,450 written to it, 3,969,133 output, 24 thinking blocks dropped, USD 0.5588 at list price a priced request and 123 requests with no list price. The figures are the stand-in's model of each provider's published caching and token rules, not a measurement. Two drives of one tree have given the same figures, so a difference between the arms comes from what differs in the code each arm ran. A list price is what each arm's host prices those figures at with its own table (connectome-host's Runs that couldn't be compared (2)This head couldn't be compared at This head couldn't be compared at Upgraded runs beside their fresh twins
A run that writes its own history first, as a fresh twin does, is shown without that history's requests, so its figures are its workload's alone, as the upgraded runs' are. Changed source lines and deletions not seen to run, by file
Held the same in base and head: connectome-host |
|
Automatic review of About these findingsThe findings below came from reading this PR and relevant code; not a holistic understanding of the project's functional intent and its architecture choices. Finding precision is higher for flagging issues than identifying ideal changes/fixes. This review prioritizes recall - minor findings (in particular) may be nits. Before actioning a finding, consider the relevant code from first principles given the functional+architectural intent. In particular, when considering adding machinery/logic, scrutinize whether the incremental value of such pays rent for the complexity it adds to the codebase - kudzu has a direct negative impact on our future ability to work with the codebase. Consider explicitly mentioning which findings you accept/decline (by code-formatted numerical id) and why; this enables future rounds of automated review to take your notes into account. Findings, most severe first:
Raised before, still answered (6)
|
The breaking fragment says that an edit, dry or not, is refused where the stored summaries or chunk records aren't the ones that the strategy holds, which 0.29.0 didn't refuse. The script's header says what the dry run prints now: to run the same command again with --apply and the sha256.
This keeps this branch on the current head of anima-research#506, whose latest commit changes its breaking fragment and the external-memory script header only.
These tests answer the automatic review of 83ada1e. A batch that removes a folded row with drop_covering_summaries and edits a summary under another parent applies in legacy and presented windows, with leave_parents and with drop_parents. The preview and the apply refuse readers and ignoreNamespaces with a hole. The test of a landed, failed and superseded switch asserts that the read after the failure started a newer initialization, and its name says so. The test of a read that threw in the switch callback is removed, since the callback no longer reads.
These fixes answer the automatic review of 83ada1e. - The switch callback only notes that the store reached the target branch, and the receipt's toSequence is the built branch's head, read before the switch. A reentrant selection can no longer put another branch's head in the receipt. - A refusal after the build says that the apply wrote nothing to the source branch, not that the source holds what it held. - carriedMemory's doc is above carriedMemory again. - The changelog says that the mutation waits for each onRetracted it calls, and that a hook that throws or rejects fails it. - The changelog says that the store's own tool-pair check can refuse an edit whose split the record held before the change.
|
This answers the automatic review of Details for agentsHead
Runs, each on a clean checkout: At — Paloma-2644 |
Why. Today a host can change an agent's history: it edits a summary, redacts a message, or removes a tool turn. It writes the store's state directly, without the manager. So it has to apply the manager's rules itself. With this PR, such a change goes through the manager, which checks it. The manager refuses a change that would break the history. It moves the store to the change only after it has read the change back.
The manager can now plan, preview and apply a change to an agent's history. Other agents that read the same rows are brought up to date too.
A checked way to change a history
main): there is no such API. A host writes the store's state directly.planHistoryMutation(manifest)takes ops of three kinds: edit a summary's text, edit a message, and remove messages. A message edit needs alabelthat names who changed it. The plan writes nothing. It returns what the change would do, and each rule that the change would break.compileMutationPreviewcompiles the changed history on a scratch branch.applyHistoryMutationbuilds the change on a new branch and reads that branch back through a new manager with a cold strategy, on a view of the branch. Only then does it switch the store to the branch. If the apply fails before the switch, or its process is killed, the store stays on its source branch, unless something else moved it.Other agents on the same rows
main): residents share one message slot, and each has its own window and summaries. The manager tells a strategy when a row leaves its window. It is never told that a row changed. So when a host edits a row, another resident's summary of it keeps the old text.readers. These are the other managers that read the rows. Each reader gets the same rules as the manager. Before the switch, the apply updates every reader on the new branch and reads each one back. The plan also refuses where the store holds another namespace whose summaries fold a changed row, or whose presented window holds one, and the caller didn't list it.The recall envelope names who wrote a summary's text
main): some summaries hold text from outside the strategy (external). The recall envelope doesn't say who wrote that text.recallEnvelope: 'xml', the envelope carrieswrittenBy, escaped as an attribute value. Summaries stored before this change with anexternalwhosebyisn't empty gain the attribute too. So the first request that renders such a summary after the upgrade sends different bytes.Before you rely on it, note these limits:
historyMemory(). A strategy that keeps no summaries gives empty lists there. A reader that keeps summaries, or hears rows leave its window, also needs a usablecloneForScratch.Merges after #506 and #507. As the review here suggested, the
editSummaryTextfixes and theselectBranchfix are pull requests of their own. This branch merges in their current heads,e3c2c025ande113750f, so that it holds the code that will merge, and it merges them in again when they move. Once they land, main merges in here, and this diff holds the history mutation alone.changelog.d/history-mutation.added.mdandchangelog.d/history-mutation.changed.md. TheeditSummaryTextfixes that this PR carries are feat(external-memory): tighten editSummaryText and rewrite carriers #506's, whose fragments come in when it merges.Credits
Paloma-2644 built the change. Clement-4419 designed it and made its design calls. Martin-4134 read the first design, and Andrew-4443, Ethan-4037 and Clara-3577 read the change and ran it, and Carmen-3611 read the agent-framework side that uses it. Paloma-2644 wrote this description.
Details for agents
Head
26ad6fc7, after84a36783, which mergesmainat87cbd1b355dee26b470e360841c9c0adf24c8d23(0.29.0, which admits chronicle 0.8).Problem
At
4399a068, the manager has no way to change a history that checks the result. A host that edits a summary, edits a message or removes messages writes the store itself. The store checks tool pairs on each write, but nothing checks a batch as a whole before it writes, or reads the result back. A failure partway can leave the store half-changed. Another agent on the same slot isn't brought along: its window and summaries change only through a manager that runs its own strategy, andContextStrategyhas hooks for a row that enters or leaves a window (onPresented,onRetracted), and none for a row that changes.editSummaryText(#500, released in 0.29.0) shows two of the rules that such a host must redo. A compile renders a carrier's carried summary in its place (summaryAnswerProse), so an edit of the carrier never shows. A summary'sresponseContentrenders in place of itscontent, so an edit that kept it would show the old text, and the edit deletes it silently.548b8e33adds tests for this to the base's source, and 5 of the 12 tests inexternal-memory.test.tsfail there.Changes
The first five commits:
548b8e33(tests) and37f38159:editSummaryTextmoves its rules into a pureplanSummaryEdit(src/summary-edit.ts). It refuses a carrier and names the summary carried. It drops response blocks only withdropResponseContent(CLI:--drop-response-content), and refuses a text other thanexpectedPriorSha256. Its token stamp stays the new text's length over three. It rewrites each carrier as the edited summary's copy, and clears the memo of recall-answer prices.SummaryTextEditlists carriers incarriedBy, apart from the mergedparents.04d8ea51: a refactor with no change in behaviour for content without holes.findUnpairedToolBlocks,summariesFoldingRows,withSummariesAboveandtoolPairSplitReasoneach hold a rule that the plan must predict, so the plan and the old caller share one function.6e7a2992(tests) andec501962: the history mutation API.src/history-mutation.tsis pure: the plan (planMutation), the anomalies of a history at rest (historyAnomalies), and the readback (snapshotOf,readBackMismatches).blockAsStored). It drops the raw replay forms (rawItem,rawXml) that the old content held from each block that changes (releaseReplacedRawFormsinsrc/raw-forms.ts), because a formatter replays a raw form in place of the block's fields.expectedAfterSha256(on both edits) refuses the plan (AFTER_SHA_MISMATCH) unless the text or content as written has that sha256, so a caller that approved a preview of the label's placement or of the raw forms dropped gets that content.expandBodyGroups(on a removal) takes the whole body of a listed shard; without it, a removal of part of a body refuses, since a body renders only whole. Two methods serve the same caller.describeMutationTargetgives the sha256 that an op names, of the text or content as the store keeps it, which a caller can't compute from what a compile shows.checkHistoryInvariantslists the anomalies that a history already has, since the plan and the apply refuse only those that the change would introduce.ContextManager.applyHistoryMutationforks the target branch from the head with every state (JsStore.createBranch). A manager on a view of that branch makes the writes, with a fresh strategy (ContextStrategy.cloneForScratch, or the caller's) that gets the live strategy's rendering frontier asderivedoes. AfterbeforeSwitch, a second manager opens the branch cold and reads it back. A fence then checks, with no await before the native switch, that the store is still on the source branch at the head that it forked from, and that the target is still the branch built (by id). Then it syncs and switches.BRANCH_LEFT, which says whether the branch is still there or its deletion isn't saved yet. Where the store moved and the switch then didn't complete, the error isAPPLIED_INIT_FAILED, with the receipt, and the branch stays.compileMutationPreviewmakes the same writes on a scratch branch, compiles withdryRun, and deletes the branch.AutobiographicalStrategygetshistoryMemoryanddropSummaries, whichKnowledgeStrategyinherits. Autobiographical, Knowledge and Passthrough getcloneForScratch.WindowedPassthroughStrategyhas none, so its caller gives a strategy.recallEnvelope: 'xml', the recall envelope writeseditedByfor a summary withexternal.MessageStore.editandContextManager.editMessagetake{ mergeMetadata }, which sets keys of the message's metadata in the same write as its content. An edit kept the metadata as it was, and the apply stampsmetadata.historyMutationon each edited row beside what the row holds, in one write.cdeec6b1(tests) and99dddaf1: readers. The plan takesreaders, the other managers on the store. Each reader's held rows are the rows that its view holds or that its summaries fold. Each reader gets the manager's rules: its summaries over an edited row refuse (FOLDED_ROW_REQUIRES_POLICY, withreaderNamespace) unless the op's policy decides them. Over a removed row they go by the op's policy, or by the reader's window mode (presented: drop; legacy: refuse). A tool pair split in its record or window refuses. The plan reports each reader's held rows, covering summaries, drops, KV boundary and thinking reach (PlannedReader). The apply opens, for each reader, a manager bound to the target branch with a fresh instance of the reader's strategy. That manager drops the reader's summaries over edited rows, takes removed rows out of a presented window (retractRemoved), or tells a legacy strategy that they left. A fresh open then reads the reader back.b218e718(tests) and4e50c5a6: the readback compares the whole record, every merged slot, and each summary. A change is placed by the record's rows, since a summary can fold another slot's rows. The switch handler keeps the built branch where the store reached it, even if a later selection moved the store back to the source. Preview and apply refuse while a shardedaddMessagestores its shards, and refuse a blankby.releaseReplacedRawFormsreleases a raw form whose blocks moved, and a changed opaque carrier gives up its item.editSummaryTextrefuses a summary that the stored summaries no longer hold, and its price memo is keyed byexternal.by.227662e9(tests) and9b86753f:planSha256covers everything that the plan reports, with each summary that it drops as the strategy holds it. An apply checks the plan's branch and sha256 before the new plan's violations, so a drifted plan reads asPLAN_DRIFT.onRetractedis reconciled through aPassthroughStrategy. A reader whose strategy does, and gives no usablecloneForScratch, is refused before anything is written. The apply waits for theonRetractedcalls that a presented reader's removal makes.storedJson). It allows only the changes that a planned op or the strategy makes: a pointer cleared by a drop, the strategy's carry of a summary that the branch holds, and an edit's own fields.editSummaryTextrefuses where the stored summaries aren't as the strategy holds them (storeWrittenElsewhere), and writes the summary and its carriers in one write.releaseReplacedRawFormskeeps a shared raw form, or a reasoning pairing, only where its blocks stand as they stood, with nothing between them, and matches blocks by place. A changed block gives up itsrawXmlonly where the XML formatter replays it, so atool_attemptkeeps the XML that is its content.selectBranchreports it).70f53d1c(tests) and285a6c3a:selectBranchtakes a native switch whose checkpoint fails, with the store on the requested branch, as a switch. It invalidates the manager and moves the branch generation, then rejects, saying that the switch took effect and thatsync()saves it. The apply reports such a switch asAPPLIED_INIT_FAILEDwith the receipt, where it had tried to delete the branch the store was on.switchBranch()andfork()shareselectBranch, so a failed checkpoint no longer leaves their manager initialized for the branch the store left (changelog.d/branch-switch-unsaved.fixed.md).planSha256takes each dropped summary as the store holds it (historyMemory().stored, read only where another write moved the stored summaries), in its stored form, and covers the plan's validity and violations. A summary edited through another handle, or a plan that has become invalid, then refuses asPLAN_DRIFT.HistoryState.viewKeeps).editSummaryTextrefuses where reading the stored summaries to compare them fails. Its doc no longer says that a failed write leaves them as they were: a write that throws may have landed, and the strategy then holds the new text.73b0b802(tests) and4061f256:onRetractedcalls that its own removals start, as it waited for a reader's, and records each one that fails. A failure refuses the apply before the switch.dropSummaries). A let-go drops only what folds the window's rows, and only where the strategy hears it. A legacy strategy is no longer told that the rows left, which served only those drops.externalmust hold who made the edit, its note and a time, and nothing more.planSha256covers each summary that the plan edits, and its carriers, as the store holds them.bywhen they check it. The receipt'stoSequenceis read at the switch. An invalid plan's error lists each violation.editSummaryText's failed write says that it landed or may have.RESPONSE_CONTENT_SHADOWcounts the response blocks of each entry that carries the summary. Taking up summaries that another handle wrote clears the price memo.c79ac495(tests) ande6f83068:MALFORMED_OP, which names the op and the field, and a malformed manifest plans nothing. Before, an op of an unknown kind planned as valid with no targets.STALE_MEMORY). Before, it walked the inventory in memory, so a parent that another handle had merged since could be dropped on the branch without the plan listing it.selectBranchinvalidates the manager before its caller's bookkeeping, so a failure there leaves the manager uninitialized. The apply keeps the target branch that it was given at its start. A reader whosecloneForScratchreturns no strategy is refused when it plans. Rows that an edit brings into the view are placed by window order. An edited message's planned sha256 is of its content as the store keeps it.editedBynames abythat isn't empty, and the changelog names the exported types.16d01cd1(tests) andd934ab29:historyMemory(), the manager's own or a reader's (STRATEGY_UNSUPPORTED). Before, it took such a strategy to keep no summaries.PassthroughStrategyandWindowedPassthroughStrategythemselves keep none, and a reader that shows an empty memory and has noonRetractedis reconciled through a stand-in.STALE_MEMORYcompares the summaries as stored, not the lists' identity. Since the plan refuses where they differ,planSha256reads the strategy's summaries, and no longer the stored ones or the edited summaries.MALFORMED_OPalso refuses a field that an op's kind doesn't take, a field that no manifest has, a hole in the ops, a content block that isn't an object, and content that JSON can't write (a cycle, a BigInt), and names what was given. The plan works on a JSON copy of the ops, so it plans and applies a value as JSON writes it (NaNasnull, aDateas a string), and its sha256 covers that copy. The apply works on thebeforeSwitchand strategy it was given at its start.type:idno longer strips a new item that keeps an old id from a block that matches no old block.APPLIED_INIT_FAILED.selectBranchinvalidates the manager where a failed native switch left the store on another branch.5ed5b512(tests) and5dff5225:dropSummaries()wherever the strategy has it, and refuses a planned drop it can't make.describeMutationTargetandcheckHistoryInvariantsrefuse a strategy with nohistoryMemory(). The manifest check runs on the copy of each op that the plan works on.selectBranchsays that the store moved where a failed native switch left it on another branch, and an unsaved switch's error counts whatever its value.a07ff1e4(tests) andc2c72b1d, for the maintainer's review R1:UNLISTED_READERand names it.ignoreNamespacesleaves a namespace alone, andplanSha256covers it.BRANCH_LEFT.HistoryMemorySourceholdshistoryMemory()alone, andHistoryMutationStrategyextends it.writtenBy.ce6e1dbb(tests) and42cd2d9a:compileMutationPreviewtakesbeforeCompile, which gets the scratch manager after the mutation is built and before the compile. A caller that writes a notice to the agent after an apply can write it there, on the scratch branch. The compile then weighs it, as the first compile after the apply will.d3c7118e(tests) and68b68008, for the automatic review of42cd2d9a: a namespace that the caller didn't list is refused where its presented window holds any row that the change edits or removes, and an ignored namespace's states aren't read. A label goes after the tool results that a message opens with, and first otherwise.HistoryMutationStrategyisHistoryMemorySourcewitheditSummaryTextanddropSummaries. A tool-pair split is an anomaly once in each place where it stands, and malformed content and incomplete bodies are read over the whole record. A preview waits for the let-gos thatbeforeCompilestarts. Where the work on a built branch throws an error that isn't aHistoryMutationError, the preview and the apply say so, that the branch is deleted, and that the source holds what it held.84a36783mergesmain. 0.29.0 folded the fragment that this PR edited for theeditSummaryTextfixes, which #506 now carries with fragments of its own, so the merge drops that edit. On chronicle 0.8, a branch change whose checkpoint fails is undone. The tests of a real failed checkpoint ask the chronicle that they run on which it does, and each runs where it holds.757af2d5(tests) and953c163f, for the automatic review of84a36783: a carrier's recall envelope, and the key of its price memo, take the writer of the summary whose text it renders, since an edit by 0.29.0 can leave a carrier with a stale writer of its own. Each refusal says what to do. The texts say where the label goes, where a preview's compile showsby, that a redaction doesn't find a summary written from a prompt that showed the row, which methods the strategies gain, and which chronicles keep a failed switch.c4afa161(tests) andb89d662f, for the automatic review of953c163f: a removal in a legacy window tells the strategy of the rows that it takes out, as a presented window's removal does, so that no chunk record keeps only ids that no row has.dropSummariesrefuses a stale store. The plan's sha256 covers each edited summary and its carriers as the strategy holds them. Only this mutation's ownHistoryMutationErrorpasses through the built branch's failure unwrapped.b7a02626(tests) and9dbc7c08, for the automatic review ofb89d662f: the unlisted-reader check counts an uncompressed chunk record that holds a removed row. A legacy reader hears only the removed rows that it held.onRetracted's contract names the mutation's call in legacy mode, and that the mutation waits for it. Each refusal says whether anything was written, and what to do.e0bf6a89(test) andf0b68e75, for round R2 of the nightly review: the plan, the preview and the apply checkreadersandignoreNamespacesat runtime (R2-5). ThewrittenBychange has a fragment of its own,history-mutation.changed.md(R2-2). The texts call the readback a new manager with a cold strategy on a view of the branch (R2-3), and say how to undo an apply (R2-4).The merges of the current heads of #506 (
92727ea0,6eff0181) and #507 (62f4a9dd), then5221681c(tests) and83ada1ed, for round R3 of the nightly review: this branch takes those pull requests'summary-edit.ts,editSummaryText, CLI,selectBranch,fork(),branchAt(),derive(), fragments and tests. The apply'sselectedcallback fires where the store is known to be on the target, a superseded switch included (R2-1). The copies of their tests that this branch kept are removed.readersandignoreNamespaceswith a hole are refused (R3-2), and the undo sentence says to callswitchBranch(receipt.sourceBranch)on the manager that applied it (R3-4).The merge
5d3e14f1of #506 ate3c2c025, thene16cf893(tests) and26ad6fc7, for the automatic review of83ada1ed: the switch callback only notes that the store reached the target, and the receipt'stoSequenceis the built branch's head. A refusal after the build says that the apply wrote nothing to the source. A batch that removes a folded row and edits another summary applies in both window modes.What this relies on in Chronicle, read in
src/napi.rsandsrc/store.rsof chronicle ata97d734and in the doc comments ofv0.7.0.view(branch)returns a handle pinned to one branch, whose writes go to that branch.createBranch(name, from)copies the parent's state heads and returns the branch with its id.currentSequence()is the current branch's head.deleteBranchrefuses the current branch. On chronicle 0.6 and 0.7,createBranch,switchBranchanddeleteBranchkeep their change in memory when their checkpoint fails, andswitch_branchselects the branch before it checkpoints, returning the checkpoint's error with the selection in effect (src/store.rs:3162-3168atv0.7.0). On chronicle 0.8, a failed create is undone, a failed switch leaves the old selection, and a failed delete restores the branch (src/store.rs:3275-3360atv0.8.0). The apply'sselectedcallback fires where the store is known to be on the target, after a native switch that succeeded, or one that failed with the store there, a superseded one included. In context-manager,selectBranchcalls the native switch before its first await, so nothing runs between the fence and the switch. A strategy'sonRetractedis fire and forget (tellRetracted), which logs a failure and goes on, so each manager that builds the change keeps the calls that its removals make, awaits them, and records each failure.Tests
Runs on Linux, Node v24.22.3, with
@animalabs/chronicle0.7.0 before the merge ofmainand 0.8.0 after it,@animalabs/membrane0.9.0 andtypescript7.0.2, asnpm lsprinted them for the run atec501962. Each ran on a clean checkout of the commit named, aftertsc -p ., withnode --teston the compiled files.4061f25639db071f56526c4dd451b4d441d6fef9: the whole suite, 247 test files, 4,918 tests, 4,918 pass, 0 fail. tsc is clean.26ad6fc7, on chronicle 0.8.0 (the lockfile): the 105 test files that reach the changed code, 3,049 tests, 3,046 pass, 0 fail, 3 skipped (the tests of a chronicle that keeps a branch change whose checkpoint fails). tsc is clean. The whole suite runs in this PR's CI.26ad6fc7's tree less one changelog line, on chronicle 0.7.0: the five test files of the change with the two branch test files, 276 tests, 274 pass, 0 fail, 2 skipped (the tests of a chronicle that keeps the open store on its branch).83ada1ed, two mutants each fail the test that pins them: one doesn't callselectedon a superseded switch that left the store on the target, and one checksreaderswithoutArray.from.68b68008, before the merge, on chronicle 0.7.0: the 103 test files, 3,019 tests, 3,019 pass, 0 fail.ec501962: the 102 test files that reach the changed code, 2,938 tests, 2,938 pass, 0 fail.548b8e33(its tests with the base's source): 12 tests ofexternal-memory.test.ts, 5 fail. These are the three new tests, and the two existing tests that now pass--drop-response-content.6e7a2992:history-mutation.test.tsandhistory-mutation-plan.test.tsfail to compile (98 tsc errors, the API missing), and the test of the escapededitedByinrecall-envelope.test.tsfails.cdeec6b1,b218e718,227662e9,70f53d1c,73b0b802,c79ac495,16d01cd1,5ed5b512,a07ff1e4,ce6e1dbb,d3c7118e,757af2d5,c4afa161,b7a02626ande0bf6a89, each commit's tests with the source before it: atcdeec6b1,history-mutation.test.tshas 30 tsc errors, the API that it tests being missing, and 7 of its 34 tests fail; atb218e718, 13 of the 146 tests in the five test files of the change fail; at227662e9, 21 of the 131 tests inhistory-mutation.test.ts,history-mutation-plan.test.tsandraw-forms.test.tsfail, with 2 tsc errors (HistoryState.window); at70f53d1c, 8 of the 91 tests inhistory-mutation.test.ts,history-mutation-plan.test.tsandexternal-memory.test.tsfail, and tsc is clean; at73b0b802, 20 of the 183 tests in the five test files of the change fail, and tsc is clean; atc79ac495, 13 of the 192 tests in the five test files fail, with 3 tsc errors (STALE_MEMORYmissing from the code type); at16d01cd1, 14 of the 197 tests in the five test files fail, with 3 tsc errors (HistoryState.hiddenStrategymissing); at5ed5b512, 8 of the 201 tests in the five test files fail, and tsc is clean; ata07ff1e4, 10 of the 206 tests in the five test files fail, with 9 tsc errors (the new exports and options missing); atce6e1dbb, 1 of the 207 tests in the five test files fails, with 4 tsc errors (the new option missing); atd3c7118e, 18 of the 214 tests in the five test files fail, and tsc is clean; at757af2d5, with84a36783's source on chronicle 0.7.0, 4 of the 217 tests fail, 1 is skipped, and tsc is clean; atc4afa161, with953c163f's source on chronicle 0.7.0, 2 of the 219 tests fail, 1 is skipped, and tsc is clean; atb7a02626, withb89d662f's source on chronicle 0.7.0, 4 of the 222 tests fail, and tsc is clean; ate0bf6a89, with9dbc7c08's source on chronicle 0.7.0, its new test fails, and tsc is clean. Each test that fails is new or changed in its commit.history-mutation.test.tsruns the manager on a store of 40 rows, compressed into L1 summaries with response blocks and one L2, and on two residents of one slot with summaries of their own. A Responses replay test formats a request through membrane'sMembrane, aMockAdapterandOpenAIResponsesFormatter, and asserts that the edited text ships and the old text doesn't. A test kills a process with SIGKILL insidebeforeSwitch(test/_harness/apply-then-die.ts), and reopens the store on its source branch with every row and summary as it was.Not verified
beforeSwitch, in the same process. The maintainer's review reads an exclusive file lock that Chronicle takes at open, which would keep a second process out. I didn't read it.retractRemovedElsewhere) on a real resident. The tests support the presented path, which usesretractRemovedand waits for the reader's retraction calls, and the legacy path, which makes the planned drops withdropSummaries. They don't show it equal to a whole branch move in a live host.