feat(dashboard): x stops a dashboard-owned bottle #46

Merged
didericis merged 1 commits from chunk-4-explicit-stop into main 2026-05-26 13:48:04 -04:00
Owner

Summary

Final PRD 0020 chunk. x on a focused agents-pane row tears down the selected bottle if the dashboard owns it (started via the chunk-2 n flow):

  1. Pop (cm, bottle, identity) from the main loop's bottles map.
  2. capture_session_state(identity, 0) — best-effort transcript snapshot before teardown.
  3. cm.__exit__(None, None, None) — drives the existing compose-down + network-remove sequence.
  4. settle_state(identity) — honors any pre-existing preserve marker (capability-block sets one; if present, state stays and the resume hint prints).

On a non-owned slug (discovered via list_active_slugs but not in the dashboard's bottles dict — i.e., previous-dashboard or external ./cli.py start bottle), x is a no-op with a status hint pointing at ./cli.py cleanup. Matches the PRD's cross-dashboard model: re-attach works either way, but explicit stop only works on what the dashboard started.

Chunk 5 is satisfied

The PRD's chunk 5 ("quit-cleanup") is satisfied by the existing no-op behavior of q — per the user's resolved-question answer, quit leaves bottles running unchanged. No code change needed for that, just the implicit documentation in the chunk-2 bottles dict comment.

Status

  • 465 unit tests pass (1 new for the non-owned no-op path)
  • Owned path's teardown is integration territory (real compose-down); the chunk-2 integration test exercise the same cm.__exit__ machinery via the test_supervise_sidecar smoke test
  • Footer surfaces [x] stop
## Summary Final PRD 0020 chunk. `x` on a focused agents-pane row tears down the selected bottle if the dashboard owns it (started via the chunk-2 `n` flow): 1. Pop `(cm, bottle, identity)` from the main loop's `bottles` map. 2. `capture_session_state(identity, 0)` — best-effort transcript snapshot before teardown. 3. `cm.__exit__(None, None, None)` — drives the existing compose-down + network-remove sequence. 4. `settle_state(identity)` — honors any pre-existing preserve marker (capability-block sets one; if present, state stays and the resume hint prints). On a non-owned slug (discovered via `list_active_slugs` but not in the dashboard's `bottles` dict — i.e., previous-dashboard or external `./cli.py start` bottle), `x` is a no-op with a status hint pointing at `./cli.py cleanup`. Matches the PRD's cross-dashboard model: re-attach works either way, but explicit stop only works on what the dashboard started. ## Chunk 5 is satisfied The PRD's chunk 5 ("quit-cleanup") is satisfied by the existing no-op behavior of `q` — per the user's resolved-question answer, quit leaves bottles running unchanged. No code change needed for that, just the implicit documentation in the chunk-2 `bottles` dict comment. ## Status - 465 unit tests pass (1 new for the non-owned no-op path) - Owned path's teardown is integration territory (real compose-down); the chunk-2 integration test exercise the same `cm.__exit__` machinery via the test_supervise_sidecar smoke test - Footer surfaces `[x] stop`
didericis added 1 commit 2026-05-26 03:47:11 -04:00
feat(dashboard): x stops a dashboard-owned bottle (PRD 0020 chunk 4)
test / unit (pull_request) Successful in 17s
test / integration (pull_request) Successful in 1m7s
3ed3745982
Final PRD 0020 chunk. `x` on a focused agents-pane row tears
down the selected bottle if the dashboard owns it (started via
the chunk-2 `n` flow): pops `(cm, bottle, identity)` from the
main loop's bottles map, snapshots the transcript best-effort,
calls `cm.__exit__(None, None, None)` to drive the existing
compose-down + network-remove sequence, then `settle_state` to
honor any pre-existing preserve marker.

On a non-owned slug (discovered via `list_active_slugs` but not
in the dashboard's bottles dict — i.e., previous-dashboard or
external `./cli.py start` bottle), `x` is a no-op with a status
hint pointing at `./cli.py cleanup`. Matches the PRD's
cross-dashboard re-attach model: the dashboard can re-attach
either kind, but can only tear down its own.

The PRD's chunk 5 ("quit-cleanup") is satisfied by the existing
no-op behavior of `q` — per the user's resolved-question
answer, quit leaves bottles running unchanged. No code change
needed for that.

Footer surfaces `[x] stop`. 465 unit tests pass (1 new for the
non-owned no-op path; the owned path is integration territory
because it drives a real compose-down).
didericis merged commit 3d179f18fc into main 2026-05-26 13:48:04 -04:00
didericis deleted branch chunk-4-explicit-stop 2026-05-26 13:50:42 -04:00
Sign in to join this conversation.