Skip to content

Make the rewind scrubber render a subject-neutral timeline document - #741

Merged
xmap merged 1 commit into
mainfrom
status-relay-timeline-document
Aug 29, 2026
Merged

xmap merged 1 commit into
mainfrom
status-relay-timeline-document

Conversation

@xmap

@xmap xmap commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

First step of a larger plan (two modes sharing one viewer: a flowing live window, and rewind reaching any run in the record). This step is frontend-only, no transport change, independently shippable.

The scrubber read a Run-shaped payload directly (history.events, history.observations, five hardcoded Run* event-type strings), so every future lens over a different kind of subject would have meant new frontend branching. It now renders a generic timeline document — a time domain plus marker/series lanes, each marker optionally carrying the state it puts its subject into — so adding a lens later is a server-side change with no frontend work. A small bridge adapter in page.html (runHistoryToTimelineDocument) converts today's unchanged run_history wire payload into that document shape; it's expected to move server-side and disappear once the producer emits documents directly (a later step).

Also fixes, found while reading the code for this

  • The whole --cs-* color palette was defined on a class (.cora-scrubber) that nothing ever applied to the mount root — the scrubber has been rendering unstyled.
  • backToLive() never called the mount's own cleanup, leaking a running requestAnimationFrame loop against detached DOM.
  • scaffold() interpolated a run's name/status into innerHTML unescaped — the one injection hole on an otherwise textContent-only page.

Verification

Driven in a real browser (Playwright) against a fake relay server serving fixture run_history data:

  • Palette now resolves (--cs-line computed correctly, .cora-scrubber class present).
  • XSS payload in a run name renders as escaped text, confirmed no script execution.
  • Folded readout correctly walks active → paused → active → ended across a RunStarted/RunHeld/RunResumed/RunCompleted sequence, with per-lane numeric and categorical readings at the cursor.
  • backToLive mid-playback correctly invokes cleanup.

No Python files touched; infra/status-relay/ sits outside the repo's Python-scoped pre-commit hooks by design (host-layer artifact, stdlib+websockets only). Full CI still runs since pre-push hooks aren't path-scoped.

🤖 Generated with Claude Code

The scrubber read a Run-shaped payload directly (history.events,
history.observations, five hardcoded Run event-type strings), so every
future lens over a different kind of subject would have meant new
frontend branching. It now renders a generic document -- a time domain
plus marker/series lanes, each marker optionally carrying the state it
puts its subject into -- so adding a lens later is a server-side change
with no frontend work. A small bridge adapter in page.html converts
today's unchanged run_history wire payload into that document shape;
it is expected to move server-side and disappear once the producer
emits documents directly.

Also fixes three defects found while reading the code for this: the
whole --cs-* color palette was defined on a class (.cora-scrubber)
that nothing ever applied to the mount root, so the scrubber has been
rendering unstyled; backToLive() never called the mount's own cleanup,
leaking a running requestAnimationFrame loop against detached DOM; and
scaffold() interpolated a run's name/status into innerHTML unescaped,
the one injection hole on an otherwise textContent-only page.

Verified against a real browser (Playwright) driving a fake relay:
palette resolves, XSS payload renders as escaped text, and the folded
readout correctly walks active -> paused -> active -> ended across a
Started/Held/Resumed/Completed sequence with per-lane readings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

@xmap
xmap merged commit 44cdd83 into main Aug 29, 2026
19 checks passed
@xmap
xmap deleted the status-relay-timeline-document branch August 29, 2026 00:19
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