Repository navigation
Describe the timeline record, version it, and stop restamping createdAt - #10
Merged
Merged
Conversation
Two changes taken now because both get more expensive the more records exist in other people's repos, and that number only grows. Adds lexicons/com.knightlab.timeline.json, written from the core types and what publishTimeline actually emits rather than from the design docs. It validates, and a trimmed copy of the demo timeline record validates against it. It stays a repo artifact rather than a published lexicon: nothing resolves it today, and publishing invites PDS-side validation of a schema still expected to gain a contributors field in Phase 4. Stamps schemaVersion on the record, from core's new TIMELINE_RECORD_VERSION. Distinct from the authoring app's draft SCHEMA_VERSION, which versions the Yjs document — different artifact, different reasons to change. Additive, so there is no deadline, but its value is entirely in being present early: a record written without it can afterwards only be identified by guessing at its shape. Preserves createdAt across republishes. Every publish restamped it with the current time, so a field named for when a timeline was created in fact said when it was last written — in public data, where anything reading the repo would believe it. The value now rides in DocMeta beside atUri and baseCid, and is cleared with the URI for the reason the CID already was: a fresh rkey is a different record, and carrying the old creation time onto it would backdate it. The conflict paths learn it once after the fetch, except those re-entering the editor, which carry it through enterEditor because they replace the document the other call would write to. Deliberately not changed, and documented in the lexicon instead: the snake_case/camelCase split, which is a clean TL3-heritage boundary rather than drift and whose field names appear in every TL3 tutorial and spreadsheet; the two title fields at different nesting levels; and the non-TID record key, which sorts by time already. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JoeGermuska
added a commit
that referenced
this pull request
Nov 14, 2026
Both fall out of #10 rather than from the plan, and neither affects Phase 2 directly — they are the places where that work and this one touch. [P28] The Yjs meta map holds four facts about the owner's published record, and createdAt just made it four. Phase 1 never had to say who may write it, having one writer; Phase 2 syncs it to everyone on the socket. So collaborators sync meta and never originate writes to it — [P22] one level down. The mutation sites are already tagged, since doc.svelte.ts draws the same line as BOOKKEEPING_ORIGIN for undo. [P29] TIMELINE_RECORD_VERSION lives in packages/core, and [P25] keeps core out of the service. Phase 2 is fine because the browser publishes, but Phase 3's server-side publish cannot know the version to stamp. It therefore travels with the draft and the publish layer copies it out — coauthoring.md 10.6's "which record shape is a parameter", which this is the first concrete test of. Settled now because the alternative is meeting it at Phase 3 as an argument for importing core "just for one constant". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Two changes taken now because both get more expensive the more records exist
in other people's repos, and that number only grows.
What's here
lexicons/com.knightlab.timeline.json— written from the core types andwhat
publishTimelineactually emits, rather than from the design docs. Itvalidates, and a trimmed copy of the demo timeline record validates against it.
It stays a repo artifact rather than a published lexicon: nothing resolves
it today, and publishing invites PDS-side validation of a schema still expected
to gain a
contributorsfield in Phase 4.schemaVersionon the record, from core's newTIMELINE_RECORD_VERSION.Distinct from the authoring app's draft
SCHEMA_VERSION, which versions the Yjsdocument — different artifact, different reasons to change. Additive, so there's
no deadline, but its value is entirely in being present early: a record written
without it can afterwards only be identified by guessing at its shape.
createdAtpreserved across republishes. Every publish restamped it withthe current time, so a field named for when a timeline was created in fact said
when it was last written — in public data, where anything reading the repo would
believe it. The value now rides in
DocMetabesideatUriandbaseCid, and iscleared with the URI for the reason the CID already was: a fresh rkey is a
different record, and carrying the old creation time onto it would backdate it.
Deliberately not changed
Documented in the lexicon instead: the snake_case/camelCase split, which is a
clean TL3-heritage boundary rather than drift and whose field names appear in
every TL3 tutorial and spreadsheet; the two title fields at different nesting
levels; and the non-TID record key, which sorts by time already.
Testing
pnpm typecheckandpnpm test:runboth exit 0 — 571 tests across core (96),authoring (457) and player (18), no type errors.
Notes for Phase 2
Independent of the Phase 2 work, and worth landing ahead of it: the
createdAtbug is live in already-published records, and
schemaVersionis worth more theearlier it exists. Two things it does constrain, to be recorded in the Phase 2
plan rather than here:
DocMetanow carries four fields that are facts about the owner's publishedrecord. In Phase 2 that map syncs to every collaborator, so "collaborators sync
metabut never originate writes to it" becomes an access rule rather thanjust the undo-tracking distinction
BOOKKEEPING_ORIGINdraws today.TIMELINE_RECORD_VERSIONlives inpackages/core, and the collaborationservice is meant never to import core. Phase 3's server-side publish has to
stamp the version without knowing it — the first concrete test of
coauthoring.md §10.6's "which record shape is a parameter".
🤖 Generated with Claude Code