Skip to content

6 Runtime View

The scenarios that cross the building blocks of chapter 5: an issue's way from intake to merge (6.1), a coordinator round with its workers (6.2), a token rotation (6.3), a sandbox's setup (6.4) and a docs-site publish (6.5). Each shows who talks to whom; the rules of each step stay on the how-to page it links.

6.1 From idea to merge

flowchart LR
    input(["Owner input"]) --> intake["workflow:intake"]
    intake --> issue["Issue or milestone<br/>with priority"]
    issue --> coord["Coordinator"]
    coord --> worker["Worker in<br/>its own worktree"]
    worker --> pr["Pull request"]
    pr --> ci["CI checks"]
    pr --> ai["AI reviewers:<br/>claude-review, Copilot"]
    ci --> merge{"Merge"}
    ai --> merge
    merge --> update["Plugin update<br/>through the marketplace"]
    update -- "next session" --> coord

    classDef person fill:#ffe8b0,stroke:#9a6b00,color:#000
    classDef built fill:#b7e4c7,stroke:#2d6a4f,color:#000
    classDef planned fill:#c6dcff,stroke:#1168bd,stroke-dasharray:4 3,color:#000
    classDef external fill:#e6e6e6,stroke:#6b6b6b,color:#000
    class input person
    class intake,issue,coord,worker,pr,ci,ai,merge,update built
Colour Meaning
green built
light orange the owner
Step From → To What Status
1 Owner → workflow:intake new work, an idea or a question becomes a checked issue or milestone with its priority (work-items.md) built
2 Issue → coordinator → worker the coordinator picks the next issue and starts one worker in a worktree of its own (parallel-work.md) built
3 Worker → pull request the worker builds test first, runs the gate and opens one pull request (quality-gate.md) built
4 Pull request → CI, AI reviewers the CI checks run the machine checks; claude-review and Copilot review the pull request once it is ready (7.1.4) built
5 CI, AI reviewers → merge the coordinator merges a routine pull request, the owner approves or merges the rest (decisions.md) built
6 Merge → plugin update → coordinator a merged plugin change reaches every machine through the marketplace at the next session's start (setup/marketplace.md) built

The same way as a sequence, with the merge kinds that decide who merges (decisions.md):

sequenceDiagram
    actor owner as Owner
    box rgb(183,228,199) Built
        participant intake as Intake
        participant coord as Coordinator
        participant worker as Worker
        participant ci as CI checks
    end
    box rgb(230,230,230) External
        participant gh as GitHub
        participant copilot as Copilot
    end

    owner->>intake: new input
    intake->>gh: checks open issues and code
    intake->>owner: proposed issues
    owner->>intake: yes
    intake->>gh: files the issues
    coord->>gh: candidates, claim
    coord->>worker: start in its own worktree
    worker->>gh: reads the issue, checks it against the code
    opt a question only the owner can answer
        worker->>owner: decision page
        owner-->>worker: answer, read back
    end
    worker->>gh: test first, gate, push, pull request
    worker->>coord: pr_open
    gh->>ci: check, claude-review
    gh->>copilot: review request
    ci-->>gh: checks, findings
    copilot-->>gh: findings
    worker->>gh: fixes until green
    worker->>coord: green
    alt merge:agent
        coord->>gh: merge
    else needs:owner-approval
        owner->>gh: approve
        coord->>gh: merge
    else needs:owner-merge
        owner->>gh: merge
    end
    coord->>gh: cleanup, claim released
Colour Meaning
green box built
grey box external
outside the boxes the owner
Step From → To What Status
1 Owner → Intake new input—an idea, a bug noticed in passing, a question built
2 Intake → GitHub checks the input against the open issues and the code; an independent reviewer checks each draft (workflow plugin page) built
3 Intake → Owner → Intake the proposed issues with type, priority and milestone; nothing is written before the owner's yes built
4 Intake → GitHub files the issues built
5 Coordinator → GitHub picks the candidates by stream and priority, claims one issue (parallel-work.md) built
6 Coordinator → Worker starts a background session on its own branch and worktree, with the handover built
7 Worker → GitHub reads the issue and checks it against the repository built
8 Worker → Owner a question only the owner can answer goes on the decision page; the worker reports blocked and the answer is read back built
9 Worker → GitHub builds test first, runs the gate's two halves, pushes and opens the pull request with its merge label (quality-gate.md) built
10 GitHub → CI checks, Copilot the machine checks, the Claude review and Copilot's review (ci/checks.md) built
11 Worker → GitHub → Coordinator judges and fixes the findings until the pull request is green, then reports green (quality-gate.md) built
12 Coordinator, Owner → GitHub merge:agent: the coordinator merges; needs:owner-approval: the owner approves, the coordinator merges; needs:owner-merge: the owner merges (quality-gate.md) built
13 Coordinator → GitHub cleans up the worktree, the branch and the session, and releases the claim built

How each step is done: sdlc/index.md and quality-gate.md.

6.2 A coordinator round

One round of a coordinator with its workers. The round starts on the coordinator's start, on a check-in or when its watch wakes it; between rounds it waits on the watch, never on a poll.

sequenceDiagram
    box rgb(183,228,199) Built
        participant coord as Coordinator
        participant cmd as coordinator command
        participant snap as Status snapshot
        participant mods as owner-desk, coordinator-mod
        participant worker as Worker
    end
    box rgb(230,230,230) External
        participant gh as GitHub
    end

    coord->>cmd: status
    cmd->>gh: claims, pull requests, checks
    cmd->>snap: writes the snapshot
    mods->>snap: read it
    coord->>cmd: cleanup of what merged
    cmd->>gh: claim released
    coord->>cmd: candidates
    cmd-->>coord: free slots, next issues
    coord->>cmd: start
    cmd->>gh: claim
    cmd->>worker: background session in its worktree
    coord->>cmd: watch, in the background
    worker->>cmd: report pr_open, green or blocked
    worker->>coord: one-line message
    cmd-->>coord: watch wakes: merged, label, approval, worker gone
    coord->>cmd: merge
    cmd->>gh: merge, announce
Colour Meaning
green box built
grey box external
Step From → To What Status
1 Coordinator → command → GitHub coordinator status reads the claims, the pull requests and their checks; on a restart it lists the workers to resume first built
2 Command → status snapshot → mods the snapshot holds the tasks, the machine's load and the owner's to-do; owner-desk and coordinator-mod read it (5.2.5, 5.2.6) built
3 Coordinator → command → GitHub coordinator cleanup of the merged tasks: worktree, branch, session, claim released built
4 Coordinator → command coordinator candidates: the free slots by memory and load, and the issues that can start by stream and priority (parallel-work.md) built
5 Coordinator → command → GitHub, Worker coordinator start claims the issue and starts the worker in its own worktree (6.1, steps 5–6) built
6 Worker → command, Coordinator the worker records its report with coordinator report and sends one line built
7 Command → Coordinator coordinator watch wakes the coordinator on what it acts on: a merge or close, a merge label, the owner's approval, a worker ending or stalling built
8 Coordinator → command → GitHub coordinator merge re-checks the merge rules, merges and announces a plugin change to the peer coordinators; the next round cleans up built

The rules of a round: sdlc/parallel-work.md and the workflow plugin page.

6.3 A token rotation

The tokens of the bot's sessions on the Linux host, rotated by the Linux host scripts (5.2.10); from the owner's workstation, the workstation's scripts run the same over SSH. Where the token file is a cache of Bitwarden, the new value goes into the vault instead and the vault sync writes it into the file (setup/secrets.md).

sequenceDiagram
    actor owner as Owner
    box rgb(183,228,199) Built
        participant rot as Token rotation
        participant file as Token file
        participant home as Home session
    end
    box rgb(230,230,230) External
        participant gh as GitHub
        participant sbx as sbx proxy
    end

    owner->>rot: rotate
    rot->>gh: device flow
    owner->>gh: confirms the code as the bot account
    gh-->>rot: new token
    rot->>gh: test: account, scopes
    rot->>file: stage the new token, keep the old one to revoke
    sbx->>file: token helper reads it on the next refresh
    owner->>home: restart, if it runs
    owner->>rot: clean
    rot->>gh: revoke the replaced token
Colour Meaning
green box built
grey box external
outside the boxes the owner
Step From → To What Status
1 Owner → token rotation → GitHub a new GitHub token by device flow, confirmed by the owner signed in as the bot account; the other services' tokens the same way or by hand built
2 Token rotation → GitHub the new token is tested before it is staged: the account it acts as and its scopes built
3 Token rotation → token file staged; the replaced GitHub token is kept to be revoked built
4 sbx proxy → token file the sandboxes use the new token from their next refresh, through the token helper; no token enters a VM built
5 Owner → home session the home session, if it runs, uses it only after its unit's restart: staged and active apart built
6 Token rotation → GitHub clean revokes the replaced tokens once nothing uses them built

How to rotate: setup/token-rotation.md.

6.4 A sandbox's setup

A repository's Docker Sandbox on the Linux host, from its setup to the coordinator running in it, by the sandbox scripts (5.2.12). The workstation's scripts ran the same steps on Windows, with the secrets from Bitwarden; they are on hold since 2026-11-21 (#947).

sequenceDiagram
    actor owner as Owner
    box rgb(183,228,199) Built
        participant setup as Sandbox setup
        participant host as Linux host scripts
        participant prov as Provisioning
        participant coord as Coordinator
    end
    box rgb(230,230,230) External
        participant systemd as systemd user manager
        participant sbx as sbx
        participant gh as GitHub
    end

    owner->>host: one-time root steps
    owner->>setup: setup, as claude
    setup->>systemd: lifecycle script, token helper, units
    setup->>sbx: settings, secrets, network policy
    setup->>sbx: create the sandbox
    setup->>host: root packages inside the VM
    setup->>prov: provision inside the VM
    prov->>gh: plugins from the marketplace
    setup->>systemd: enable and start the sandbox's unit
    systemd->>sbx: start detached
    systemd->>coord: start or resume the coordinator
    loop the watch
        systemd->>coord: bring it back when its process ended
    end
Colour Meaning
green box built
grey box external
outside the boxes the owner
Step From → To What Status
1 Owner → Linux host scripts the one-time root steps, from the owner's own clone built
2 Owner → sandbox setup → systemd as the user claude: the lifecycle script and the token helper copied, the user units installed; no step needs root built
3 Sandbox setup → sbx Remote Control allowed in sandboxes, each secret read through the token helper, the network policy with the hosts on the allowlist (setup/network-allowlist.md) built
4 Sandbox setup → sbx, Linux host scripts each listed sandbox created, then the packages provisioning needs, as root inside the VM only built
5 Sandbox setup → provisioning → GitHub from inside the VM: the tools, the plugins and the settings a coordinator needs (setup/linux-host.md) built
6 Sandbox setup → systemd → sbx, Coordinator the unit starts the sandbox detached and then the coordinator inside, resuming its last session when its transcript is there built
7 systemd → Coordinator the watch brings back a coordinator whose process ended (7.1.1) built

How to set it up: setup/linux-host.md and, on hold, for Windows: setup/owners-workstation.md.

6.5 A docs-site publish

A change to the site's inputs, from its pull request to the public site, by the docs site's build and gate in the CI checks' pages workflow (5.2.17).

sequenceDiagram
    box rgb(183,228,199) Built
        participant worker as Worker
        participant pages as pages workflow
        participant build as Site build and hooks
        participant gate as Site checks and gate
    end
    box rgb(230,230,230) External
        participant gh as GitHub
        participant ghp as GitHub Pages
    end

    worker->>gh: pull request that changes the site's inputs
    gh->>pages: run without the deploy
    pages->>build: lint, strict build
    pages->>gate: checks and gate
    gate-->>gh: findings by file, line and rule
    gh->>pages: push to main: the same build, checks and gate
    pages->>ghp: deploy, only when every step passed
Colour Meaning
green box built
grey box external
Step From → To What Status
1 Worker → GitHub → pages workflow a pull request that changes the site's inputs runs every step but the deploy, so a finding shows before the merge built
2 Pages workflow → site build the Markdown lint, then the strict build with its hooks (docs site) built
3 Pages workflow → site checks and gate the site check against the publish list, then the gate over the built site built
4 Site checks and gate → GitHub each finding by file, line and rule, never the value built
5 GitHub → pages workflow → GitHub Pages on the push to main the same steps run again, and the deploy runs only when every one of them passed built

The steps and what each protects against: ci/checks.md.