Skip to content

Keep an unsent draft's drawing across a protocol bump that leaves it alone - #3282

Merged
max-sixty merged 2 commits into
mainfrom
draft-since
Oct 20, 2026
Merged

max-sixty merged 2 commits into
mainfrom
draft-since

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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 for state.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.js exports DRAFT_FORMAT generated from it, replacing the recordFormat(kind) only the draft used.

The protocol baseline (#3263) holds it like a record: protocolSchemas adds a draft entry whose schema is the part of a draft its format guards, the comment record's drawing plus the at placement a draft adds to it. Changing the drawing's shape while draft_since stays put fails the build (record draft.drawing.says: maxLength 500 → 100); moving draft_since to the current protocol clears it.

The draft's at schema is written in contract-types.mjs beside a pointer to captured in runtime/composing/drawing.js, its writer, since no schema declared it before.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 20, 2026 00:11
…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]>
@max-sixty
max-sixty merged commit 8516bf1 into main Oct 20, 2026
3 checks passed
@max-sixty
max-sixty deleted the draft-since branch October 20, 2026 07:23
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.

2 participants