Parallel Prerequisite & Runtime Checks
When you run damru check, the CLI executes environment and toolchain probes concurrently rather than failing on the first missing binary. Checks are defined declaratively as TOML manifests inside damru/checks/ ↗ and evaluated by damru/src/checks.rs ↗.
Each check inspects Docker Compose v2 availability, Node.js major version (≥ 24), npm (≥ 11.10), uv installation and version alignment with pre-commit, and host memory/CPU headroom. Results are classified into pass, warn, or fail so non-blocking warnings never halt local onboarding.
- Declarative TOML check definitions:
damru/checks/docker-compose-v2.toml↗,damru/checks/node-major-24.toml↗,damru/checks/uv-installed.toml↗ - Environment discovery & Flagsmith checkout detection:
damru/src/lib.rs↗ - Dry-run & explanation flags (
--dry-run,--explain) preview every step before execution indamru/src/main.rs↗
Profile Selection & Flagsmith Stack Setup
During damru setup, damru/src/runtime.rs ↗ inspects available host resources (or respects --profile low|default) to pick the right Docker Compose profile. Low-memory machines automatically skip heavy optional services so the core Flagsmith API and database start reliably.
Next, damru/src/envfile.rs ↗ safely hydrates local .env configuration from templates without overwriting existing secrets, and damru/src/orchestrator.rs ↗ invokes damru/api-Makefile.doctor.mk ↗ using argument-array subprocesses.
damru check --explain
damru setup --profile low
damru verify --json
End-to-End Live Flag Round-Trip
Container healthchecks alone do not prove Flagsmith can evaluate flags. The verify command in damru/src/main.rs ↗ and the TypeScript verifier in damru/ts-verify/src/index.ts ↗ perform a real REST API round-trip against localhost:8000.
Damru creates a temporary feature flag (e.g., doctor-tmp-<timestamp>), evaluates it for a synthetic identity via /api/v1/identities/, asserts the returned value matches, deletes the temporary flag, and confirms a subsequent lookup returns HTTP 404.
- Rust CLI verification & cleanup orchestration:
damru/src/main.rs↗ - TypeScript SDK & API verification harness:
damru/ts-verify/src/cli.ts↗ anddamru/ts-verify/src/index.ts↗ - Web-triggered live verification endpoint:
POST /api/doctor/verifyinplugin-1/server.js↗
Atomic Status & Deterministic CI Exit Codes
Every run writes an atomic, secret-redacted status.json snapshot via damru/src/report.rs ↗. Passing --json emits machine-readable diagnostics for CI pipelines and powers the GET /api/doctor/status endpoint.
| Exit Code | State | Meaning in Local & CI Runs |
|---|---|---|
| 0 | pass | All prerequisite checks, setup steps, and live flag evaluation cleared |
| 1 | warn | Non-blocking warnings detected; Flagsmith stack remains usable |
| 2 | fail | Prerequisite, Docker Compose, or live flag verification failed |
| 3 | usage | Invalid CLI arguments, unsafe remote URL, or missing config |