Skip to content

Integrate interactive charts, PNG readability and README wordmark - #25

Merged
0xBreadguy merged 21 commits into
mainfrom
t3/implement-agent-authored-spec
Nov 6, 2026
Merged

0xBreadguy merged 21 commits into
mainfrom
t3/implement-agent-authored-spec

Conversation

@0xBreadguy

@0xBreadguy 0xBreadguy commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Agents can now build question-specific interactive charts from the existing read-only queries, using private Muse HTML widgets or Grok Pages. A packaged sleep/recovery explorer and archive-free chart-kit starters share the Workbench brand, query semantics, coverage and provenance rules. PNGs remain available as the portable fallback.

This combines the accepted Muse/Grok branches already in this PR with the separate PNG readability feature and BREAD-approved README wordmark. PNG sleep reports now label nightly totals, show per-night need marks, retain incomplete-stage totals and distinguish missing scores from zero. The merged renderer uses the shared stage palette. The synthetic documentation preview is refreshed; approved historical real-data captures are unchanged. Concurrent source worktrees and the old scratch prototype are preserved.

Validation on final integration revision c81bbef:

  • Locked full offline suite: 221 tests passed.
  • Source/wheel build and installed-wheel smoke checks with and without charts passed.
  • Grok renderer: 324 browser assertions passed; transport: 194 checks passed.
  • Exact Grok/Muse chart-kit starters: 312 browser checks passed, including strict Grok TSX type checking, Chromium/WebKit, light/dark and narrow layouts.
  • MCP Apps and Muse snapshot harnesses: 24 Chromium/WebKit scenarios passed, with 20 and 23 assertions respectively in each host scenario.
  • Four synthetic PNGs inspected; 80 local documentation links/anchors checked; approved wordmark and real-image hashes verified; diff/privacy review passed.

Windows CI exposed two test-only portability assumptions, now corrected: template budgets measure the same normalized UTF-8 text that is exported (the 14.6 KB limit is unchanged), and preserved output paths are checked in the decoded JSON error message. Both affected test files pass locally; explicit CRLF and JSON-escaped-path reproductions pass too. Product files are unchanged by this follow-up, so prior browser/render results remain applicable.

Required three-OS CI must pass for the updated head before merge. Native authoring and host delivery remain experimental and separately bounded by the recorded acceptance evidence; browser stand-ins do not establish arbitrary assistant, physical-device or restart compatibility. No live Garmin request, credentials, schema, scheduler or runtime dependency change. No new release/tag or hosting.

0xBreadguy and others added 20 commits November 5, 2026 17:10
Revise the shared chart renderer so CLI and MCP images answer the question
directly, in both the chat and wide layouts.

Values and dates:
- Label every value when it fits; longer ranges label the latest value and
  extremes, and sparse sleep labels say "latest", "high" or "low".
- Label every date with its weekday on short ranges, and space longer ranges
  evenly. Wide weekly charts no longer skip nights.
- Show the average sleep score beside its panel, using the query's aggregate.

Sleep overview:
- Remove the dashed total line, which repeated the bar tops. Nights without
  usable stages draw a capped "Total only" column; stages are never inferred.
- Draw Garmin need as one tick per night instead of a connected dotted line.
- Hide "Unclassified" from the legend when unused and separate its color
  from Light.

Missing data:
- Move missing-score marks off the 0 line, where they read as a score of zero,
  to a hollow dot under the axis. x stays reserved for a failed refresh.
- Shade unavailable dates, and show status marks only for those dates. Complete
  ranges omit the coverage strip.

Layout:
- Scale long titles and summaries to fit; several summaries printed over the
  coverage figure in the chat layout.
- Reduce the coverage figure, remove the empty top row, cap bar width, align
  plots to the text margin, and add thousands separators with room for 10,000.
- Fix "1 available nights".

Update the sleep and visualization docs, the agent guide and the chart
explanation text, which described the dotted need line. Replace the tests that
pinned the old date and coverage-mark look with checks that both endpoints stay
labeled and only unavailable dates are marked, and add regressions for the
fixes above.

README images are unchanged. assets/grok-sleep-week.png predates this renderer,
and assets/sleep-example.png has not been regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The widget used purple and teal sleep stages, a different stage order and
vocabulary from the PNG charts, and carried no logo. In dark mode Light and
REM were nearly indistinguishable under simulated color blindness.

- Make brand.json the only source of chart colors, with a dark step for each,
  and use it for both PNG and interactive output. Tests reject color literals
  in the UI.
- Match the PNG stage order, names, status glyphs and date wording.
- Rebuild the top panel from the logo: two conversation bubbles joined by a
  white line of unsmoothed sleep data, labeled with its range.
- Add the footer logo signature, period bubbles and zero-based comparison
  bars, and a date slider aligned to the chart columns.
- Separate chart drawing from the selection overlay, so a 14-night drag makes
  56 text updates instead of rebuilding 8,084 chart nodes.
- Select brand colors from the host's actual surface, not the OS theme.

The Unclassified stage moves to slate because its old color was nearly
invisible on white (1.35:1); the README chart is refreshed to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add native TSX export over the shared read-only snapshot, linked explorer views and a synthetic interaction harness. Document passing local checks and the unresolved native source transport boundary.
The Muse Mac app renders widgets with WebKit, as iPhone browsers do, and the
earlier checks only ran in Chromium.

- Style the night picker so it matches its arrow buttons (it rendered at 22px
  beside 41px buttons) and avoid iOS zoom on focus.
- Stop a mouse drag from selecting the surrounding text.
- Ignore late echoes of the widget's own saved state. With a simulated 150ms
  host echo, a left-to-right drag otherwise jumped backward 3-5 times.
- Respond to the slider's change event, which assistive technology may fire
  without input.
- Declare a charset in the browser harnesses, whose literal en dash failed
  when decoded as Latin-1 in WebKit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a mouse, hovering selected a night and saved it, so moving the pointer
across the charts toward a button changed the selection before the click.
Hovering now only previews a night, without saving, until the pointer leaves
the charts. A press or drag selects, and touch behaves as before.

Also record the user's report that the branded widget worked on a physical
phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both hosts now share brand.json for chart colors, stage order and logo, so the
Grok design pass can build on the same tokens instead of a second palette.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The packaged Page was functional but plain. It now follows the branded Muse
widget, with colors and logo applied from brand.json at export.

- Add the logo-derived hero, a scrubber aligned to the chart columns, status
  shapes for gaps, period bubbles and zero-based comparison bars.
- Preview a night on mouse hover; a press, drag, tap or arrow key selects it.
  Selection moves an overlay instead of rebuilding the marks.
- Move Body Battery from a chart lane to the night summary, as in Muse.

The native app repaints colors at runtime and restyles native elements, which no
local check can see. Set the host surface on the root, draw near-white shapes as
SVG, and use plain elements with ARIA roles. See docs/GROK_CHARTS.md.

Grok retypes source and slipped about once per delivery, always in text that
compiled. Check every step against its after_sha256, and ship fix_step.py so a
correction comes from the plan rather than from memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add `chart-kit`, which exports a guide, a small working starter, the
explorer as a read-only reference, and brand assets for Grok or Muse.
Agents choose the layout. Data honesty stays strict: gaps, real zeros,
coverage and provenance.

The guide leads with the question, not with filling in a template. It sets
an ordered color preference and asks agents to run their code and check
their layout by script, because they cannot see the rendered chart.

Starters gain duration formatting, optional tick spacing and lane clipping,
and show missing values as N/A. Series colors reach the kit only, so the
existing explorer's output is unchanged.

Native synthetic trials on Muse (T1 to T4) and Grok (T2) had no wrong
displayed values. T3 first shipped with a script crash, which prompted the
rule to run the code. Light mode, narrow widths and real data are untested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0xBreadguy 0xBreadguy changed the title Add interactive charts that agents build for each question Integrate interactive charts, PNG readability and README wordmark Nov 6, 2026
@0xBreadguy
0xBreadguy merged commit dd67f02 into main Nov 6, 2026
4 checks passed
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