test(spec-5b-2): stale-widget regression guard - #12
Merged
Merged
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enforces the architectural invariant that would have caught both v0.9.2 bugs: all
setWidgetcalls go throughFleetWidgetController(which owns a disciplined set/clear lifecycle). AnysetWidgetoutside 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):
26454af): the subagent tool setctx.ui.setWidget('fleet', ['▶ agent · running'])on everyturn_endand never cleared it → stale▶ general-purpose · runninglingered above the editor after the run finished.fleet-viewwidget duplicated the above-editor widget (redundant — samewidgetLine, cap 8 vs 5).The guard (2 tests)
setWidgetcall sites only appear insrc/panel/fleet-widget.ts— catches ad-hocsetWidgetelsewhere that risks never being cleared.FleetWidgetControllersets exactly one widget key (fleet-active) — catches widget proliferation.Verification