Skip to content

Describe the timeline record, version it, and stop restamping createdAt - #10

Merged
JoeGermuska merged 1 commit into
mainfrom
timeline-record-lexicon
Nov 14, 2026
Merged

JoeGermuska merged 1 commit into
mainfrom
timeline-record-lexicon

Conversation

@JoeGermuska

Copy link
Copy Markdown
Member

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 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.

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'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.

createdAt preserved 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.

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 typecheck and pnpm test:run both 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 createdAt
bug is live in already-published records, and schemaVersion is worth more the
earlier it exists. Two things it does constrain, to be recorded in the Phase 2
plan rather than here:

  • DocMeta now carries four fields that are facts about the owner's published
    record. In Phase 2 that map syncs to every collaborator, so "collaborators sync
    meta but never originate writes to it" becomes an access rule rather than
    just the undo-tracking distinction BOOKKEEPING_ORIGIN draws today.
  • TIMELINE_RECORD_VERSION lives in packages/core, and the collaboration
    service 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

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>
@JoeGermuska
JoeGermuska merged commit 7e06851 into main Nov 14, 2026
1 check passed
@JoeGermuska
JoeGermuska deleted the timeline-record-lexicon branch November 14, 2026 18:26
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