Skip to content

feat(book): enumerate a vocabulary on any grid - #46

Merged
wavekat-eason merged 1 commit into
mainfrom
feat/parameterised-vocabulary-grid
Aug 10, 2026
Merged

feat(book): enumerate a vocabulary on any grid#46
wavekat-eason merged 1 commit into
mainfrom
feat/parameterised-vocabulary-grid

Conversation

@wavekat-eason

Copy link
Copy Markdown
Contributor

The mechanism half of the platform's docs/36. Additive, npm + crates.io
only — no daemon needs this, and no daemon behaviour changes.

Why

required_assets is computed from the BOOK_GRANULARITY_MINS compiled
into each device, not from anything a flow version carries. So a
renderer that only knows its own grid can satisfy only the devices that
happen to agree with it, and narrowing the grid becomes a change that is
safe once the whole fleet has updated — which is not an event that
happens. Installed clients are not ours to move.

The way out is for the renderer to cover the union of every grid
still installed. That needs a way to enumerate a grid this build does
not compile in:

bookVocabularyRefs(node, { granularityMins: 15 })   // TypeScript
vocabulary_refs_on(node, 15)                        // Rust twin

What is deliberately not here

No list of which grids are live. That is a fact about our customers'
machines, not about the format — it changes with no format change, and
baking it in would make every consumer inherit our fleet's history. The
package owns the mechanism; the platform owns the policy
(LIVE_BOOK_GRIDS).

Compatibility

The parameter is optional and defaults to BOOK_GRANULARITY_MINS, so
every existing caller is byte-identical — including the daemon's arming
check, which should keep asking about its own grid, because that is the
question it is actually being asked.

The conformance corpus is untouched and still passes: it pins the
default derivation in both languages, which is exactly the guard that
must not move while this lands.

Tests

Both languages: an explicit grid is walked instead of the build's own;
non-time refs (days, keypad, taken) are unaffected; a finer grid is a
superset of a coarser one — the property the union rests on. TypeScript
throws on a non-positive or fractional grid; Rust returns empty for a
zero step, where the failure would otherwise be a hung device rather
than a wrong answer.

Draft until the platform side is reviewed — merging this releases
@wavekat/flow-schema and the crate, and there is no reason to publish
a mechanism before the caller that needs it exists.

🤖 Generated with Claude Code

https://claude.ai/code/session_018stjkZJ4kxDViq1ENnVDmH

`required_assets` is computed from the grid compiled into each device,
so a renderer that knows only its own can serve only devices that agree
— which makes narrowing wait on the whole fleet updating, an event that
does not occur.

Adds an explicit grid to both twins (`bookVocabularyRefs(node, {
granularityMins })`, `vocabulary_refs_on`) so a renderer can cover the
union of every grid still installed and stop being pinned to its oldest
device's opinion. Defaults are untouched: every existing caller,
including the arming check itself, gets exactly what it got before.

See the platform's docs/36.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018stjkZJ4kxDViq1ENnVDmH
@wavekat-eason
wavekat-eason marked this pull request as ready for review August 10, 2026 09:31
@wavekat-eason
wavekat-eason merged commit 2eaf65a into main Aug 10, 2026
3 checks passed
@wavekat-eason
wavekat-eason deleted the feat/parameterised-vocabulary-grid branch August 10, 2026 09:31
@github-actions github-actions Bot mentioned this pull request Aug 10, 2026
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