crabidy/quality/cbd-bundle.md

1.5 KiB

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)

  • 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.
  • Every pre-existing test moved along and passes unchanged; no test was rewritten to accommodate the refactor.
  • cbd-tui's library exposes run(config); tracing setup stays in the binaries (where logs go is a hosting decision).

Bundled behavior

  • cbd uses the same configs as the pair (cbd-tui.toml and the server-side configs) — nothing bundled-specific to configure.
  • Both halves log to one file; the terminal is never written to outside the TUI.
  • An already-running standalone server is adopted (occupied port + reachable socket → connect), never treated as an error.
  • A server that dies before readiness surfaces its actual error; a slow one gets a bounded, generous wait (first-run login flows).
  • The readiness poll strips the config URL's scheme and never parses beyond host:port.

Hygiene

  • New public items are documented; docs state error/edge behavior.
  • clippy -D warnings, fmt, taplo, markdownlint clean; all tests green.
  • architecture/cbd-bundle.md reconciled where the implementation diverged.