@aiwg/cockpit 2026.7.10 → 2026.7.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,7 +58,8 @@ AIWG_COCKPIT_EXECUTOR_URL=http://127.0.0.1:8122 aiwg cockpit
58
58
  - **Home** — connected-state overview, first-run flow, and a session-first entry point.
59
59
  - **Inventory** — host, container, Docker, and VM runtime targets with lifecycle controls.
60
60
  - **Running** — active work across stacks, spend posture, and task stop controls.
61
- - **Sessions** — observe-first terminal attach, explicit drive/control, and replay posture.
61
+ - **Missions** — read-only Mission Control projection: sessions, per-mission status, audit tail.
62
+ - **Sessions** — observe-first terminal attach, explicit drive/control, replay posture, and stale-agent recovery.
62
63
  - **Approvals** — unified human-in-the-loop decision inbox.
63
64
  - **Explore** — live index status/query/rebuild plus read-only AIWG capability catalog.
64
65
  - **Library** — user-owned assets cloned/imported under `~/.aiwg/cockpit/library`.
@@ -138,7 +139,8 @@ operator / CLI: aiwg cockpit
138
139
  | **Home** | Guided first-run: what-is-this, live status, the **Start a session** primary verb, first-run tour. |
139
140
  | **Inventory** | Instances + lifecycle (Start/Stop/Destroy). |
140
141
  | **Running** | Running work across stacks + cross-stack spend + per-task Stop. |
141
- | **Sessions** | Live pty terminal — observe/drive, keyframe, non-destructive replay; inline **+ capability picker**. |
142
+ | **Missions** | Read-only Mission Control projection — durable `aiwg mc` sessions merged with the live executor task session. |
143
+ | **Sessions** | Live pty terminal — observe/drive, keyframe, non-destructive replay, stale-agent recovery; inline **+ capability picker**. |
142
144
  | **Approvals** | Unified HITL inbox (`hitl-prompt/v1`); decisions = operator authorization. |
143
145
  | **Explore** | Live artifact-index status/query/rebuild plus read-only AIWG catalog search. |
144
146
  | **Library** | Your own assets — clone from the catalog / import / remove. AIWG files never overwritten. |
@@ -177,9 +179,10 @@ Set `AIWG_COCKPIT_KEYCHAIN_STRICT=1` when shells must refuse plaintext runtime
177
179
  tokens. In strict mode the Bridge exits if it cannot persist the per-launch token
178
180
  to the OS keychain, and shell-core refuses runtime files that only contain a
179
181
  plaintext token. Operator intent is also recorded in a local redacted audit log
180
- under `~/.aiwg/cockpit/audit/events.jsonl` for lifecycle, session, action-inject,
181
- and approval-response decisions; bearer material and provider credentials are
182
- redacted before write.
182
+ under `~/.aiwg/cockpit/audit/events.jsonl` for lifecycle, session, and
183
+ approval-response decisions (the web UI additionally records action injections
184
+ as operator intents); bearer material and provider credentials are redacted
185
+ before write.
183
186
 
184
187
  ## Run (dev/test, against a real agentic-sandbox executor)
185
188
 
@@ -196,6 +199,17 @@ binary before serving Cockpit. Override `AIWG_COCKPIT_EXECUTOR_URL` (default
196
199
  `http://127.0.0.1:8122`) or `PORT` (default `8140`). Set
197
200
  `AIWG_COCKPIT_EXECUTOR_COMMAND` to pin the autostart command, or
198
201
  `AIWG_COCKPIT_AUTOSTART_EXECUTOR=0` to require an already-running executor.
202
+
203
+ **Bring up both halves at once (#1634).** `npm run cockpit:up` (→
204
+ `apps/cockpit/scripts/cockpit-up.sh`) guarantees a real, current executor is
205
+ listening *before* the Bridge starts: it launches the agentic-sandbox executor
206
+ via its own `management/dev.sh` when one isn't already healthy on
207
+ `AIWG_COCKPIT_EXECUTOR_URL` (default `http://127.0.0.1:8122`), then delegates to
208
+ `cockpit-dev.sh` for the Bridge + UI. Set `AIWG_COCKPIT_ENSURE_EXECUTOR=0` to
209
+ skip the executor-ensure step when a sandbox is already running, or
210
+ `AIWG_COCKPIT_START_HOST_DAEMON=1` to also start the optional host-runtime
211
+ daemon. `cockpit-dev.sh` stays the Cockpit-only launcher.
212
+
199
213
  Equivalent manual steps:
200
214
 
201
215
  ```bash
@@ -217,10 +231,10 @@ agentic-sandbox executor. The bundled mock is reserved for automated tests and
217
231
  PoCs; if a mock-like executor is detected, the Bridge refuses it unless
218
232
  `AIWG_COCKPIT_ALLOW_MOCK_EXECUTOR=1` is set by an automated harness.
219
233
 
220
- The Bridge keeps legacy admin-surface compatibility (`/admin/instances`,
221
- `/admin/running`) for automated coverage, but dev/test launches should target
222
- real agentic-sandbox v2 admin surfaces (`/api/v2/admin/instances`,
223
- `/api/v2/admin/running`). Field normalization covers snake_case and camelCase
234
+ The Bridge probes legacy (`/admin/instances`) and v2 (`/api/v2/admin/instances`)
235
+ admin surfaces as fallback candidates for inventory and lifecycle; running work
236
+ and approvals are derived from per-instance A2A task lists rather than any
237
+ admin `/running` route. Field normalization covers snake_case and camelCase
224
238
  payloads so live sandboxes can evolve without breaking the operator UI; unknown
225
239
  fields degrade to opaque posture rather than failing the screen.
226
240
 
@@ -230,6 +244,39 @@ QEMU/VM launches. Cockpit does not replace attached sessions when provisioning;
230
244
  it refreshes inventory and leaves concurrency and resource admission to
231
245
  agentic-sandbox.
232
246
 
247
+ ### Recover stale agents
248
+
249
+ When a container, Docker, or VM runtime is still running but its agent
250
+ registration has disappeared, Cockpit keeps the row visible instead of hiding
251
+ it. Inventory and Sessions show `agent unreachable` and expose **Reconnect**
252
+ for stale container/Docker **and vm/qemu/kvm** rows (#1778). Use this when an
253
+ instance is alive but session attach, running projections, or actions cannot
254
+ resolve an agent id.
255
+
256
+ The Bridge handles recovery through:
257
+
258
+ 1. executor-owned reconnect endpoints when the sandbox exposes one, then
259
+ 2. local Docker fallback: `docker exec <container> agent-reconnect`, or
260
+ 3. VM fallback (#1778): the same reconnect SIGHUP delivered through the libvirt
261
+ qemu-guest-agent channel (`virsh qemu-agent-command <domain> guest-exec
262
+ pkill -HUP -x agent-client`). Sessions survive reconnect on agentic-sandbox
263
+ 2026.7.8+ agents; older agents preserve only detached tmux sessions
264
+ (agentic-sandbox#634).
265
+
266
+ The Docker fallback requires sandbox images that include the `agent-reconnect`
267
+ helper (agentic-sandbox v2026.7.5+ images); the VM fallback requires virsh
268
+ access to the domain from the Bridge host. If **Reconnect** reports that no
269
+ reconnect path is available, rebuild or repull the sandbox image, then start the
270
+ instance again. For host targets, prefer starting Cockpit with the host daemon:
271
+
272
+ ```bash
273
+ AIWG_COCKPIT_START_HOST_DAEMON=1 npm run cockpit:up
274
+ ```
275
+
276
+ After a successful reconnect, refresh Inventory, then attach from Sessions. A
277
+ Reconnect action never creates a replacement instance and never destroys the
278
+ running container; it only attempts to restore the missing agent registration.
279
+
233
280
  `aiwg cockpit` (the operator command) will wrap this; the Bridge serves the built
234
281
  React app token-injected, falling back to a legacy page when no build is present.
235
282
 
@@ -402,6 +449,25 @@ Known state as of the 2026-06-19 host live run:
402
449
  `v2026.6.34`: VM matrix PASS — provision → vsock enroll → boot-ready → provider
403
450
  workload → clean destroy. Evidence:
404
451
  `.aiwg/testing/cockpit-vm-vsock-2026-06-27.md/.json`.
452
+ - Instance **transport posture + host-daemon** now surface from the sandbox side
453
+ (`dd97529 fix(admin-v2): expose instance transport posture`, plus `#611`
454
+ host-runtime session listing). Re-validated Cockpit-side against `v2026.7.4`
455
+ (2026-07-09): Inventory renders real posture per instance — Host + Container
456
+ `Secure transport · mtls` (Host daemon `available`), enrolled VM `Local
457
+ transport · vsock`, a mid-bootstrap VM showing transport `Unknown` with the
458
+ informative posture `bootstrap-pending` (vs the old dead `unknown`; every
459
+ enrolled instance now renders real posture). Session-list returns
460
+ cleanly (no 502 — the `#140`/`#611` endpoints are live). Runtime coverage
461
+ banner `host ✓ · docker ✓ · vm ✓`. Evidence:
462
+ `.aiwg/testing/cockpit-7.4-transport-verify-2026-07-09.md` +
463
+ `.aiwg/working/cockpit-7.4-inventory-2026-07-09.png`.
464
+ - Stale Docker/container agent recovery is wired through the Bridge and UI
465
+ (2026-07-11): stale running instances remain visible as `agent unreachable`,
466
+ Inventory and Sessions expose **Reconnect**, and the Bridge tries executor
467
+ reconnect before Docker `agent-reconnect`. Host-daemon scoped live UAT passed
468
+ against the real executor with `AIWG_COCKPIT_LIVE_PROVISION=1`,
469
+ `AIWG_COCKPIT_LIVE_MATRIX_TARGETS=host`, and Codex provider workload evidence
470
+ at `test-results/cockpit-live-host-daemon-2026-07-11.md/.json`.
405
471
  - Remaining upstream follow-ups are Claude auth-state propagation
406
472
  (roctinam/agentic-sandbox#499) and agent-scoped PTY sessions not appearing in
407
473
  the formal/global session registry (roctinam/agentic-sandbox#500).
@@ -418,9 +484,11 @@ agentic-sandbox executor through `AIWG_COCKPIT_EXECUTOR_URL`. The host target
418
484
  (agentic-sandbox#460) and direct/managed multiplexer sessions
419
485
  (agentic-sandbox#461) have landed upstream; the Bridge seam is now the
420
486
  AIWG-side integration point for #1589. Runtime-tier provisioning and
421
- host-daemon UX are tracked in roctinam/aiwg#1615, direct/managed PTY negotiation
422
- in #1616, the live real-sandbox gate in #1617, and transport-trust visibility in
423
- #1618. Secure transport details map back to agentic-sandbox#409/#410/#412; local
487
+ host-daemon surfacing (roctinam/aiwg#1615) and transport-trust visibility (#1618)
488
+ **landed and are verified against `v2026.7.4`** — transport posture and
489
+ host-daemon now render per instance (a host-daemon *detail-status* payload
490
+ remains a residual under #1615). Direct/managed PTY negotiation (#1616) and the
491
+ live real-sandbox gate (#1617) continue. Secure transport details map back to agentic-sandbox#409/#410/#412; local
424
492
  Browser/Tauri/VS Code-to-Bridge auth remains roctinam/aiwg#1595.
425
493
 
426
494
  ### Operator-wall review modes (#1622)