Skip to content

feat(#113): hand-walk the timeline - #116

Merged
Enniwhere merged 13 commits into
mainfrom
113-hand-walk-the-timeline
Nov 24, 2026
Merged

Enniwhere merged 13 commits into
mainfrom
113-hand-walk-the-timeline

Conversation

@Enniwhere

@Enniwhere Enniwhere commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What grew

Explore now opens on one row: the encoded input at t = 0 / 0, ready with no worker compute. Clicking a token pins its inspector; clicking a neighbour node appends exactly one row with every other cell copied, and acting from an earlier row replaces the future. Undo pops the tail, the slider is a history scrubber over 0..T, and the total is read-only. The old film walk, its progress UI, beta readout and e2e coverage are gone.

Try it

  1. npm run dev, then open http://localhost:5173.
  2. Click a token in the prose, then a neighbour node in the inspector.
  3. Scrub back, jump again, and press Undo.
  4. Run npx playwright test to replay the recorded Show.

Recorded run

t=0  The quick brown fox
pin position 1 (quick) -> first neighbour
t=1  Thequick brown fox
pin position 2 (brown) -> first neighbour
t=2  Thequick brow fox
undo t=1  Thequick brown fox
scrub to 0, jump position 2 -> t=1  The quick brow fox

Read first

src/lib/engine/hand-walk.ts — the growable rows and the jump/branch/undo rules; src/routes/+page.svelte wires pinning and the jump.

Noticed

The plan said "three film-era e2e assertions"; retiring the film actually meant three spec files (620 lines), so S4 split into 4a–4e. Slice churn also ran above the plan: 398 vs 160, 271 vs 110, 141 vs 60, and 849 for S4 vs 210. The e2e run also shows a token-level jump can merge words (Thequick) because the chosen neighbour carries no leading space.

Closes #113

Next step: /review 116, then /retrospective 113 after the merge.

Explore now opens with the encoded input as row 0 and no future, ready
without posting a compute request. A growable HandWalk model appends a
chosen token, branches by discarding the future, and undoes the tail; the
slider ranges over built rows and its total is read-only.

Verified with npm run check, lint, prettier --check and vitest (653 tests).

Plan: 1
Slice: 1/4
Kind: behavioral
The inspection graph now focuses one step and draws only that token's
1-hop neighbours, so earlier-step neighbours never appear. Click, Enter or
Space pins the clicked position and time; Escape or the close button
unpins, and the pinned tooltip survives the pointer entering it. Hover
still previews without pinning.

Verified with npm run check, lint, prettier --check and vitest (654 tests).

Plan: 1
Slice: 2/4
Kind: behavioral
Only the focused token's neighbour nodes are pickable. A pick appends one
row from the visible row with every other cell copied, discards any future,
follows the new tail and re-queries the pinned inspector. Undo pops the tail
from the tail row only, and a kernel or spread change re-queries without
touching rows.

Verified with npm run check, lint, prettier --check and vitest (658 tests).

Plan: 1
Slice: 3/4
Kind: behavioral
Add a Playwright spec for the Show: one row at t = 0 / 0, a pinned
inspector, a neighbour jump, a second jump, undo, and a branch from row 0
that replaces the future. Smoke keeps first load and per-strategy rendering
on a one-row timeline; the film-era scrub loop and its tokenizer helper go.

Verified with npm run check, lint, prettier --check, vitest (658 tests) and
npx playwright test e2e/hand-walk.spec.ts.

Plan: 1
Slice: 4a/4
Kind: mechanical
Delete the prose-span and GloVe specs, whose subject was the removed
random walk, and the tiny-bundle fixture only they used. Their t = 0
checks return with the film mode or its own tokenizer coverage.

Verified with npm run check, lint, prettier --check and vitest (658 tests).

Plan: 1
Slice: 4b/4
Kind: mechanical
Delete the word-tokenizer spec, whose cases drive the removed random walk:
noise scrubbing, absorbing masks and the OOV table under scrub. The
one-row timeline has no such states; tokenizer coverage returns with the
film mode or its own issue.

Verified with npm run check, lint, prettier --check and vitest (658 tests).

Plan: 1
Slice: 4c/4
Kind: mechanical
Rewrite the Show and read-only-total prose in README, DESIGN §3–§6,
AboutPanel and the map. Record the plan's Not doing lines in COMPOST, drop
the promoted click/jump line with a Promoted note for #113/#60, delete the
orphaned word-vocab fixture, and bump the version to 1.18.0.

Verified with npm run check, lint, prettier --check, vitest (658 tests) and
npx playwright test (6 passed).

Plan: 1
Slice: 4d/4
Kind: mechanical
The schedule's beta value no longer drives a timeline that has no computed
future, so drop the readout; the schedule picker stays for inspector weights
and later random flips.

Verified with npm run check, lint, prettier --check and vitest (658 tests).

Plan: 1
Slice: 4e/4
Kind: behavioral
@Enniwhere

Copy link
Copy Markdown
Contributor Author

Reviewed commit: 7c09b14

Verdict: approve

Blockers

  • None.

Stewardship notes

  • DESIGN.md:105 still shows the β readout line that 7c09b14 deleted from the page, so the §3.2 layout diagram now describes a control that is not in the hand-walk UI.
  • Pinning at one step and then scrubbing the history slider leaves the inspector focused at the old step: src/routes/+page.svelte:367-372 branches from the current trajectoryStore.t, while src/routes/+page.svelte:641-643 changes t without re-querying or unpinning. A neighbour click after scrubbing can therefore append a row whose token at that position is not the focus token. Unpinning on scrub (or including t in the inspector key) would keep the pinned graph and the branch point aligned.
  • src/lib/engine/hand-walk.test.ts:1-52 covers only hand-picked cases; the repo rule asks for algorithmic code to get a seeded randomized differential test against a naive reference. HandWalk is small, but it owns the branching buffer and is the one new algorithmic piece here.

What could be deleted or simplified

  • DESIGN.md:105 — the stale β-readout line.
  • src/routes/+page.svelte:704-711 — the seed picker's re-roll is inert: trajectoryStore.reroll() (src/lib/stores/trajectory.svelte.ts:140-142) only changes seed, and no request() follows it, so the button does nothing in hand-walk. Hide it with BetaReadout or drop the wiring.

…click

The GloVe default effect both read and wrote embeddingStore.sourceId, so
clicking GPT-2 while the word tokenizer was active re-ran the effect and
wrote GloVe back. Read and write the source inside untrack so the effect
still selects GloVe when the word tokenizer becomes active but a user's
source click no longer re-triggers it.

Verified with npm run check, lint, prettier --check, vitest (658 tests) and
npx playwright test e2e/embedding-source.spec.ts.

Plan: 2
Slice: 1/5
Kind: behavioral
A pinned inspector belonged to the row it was opened on, but scrubbing or
arrowing left it focused at the old step, so a neighbour click could
branch from a row whose token was no longer the focus. Route both the
slider and the arrow keys through setTime, which moves t and unpins.

Verified with npm run check, lint, prettier --check, vitest (658 tests) and
npx playwright test e2e/hand-walk.spec.ts.

Plan: 2
Slice: 2/5
Kind: behavioral
HandWalk owns the branching buffer, so drive 2,000 seeded random jumps
and undos — including out-of-range rows and positions — against a naive
number[][] reference and compare return values, T, rows and tokensAt.
The existing hand-picked cases stay.

Verified with npm run check, lint, prettier --check and vitest (659 tests).

Plan: 2
Slice: 3/5
Kind: mechanical
The hand-walk screen no longer renders a beta value, so the §3.2 layout
diagram should not advertise one. The unused BetaReadout component stays
for the future film mode.

Verified with npm run check, lint, prettier --check and vitest (659 tests).

Plan: 2
Slice: 4/5
Kind: mechanical
The Advanced seed picker's re-roll only changed the store seed and never
posted a request, so it did nothing in hand-walk. Remove the control, its
component, reroll() and the now-unused randomSeed import; keep the seed
field because the trail wrapper and cache key still read it.

Verified with npm run check, lint, prettier --check and vitest (659 tests).

Plan: 2
Slice: 5/5
Kind: mechanical
@Enniwhere

Copy link
Copy Markdown
Contributor Author

What grew

Round 2 answers plan 2: the GloVe default no longer overwrites a GPT-2 source click, scrubbing or arrowing now closes a pinned inspector so the next jump branches from the visible row, and the hand-walk trail has a seeded differential test against a naive reference. The stale β line is gone from the DESIGN sketch, and the inert Advanced seed control, its component and reroll() are deleted. No version bump; the PR still carries 1.18.0.

Try it

  1. npm run dev, select embedding-knn, then GloVe, then GPT-2; the source card and tokenizer stay on GPT-2, and switching back to GloVe still works.
  2. Pin a token, scrub the history slider; the inspector closes. Re-pin and jump.
  3. npm run e2e replays e2e/embedding-source.spec.ts and the updated hand-walk Show.

Read first

src/routes/+page.svelte — the untracked source default, setTime, and the jump wiring.

Noticed

The deleted seed control was already dead in hand-walk: its re-roll changed a seed that no request read, so the button looked live while doing nothing. That is the kind of inert control the hand-walk rewrite is meant to retire, not preserve.

Next step: /review 116, then /retrospective 113 after the merge.

@Enniwhere

Copy link
Copy Markdown
Contributor Author

Reviewed commit: ab00826

Verdict: approve

Blockers

  • None.

Stewardship notes

  • Later (parked): src/lib/stores/tokenizer.svelte.ts:13-14 still drops a selectTokenizer request made while a load is in flight; plan 2 explicitly leaves that race out of scope, and the disabled source/tokenizer pickers keep it off this fix's path.
  • Nit: setTime (src/routes/+page.svelte:380-384) unpins only a pinned inspector, so a non-pinned hover preview stays at its old step when ArrowLeft/ArrowRight moves t; the tooltip renders hover.step (src/routes/+page.svelte:631-639) while the prose shows the new row. Clearing hover on every timeline move would close it.

What could be deleted or simplified

  • e2e/embedding-source.spec.ts:22-43 — the GloVe select/assert sequence is repeated; one helper would remove the copied assertions.
  • src/routes/+page.svelte:380-384 — unpin() unconditionally would clear the stale hover preview and drop the if (pinned) branch.

@Enniwhere
Enniwhere merged commit 9c8575a into main Nov 24, 2026
3 checks passed
@Enniwhere
Enniwhere deleted the 113-hand-walk-the-timeline branch November 24, 2026 11:53
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.

Hand-walk the timeline: click a token, jump to a neighbour, undo

1 participant