Repository navigation
Keep an unsent draft's drawing across a protocol bump that leaves it alone - #3282
Merged
Merged
Conversation
…alone The composer's draft in browser storage carried `leaf-draft/<protocol>`, and a runtime reading a draft at another format keeps its words but drops its drawing. So every protocol bump dropped the drawing of every unsent draft, whatever the bump changed. The draft now carries `$events.draft_since`, the protocol at which its drawing last changed shape, as a `state.Record` carries its `since`. `runtime/protocol.js` exports `DRAFT_FORMAT` generated from it, in place of the `recordFormat(kind)` only the draft used. The protocol baseline holds it beside the records: `protocolSchemas` adds a `draft` record whose schema is the one part of a draft its format guards, the comment record's `drawing` with the `at` placement a draft adds to it, so changing the drawing's shape while `draft_since` stays put fails the build (`record draft.drawing.says: maxLength 500 → 100`), and moving `draft_since` to the current protocol clears it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The composer's draft in browser storage carried
leaf-draft/<protocol>, and a runtime reading a draft at another format keeps its words but drops its drawing, so every protocol bump dropped the drawing of every unsent draft, whatever the bump changed. #3244 fixed the same problem forstate.Records; this does it for the draft.The draft now carries
$events.draft_since(registry.json), the protocol at which its drawing last changed shape.runtime/protocol.jsexportsDRAFT_FORMATgenerated from it, replacing therecordFormat(kind)only the draft used.The protocol baseline (#3263) holds it like a record:
protocolSchemasadds adraftentry whose schema is the part of a draft its format guards, the comment record'sdrawingplus theatplacement a draft adds to it. Changing the drawing's shape whiledraft_sincestays put fails the build (record draft.drawing.says: maxLength 500 → 100); movingdraft_sinceto the current protocol clears it.The draft's
atschema is written incontract-types.mjsbeside a pointer tocapturedinruntime/composing/drawing.js, its writer, since no schema declared it before.