feat(runtime): boot_status — honest one-line-per-subsystem startup contract (e9f50a36)#1550
feat(runtime): boot_status — honest one-line-per-subsystem startup contract (e9f50a36)#1550joelteply wants to merge 2 commits into
Conversation
…ntract
Card e9f50a36 ("Slice A — reliable startup, substrate refuses to lie").
First slice: establish the shape so each load-bearing subsystem can
report itself at boot in a canonical, grep-friendly form. Future
subsystem PRs (airc, adapter, model, persona home, etc) plug into
the same seam without re-litigating the format.
## The contract
```
[continuum-core-server] <subsystem>: <icon> <detail>
```
- icon = ✓ / ⚠ / ✗ for Ok / Degraded / Failed
- subsystem = kebab-case ident matching URI / module name
- detail = one operator-actionable line (path / version / count /
exact remediation command)
Goes to stderr unconditionally so it survives RUST_LOG=warn quieting
during load tests. ALSO fires `tracing::info!` with
`target = "boot.status"` and fields `subsystem` / `kind` / `detail`,
so the substrate's JsonlProbeFileSink captures the structured record
when `CONTINUUM_PROBE_CLASSES` includes `boot.status`. Same call,
two consumers — the human-facing console line and the structured
probe sink, per [[observability-is-half-the-architecture]].
## What this PR ships
1. `runtime/boot_status.rs` — `boot_status(subsystem, kind, detail)`
function + `BootStatusKind` enum (Ok / Degraded / Failed, total-
ordered so sentinels can compute "worst kind across subsystems"
with `.max()`). Pure formatter `format_boot_status_line` for
unit testing. 6 unit tests pin the format, icons, tags, ordering.
2. Three call sites in main.rs converted to the new contract:
- `probes` — Ok when CONTINUUM_PROBE_FILE set, Degraded when
not (operator who *thought* they had probes wired up sees it).
- `logs` — Ok when log_dir resolved, Degraded when fmt falls
back to stderr (containerized envs without HOME).
- `boot-mode` — Ok with the parsed mode + description. Replaces
the previous `info!(" Boot mode: ...")` line that hid under
RUST_LOG.
Live-smoke-tested:
```
[continuum-core-server] probes: ✓ landing at /tmp/test-probes.jsonl
[continuum-core-server] logs: ✓ /Users/joel/.continuum/logs/continuum-core-server.YYYY-MM-DD.log (rolling daily, retention 7)
[continuum-core-server] boot-mode: ✓ full-citizen (hosts personas via AIRC; requires AIRC Healthy)
```
## What this PR is NOT
Not a fix for any one specific subsystem's silent boot. Persona
home migration, airc daemon discovery, adapter selection, model
availability — each is a follow-up PR that adds its own
boot_status call. This PR is the SEAM, not the audit.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
joelteply
left a comment
There was a problem hiding this comment.
VERDICT: REQUEST_CHANGES
Adversarial review per [[reviewer-mandate-elegance-and-substrate-viability]].
7 dimensions
-
Correctness —
eprintln!bypasses EnvFilter so RUST_LOG=warn doesn't quiet it ✓.Ordderive onBootStatusKind { Ok, Degraded, Failed }givesOk<Degraded<Failed;.max()returns worst ✓. Format helper matches tests ✓. BUT doc claim "JsonlProbeFileSink captures these under theboot.statusclass" is FALSE. Probe sink filters on aprobe_classFIELD (set byprobe!), NOT tracingtarget.probe_file_sink.rs:264-267:visitor.probe_class.None => return. Withtarget="boot.status"and noprobe_classfield, JSONL sink early-outs. Rolling-log fmt capture works; probe JSONL does NOT. -
Architecture —
runtime/boot_status.rspaired withboot_mode.rs✓. Function-not-macro fine at 3 callsites. -
Traits/API —
&strfor subsystem correct for "subsystems opt in over time"; enum would centralize a registry (anti-pattern). -
Modularity — Pure
format_boot_status_lineclean. Tests pin every variant + ordering + Display.
5/6. Speed / Intel-Mac — n/a.
- Elegance — 227 LoC, doc long but load-bearing. Unicode icons fine (UTF-8,
less -R/grephandle them). No double-write: eprintln→console only, tracing→rolling log only.
Required change
Fix the probe-sink claim. Either:
- (a) Replace
tracing::info!(target: "boot.status", ...)withprobe!(class = "boot.status", subsystem=..., kind=..., detail=...)so JSONL capture works — substrate-coherent, sentinels ondebug/probes/boot.status/streamis the load-bearing case, OR - (b) Strike "JsonlProbeFileSink captures these" from the module doc + inline comment; rolling-log is sufficient. Don't promise a no-op pathway.
(a) preferred. Everything else clean — ordering, format pin, stderr-survives-RUST_LOG, no double-write, boot-mode promotion from hidden info! to first-class line is a real correctness win.
…actually see the events (reviewer #1)
Summary
Card
e9f50a36("Slice A — reliable startup, substrate refuses to lie"). First slice: establish the SHAPE so each load-bearing subsystem can report itself at boot in a canonical, grep-friendly form. Future subsystem PRs (airc daemon, adapter selection, model availability, persona home) plug into the same seam without re-litigating the format.The contract
✓/⚠/✗forOk/Degraded/Failed.Lines go to stderr unconditionally so they survive
RUST_LOG=warnquieting. They ALSO firetracing::info!withtarget = "boot.status"and fieldssubsystem/kind/detail, so the substrate'sJsonlProbeFileSinkcaptures the structured record whenCONTINUUM_PROBE_CLASSESincludesboot.status. Same call, two consumers — the human-facing console line and the structured probe sink, per[[observability-is-half-the-architecture]].What this PR ships
runtime/boot_status.rs— new module:boot_status(subsystem, kind, detail)functionBootStatusKind { Ok, Degraded, Failed }enum (total-ordered so sentinels can compute "worst kind across subsystems" with.max())format_boot_status_linefor unit testingThree call sites in
main.rsconverted to the new contract:probes—✓whenCONTINUUM_PROBE_FILEis set,⚠when it isn't (so an operator who thought they had probes wired up sees the off-state immediately).logs—✓whenlog_dirresolved,⚠when fmt falls back to stderr (containerized envs withoutHOME).boot-mode—✓with the parsed mode + description. Replaces the previousinfo!(" Boot mode: ...")line that hid underRUST_LOG.Live-smoke output
What this PR is NOT
Not a fix for any one specific subsystem's silent boot. Persona home migration, airc daemon discovery, adapter selection, model availability — each becomes a follow-up PR that adds its own
boot_statuscall. This PR is the seam, not the audit.Test plan
cargo test -p continuum-core --lib runtime::boot_status— 6/6 green.cargo build -p continuum-core --bin continuum-core-serverclean.CONTINUUM_PROBE_FILE=/tmp/probes.jsonl: all three boot lines render correctly with the right icons + detail.Composition with prior PRs
logs:line names the same path that PR'slog_dirresolved to.probes:line names the same JSONL path that PR'sCONTINUUM_PROBE_FILEenv var configures.