From DOS — the trust substrate for agent fleets
Chains snapshot, lane arbitration, gating, ship, and archive for one dispatching lane with concurrency safety. Use when planning and shipping a single batch with parallel collision avoidance.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dos-kernel:dos-dispatchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **The concurrency-safe dispatch.** It chains `/dos-next-up` (the packet) to a
The concurrency-safe dispatch. It chains
/dos-next-up(the packet) to a ship, but first takes a lane lease through the admission kernel so several dispatches on disjoint lanes run in parallel without editing the same files. The "may I run on this lane" decision is the kernel's (dos arbitrate), not inline prose. Every path/lane comes fromdos doctor --json; nothing is hardcoded.
The shape: discover → take a lane → snapshot → gate → ship → archive. The
lane taxonomy and the run-dir location are data ([lanes], [paths]); the
admission and the gate verdict are kernel syscalls.
--lane <name> (optional) — the lane to dispatch on (a name from the active
[lanes]). Omitted = a bare auto-pick: the arbiter picks a free lane from the
autopick ladder.--leases <json> (optional) — the live leases other dispatches hold, as a JSON
list of {lane, lane_kind, tree} (the arbiter keys exclusivity on lane_kind,
so include it — cluster/keyword/global). In a real loop these come from a
status query; for a single dispatch this is usually [].dos doctor --workspace . --json
Read lanes (the taxonomy), paths.next_packets (packet output), and
paths.runs (the run dir to archive under). Use these; never hardcode a lane
name or a run path.
Ask the kernel whether this dispatch may run on the requested lane, given the live leases. The arbiter runs the tree-disjointness algebra over the lanes' declared trees — two dispatches on disjoint trees both ADMIT; overlapping trees COLLIDE.
dos arbitrate --workspace . --lane <LANE> --kind cluster --leases '<LIVE_LEASES>'
Read the LaneDecision JSON: {outcome, lane, tree, reason, free_clusters, …}.
outcome: "acquire" → admitted. lane is the lane to run on (may differ from
the request when auto-pick reassigned it); tree is its file tree. Proceed.outcome: "refuse" → not admitted. reason explains why; free_clusters
lists lanes you could pick instead. Stop (or retry on a free lane). Do not
force — --force is an operator-only override, not an automation default.The exit code mirrors the outcome (0 = acquire, 1 = refuse), so the screenplay can branch on it directly.
Run /dos-next-up scoped to the acquired lane:
/dos-next-up --scope <LANE>
It writes a packet under paths.next_packets and returns its path + a gate
verdict. Capture the packet path and its .dispositions-<tag>.json sidecar.
Before shipping, classify the packet so an empty packet doesn't launch a no-op ship:
dos gate --workspace . <paths.next_packets>/.dispositions-<tag>.json
Branch on the exit code (the verdict IS the code):
0 LIVE → there is dispatchable work; proceed to Step 4 (ship).3 DRAIN → empty backlog; skip the ship, archive a no-op, report drained.4 STALE-STAMP → shipped-but-unstamped drift; skip the ship, surface the
drift for reconciliation (a /dos-replan can stamp it).5 BLOCKED → picks blocked; skip, surface.6 RACE → lost a render race; retry the snapshot once.Launch the packet's dispatch list (the per-pick prompts /dos-next-up rendered).
How you ship is host-shaped — the generic baseline launches each pick's prompt as
its own agent. Record what shipped.
Write a run record under paths.runs (the run dir from dos doctor --json): the
lane, the packet path, the gate verdict, and what shipped. Commit it with a
generic subject — read your trunk and ship-grammar from config; do not hardcode
a commit prefix. (dos doctor --json's stamp names the active grammar.)
If you took a cross-process dos lease for the archive, release it:
dos lease --workspace . release <owner>
The lane lease itself is advisory state in live_leases; a real loop
(/dos-dispatch-loop) threads it forward. A single dispatch simply finishes.
Shipping on one lane surfaces work that belongs to another: a bug in a
different tree, a missing test, a doc that drifted from the code. Do not absorb
it into this run's commits — the lease covers ONE lane's tree, and a widened
diff is exactly the collision the admission kernel exists to prevent. Do not
let it evaporate either. If the workspace has a public issue tracker (on a
GitHub-hosted repo, the gh CLI), capture it there, then return to the leased
lane:
gh issue list --search "<keywords>" — and comment on the existing issue rather than opening a twin.--body-file); a hit is a refusal, not a warning.Fixes #N in the commit BODY of the change that resolves it — the platform
closes the issue when that commit lands on the trunk, an ancestry check the
claimant didn't author (the same witness dos verify rides). gh issue close off "I fixed it" is the self-report this kernel exists to refuse;
non-commit closes (duplicate, wontfix) are operator moves an agent may
propose, never execute.dos arbitrate),
not the heavy per-pick soft-claim core (CLAUDE.md heavy tier). Two loops on
the same lane serialize on the lane, not on individual picks./dos-dispatch-loop adds the cadence.[stamp] and assembles a generic archive record.Log the gap, never silently skip it. The first time the skill would have
reached for one of these (a per-pick soft-claim, a focus-scheduler pick, a
rate-limit resume), emit a one-line log naming what it is not doing — so the
capability gap is surfaced at runtime, matching /dos-dispatch-loop.
The shape, run for real.
doctor → arbitrate → gate → ship → verify, with the actualLaneDecisionJSON and the exit codes that branch it. Captured against a live DOS workspace (dos 0.28.0); copy-paste, then read the RUNG.
$ dos doctor --workspace . --json
{ ... "lanes": {"concurrent": ["benchmark","docs","examples","scripts","spikes","src","tests"],
"exclusive": ["global"], "autopick": ["benchmark","docs",...,"tests"]},
"paths": {"plans_glob":"docs/**/*-plan.md","next_packets":".dos/verdicts","runs":".dos/runs"},
"stamp": {"style":"grep"}, "overlap_policy": {"active":"prefix"} }
The WCR on-ramp — lanes/paths/stamp are DATA. Nothing below is hardcoded.
$ dos arbitrate --workspace . --lane src
{"auto_picked":true,"free_clusters":[],"lane":"benchmark","lane_kind":"cluster","outcome":"acquire","pick_count":null,"reason":"auto-picked free cluster lane benchmark (requested src was refused: lane src would edit the orchestrator's own running code … (SELF_MODIFY) …).","tree":["benchmark/**"]}
exit 0 (acquire) — but you asked for src and got benchmark: the admission
conjunction refused the hint (here SELF_MODIFY — on the kernel's own repo src/**
IS the running kernel; a lane contended by a live lease redirects the same way,
with the real reason in the parenthetical), so the kernel redirected rather than
double-book. A free, admissible lane you name is granted directly. Run on
lane (= benchmark), not your request. exit 1 (refuse) would mean stop / pick from free_clusters.
$ dos gate --workspace . .dos/verdicts/.dispositions-benchmark.json
The verdict IS the code: 0 LIVE → ship; 3 DRAIN → skip + archive no-op; 4
STALE-STAMP / 5 BLOCKED → skip + surface; 6 RACE → retry the snapshot once.
$ dos verify --workspace . docs/82_liveness-oracle-plan liveness --json
{"phase":"liveness","plan":"docs/82_liveness-oracle-plan","rung":"direct","sha":"80d4f30","shipped":true,"source":"grep-subject","summary":"80d4f30 liveness: exclude the BIRTH acquire from the ADVANCING event count"}
exit 0 SHIPPED — but source is grep-subject, not registry: a commit subject
carrying the phase token flips this true even if little was built. Read the rung.
$ dos verify --workspace . docs/99_runtime-validation-and-the-actuation-boundary halt --json
{"phase":"halt","plan":"docs/99_runtime-validation-and-the-actuation-boundary","shipped":false,"source":"none"}
exit 1 NOT_SHIPPED (source=none) — git ancestry never stamped it. The oracle closes
the phase from git, never from "I'm done." Then /release cuts the version.
--force-ing past a refuse in automation — a refuse means a real collision;
pick a free lane from free_clusters or stop.dos doctor --json.npx claudepluginhub anthony-chaudhary/dos-kernel --plugin dos-kernelCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.