Skip to content

feat(docker): add Container Triage world and orphaned lab cleanup - #32

Merged
Aleksandergreg merged 5 commits into
mainfrom
feat/web-app-implementation
Sep 30, 2026
Merged

Aleksandergreg merged 5 commits into
mainfrom
feat/web-app-implementation

Conversation

@Aleksandergreg

Copy link
Copy Markdown
Owner

feat(docker): add Container Triage world and orphaned lab cleanup

Add Docker World 2, "Container Triage" (Missions 30–34), built on the
rm, logs --tail, ps --filter, health-probe, and crash-loop support from
the previous commit:

  • Janitor Duty: remove finished job containers, keep services running
  • Tail End: show only the final lines of a long job log
  • Running Isn't Healthy: swap an unhealthy replica for its standby
  • Crash Loop: stop a restart-policy loop and surface its fault
  • Postmortem Triage: combine health, exit codes, stop, and rm while
    keeping the evidence the postmortem needs

Add opsquest doctor --cleanup to remove lab containers left behind by
OpsQuest processes that exited without cleanup. A plain opsquest doctor now reports them without removing anything.

Also:

  • start every fixture before waiting on health probes, so setup waits
    one probe interval instead of one per fixture
  • keep the original 8-column STATUS layout in docker ps
  • add real-engine integration tests for the triage fixtures and the
    orphan sweep (run with OPSQUEST_DOCKER_TEST=1)
  • update smoke assertions, mission counts (34 total, 11 Docker), the
    mission map, safety model, authoring guide, roadmap, and diagram

Schema changes are additive and persisted profiles need no migration.

http.Server.Shutdown only closes connections that have not sent a request
yet once they have sat for about 5 seconds. Browsers routinely preconnect
spare sockets, so closing the companion ran into the CLI's 2s shutdown
timeout. Quitting `opsquest play --web` could then report "close web
companion: context deadline exceeded", and
TestServerRequiresOneTimePairingAndSetsSecurityHeaders failed
intermittently in CI.

Track connections through http.Server.ConnState and close the ones that
have not sent a request when Close begins. Connections accepted after
that are closed straight away. If Shutdown still runs out of time, force
the server closed so no connections stay open, and keep returning the
error to the caller.

Add a regression test that opens a TCP connection, never sends a request,
and checks that Close succeeds within its deadline and that the
connection is closed.
Add Docker World 2, "Container Triage" (Missions 30–34), built on the
rm, logs --tail, ps --filter, health-probe, and crash-loop support from
the previous commit:

- Janitor Duty: remove finished job containers, keep services running
- Tail End: show only the final lines of a long job log
- Running Isn't Healthy: swap an unhealthy replica for its standby
- Crash Loop: stop a restart-policy loop and surface its fault
- Postmortem Triage: combine health, exit codes, stop, and rm while
  keeping the evidence the postmortem needs

Add `opsquest doctor --cleanup` to remove lab containers left behind by
OpsQuest processes that exited without cleanup. A plain `opsquest
doctor` now reports them without removing anything.

Also:
- start every fixture before waiting on health probes, so setup waits
  one probe interval instead of one per fixture
- keep the original 8-column STATUS layout in `docker ps`
- add real-engine integration tests for the triage fixtures and the
  orphan sweep (run with OPSQUEST_DOCKER_TEST=1)
- update smoke assertions, mission counts (34 total, 11 Docker), the
  mission map, safety model, authoring guide, roadmap, and diagram

Schema changes are additive and persisted profiles need no migration.
@Aleksandergreg
Aleksandergreg enabled auto-merge (squash) September 30, 2026 16:23
@Aleksandergreg
Aleksandergreg merged commit 56dbfe2 into main Sep 30, 2026
4 checks passed
@Aleksandergreg
Aleksandergreg deleted the feat/web-app-implementation branch September 30, 2026 16:24
Aleksandergreg pushed a commit that referenced this pull request Sep 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.8.0](v0.7.1...v0.8.0)
(2026-09-30)


### Features

* **docker:** add Container Triage world and orphaned lab cleanup
([56dbfe2](56dbfe2))
* **docker:** add Container Triage world and orphaned lab cleanup
([#32](#32))
([56dbfe2](56dbfe2))
* **docker:** add Network Plumbing world with internal attempt-owned
networks
([#34](#34))
([b4b1ba9](b4b1ba9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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