Skip to content

fix(tools): editProse merge-patches content instead of overwriting the whole fragment#43

Open
Viscerous wants to merge 1 commit into
tealios:masterfrom
Viscerous:fix/editprose-partial-update
Open

fix(tools): editProse merge-patches content instead of overwriting the whole fragment#43
Viscerous wants to merge 1 commit into
tealios:masterfrom
Viscerous:fix/editprose-partial-update

Conversation

@Viscerous

Copy link
Copy Markdown

editProse was the only write path that overwrote the entire fragment from an up-front bulk read, so it (a) skipped versioning that every other edit records, and (b) could clobber metadata written concurrently by the librarian (e.g. inline character-mention annotations, running summary).

Switches editProse to updateFragmentVersioned with a content-only patch, which re-reads on write and preserves fields outside the patch, fixing the clobber, adding version history (bulk AI edits are now revertable), and skipping fragments that vanished between read and write rather than resurrecting them.

Test: tests/llm/tools.test.ts (editProse block; the version assertion fails on the old full-object path).

Note: touches the editProse loop, so it conflicts with #42, whichever lands second needs a trivial rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant