actorA critically loaded machine refuses new agents and stops none
spec:cc-agents.machine-guardPacks: none
Design: 4 design entries · 4 pinned declarations · no decisions
Findings: no errors, no warnings
specs/runner/machine-guard.sdp.md
No open questions and no blocking questions; implementation binding present, verifier binding present, and expected-outcome oracle none.
The machine guard is plugin/sidecar/machine.mjs. The sidecar asks it before it takes a slot. The caps keep one harness from taking every slot, and this guard keeps the machine itself from breaking.
Intent
- The sidecar that is about to start a turn.
problem- Many agents on one machine can drive it into swapping or a stall, and a plugin that merely counts turns cannot see that.
outcome- A new start waits, saying why, while the machine is critical, and every running turn goes on.
value- A fan-out cannot break the machine it runs on, at the price of a minimal sensor.
Behavior
rule.kernelSignalFirstline 22 ·specs/runner/machine-guard.sdp.md:22- Memory is judged on the kernel's own pressure signal where there is one, macOS's pressure level or Linux's pressure stall information, and on available memory only as the fallback, because free memory alone misleads.
no example exercises it
rule.cpuNeedsMinutesline 23 ·specs/runner/machine-guard.sdp.md:23- The CPU run queue makes the machine busy at 1.5 runnable threads per core over a minute and critical only at 4 per core over five minutes.
no example exercises it
rule.criticalOnlyline 25 ·specs/runner/machine-guard.sdp.md:25- A start is refused only while the machine is critical, with the reason, and a busy machine starts it.
no example exercises it
rule.waitingStartline 26 ·specs/runner/machine-guard.sdp.md:26- A start the guard refuses waits, saying why, and runs once the machine is admitted.
no example exercises it
rule.neverRefuseBlindline 27 ·specs/runner/machine-guard.sdp.md:27- Sensors that fail never refuse a start.
no example exercises it
rule.cachedline 28 ·specs/runner/machine-guard.sdp.md:28- The sample is measured at most once every two seconds.
no example exercises it
rule.worstReasonline 29 ·specs/runner/machine-guard.sdp.md:29- A reading with a memory and a CPU finding names the worse one, or both.
no example exercises it
0 unkeyed rules.
Design
levelsline 33 ·specs/runner/machine-guard.sdp.md:33ok,busy,critical.no citation recorded
sampleline 34 ·specs/runner/machine-guard.sdp.md:34sample()returns{ level, memory, cpu, reason }.no citation recorded
admitline 35 ·specs/runner/machine-guard.sdp.md:35admit({ capKey })returns{ ok: true }or{ ok: false, reason }.no citation recorded
recordedReadingsline 36 ·specs/runner/machine-guard.sdp.md:36CC_AGENTS_MACHINE_READINGSnames a file of sensor readings, in the shape of the fixtures under tests/fixtures/machine, used instead of this machine's sensors.no citation recorded
Verification
Verifier bindings
- test:cc-agents.machine-suite · the machine guard against recorded sensor readings · anchored · test anchor binding present ·
tests/machine.test.mjs:4 - test:cc-agents.sidecar-suite · the sidecar, the Codex adapter, the slots and the guard against a fake Codex app-server · anchored · test anchor binding present ·
tests/sidecar.test.mjs:4
Design view
Requirement drawing
- Declared verifying examples: no declared verifying example.
The diagram as text
- spec:cc-agents.machine-guard: A critically loaded machine refuses new agents and stops none · declared Spec
- spec:cc-agents.runner: Other model families run as real Claude Code agents · declared Spec
- impl:cc-agents.machine: judges how loaded the machine is and admits a start unless it is critical · anchored code ·
plugin/sidecar/machine.mjs:20 - impl:cc-agents.sidecar: the per-session sidecar: owns each harness turn, its events and its slot, and drives every adapter through the contract · anchored code ·
plugin/sidecar/server.mjs:12 - test:cc-agents.machine-suite: the machine guard against recorded sensor readings · anchored test binding · binding present ·
tests/machine.test.mjs:4 - test:cc-agents.sidecar-suite: the sidecar, the Codex adapter, the slots and the guard against a fake Codex app-server · anchored test binding · binding present ·
tests/sidecar.test.mjs:4 - spec:cc-agents.machine-guard refines spec:cc-agents.runner · declared
- impl:cc-agents.machine satisfies spec:cc-agents.machine-guard · anchored
- impl:cc-agents.sidecar references spec:cc-agents.machine-guard · anchored
- test:cc-agents.machine-suite verifies spec:cc-agents.machine-guard · anchored
- test:cc-agents.sidecar-suite verifies spec:cc-agents.machine-guard · anchored
Mermaid source
Copyable source; the Studio draws static SVG.
Preferred syntax: requirementDiagram. Chosen syntax: flowchart TB because references require exact labels unavailable in requirement syntax.
Decisions
No decision record named.
Runtime
impl:cc-agents.machine· judges how loaded the machine is and admits a start unless it is critical ·plugin/sidecar/machine.mjs:20Uses
None.
Runtime observation: not tracked.
Evidence
Runtime observation: not tracked.
Build attestations: not tracked.
Deployments: not tracked.
Bills of materials: not tracked.
Impact
The diagram as text
- spec:cc-agents.machine-guard: A critically loaded machine refuses new agents and stops none
- spec:cc-agents.runner: Other model families run as real Claude Code agents
- spec:cc-agents.sidecar: One sidecar per Claude session owns the session's harness turns
- spec:cc-agents.machine-guard refines spec:cc-agents.runner · declared
- spec:cc-agents.sidecar dependsOn spec:cc-agents.machine-guard · declared — a start waits while the machine refuses it
Mermaid source
Copyable source; the Studio draws static SVG.
Preferred syntax: flowchart. Chosen syntax: labelled flowchart, preserving exact relations, claims and folds.
Rests on
- refines · spec:cc-agents.runner · stated defined, floor ready
Rested on by
Distance 1
- spec:cc-agents.sidecar
Implementing units
impl:cc-agents.launch·plugin/sidecar/launch.mjs:7impl:cc-agents.sidecar·plugin/sidecar/server.mjs:12
Referencing units
None.
Enabled verifiers: test:cc-agents.sidecar-suite
Packs: None
Distance 2
- spec:cc-agents.mod-layer
Implementing units
impl:cc-agents.mod·plugin/hooks/register.js:9
Referencing units
None.
Enabled verifiers: test:cc-agents.mod-suite
Packs: None
- spec:cc-agents.pane
Implementing units
impl:cc-agents.harness-options·plugin/hooks/harnesses.js:5impl:cc-agents.pane·plugin/hooks/pane.js:13
Referencing units
None.
Enabled verifiers: test:cc-agents.mod-suite, test:cc-agents.pane-suite
Packs: None
- spec:cc-agents.relay-job-type
Implementing units
impl:cc-agents.mod·plugin/hooks/register.js:9impl:cc-agents.relay-header·plugin/sidecar/relay-header.mjs:9impl:cc-agents.sidecar·plugin/sidecar/server.mjs:12
Referencing units
None.
Enabled verifiers: test:cc-agents.mod-suite, test:cc-agents.sidecar-suite
Packs: None
- spec:cc-agents.runner
Implementing units
None.
Referencing units
None.
Enabled verifiers: None
Packs: None
- spec:cc-agents.steering-and-stop
Implementing units
impl:cc-agents.mod·plugin/hooks/register.js:9impl:cc-agents.sidecar·plugin/sidecar/server.mjs:12
Referencing units
None.
Enabled verifiers: test:cc-agents.mod-suite, test:cc-agents.sidecar-suite
Packs: None
Distance 3
- spec:cc-agents.adapter-contract
Implementing units
impl:cc-agents.codex·plugin/sidecar/adapters/codex.mjs:15impl:cc-agents.opencode·plugin/sidecar/adapters/opencode.mjs:26impl:cc-agents.sidecar·plugin/sidecar/server.mjs:12
Referencing units
None.
Enabled verifiers: test:cc-agents.opencode-suite, test:cc-agents.sidecar-suite
Packs: None
- spec:cc-agents.codex-adapter
Implementing units
impl:cc-agents.codex·plugin/sidecar/adapters/codex.mjs:15
Referencing units
None.
Enabled verifiers: test:cc-agents.sidecar-suite
Packs: None
- spec:cc-agents.cross-session-slots
Implementing units
impl:cc-agents.sidecar·plugin/sidecar/server.mjs:12impl:cc-agents.slots·plugin/sidecar/slots.mjs:16
Referencing units
None.
Enabled verifiers: test:cc-agents.sidecar-suite
Packs: None
- spec:cc-agents.exact-answer
Implementing units
impl:cc-agents.mod·plugin/hooks/register.js:9
Referencing units
None.
Enabled verifiers: test:cc-agents.mod-suite
Packs: None
- spec:cc-agents.hq-links
Implementing units
None.
Referencing units
None.
Enabled verifiers: None
Packs: None
- spec:cc-agents.installation
Implementing units
None.
Referencing units
impl:cc-agents.harness-options·plugin/hooks/harnesses.js:5
Enabled verifiers: None
Packs: None
- spec:cc-agents.model-templates
Implementing units
impl:cc-agents.harness-options·plugin/hooks/harnesses.js:5impl:cc-agents.mod·plugin/hooks/register.js:9
Referencing units
impl:cc-agents.sync-templates·scripts/sync-templates.mjs:10
Enabled verifiers: test:cc-agents.mod-suite
Packs: None
- spec:cc-agents.opencode-adapter
Implementing units
impl:cc-agents.opencode·plugin/sidecar/adapters/opencode.mjs:26
Referencing units
None.
Enabled verifiers: test:cc-agents.opencode-suite
Packs: None
- spec:cc-agents.work-containment
Implementing units
impl:cc-agents.groups·plugin/sidecar/groups.mjs:13impl:cc-agents.guard·plugin/sidecar/guard.mjs:16
Referencing units
None.
Enabled verifiers: test:cc-agents.sidecar-suite
Packs: None
Relations
| Relation and direction | Other end | Claim | Reason | Exercised keys |
|---|---|---|---|---|
| refines · outgoing | Other model families run as real Claude Code agentsspec:cc-agents.runner · resolves | declared | None | None |
| dependsOn · incoming | One sidecar per Claude session owns the session's harness turnsspec:cc-agents.sidecar · resolves | declared | a start waits while the machine refuses it | None |
Bindings
Implementation binding: present
impl:cc-agents.machine· judges how loaded the machine is and admits a start unless it is critical ·plugin/sidecar/machine.mjs:20
Design reference: present
impl:cc-agents.sidecar· the per-session sidecar: owns each harness turn, its events and its slot, and drives every adapter through the contract ·plugin/sidecar/server.mjs:12
Verifier binding: present
- test:cc-agents.machine-suite · the machine guard against recorded sensor readings · anchored ·
tests/machine.test.mjs:4· test anchor - test:cc-agents.sidecar-suite · the sidecar, the Codex adapter, the slots and the guard against a fake Codex app-server · anchored ·
tests/sidecar.test.mjs:4· test anchor
Expected-outcome oracle: none
Runtime observation: not tracked.
Run results: not recorded in the graph.
Findings
None.
Composing (0)
Composing needs the script.