refactor(preflight): compact y/N summary #31

Merged
didericis merged 2 commits from compact-preflight-summary into main 2026-05-25 20:59:48 -04:00
Owner

Summary

Trim the y/N preflight to the parts the operator actually scans before pressing y. Output now looks like:

```
claude-bottle: agent : implementer
claude-bottle: env : CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
claude-bottle: CLAUDE_CODE_OAUTH_TOKEN
claude-bottle: DISABLE_ERROR_REPORTING
claude-bottle: skills : (none)
claude-bottle: bottle : dev
claude-bottle: git gate : gitea.dideric.is:30009
claude-bottle: egress-proxy : api.anthropic.com [auth:Bearer]
claude-bottle: gitea.dideric.is [auth:token]
claude-bottle: statsig.anthropic.com
claude-bottle: sentry.io
claude-bottle: ...
```

Verified against the dev bottle: byte-for-byte match to the spec.

What's gone (still in JSON via `--format=json`)

image, dockerfile path, derived-image (cwd) line, container name, stage dir, docker runtime, git remotes list, egress allowlist summary, tls-interception note, supervise note, prompt metadata, remote-control flag. The dataclass + `to_dict` are unchanged so tooling that introspects the plan still gets the full shape.

Code

  • `bottle_plan.py::print` rewritten around a tiny `_multi(label, values)` helper — first value next to the label, remainder continuation-indented to the label width. Same pattern handles env / skills / git-gate / egress-proxy.
  • `remote_control` kwarg kept on the signature for callsite stability (start.py still passes it).

386 unit tests pass.

## Summary Trim the y/N preflight to the parts the operator actually scans before pressing y. Output now looks like: \`\`\` claude-bottle: agent : implementer claude-bottle: env : CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC claude-bottle: CLAUDE_CODE_OAUTH_TOKEN claude-bottle: DISABLE_ERROR_REPORTING claude-bottle: skills : (none) claude-bottle: bottle : dev claude-bottle: git gate : gitea.dideric.is:30009 claude-bottle: egress-proxy : api.anthropic.com [auth:Bearer] claude-bottle: gitea.dideric.is [auth:token] claude-bottle: statsig.anthropic.com claude-bottle: sentry.io claude-bottle: ... \`\`\` Verified against the dev bottle: byte-for-byte match to the spec. ## What's gone (still in JSON via \`--format=json\`) image, dockerfile path, derived-image (cwd) line, container name, stage dir, docker runtime, git remotes list, egress allowlist summary, tls-interception note, supervise note, prompt metadata, remote-control flag. The dataclass + \`to_dict\` are unchanged so tooling that introspects the plan still gets the full shape. ## Code - \`bottle_plan.py::print\` rewritten around a tiny \`_multi(label, values)\` helper — first value next to the label, remainder continuation-indented to the label width. Same pattern handles env / skills / git-gate / egress-proxy. - \`remote_control\` kwarg kept on the signature for callsite stability (start.py still passes it). 386 unit tests pass.
didericis added 1 commit 2026-05-25 20:44:44 -04:00
refactor(preflight): compact summary — agent / env / skills / bottle / gates
test / unit (pull_request) Successful in 17s
test / integration (pull_request) Successful in 1m8s
5d5f118fb4
Trim the y/N preflight to the parts the operator actually scans
before pressing y:

  agent
  env (one per line)
  skills (one per line)
  bottle
    git gate (one upstream per line)
    egress-proxy (one route per line, with [auth:scheme] when set)

Dropped from the display (still on the plan dataclass / json
output for tooling): image, dockerfile, derived-image (cwd) line,
container, stage dir, docker runtime, git remotes list, egress
allowlist summary, tls interception note, supervise note, prompt
metadata, remote-control flag.

`remote_control` kwarg kept on `.print()` for callsite stability
but unused in the compact format.

A `_multi(label, values)` helper does the "first value next to
the label, remainder continuation-indented" pattern that env /
skills / git gate / egress-proxy all share — keeps the columns
aligned to the label width.

Verified against my own dev bottle: output is byte-for-byte the
spec the operator asked for.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
didericis added 1 commit 2026-05-25 20:54:55 -04:00
refactor(cli): drop --format=json end-to-end
test / unit (pull_request) Successful in 18s
test / integration (pull_request) Successful in 1m2s
572106d98f
Companion to the compact preflight in #31 — the JSON format was
the structured alternative to the verbose text summary. With the
new compact text already on screen, no consumer was using the
JSON shape, and the abstract `BottlePlan.to_dict` was the
biggest piece of API surface no one is implementing against.

Removed:
  - `--format` CLI flag from `start` and `resume`.
  - `output_format` kwarg from `_launch_bottle`.
  - `BottlePlan.to_dict` abstract method.
  - `DockerBottlePlan.to_dict` (60-line dict builder).
  - The `_PlanView` dataclass — `print` was the only remaining
    caller, so the env-name computation is inlined.
  - `tests/integration/test_dry_run_plan.py` (JSON-shape
    integration test).
  - `tests/unit/test_cli_start_format.py` (flag-conflict unit).

Plan-introspection is still possible by reading the
`DockerBottlePlan` dataclass directly — fields like `image`,
`container_name`, `stage_dir`, `use_runsc` are all there. Tooling
that needs a stable wire shape can JSON-serialize the dataclass
themselves.

411 unit + integration tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
didericis merged commit d79a976999 into main 2026-05-25 20:59:48 -04:00
didericis deleted branch compact-preflight-summary 2026-05-25 21:05:21 -04:00
Sign in to join this conversation.