feat(commands): dual-mode subcommands + mode banner + doctor report (PR 2/3)#152
Merged
Conversation
This was referenced Jun 5, 2026
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.
Part of #149 — Phase 1 dual-mode network/socket containment, PR 2/3 (stacked on PR1 #151, merged to
dev).What this adds
Building on PR1's compose-core (network-neutral base +
dood/containoverlays +resolve_run_mode), PR2 delivers the user-facing controls and the visible posture signal:drydock default <dood|contain>— manage the global default sentinel (~/.config/drydock/default-dood). Idempotent.drydock dood <proj> [--remove]/drydock contain <proj> [--remove]— per-project pins, mutually exclusive (pinning one clears the opposite).--removeon an unpinned project is a no-op, not an error.doodprints the INV-6 root-equivalent warning._emit_mode_banner— prints the active mode + the deciding reason at container creation only, never on attach.drydock doctornow reports the active network/socket mode (viaresolve_run_mode) in the COMPOSE OVERLAYS section, with the deciding reason. Without it, contained-by-default makesmake shell-api/curl localhost:PORTfail with no visible cause.bin/drydock+usage()rows.Honest framing
Contained mode in Phase 1 removes the Docker socket and host networking only — egress stays open (no
internal: true; the agent still reaches the internet). The banner and doctor wording state exactly that and make no egress-filtering claim. A domain-allowlist egress jail is Phase 2.Notes for review
cmd_runnested,cmd_run0-session,cmd_new,cmd_shell), but decision D6 (emit at creation, never attach) also covers the two ≥1-session TUI menu branches — "Start a new session" and "Stop all sessions and start fresh" — which create via_launch_new. All six emit at the call site (never inside_launch_new, to avoid double-emit) and zero attach paths emit.doodwarning restates that the Docker socket is root-equivalent on the host. The full INV-9 invariant text lands in PR3 (forward-referenced here).resolve_run_mode's lookup.Tests & gates
scripts/test.sh: 1099/1099 passing (22 new tests covering subcommands, mutual exclusion, idempotency, arg-validation, banner wording/reason, and doctor reporting).shellcheck,shfmt -d,scripts/lint-commits.sh: all clean (5 conventional commits).Size
size:exception— 440 lines changed, 40 over the 400 budget. The implementation is 139 lines; the remaining 301 are tests (per-test isolatedHOMEfixtures). The feature slice is cohesive and small; the overage is test coverage.