# Quality gates: cbd-bundle Criteria beyond the automatic tests (`cbd/src/main.rs` readiness tests plus the moved suites). Each gate is pass/fail by reading the code. ## Refactor (behavior-preserving) - [x] The server's modules (`playback`, `provider`, `rpc`) and command/ message types moved to the library **unchanged**; `serve(addr)` is the old `main` body verbatim (minus tracing); both thin mains only set up tracing and delegate. - [x] Every pre-existing test moved along and passes unchanged; no test was rewritten to accommodate the refactor. - [x] `cbd-tui`'s library exposes `run(config)`; tracing setup stays in the binaries (where logs go is a hosting decision). ## Bundled behavior - [x] `cbd` uses the same configs as the pair (`cbd-tui.toml` and the server-side configs) — nothing bundled-specific to configure. - [x] Both halves log to one file; the terminal is never written to outside the TUI. - [x] An already-running standalone server is adopted (occupied port + reachable socket → connect), never treated as an error. - [x] A server that dies before readiness surfaces its actual error; a slow one gets a bounded, generous wait (first-run login flows). - [x] The readiness poll strips the config URL's scheme and never parses beyond host:port. ## Hygiene - [x] New public items are documented; docs state error/edge behavior. - [x] `clippy -D warnings`, `fmt`, `taplo`, `markdownlint` clean; all tests green. - [x] `architecture/cbd-bundle.md` reconciled where the implementation diverged.