Skip to content

[M11] Hero live console: memtable towers and WAL tail (M11.4) - #93

Merged
ssoufii merged 2 commits into
mainfrom
auto/m11.4-hero-live-console
Nov 17, 2026
Merged

ssoufii merged 2 commits into
mainfrom
auto/m11.4-hero-live-console

Conversation

@ssoufii

@ssoufii ssoufii commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Turns the hero console into the live instrument section 6 describes: the memtable drawn as skip list towers, the log tail, SSTable tiles, and a compact control that appears only when the engine has a merge to run.

What changed

  • Tower.tsx: the motif at true size. One block per level, bottoms on one line, heights straight from the snapshot. Decorative in the accessibility tree, because the level is already announced in the text beside it.
  • Console.tsx: the three panels now draw the snapshot rather than list it.
    • In memory: one tower per key in key order, with the key, the value and the level under it. A tombstone keeps its tower, loses its colour and says "deleted", so the distinction is not carried by colour alone.
    • Log: the last six records in fixed columns (offset, kind and key, byte length, crc32), with the key the only column that gives way.
    • On disk: one tile per table with its record count as a figure and its key range.
    • The controls are a <form>, so Enter in either field is the put. An empty key is refused before the engine is called, with the reason in a message tied to the input by aria-describedby and aria-invalid, and focus returned to the field. Long keys are clipped with text-overflow and carried whole in title and data-key.
    • The compact button renders only when snapshot.compaction.needs_compaction is true, so the page cannot offer a merge compactOnce would decline.
  • console.spec.ts: ten specs, all reading the page rather than the worker.

Acceptance criteria

  • Key and value inputs and put, get, delete and flush controls, all keyboard operable, Enter in the value field puts.
  • The memtable is drawn as towers, one per key in key order, each tower's height equal to that node's level in the snapshot; tombstones are visibly distinct; values come from the engine.
  • The WAL tail shows the last six records: offset, kind, key, byte length and checksum.
  • Flush turns the memtable into a new SSTable tile with its record count and key range; a compact control appears when the compaction plan is not empty and runs compactOnce.
  • An empty key is rejected with a message tied to the field by aria-describedby; long keys are truncated visually, never in the data.
  • Playwright: three puts give three towers whose heights match the snapshot; get shows the stored value; delete shows a tombstone; flush shows a tile; the whole flow works by keyboard alone.

What ran, and what passed

All of it, locally in this sandbox:

  • pytest: 1244 passed. ruff check src tests and ruff format --check src tests: clean. No Python changed in this story.
  • In web/: npm ci, npm run lint, npm run typecheck, npm run build: clean.
  • npx playwright test: 46 passed across both projects (default and chromium-reduced-motion). Playwright ran locally, not only in CI.

The tower height assertion is not a restatement of the attribute it reads: the test takes each tower's data-level (rendered straight from the snapshot), then measures the drawn stack and checks both the block count and the pixel height against level * --block + (level - 1) * --block-gap. The compact test drives four real flushes until the engine's default policy (four comparable tables to a tier) makes a tier ready, then merges and watches four tiles become one.

The M11.3 house-rules audit is reused here rather than duplicated: it is run again with the empty-key error on screen, since that message is running text the resting page never shows, and again at 390 wide with towers, a log tail and a tile populated, since the house rules at 390 are otherwise only checked on an empty console. Both pass with no violations and no horizontal overflow.

I also drove the console by hand at 1440 (three puts, a flush, two more puts, a delete) and looked at the result: towers with real levels and a greyed tombstone, six log rows with rising offsets and real checksums, and a tile reading 3 records over the right key range.

Decisions taken without asking

  • The towers are --muted, not maroon. Section 3 reserves the maroon family for the stage, the primary button, the active segment, the heading tile and the cta field. A tombstone drops to --surface-3, which is the tone step section 6 asks for, and the word "deleted" under it carries the same meaning without colour.
  • The tower strip scrolls rather than wraps. A wrapped row of towers is no longer one skip list seen from the side.
  • The reset control stays, though this story does not list it: it arrived with M11.2, it is how a visitor starts over, and removing it would take away working behaviour.

No motion was added. The tower build, the flush move and the rest of section 8 are story M11.9.

Closes #82


Generated by Claude Code

Story M11.4. The console reads one snapshot after every call and draws it:
one tower per key in key order, as many blocks tall as the level the skip
list gave that node, with tombstones greyed and labelled; the last six log
records with offset, kind, key, byte length and checksum; and a tile per
table on disk with its record count and key range. The compact control
appears only when the engine's own plan has a tier ready.

The controls are a form, so Enter in either field writes the record and the
whole flow runs from the keyboard. An empty key is refused with a message
tied to the field by aria-describedby, and a long key is clipped on screen
while the full key stays in the page and in the engine.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QWNkuNh5Bysnfo2KrxL9Sp
Reviewing the console at 390 wide showed the four column row squeezing the
key to three characters while the checksum kept 150px. A container query on
the fragment, rather than on the viewport, drops the byte count and the
checksum to a second line once the console is under 460px, so the key keeps
its width. A Playwright assertion at 390 holds it there.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QWNkuNh5Bysnfo2KrxL9Sp

ssoufii commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Screenshot review, and the one change it caused.

CI was green on the first head (182f296), but reviewing the console at 390 wide with real data in it showed the four column log row squeezing the key down to "put u..." while the checksum kept about 150px, which is the wrong column to protect on a phone. Fixed in bde13a4 with a container query on the fragment (not the viewport, since what decides the fit is how wide the console ended up, which depends on the stage as much as on the window): under 460px the byte count and the checksum drop to a second line and the key keeps its width. A Playwright assertion at 390 holds it there. Re-reviewed at 390 after the fix: full keys readable, the tile's key range no longer clipped, towers showing their real levels.

ci-ok is green on bde13a4, with lint, the full pytest matrix and the web job all passing, first time, no re-runs.

As on #92: the web-test-results artifact could not be downloaded here, because the Azure blob host it redirects to is refused by this sandbox's egress policy. The screenshots were reviewed from local runs of the same production build with the same pinned Chromium revision CI uses, at 1440 and 390, both empty and with towers, a log tail and a table tile on screen.


Generated by Claude Code

@ssoufii
ssoufii merged commit 85ea648 into main Nov 17, 2026
9 checks passed
@ssoufii
ssoufii deleted the auto/m11.4-hero-live-console branch November 17, 2026 05: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.

[M11] Hero live console: memtable towers and WAL tail (M11.4)

2 participants