Skip to content

Diagram — System Context (C4)

Status: mixed — see labels. fleet-routine box = mostly DESIGNED; the one piece with a solid outline inside it (Gate 0 doctor) is BUILT.

Renders natively wherever GitHub/GitLab/the Artifact viewer support Mermaid. No SVG export tool is installed in this repo yet — TODO: wire mmdc (mermaid-cli) into CI once the repo has a CI workflow (it doesn't yet; see docs/technical/making-of.md).

C4Context
    title fleet-routine — system context (DESIGNED plane, Gate 0 BUILT)

    Person(andrew, "Andrew", "Runs the one-time interactive setup; owns the fleet")

    System_Boundary(fr, "fleet-routine (this repo) — C# scheduling plane") {
        System(doctor, "Gate 0 doctor (BUILT)", "fleet-routine.exe doctor — non-interactive auth smoke test")
        System(registry, "Registry (DESIGNED)", "routine definitions: cron, budget, target harness")
        System(runner, "Thin runner (DESIGNED)", "invoked by WTS; calls fleet-harness across a process boundary")
        System(wts_trigger, "WTS trigger mgmt (DESIGNED)", "registers real routine tasks; reboot/sleep survival, missed-run catch-up")
    }

    System_Ext(wts, "Windows Task Scheduler", "OS scheduler; S4U logon; fires doctor's probe task and (later) routine tasks")
    System_Ext(harness, "fleet-harness (FLT-1)", "Python/LangGraph — the ONLY orchestration engine; selects adapter, routes, Claude-down failover")
    System_Ext(governor, "usage-governor", "fire-time budget check; fail-closed; defer = skip this tick")
    System_Ext(nats, "NATS JetStream (fleet.v1)", "DESIGNED transport for telemetry + multi-PC replay")
    System_Ext(pavlok, "Pavlok policy", "DESIGNED escalation/dedupe for failures")

    System_Ext(claude, "claude CLI", "subprocess probe target")
    System_Ext(codex, "codex CLI", "subprocess probe target")
    System_Ext(agy, "agy (Gemini) CLI", "subprocess probe target")
    System_Ext(grok, "grok CLI", "subprocess probe target")
    System_Ext(odysseus, "Odysseus HTTP :7000", "local-only probe target")
    System_Ext(ollama, "Ollama HTTP :11434", "local-only probe target")

    Rel(andrew, doctor, "doctor --register-probe (one-time, interactive password prompt)")
    Rel(doctor, wts, "registers + validates + triggers the fleet-routine-doctor S4U task")
    Rel(wts, doctor, "runs doctor --probe-payload inside the S4U task")
    Rel(doctor, claude, "probes (subprocess, temp-file prompt)")
    Rel(doctor, codex, "probes (subprocess, stdin, < NUL)")
    Rel(doctor, agy, "probes (subprocess, stdin, < NUL)")
    Rel(doctor, grok, "probes (subprocess, --prompt-file, no argv)")
    Rel(doctor, odysseus, "probes (HTTP, localhost only)")
    Rel(doctor, ollama, "probes (HTTP, localhost only)")

    Rel(wts_trigger, wts, "DESIGNED: registers real routine tasks (trigger only)")
    Rel(runner, harness, "DESIGNED: fleet-harness routine-fire (prompt-file in / JSON out)")
    Rel(runner, governor, "DESIGNED: fire-time budget check, fail-closed")
    Rel(runner, nats, "DESIGNED: emits fleet.v1 telemetry")
    Rel(runner, pavlok, "DESIGNED: escalation on repeated failure")
    Rel(registry, runner, "DESIGNED: supplies routine definition at fire time")

Reading this diagram

  • Everything touching doctor (top-left cluster and the six harness targets) is live code, covered by BUILD-REPORT.md (0 warnings / 0 errors, 18/18 tests) — see docs/technical/ARCHITECTURE.md §2.
  • Everything touching registry, runner, wts_trigger, nats, pavlok, governor is designed, not built — FLT-105 through FLT-108, all blocked in sequence behind Gate 0. See docs/BOARD.md.
  • fleet-harness is a different repo (Python/LangGraph, FLT-1) and is drawn as external — this repo does not implement it and must not re-implement its routing.