Skip to content

feat(hud): complete Wave 3 integration for 1-D/2-A/2-D/2-E (Wave 3b)#1488

Merged
JeremyDev87 merged 1 commit into
masterfrom
feat/hud-wave3b-completion
Apr 11, 2026
Merged

feat(hud): complete Wave 3 integration for 1-D/2-A/2-D/2-E (Wave 3b)#1488
JeremyDev87 merged 1 commit into
masterfrom
feat/hud-wave3b-completion

Conversation

@JeremyDev87
Copy link
Copy Markdown
Owner

Summary

Commit bd78195 (Wave 3) wired Wave 2-B velocity and 2-C cache savings into format_status_line but left four sibling Wave modules as dead code: hud_buddy, hud_rainbow, hud_context_bar, and hud_layout. Their unit tests passed, but format_status_line never called them — v5.6.0 shipped with half of the Wave features inert.

This PR closes the gap by hoisting all four modules as top-level imports (matching the existing velocity/cache_savings pattern) and refactoring format_status_line to build (name, priority, text) segments consumed by fit_segments.

Wave 2-A — breathing buddy face

BUDDY_FACE constant → select_face_from_state(hud_state). Face now reflects phase / blockerCount:

State Face
ready / None ◕‿◕ (idle)
planning / evaluating ◔‿◔ (thinking)
executing / cycling ◕◡◕ (active)
blockerCount > 0 ◕︵◕ (error, wins)
lastEvent=victory ◕ᴗ◕ (victory)

Wave 2-D — mode rainbow ANSI coloring (opt-in)

Gated on CODINGBUDDY_HUD_RAINBOW=1 — Claude Code statusLine ANSI support is environment-dependent so default OFF keeps existing terminals clean. Transitively honours NO_COLOR standard. Only real modes (PLAN/ACT/EVAL/AUTO) are colored — the "Ready" fallback stays plain.

Coloring is applied post-fit_segments via string replace on the assembled line1, so ANSI escapes don't break visible_len width accounting during layout.

Wave 2-E — smart context bar

Ctx:{pct}%format_context_bar_segment(stdin_data):

  • [████░░░░░░] 42%
  • [████████▓░] 92%⚠ (warning threshold)

The three existing tests asserting "Ctx:45%" / "Ctx:10%" are updated to match the new [bar] NN% combination.

Wave 1-D — adaptive layout

Final " | ".join(segments)fit_segments(layout_segments, terminal_width()). Low-priority segments drop first on narrow terminals; face_version and mode_health are sacred. shorten_model_label trims "(1M context)" so Opus fits mid-width terminals.

test_full_telemetry gained monkeypatch.setenv("COLUMNS", "300") because its "all segments render" assertion would otherwise flake against the pytest 80-col default.

Test plan

  • 14 new tests across four integration classes:
    • TestWave2ABreathingFaceIntegration (4)
    • TestWave2EContextBarIntegration (3)
    • TestWave2DRainbowIntegration (4)
    • TestWave1DAdaptiveLayoutIntegration (3)
  • 3 existing tests updated for Wave 2-E [bar] NN% format
  • 1 existing test (test_full_telemetry) hardened with COLUMNS=300
  • 1077 passed locally (full plugin test suite)
  • Manual CLI reproductions:
    • Default: ◕‿◕ CB v5.6.0 | Ready 🟢 | ... | [████░░░░░░] 42% | ...
    • 92% context: ... | [████████▓░] 92%⚠ | ...
    • RAINBOW=1 PLAN: ... | \x1b[38;2;64;128;255m◇ PLAN\x1b[0m 🟢 | ...
    • COLUMNS=60: ◕‿◕ CB v5.6.0 | Ready 🔴 | $1.50... | 12m (sacred + cost + duration only)

Relates to

Companion PR: fix/hud-heal-timestamp-leak (Wave 1-B heal timestamp leak).

Target: v5.6.1 hotfix release.

Commit bd78195 ("integrate Wave 2-B/2-C in format_status_line") wired
velocity and cache-savings into the cost segment but left four sibling
Wave modules as dead code: hud_buddy, hud_rainbow, hud_context_bar, and
hud_layout. Their unit tests passed, but format_status_line never
called them — the statusLine rendered with a static buddy face, no
adaptive layout, text-only context percentage, and no mode coloring.

This commit closes that gap by hoisting all four modules as top-level
imports (matching the velocity/cache_savings pattern) and refactoring
format_status_line to build (name, priority, text) segments consumed
by fit_segments.

Wave 2-A — breathing buddy face
  BUDDY_FACE constant → select_face_from_state(hud_state). The face
  now reflects phase/blockerCount:
    ready/None         → ◕‿◕  (idle)
    planning/evaluating → ◔‿◔  (thinking)
    executing/cycling  → ◕◡◕  (active)
    blockerCount > 0   → ◕︵◕ (error, wins over phase)
    lastEvent=victory  → ◕ᴗ◕ (victory, wins over phase)

Wave 2-D — mode rainbow ANSI coloring (opt-in)
  Gated on CODINGBUDDY_HUD_RAINBOW=1 because Claude Code statusLine's
  ANSI support is environment-dependent; default OFF keeps existing
  terminals clean. Transitively honours NO_COLOR
  (https://no-color.org) via hud_rainbow.is_color_enabled. Only real
  modes (PLAN/ACT/EVAL/AUTO) are colored — the "Ready" fallback label
  stays plain so tests and logs don't see it uppercased.

  Coloring is applied POST-fit_segments (string replace on the
  already-assembled line1) so the ANSI escapes don't break
  hud_layout.visible_len width accounting during layout.

Wave 2-E — smart context bar
  "Ctx:{pct}%" segment → format_context_bar_segment(stdin_data),
  rendering e.g. "[████░░░░░░] 42%" or "[████████▓░] 92%⚠" above
  the warning threshold. Legacy "Ctx:" prefix is gone; the three
  existing tests asserting "Ctx:45%"/"Ctx:10%" have been updated to
  check for the new bar + percentage combination.

Wave 1-D — adaptive layout
  Final " | ".join(segments) → fit_segments(layout_segments,
  terminal_width()). Low-priority segments (worktree, rate_limits,
  model, cache, ctx) are dropped first on narrow terminals;
  face_version and mode_health are sacred and always render.
  shorten_model_label trims the "(1M context)" suffix so Opus
  display names fit mid-width terminals without being dropped.

  test_full_telemetry gained monkeypatch.setenv("COLUMNS", "300")
  because its "all segments render" assertion would otherwise flake
  against the pytest 80-col default now that adaptive layout
  actually runs.

Test coverage:
- 14 new tests split across four classes:
    TestWave2ABreathingFaceIntegration (4)
    TestWave2EContextBarIntegration (3)
    TestWave2DRainbowIntegration (4)
    TestWave1DAdaptiveLayoutIntegration (3)
- 3 existing tests updated to match the Wave 2-E "[bar] 45%" format
- 1 existing test (test_full_telemetry) hardened with COLUMNS=300

Local runs: 1077 passed (full plugin test suite). Manual CLI
reproductions confirmed:
  - Default:        ◕‿◕ CB v5.6.0 | Ready 🟢 | ... | [████░░░░░░] 42% | ...
  - 92% context:    ... | [████████▓░] 92%⚠ | ...
  - RAINBOW=1 PLAN: ... | \x1b[38;2;64;128;255m◇ PLAN\x1b[0m 🟢 | ...
  - COLUMNS=60:     ◕‿◕ CB v5.6.0 | Ready 🔴 | $1.50... | 12m  (sacred + cost + duration only)
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Apr 11, 2026 3:38pm

@JeremyDev87 JeremyDev87 added feat plugin packages/claude-code-plugin labels Apr 11, 2026
@JeremyDev87 JeremyDev87 self-assigned this Apr 11, 2026
@JeremyDev87 JeremyDev87 merged commit 64edfac into master Apr 11, 2026
29 checks passed
@JeremyDev87 JeremyDev87 deleted the feat/hud-wave3b-completion branch April 11, 2026 15:44
JeremyDev87 added a commit that referenced this pull request Apr 11, 2026
Bump the workspace version from 5.6.0 to 5.6.1 and publish the CHANGELOG
entry for the HUD hotfix cycle.

v5.6.1 is a hotfix closing the remaining gaps in the v5.6.0 HUD
Statusbar Wave cycle:

- Wave 1-B heal timestamp leak (#1487) — heal_stale_state preserved
  sessionStartTimestamp for "audit / forensics", but resolve_duration
  read the same field as a fallback when stdin lacked
  total_duration_ms. A manual-fix marker + stale timestamp therefore
  rendered enormous durations like 322h52m for brand-new sessions.
  The timestamp is now relocated into _healedFromSessionStartTimestamp.

- Wave 3b — complete Wave 3 integration (#1488) — commit bd78195
  wired Wave 2-B velocity and 2-C cache savings into
  format_status_line but left four sibling Wave modules as dead
  code: hud_buddy, hud_rainbow, hud_context_bar, and hud_layout.
  Their unit tests passed, but format_status_line never called
  them. v5.6.1 hoists all four as top-level imports and refactors
  format_status_line to build (name, priority, text) segments
  consumed by fit_segments, finally delivering the Wave 2-A
  breathing face, Wave 2-D rainbow coloring (opt-in via
  CODINGBUDDY_HUD_RAINBOW=1), Wave 2-E smart context bar, and
  Wave 1-D adaptive layout features that v5.6.0 advertised.

Bump surface:
- apps/mcp-server/package.json, src/shared/version.ts
- packages/rules/package.json
- packages/claude-code-plugin/package.json (+ peerDependencies),
  .claude-plugin/plugin.json, README.md, namespace-manifest.json
- .claude-plugin/marketplace.json
- yarn.lock
- CHANGELOG.md (new [5.6.1] section)
@JeremyDev87 JeremyDev87 mentioned this pull request Apr 11, 2026
7 tasks
JeremyDev87 added a commit that referenced this pull request Apr 11, 2026
Bump the workspace version from 5.6.0 to 5.6.1 and publish the CHANGELOG
entry for the HUD hotfix cycle.

v5.6.1 is a hotfix closing the remaining gaps in the v5.6.0 HUD
Statusbar Wave cycle:

- Wave 1-B heal timestamp leak (#1487) — heal_stale_state preserved
  sessionStartTimestamp for "audit / forensics", but resolve_duration
  read the same field as a fallback when stdin lacked
  total_duration_ms. A manual-fix marker + stale timestamp therefore
  rendered enormous durations like 322h52m for brand-new sessions.
  The timestamp is now relocated into _healedFromSessionStartTimestamp.

- Wave 3b — complete Wave 3 integration (#1488) — commit bd78195
  wired Wave 2-B velocity and 2-C cache savings into
  format_status_line but left four sibling Wave modules as dead
  code: hud_buddy, hud_rainbow, hud_context_bar, and hud_layout.
  Their unit tests passed, but format_status_line never called
  them. v5.6.1 hoists all four as top-level imports and refactors
  format_status_line to build (name, priority, text) segments
  consumed by fit_segments, finally delivering the Wave 2-A
  breathing face, Wave 2-D rainbow coloring (opt-in via
  CODINGBUDDY_HUD_RAINBOW=1), Wave 2-E smart context bar, and
  Wave 1-D adaptive layout features that v5.6.0 advertised.

Bump surface:
- apps/mcp-server/package.json, src/shared/version.ts
- packages/rules/package.json
- packages/claude-code-plugin/package.json (+ peerDependencies),
  .claude-plugin/plugin.json, README.md, namespace-manifest.json
- .claude-plugin/marketplace.json
- yarn.lock
- CHANGELOG.md (new [5.6.1] section)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat plugin packages/claude-code-plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant