Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .omhu/COMPOST.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ A line named in an open issue's `**Compost:**` line is scheduled; `/implement` d
- 2026-11-20 — Rewriting DESIGN §3.2–§7 and §10; the direct-manipulation interactions they describe do not exist yet — 1 — plan 1 on #107
- 2026-11-20 — The GitHub repository rename; a human settings action whose old URLs redirect — 1 — plan 1 on #107
- 2026-11-20 — Changing "noise" in the diffusion surfaces themselves; strategy labels, glosses and tooltips keep that vocabulary on purpose — 1 — plan 1 on #107
- 2026-11-20 — Click-to-flip, neighbour-jump, interleaving and mixed strategies stay unbuilt and get no implementation issues until Direct manipulation is cultivated; the copy must not promise them — 2 — plan 1 on #107 and #108
- 2026-11-21 — A creative-writing milestone or sentence; it stays an aspiration — 1 — plan 1 on #108
- 2026-11-21 — Re-labelling or closing the old backlog beyond the #110 move; history stays readable — 1 — plan 1 on #108
- 2026-11-23 — The all-neighbours scroll list — issue 2; only nodes the graph already draws are clickable — 1 — plan 1 on #113
- 2026-11-23 — Random flip and one-step diffusion — issue 3; specific jumps draw no RNG — 1 — plan 1 on #113
- 2026-11-23 — Forced jumps to neighbours outside the active candidate set — with issue 2's list — 1 — plan 1 on #113
- 2026-11-23 — Redo, branch trees, named branches — a jump from an earlier row discards the future — 1 — plan 1 on #113
- 2026-11-23 — Per-step strategy/schedule provenance — rows keep no kernel record — 1 — plan 1 on #113
- 2026-11-23 — Clicking trajectory nodes to scrub — the slider does that — 1 — plan 1 on #113
- 2026-11-23 — Mixed strategies — #60 — 1 — plan 1 on #113
- 2026-11-23 — Touch gestures and modifier-key-only actions — click/Enter and visible buttons only — 1 — plan 1 on #113
- 2026-11-23 — The film / random-process mode and the e2e coverage that goes with it; it returns as a separate mode — 1 — plan 1 on #113
- Promoted: click/jump half to #113; mixed-strategies half stays for #60.
8 changes: 5 additions & 3 deletions .omhu/MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ Its test: does the next session — you or an agent — become cheaper?
- **WordNet loader** (`src/lib/wordnet/loader.ts`): validates the manifest and caches the typed sections, including per-edge synset indices, in IndexedDB.
- **WordNet table** (`src/lib/wordnet/table.ts`): resolves a token id or word to a row, its outbound edges with their synsets, and coverage.
- **WordNet strategy** (`src/lib/strategies/wordnet.ts`): walks one relation edge per jump over the decoded table.
- **Hand-walk trail** (`src/lib/engine/hand-walk.ts`): growable $(T+1) \times L$ rows behind the display; one row in, jumps append, branches truncate, undo pops.

## Front door

The app name lives in `src/routes/+layout.svelte` (header and `<title>`) and
`src/routes/+page.svelte` (`<h1>`, intro and button); the opening story lives in
`src/lib/components/AboutPanel.svelte`, `README.md`, `AGENT_CONTEXT.md` and
`DESIGN.md` §1/§8. First load opens on the lexical strategy over GPT-2, and
the trajectory request starts only after "Walk it", so the embedding bundle
is fetched only when an embedding walk is chosen.
`DESIGN.md` §1/§8. First load opens on the lexical strategy over GPT-2 with the
encoded input as one row at $t = 0$; no trajectory is requested. Edit returns
to the text, and the embedding bundle is fetched only when an embedding walk is
chosen.

## WordNet

Expand Down
45 changes: 28 additions & 17 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ _both_ feel invited. That means:
The app has two top-level modes for the same document. They are not separate
pages — the transition is an in-place layout change.

### 3.1 Edit mode (entry)
### 3.1 Edit mode (optional)

- Reached from the **Edit** affordance in Explore; first load opens in Explore
on the one-row timeline.
- A generous, centred text field, preloaded with example text so the app
"just works" on first load.
- A short one-line explanation above it: _"Paste some text, then walk its tokens
Expand All @@ -67,18 +69,24 @@ pages — the transition is an in-place layout change.

### 3.2 Explore mode (the core)

Triggered explicitly by the **"Walk it"** button.
First load opens here with one row: the encoded input at $t = 0$ and no future.
**"Walk it"** returns here from Edit.

- The input field collapses to a slim, single-line summary bar at the top:
the first ~60 chars of the source text plus an **"Edit"** affordance that
returns to Edit mode.
- The **rendered decaying text takes the centre**, large and readable.
- **Click a token, then a neighbour node**, to pin the inspector and append one
row: the chosen token replaces that position and every other cell is copied.
Acting while scrubbed back discards the rows after it and branches from there.
- **Undo** pops the tail row.
- The **timeline** sits directly beneath the text (see §5).
- A compact **status line** (token count, current $t$, changed-this-step
count) sits near the timeline, de-emphasised.
- **Tokenizer and Strategy** remain visible in a quiet control strip (see §6).
- **Schedule** lives in the same quiet strip; **T** is editable next to the
timeline readout; **Seed** is tucked into the Advanced panel.
- **Schedule** lives in the same quiet strip; the jump horizon is the
schedule's $T$ and the total is read-only; **Seed** is tucked into the
Advanced panel.
- Technical panels (schedule plot, diagnostics, per-token distribution) are
**hidden behind an "Advanced" toggle** (see §7).

Expand All @@ -93,9 +101,8 @@ Triggered explicitly by the **"Walk it"** button.
│ │
│ │
├───────────────────────────────────────────────┤
│ ◀ ├────────●────────────────┤ ▶ t = 7/[50] │ ← timeline (T editable)
│ β₇ = 0.004 · ≈ 0.4% eligible (?) │ ← β readout
│ 120 tokens · 4 changed this step │ ← quiet status
│ ◀ ├────────●────────────────┤ ▶ t = 2 / 2 │ ← built-row history
│ 120 tokens · 1 changed this step │ ← quiet status
├───────────────────────────────────────────────┤
│ Tokenizer ▾ Strategy ▾ Schedule ▾ [⚙ Adv] │ ← quiet controls
└───────────────────────────────────────────────┘
Expand Down Expand Up @@ -159,12 +166,17 @@ whether you scrub or step.

## 5. Timeline

The timeline stays a draggable slider (dragging is retained) and gains
supplementary stepping controls:
The timeline is a history scrubber over the rows the reader has built; it never
shows a future that has not been chosen.

- **◀ / ▶ step buttons** flanking the slider (prev/next timestep).
- **Arrow-key stepping** when the slider is focused (←/→ = ∓1 step).
- Current position shown as **`t = 7 / 50`**.
- **◀ / ▶ step buttons** flanking the slider (prev/next built row).
- **Arrow-key stepping** when the slider is focused (←/→ = ∓1 row).
- Current position shown as **`t = 2 / 2`**.
- The slider ranges only over `0..T`; no control moves past either end.
- **Undo** pops the tail row. It is disabled at `T = 0` and while scrubbed
back, rather than yanking $t$ to the tail.
- The total $T$ is read-only here: it is the schedule's horizon (300 by
default), and the row count is the reader's history.

Accessibility: the slider is a native range input or an ARIA slider with proper
`aria-valuenow/min/max` and keyboard support.
Expand All @@ -191,11 +203,10 @@ styled as a subordinate detail.
### 6.2 Schedule (quiet, always visible in Explore)

The schedule picker lives in the same strip as Tokenizer/Strategy, visually
de-emphasised (smaller type, muted colour). The number of timesteps $T$ is
edited directly inside the timeline readout (`t = x / [T]`), where it
directly contextualises the scrub position. The seed and its
"Re-roll" button live in the Advanced panel (§7) — they are reproducibility
details, not exploration controls.
de-emphasised (smaller type, muted colour). The number of timesteps $T$ is the
schedule's horizon; it is shown read-only in the timeline readout and is not
edited there. The seed and its "Re-roll" button live in the Advanced panel
(§7) — they are reproducibility details, not exploration controls.

### 6.3 Display toggle (prose vs. tokens vs. graph)

Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
An in-browser playground for walking tokens through networks of similarity.
Tokenizers cut text into tokens, and a distance function — language-model
embeddings, spelling, shared letters, WordNet relations — places each one among
its neighbours. Scrub the timeline to follow a walk, hover a token to inspect its
local neighbourhood, or open the full graph to see the whole network at once.
its neighbours. Click a token, then one of its neighbours, to walk it one step at
a time; scrub back through the rows you built, hover a token to inspect its local
neighbourhood, or open the full graph to see the whole network at once.
Built with SvelteKit and TypeScript, runs entirely in the browser with zero
server-side compute.

## How it works

Each step moves a token to a neighbour with probability $\beta_t$, and the
schedule controls how $\beta_t$ grows over time. The maths follows the D3PM
framework of Austin et al. (2021): every strategy defines a Markov transition
matrix $Q_t = (1-\beta_t)I + \beta_t R$, sampled one step at a time from the
current text.
Each jump replaces one token with a neighbour you choose, copying every other
token into the next row; acting from an earlier row discards the rows after it.
The strategy decides which neighbours exist and the schedule gives the weights
the inspector reads. The maths follows the D3PM framework of Austin et al.
(2021): every strategy defines a Markov transition matrix
$Q_t = (1-\beta_t)I + \beta_t R$. The walk itself draws no random sample yet.

## Development

Expand Down
44 changes: 44 additions & 0 deletions e2e/embedding-source.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// The embedding source picker must let the user choose GPT-2 while the word
// tokenizer is active, then switch back to GloVe.
import { expect, test } from '@playwright/test';

const TIMEOUT = 120_000;

test('embedding source: GPT-2 wins over the word-tokenizer default', async ({ page }) => {
await page.goto('/');
await expect(page.getByTestId('tokenizer-gpt2')).toHaveAttribute('aria-checked', 'true', {
timeout: TIMEOUT,
});

const strategy = page.getByTestId('strategy-embedding-knn');
await expect(strategy).toBeEnabled({ timeout: TIMEOUT });
await strategy.click();
await expect(strategy).toHaveAttribute('aria-checked', 'true');

// GloVe pairs with the word tokenizer, so selecting it loads that tokenizer.
const glove = page.getByTestId('embedding-source-glove-840b-300d');
const gpt2 = page.getByTestId('embedding-source-gpt2');
await expect(glove).toBeEnabled({ timeout: TIMEOUT });
await glove.click();
await expect(glove).toHaveAttribute('aria-checked', 'true');
await expect(page.getByTestId('tokenizer-words')).toHaveAttribute('aria-checked', 'true', {
timeout: TIMEOUT,
});
await expect(glove).toBeEnabled({ timeout: TIMEOUT });

// A user click on GPT-2 must not be overwritten by the word-tokenizer
// default effect.
await gpt2.click();
await expect(gpt2).toHaveAttribute('aria-checked', 'true');
await expect(page.getByTestId('tokenizer-gpt2')).toHaveAttribute('aria-checked', 'true', {
timeout: TIMEOUT,
});

// Switching back to GloVe still works.
await expect(glove).toBeEnabled({ timeout: TIMEOUT });
await glove.click();
await expect(glove).toHaveAttribute('aria-checked', 'true');
await expect(page.getByTestId('tokenizer-words')).toHaveAttribute('aria-checked', 'true', {
timeout: TIMEOUT,
});
});
167 changes: 0 additions & 167 deletions e2e/fix-prose-view-for-uncased-bert-tokenizer.spec.ts

This file was deleted.

Loading
Loading