Skip to content

test(spec-5b-2): stale-widget regression guard - #12

Merged
rz1989s merged 3 commits into
mainfrom
test/spec-5b-2-widget-lint
Jul 27, 2026
Merged

rz1989s merged 3 commits into
mainfrom
test/spec-5b-2-widget-lint

Conversation

@rz1989s

@rz1989s rz1989s commented Jul 27, 2026

Copy link
Copy Markdown
Member

Enforces the architectural invariant that would have caught both v0.9.2 bugs: all setWidget calls go through FleetWidgetController (which owns a disciplined set/clear lifecycle). Any setWidget outside the controller fails the build — that's the stale-widget bug class (set a widget, never clear it on completion).

Why

The stale-widget class bit fleet twice (both fixed in v0.9.2, PR #11):

  1. SPEC-1 (commit 26454af): the subagent tool set ctx.ui.setWidget('fleet', ['▶ agent · running']) on every turn_end and never cleared it → stale ▶ general-purpose · running lingered above the editor after the run finished.
  2. SPEC-5b-2: a below-editor fleet-view widget duplicated the above-editor widget (redundant — same widgetLine, cap 8 vs 5).

The guard (2 tests)

  • setWidget call sites only appear in src/panel/fleet-widget.ts — catches ad-hoc setWidget elsewhere that risks never being cleared.
  • FleetWidgetController sets exactly one widget key (fleet-active) — catches widget proliferation.

Verification

  • 313/313 tests pass (311 + 2 new), typecheck clean.
  • Test-only — no behavior change, no release needed; guards CI on future PRs.

rz1989s added 3 commits July 27, 2026 11:10
…g + context% + Tiers view

SPEC-6 (power-user tier → v1.0) decomposed into 6-1..6-4 (mirroring the 5b split).
6-1 is the foundation: tier-resolved model selection + live $/run + context% +
the /fleet Tiers view. Everything downstream (6-2 budget gates, 6-3 phase tiers,
6-4 RPC observe payload) reads from it.

10 decisions settled in brainstorm (Q1-Q10). Key discovery: pi-ai's Usage event
already carries cost.total ($) + totalTokens (context) — no pricing engine needed.
The genuinely new work is the tier abstraction (registry + resolver + Tiers view).

Release target: @getpipher/armory-fleet@0.10.0.
…esolve → spawn → widget → Tiers view → wire → release+smoke)
…leetWidgetController

The stale-widget bug class bit fleet twice (both fixed in v0.9.2, PR #11):
1. SPEC-1 (commit 26454af): the subagent tool set ctx.ui.setWidget('fleet',
   ['▶ agent · running']) on every turn_end and never cleared it → stale
   '▶ general-purpose · running' lingered after the run finished.
2. SPEC-5b-2: a below-editor 'fleet-view' widget duplicated the above-editor
   widget (redundant — same widgetLine, cap 8 vs 5).

The architectural invariant that prevents the stale-widget class: all setWidget
calls go through FleetWidgetController (src/panel/fleet-widget.ts), which owns a
disciplined set/clear lifecycle (set on active, clear on idle + dispose). This
test enforces it — any setWidget outside the controller fails the build.

Two tests:
- setWidget call sites only in fleet-widget.ts (catches ad-hoc setWidget that
  risks never being cleared).
- FleetWidgetController sets exactly one widget key (catches widget proliferation).
@rz1989s
rz1989s merged commit 612969c into main Jul 27, 2026
1 check passed
@rz1989s
rz1989s deleted the test/spec-5b-2-widget-lint branch July 27, 2026 04:34
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