Add the run-level operator actions to the browser run detail, matching the
Android client's wording and wire frames:
- R11 human decision: pure model in src/actions.js (pendingDecision,
lastWaitingStep, waitingPrompt/waitingOptions, humanOptions,
decisionTargetLabel, DecisionDraft) plus the decision card and sheet;
decide_run sends run_id, the chosen option and trimmed feedback.
- R12 cancel: a Cancel run action offered only while executing; the Android
confirm copy; cancel_run then a silent get_run refresh.
- R13 retry: offered only for a loaded, non-executing failed run; resume is
the default (no retry_mode, like Android) with a browser-only
Restart from start secondary that sends retry_mode:"restart".
- R14 rename: an inline set_run_title field; refreshes the run and its list row.
- One shared Action failed dialog for all of the above.
Add the protocol constants and typed builders, a hand-written dark-palette
section for the card/sheet/dialogs, focused unit tests for the helpers and
request shapes, and ui-smoke captures for the new states. Update PARITY.md:
R11 stays partial (no live waiting run), R12–R14 done with the stated
shown-not-executed and Android-divergence notes.
Also harden openRunDetail() in the UI smoke: the tabstrip already exists from
the previously opened run, so wait for the target run's identity line before
asserting on its actions (review finding).
Close T3, T4 and T5 of web/PARITY.md (the "Transport and connection"
table). T1/T2/T6 are untouched beyond wiring.
- src/connection.js (new): the pure, DOM/socket/timer-free helpers behind
every new state — `bannerState` (the persistent banner's copy and tone),
`stateBadge` (the compact header indicator, which is also where the retry
attempt is named), `foregroundAction` (the return-to-foreground policy
from ConnectionRecovery.kt), `protocolMismatch`, `serverBuildLabel` and
`liveBadgeState`. Wording and colour roles mirror ConnectionBanner.kt,
LiveBadge.kt/RunStream.kt and SettingsScreen.kt.
- src/app.js: wiring only. The banner sits in normal document flow under
the header (never overlaying content); a Reconnect control appears beside
the URL field whenever `bannerState` offers one and re-opens the same
validated endpoint through `client.connect`, resetting the backoff;
`visibilitychange`/`online` drive the foreground recovery; the ping reply
records the server build and protocol for the banner.
- src/protocol.js: `PROTOCOL_VERSION = 1`, citing internal/protocol/
identity.go and Message.kt.
- styles.css: the .conn-* banner and .live-badge rules in the app's dark
palette, on the existing :root variables.
- test/connection.test.mjs (new): 18 focused unit tests for the pure
helpers, including source-parity assertions against the Android files.
- test/ui-smoke.mjs: assert the connected banner + build line + live badge
and capture them, then point the page at a closed port to capture the
disconnected retry banner and recover via the browser's `online` event.
- PARITY.md: T3/T4/T5 done with their captures.
Checks: `node --check` on all five touched JS/MJS files; `node --test
test/` 190 pass / 0 fail (18 new); `node test/ui-smoke.mjs --out ...
/web/captures` UI SMOKE PASS against ws://127.0.0.1:8080/connect, writing
28-connected-banner.png, 29-disconnected-banner.png and
30-reconnect-recovered.png.
Integrates nine commits of reviewed work from the lane-go branch after the
automated resolver failed on this merge five times (each attempt dying on the
malformed-result defect whose fix is contained in this same merge).
Integration decisions:
- Search: kept main's shipped design (Store.Search + SearchResponse.Results) and
dropped lane-go's parallel, older attempt (an unused Message.Matches field, an
absent runs.search, and two partial TUI plumbing blocks). lane-go itself did not
compile: protocol.SearchMatch was undefined and model.go referenced searchNav,
requestSearch and applyRunNav, which exist nowhere. Those partial TUI blocks are
removed; the queued TUI omni-search item will implement the surface properly on
main's design.
- Both sides' additions are kept where they are independent: run titles and
provenance, the human decision stage and its CLI/TUI surface, the derived stage
verdict, the stale-client guard, the line-oriented result format, and main's
search command.
- The search key's help label is now "/ omni search"; the two tests asserting the
old label are updated rather than the label reverted.
- docs/cli.md and the packaged operations reference carry both sides' text.
Verified: go build ./... , go vet ./... and the full go test ./... suite pass.