Public: anyone can read this; the crew can change it.

The look table drops its old key, and dark looks are filed under their real page #16826

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The look table no longer has its old (appid, env, commitoid, page, kind) key, and dark looks are now filed under their real page with theme dark. Step 1 is in the newest tag, v0.7.675, so the work could start.

Notes

opened this

The look table no longer has its old (app_id, env, commit_oid, page, kind) key, and dark looks are now filed under their real page with theme dark. Step 1 is in the newest tag, v0.7.675, so the work could start. The new tests, test/schema-additive.test.ts, test/schema-migrations.test.ts and bun x tsc --noEmit pass, and gate.ts --explain reads 32 rules with none failing. One test in test/looks.test.ts fails, a real capture through chromium. It fails the same way without my change, and I did not investigate why.

What changed

  • Migration 20261130140000-look-drops-old-key rebuilds look without the old key, keeps look_theme_key, and recreates the three front_epoch_look_* triggers. Every dark: row becomes its real page with theme dark, so dark:narrow:/ becomes narrow:/.
  • Both ways filed: if a dark look exists both as dark:/p and as /p, the newer taking wins.
  • Pin: the migration has its pin, and test/schema-additive.test.ts lists the rebuild in REBUILT with the reason.
  • src/core/looks.ts: recordLook no longer writes the dark: prefix. DARK_PREFIX is kept only in the getLook fallback, with a comment saying it is for rows an older release still writes during the roll. getLook now prefers the plain page over the prefixed one.
  • Tests are in test/look-drops-old-key.test.ts:
    • The migration rewrites dark: rows, including the narrow one.
    • A row filed both ways collapses to the newer one.
    • Light and dark of the same page coexist under one page string.
    • A dark: row written after the migration still reads back as dark.
    • recordLook writes no prefix.

Not done

  • NARROW_PREFIX and the kind CHECK (phone, desktop and thumb only) are untouched, as the issue says.
  • DARK_PREFIX stays until no older release serves.
  • I reused existing code and did not run scripts/similar.ts, since I wrote no new function; the migration follows the table-copy pattern of 20261114010000-machine-sample-hourly.

Try it: bun test test/look-drops-old-key.test.ts test/look-theme-key.test.ts test/schema-additive.test.ts

🤖 Generated with Claude Code

Closes #16797

commented

The look table no longer has its old (app_id, env, commit_oid, page, kind) key, and dark looks are now filed under their real page with theme dark. Step 1 is in the newest tag, v0.7.675, so the work could start. The new tests, test/schema-additive.test.ts, test/schema-migrations.test.ts and bun x tsc --noEmit pass, and gate.ts --explain reads 32 rules with none failing. One test in test/looks.test.ts fails, a real capture through chromium. It fails the same way without my change, and I did not investigate why.

What changed

  • Migration 20261130140000-look-drops-old-key rebuilds look without the old key, keeps look_theme_key, and recreates the three front_epoch_look_* triggers. Every dark: row becomes its real page with theme dark, so dark:narrow:/ becomes narrow:/.
  • Both ways filed: if a dark look exists both as dark:/p and as /p, the newer taking wins.
  • Pin: the migration has its pin, and test/schema-additive.test.ts lists the rebuild in REBUILT with the reason.
  • src/core/looks.ts: recordLook no longer writes the dark: prefix. DARK_PREFIX is kept only in the getLook fallback, with a comment saying it is for rows an older release still writes during the roll. getLook now prefers the plain page over the prefixed one.
  • Tests are in test/look-drops-old-key.test.ts:
    • The migration rewrites dark: rows, including the narrow one.
    • A row filed both ways collapses to the newer one.
    • Light and dark of the same page coexist under one page string.
    • A dark: row written after the migration still reads back as dark.
    • recordLook writes no prefix.

Not done

  • NARROW_PREFIX and the kind CHECK (phone, desktop and thumb only) are untouched, as the issue says.
  • DARK_PREFIX stays until no older release serves.
  • I reused existing code and did not run scripts/similar.ts, since I wrote no new function; the migration follows the table-copy pattern of 20261114010000-machine-sample-hourly.

Try it: bun test test/look-drops-old-key.test.ts test/look-theme-key.test.ts test/schema-additive.test.ts

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs