Skip to content
Back to skills

Orchestrate

BSecurity

Standing mode for policy-resolved, worktree-isolated Dev flow runs. It dispatches scoped roles, owns run records and adjudication, monitors durable events, and schedules a merge queue without making product or safety choices. Use when coordinating one or more Dev Loop lanes. Invoke as /orchestrate.

  • 3 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added November 7, 2026
businessrustgoshellbashreactnodeexpressawsgitapi

Works with

  • claude code
  • cursor
  • terminal
  • cli
  • api

Security analysis

B75/100
  • criticalAccesses system keychains or credential stores

Pro scans all 20 files and shows the line behind each finding

Scanned November 25, 2026

npx -y skills add evanharmon1/harmon-devkit --skill orchestrate --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orchestrate?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Orchestrate
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/evanharmon1-orchestrate/badge)](https://www.skillsdirectory.com/skills/evanharmon1-orchestrate)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: orchestrate
description: >-
  Standing mode for policy-resolved, worktree-isolated Dev flow runs. It
  dispatches scoped roles, owns run records and adjudication, monitors durable
  events, and schedules a merge queue without making product or safety choices.
  Use when coordinating one or more Dev Loop lanes. Invoke as /orchestrate.
---

# Orchestrate

**Asset checkout freshness.** Orchestrator assets run from the default-branch tip
(a fast-forwarded primary checkout or an extracted copy), never from a stale tree.
`git fetch` alone does not sync the tools. On activation, before each dispatch,
and before each promotion, compare the checkout holding the vendored assets with
`refs/remotes/origin/HEAD`: stop with a `BLOCKER` when HEAD is behind or the
`.skills-sync.yaml` ref (or actual `.SKILLS_PROVENANCE` ref) differs from the
default branch pin. The blocker names both commits or pins and the command
`git -C <checkout> fetch origin && git -C <checkout> merge --ff-only origin/<default-branch> --no-edit`.
`assets/dev-flow-monitor.sh check-assets` is the shared read-only predicate,
called by activation, agent-run reservation, provisioning and promotion. Fetch
origin before these boundaries so the local default ref is current. A missing
default ref is indeterminate and blocks execution.

The canonical [label transition table](https://github.com/evanharmon1/harmon-devkit/blob/main/docs/dev-loop/label-lifecycle.md) owns lifecycle events, writer skills, object scope and coexistence. Follow it for label coordination; do not derive state from a second definition in this skill.

**Runtime assets travel with the skills.** Every executable this skill names is
vendored by `task sync:skills`, never fetched from a repository-root `scripts/`
path (harmon-devkit#974): a consumer that installed the skill has no such
directory, so a root-relative dependency installs a skill that cannot run. Two
shorthands are used below and resolve the same way in harmon-devkit's source
tree and in a consumer's flattened `.claude/skills/` one:

- `assets/<name>` — this skill's own asset, i.e. `${CLAUDE_SKILL_DIR}/assets/<name>`.
- `<package>/assets/<name>` — a sibling package's asset. **Resolve
  `${CLAUDE_SKILL_DIR}` physically first**, then append:

  ```sh
  skill_dir="$(cd "${CLAUDE_SKILL_DIR}" && pwd -P)"
  support_dir="$skill_dir/../dev-flow-support/assets"
  ```

  The `cd`/`pwd -P` is load-bearing, not ceremony: where the skills directory
  is reached through a symlink — harmon-devkit's own `.agents/skills/<name>`
  entries are symlinks into `ai/skills/<category>/` — a **logical**
  `${CLAUDE_SKILL_DIR}/../` splits by resolver. `ls` follows the link and
  succeeds; Node collapses `..` with `path.resolve()` before touching the
  filesystem and fails with `MODULE_NOT_FOUND`. Resolving physically first
  makes both agree. This is the same rule `dev-flow-support`'s own `SKILL.md`
  states for asset-to-asset calls; see it for the canonical wording.

  The shared dev-flow v2 runtime (`devflow-policy.mjs`,
  `validate-result-schemas.mjs`, `render-dev-flow.{sh,mjs}`,
  `dev-flow-exit.{sh,mjs}`) lives in `dev-flow-support/assets/`.

A missing sibling package is a blocker, not a fallback: vendor the `universal`
category as a unit rather than resolving a runtime path some other way.

Resolve and announce policy with `dev-flow-support/assets/devflow-policy.mjs`; record resolved
rigor, rounds, breadth, roles, strategy, and disclosures in the run. That
reader operates under `schema_version = 2` and under nothing else: a legacy,
v1, mixed, or unknown `.devflow.toml` is refused with one actionable message
(`copier update` against the harmon-init release shipping the version-2
template, and hold `.skills-sync.yaml` at the last pre-v2 skills release until
it has migrated). Report that message as a blocker and start no run; never
hand-decode an older shape, invent caps, or advance the pin to get past it
(harmon-devkit#604). `assets/consumer-pin-audit.sh` is the standing check
that a repository's vendored-skill pin and its policy shape agree. Runtime
isolation is optional; its absence alone is not a dispatch blocker. Every role
still stays within its declared scope. Use one worktree and branch per lane,
record ownership, scope, dependencies, and the complete file overlap.
Provisioning enforces `assets/dispatch-preflight.mjs` for implementer lanes only, using the conductor repository and its fetched default ref. For challenger, reviewer and integrator dispatch, the orchestrator must first run `assets/dispatch-preflight.mjs --rigor <run rigor> . "$(git symbolic-ref refs/remotes/origin/HEAD)" <harness> <role> [<effort>]` from the conductor, omitting the effort argument when the harness declares no efforts; no driver enforces it yet. A named refusal blocks dispatch; do not substitute an alternative. After the refusal line the CLI reports the one-rung escalation option that the default ref's `.devflow.toml` allows for that role at that rigor (`escalation-option role= rigor= tier_escalation= from= to=`), prints no option line when that rigor's `tier_escalation` is false or the role is already on the top rung, and prints `escalation-unavailable` when the policy cannot be resolved. The `from` rung is the role's rigor-profile tier, so an issue-derived or operator tier override is not reflected. The option is output only: disclose it; any escalation stays a separate orchestrator decision under the policy, never something the preflight or provisioning applies. Run the CLI by hand for a provisioning refusal to read the option.

Before dispatching overlapping scopes, either serialize them or record the
explicit merge dependency in both lane briefs.

Before tier resolution, bind `$repo` from the canonical target issue URL and
retain the validated target remote name as `$remote` in that lane's checkout.
Validate it with `gh repo view "$(git remote get-url "$remote")" --json url
-q .url`, requiring the result to equal `https://$host/$repo`
(case-insensitively), where `$host` is the canonical issue URL's host, as
`implement` step 1 does; `nameWithOwner` alone would accept a same-named
mirror on another host. A missing remote, failed lookup or mismatched target
is a blocker. This binding belongs to the target repository, which may differ
from the writable fork remote; pass it unchanged to step 0.

**Resolve each issue's Tier before you dispatch its lane, never by eye.**
Follow `dev-flow-support`'s § "Resolving an issue's Tier":
- Read the issue's `tier:<value>` label on every owner type, plus
  `tier:pinned`, its `tier:<role>:*`/`rigor:*`/`strategy:*` labels, and its
  Risk and Complexity, with the repository's owner type as `owner_type`: on
  an organization repository Risk and Complexity come only from issue
  fields, never a same-named label.
- Translate them with `dev-flow-support/assets/tier-inputs.mjs --policy
  .devflow.toml`, which
  reconciles label conflicts *before* the reader runs. A `tier:pinned` with
  more than one unqualified `tier:<value>` is an ambiguous pin: no
  `pinnedTier` is passed, a warning names both values, and
  the pin rung is dropped, so resolution continues through the remaining
  rungs.
- Pass the result to `devflow-policy.mjs resolve`. That is how the reader
  receives the issue as `issueTier` (Risk × Complexity, plus the stored Tier
  as a cache) and the pin as `pinnedTier`. When the Tier label is absent,
  the reader computes the Tier from Risk and Complexity.

Every resolution, at dispatch or any later re-resolution, runs the full
procedure, step 0 included. When the lane's working tree (committed,
staged, unstaged or untracked) differs from its merge base in
`.devflow.toml`, `agent-registry.json`, or the reader,
`toml-lite` or `tier-inputs.mjs` assets, the **merge-base** helper and reader
resolve it instead of the branch's
(the procedure's step 0). Decide that with `step0_probe "${remote:-}"`,
passing the `$remote` validated against the lane's target `$repo` above;
when it returns 2 (indeterminate), stop
rather than dispatching. A merge base that predates `tier-inputs.mjs` needs
an operator-pinned reader supplied outside the branch; without one the Tier
is indeterminate, never resolved by the branch copy. On a `strategy:*`
conflict an interactive orchestrator asks the operator, and unattended
dispatch takes `default_strategy` with the warning.
Label provenance is checked before translation, under § "Nothing here arms
anything" in `AGENTS.md`. Every `rigor:*`, `strategy:*` and `tier:<role>:*`
label you honor goes into the helper's `authorized_labels`. An unlisted one
is dropped with a warning (fail-closed). The pin's marker and value are
verified separately. Risk, Complexity and the stored Tier are ungated (ADR
2026-09-30 D3). Record the resolved implementer tier
and its source in the run and in the lane brief's `{{role-tiers}}`. Put the
`tier-inputs.mjs disclose` lines into the PR-body disclosure. They name:
- the tier source (pinned, rigor, derived, default);
- any pin-caused invariant break;
- any overridden role label;
- every warning.

In a repository whose `.devflow.toml` has no `[tier.matrix]`, a classified
issue whose Tier the **derived rung would decide** resolves indeterminate
(exit 3) and keeps its profile tier. That means no operator tier, no honored
pin, no `tier:implementer:*` label and no chosen rigor. When one of those
decides instead, it applies with exit 0; do not stop that run. This includes
harmon-devkit until its template update to the release carrying
harmon-init#1475. Disclose it; never guess a Tier.

## Planning

Multi-repository slates record the conductor origin as `plan.repo`. Each issue,
lane, overlap and merge-queue binding may carry `repo` (`owner/name`); omission
means the conductor. Identity is `(repo, number)`, never the number alone.
Foreign wave members and queue-order selectors use `owner/repo#N`; legacy
integer members remain conductor-local. `blocked_by` numbers and overlap merge
edges are local to their issue/overlap repository; cross-repository edges are
not supported. Independent repositories may own the same file path.

Use `plan-revise.mjs --repo owner/repo` beside `--issue N` for handoff, done
and release; expand may assert `--repo` beside its lane selector. Foreign lanes
record a provisioning snapshot in `base_sha`. At genesis, supply exactly one
`plan.repository_bases` entry (`{repo, base_sha}`) for each foreign repository
with issues, using that clone's fetched default branch. An addition introducing
a foreign repository supplies `repository_base: {repo, base_sha}`; later additions
reuse the recorded entry and omit this field. Only `base-move --repo` updates
an existing base. Entries survive handoff and completion because done issues
remain in the plan; entries without any issue are invalid. Lane snapshots are
never a source for repository bases. Conductor
base moves do not move foreign bases or test their fences against unrelated files.

Before provisioning or dispatching a slate, turn its single issue, explicit
issue list, milestone, or epic/umbrella issue with native sub-issues and the
resolved policy into a durable plan at
`<git-common-dir>/dev-flow-v2/slates/<slate-id>/plan.json`. Resolve the common
Git directory with `git rev-parse --git-common-dir`; a linked worktree's `.git`
path is a file and is never the shared-state root. Planning is orchestrator
judgement written down, not a new autonomous planner: the schema, validator,
and append-only recompute rule make its deterministic parts checkable.
A second writer of the same `plan.json` is a blocker: the slate lock in
§ "Durable orchestrator state" refuses it, by slate id and by the work itself.

Resolve the input read-only before building the graph:

```sh
node orchestrate/assets/slate-input.mjs --repo <owner/repo> --issue <number-or-issue-url>
node orchestrate/assets/slate-input.mjs --repo <owner/repo> --issues <number-or-url,number-or-url,…>
node orchestrate/assets/slate-input.mjs --repo <owner/repo> --milestone <number>
```

The JSON result records `input.kind` as `single`, `list`, `milestone`, or
`epic`. A single issue automatically becomes `epic` when its paginated native
GitHub sub-issue list is nonempty; the epic itself supplies context, never a
lane. Explicit lists stay literal and do not expand their members. Open
sub-issues become candidates, closed ones are listed as already `done`
(closed state takes precedence over labels), and open `human` or `umbrella`
sub-issues are excluded with a reason. The same state/label rules apply to
single issues, lists and milestones; milestone reads exclude pull requests.
Only direct sub-issues are expanded; an umbrella child is excluded rather than
recursively dispatched. An epic/umbrella without native children is treated
as a single issue and is excluded if labelled `human` or `umbrella`.

Cross-repository children follow the same candidate/done/excluded rules and
carry `repo`; keep that identity when constructing the plan. Require exit 0
and `ok: true`; a failed read must stop planning even when partial candidates
were returned. An empty
candidate set creates no dispatch work. Discovery never claims issues or
writes GitHub metadata. It does not replace the graph, live re-verification,
`needs-review` ownership checks or exclusion of blocked dependents below.

Copy the result's `input` object into the complete genesis input as
`plan.input`: `{kind: "single", url}` or `{kind: "epic", url}`,
`{kind: "list", urls: [...]}`, or `{kind: "milestone", number}`. Both plan
schemas validate this optional provenance; older plans without it remain
valid. `plan-revise.mjs genesis` retains it, and later revisions preserve it.
Reports can link to the epic using `plan.input.url`. Record the resolver's
`done` issues with verified `done` verdicts and exclude its excluded/refused
work from lanes; step 2 still owes live verification and dependency filtering.

Build and publish the plan in this order:

1. **Graph.** When `.foreman.toml` exists and the slate is milestone-backed,
   consume `task foreman:plan -- --milestone <n>` for dependencies, waves, and
   the ready set instead of reimplementing Foreman's graph. Otherwise read
   native blocked-by edges and the fixed `Blocked by:` fallback lines from
   `breakdown` §4. For single-issue, explicit-list or epic input in a Foreman
   repository, include its containing milestone in the graph input or stop if
   no authoritative Foreman graph can cover the candidate set.
2. **Re-verify.** Check every ready issue read-only against the live target
   tree. Record `valid`, `partial`, or `done` and a complete candidate-file
   list; issue-body line numbers are hints, never evidence. Remove `done`
   issues from dispatch waves without erasing their verified verdict. An
   issue labelled `human` — a `(HUMAN):`/`(QA):` collector or other
   human-only work — is never dispatched, so drop it from the slate before
   re-verifying, together with every slate issue it blocks: none of them
   enters `plan.issues`, a wave, or a lane (the plan schema has no verdict
   for them, and a dependent kept without its blocker would either dangle or
   dispatch early). The dependents re-enter a later plan once a human closes
   the precondition, and the run's human-work summary names all of them.
   For `needs-review`, use the [canonical label lifecycle](https://github.com/evanharmon1/harmon-devkit/blob/main/docs/dev-loop/label-lifecycle.md)
   and [glossary](https://github.com/evanharmon1/harmon-devkit/blob/main/docs/glossary.md).
   Exclude a `needs-review` issue only when it is open and has no lane in the
   current plan. Exclude its blocked dependents from dispatch too; retain the
   exclusion reason so they can be reconsidered after the precondition clears.
   A lane this run promoted stays in the plan as awaiting merge, and its
   dependents stay blocked until step 7 releases them. A closed issue is
   recorded `done` whatever its marker says; evaluate closed state before the
   `needs-review` exclusion. Labels alone never prove a merge or handoff.
   Current-plan ownership includes `verdict: "handed-off"` issues with a bound
   PR in `plan.issues` or `merge_queue`, whether parked or promoted, even after
   their `plan.lanes` entry releases its Working slot at handoff. Neither parked nor promoted
   handoffs owned by this plan are excluded when `needs-review` is present; both
   stay awaiting merge with dependents blocked until step 7 verifies the merge
   and releases them.
3. **Overlap.** Compare every pair of dispatchable candidate-file lists. Record
   the complete shared-path intersection for each overlapping pair, choose
   `serialize` or `split`, and record the resulting merge dependency. A split
   also becomes the ownership fence in both lane briefs; an overlap absent
   from the plan is not safe to dispatch.
4. **Cap.** Record which dispatcher applies and the cap it actually uses. An
   interactive orchestrator uses the resolved
   `[breadth].max_parallel_agents` directly. Only when Foreman is the dispatcher
   is that working-lane cap intersected with `.foreman.toml`'s `max_parallel`; a
   configured Foreman limit never lowers an interactive run's cap.
   An operator instruction naming only a lane count ("up to N parallel lanes")
   sets the working-lane cap. Keep the profile's in-flight cap, raised to N
   if N is larger, and announce both values. When N exceeds the profile's
   `max_parallel_agents`, record an operator pin on `max_parallel_agents`;
   when N also exceeds `max_in_flight`, pin that value too, preserving
   `max_in_flight >= max_parallel_agents`. Open tabs follow the in-flight
   set, including idle handed-off lanes, rather than the working set; a parked
   or blocked lane's pane may close under § Orchestrator autonomy contract.
5. **Project.** In a complete revision `plan`, record the resolved policy
   snapshot; re-verified issues and candidate files; pairwise overlaps and
   resolutions; waves; and lane, issue, branch, run id, and fence assignments.
   Each lane fence uses exactly the `brief.envelope.schema.json` `fence` item
   shape. Later authorized expansions append `{path, at, reason}` entries to
   that lane's `expansions` array instead of rewriting its original fence. An
   accepted expansion is a recomputation reason: before the lane edits the
   expanded path, publish a complete new revision through the candidate,
   validate, rename, and canonical-readback sequence in step 7.
   **Persist lane profiles at dispatch.** Write each lane's complete resolved
   profile as `{lane, policy}` in `plan.lane_profiles` in the validated
   revision before dispatch, including its caps, breadth, all five role tiers, sources and
   operator pins. `plan.policy` is the slate baseline; `lane_profiles` is a
   complete projection, not a partial override.
   A recorded lane profile is immutable for its run; changing it requires a new run.
   When the array is present it
   must cover every planned lane and name no unknown lane. On resume, read
   the last validated revision's lane profile for the lane brief and stage
   gates; never substitute the slate's global role tiers. Older plans without
   the array remain valid: before resuming dispatch, resolve every lane through
   the full tier procedure (step 0 included) and append a validated revision
   containing `lane_profiles`. Do not infer past lane refinements from the
   global baseline. If inputs cannot be recovered, stop as indeterminate.
6. **Reserve, emit and validate.** Before writing `plan.json` at all, take the
   slate lock with its explicit issue set.
   Every record write the orchestrator authors through
   `run-record.mjs` or `plan-revise.mjs` must be its own direct Bash command.
   The harness's permission check evaluates each Bash call's command text; a
   separate call keeps each write's result visible.

   Do not batch several such record writes in a here-document, a `bash -c`
   string, or an ad-hoc script the orchestrator writes. Vendored transaction
   assets are single commands and must never be split. Examples include
   `integrate/assets/promote.sh` for recorded promotion,
   `assets/provision-lane.mjs` for lane initialization, and
   `review/assets/record-pass.sh` for pass recording. This list is not exhaustive.

   When a direct write needs a value from an earlier command, read it from
   visible output and enter it in the next command; do not store it with
   `$(…)` or in a shell variable. Separate tool calls share no shell state.

   Run lock acquisition as its own command.
   Read its one-time token from the visible result.
   Include the optional milestone with the lock command,
   adding `--milestone <n>` for a milestone-backed slate (the lock reserves
   its scope; `plan.input` records its provenance):

   ```sh
   node dev-flow-support/assets/run-record.mjs lock acquire --slate <slate-id> --session <session> --issues <n,n,…> [--milestone <n>]
   ```

   A second orchestrator naming the same work is refused here, before it can
   publish a plan or dispatch anything. Publish revision 0 in a separate
   command, copying the owner token printed by lock acquisition into
   `--owner-token <token>`:

   ```sh
   node dev-flow-support/assets/plan-revise.mjs genesis --slate <slate-id> --session <session> --owner-token <token> --input <plan-input.json> --reason 'initial slate'
   ```

   The input is the complete plan content from step 5; overlap entries supply
   the chosen resolution and merge dependency, while the writer computes their
   complete shared paths. Genesis requires the already-held lock and refuses
   any issue outside its reservation; it never acquires a new lock. Validate with
   `node dev-flow-support/assets/validate-result-schemas.mjs plan <plan.json>`. Refuse dispatch
   on a structural error, a broken revision digest, an incomplete overlap set,
   a graph/projection mismatch, an ownership error, or a cap violation. Both
   writers refuse while the canonical plan names an issue outside the
   reservation, so a later revision that adds issues widens the reservation
   with `lock acquire --issues --owner-token <token>` first.
   Before dispatch, run `assets/validator-dependency-scan.sh --check-plan <plan.json>`
   with `--lane <id>` for each lane, against that lane’s repository checkout, to
   identify missing fence candidates and their reasons.
   Include each candidate or record an orchestrator waiver as described under
   [File-scope fences](#file-scope-fences); provisioning checks the selected lane again.
   Immediately before each lane dispatch, compare the live target head with the
   last revision's `plan.base_sha`; when they differ, recompute and validate the
   plan before dispatching.
7. **Recompute after every external merge.** Re-read the new default-branch
   head, release newly unblocked dependents, rebuild waves, and repeat live
   re-verification and pairwise overlap checks. Recompute the plan’s merge queue
   under [Merge queue procedure](#merge-queue-procedure); if its head merged,
   advance only the next eligible PR through catch-up and the live handoff check.
   That catch-up is the routine catch-up row of
   [Orchestrator autonomy contract](#orchestrator-autonomy-contract).
   Leave parked drafts behind until they reach the queue head. Append the next
   `revisions[]` entry with the complete new `plan` plus `seq`, `prev_digest`, `digest`, `at`,
   and `reason`, using the same canonical-JSON SHA-256 chain convention as
   `run.schema.json`; the digest covers the complete sorted-key `plan` and the
   chain fields. The last revision is current, and earlier revisions remain
   reconstructable without a second top-level projection. As the slate's single
   writer, write the complete candidate beside `plan.json`, validate that
   candidate with the `plan` kind, rename it over the canonical record, then
   validate the canonical readback. Either validation or rename failure is a
   blocker; dispatch and merge-queue mutation remain paused.
   The mechanical half of a base move — bump `base_sha`, retire done issues
   and their lanes, extend the chain — is
   `dev-flow-support/assets/plan-revise.mjs base-move`, which runs exactly
   that sequence. `--repo owner/name` selects a repository (default: conductor);
   `--done` and `--reverified` resolve issue numbers only there. Foreign moves
   inspect the matching sibling clone, or `--repo-root PATH` with a verified
   origin, and update the repository’s `repository_bases` entry plus its lane base snapshots.
   Legacy plans without that map use their consistent foreign lane bases.
   The conductor continues to use `base_sha`. It refuses, naming the paths or issues, whenever the move
   needs judgment: the new commits touch a live lane's fence or candidate
   files, or a done issue releases a dependent. After read-only re-verification
   against the new base, pass repeatable `--reverified <issue>` with a non-empty
   `--reason` to accept collisions for a live planned lane only when its run
   directory does not exist. The revision records the decision; original fences
   and candidate files stay unchanged. Other collisions and judgment refusals
   still block the whole revision. Fence expansions, overlap
   choices and wave changes stay yours; supply those decisions to the writers
   below. Every writer extends the digest chain and runs the same candidate,
   validate, rename and canonical-readback sequence. Original fences of existing
   runs never change; only dated expansions grow.

Apply step 2's `needs-review` exclusion on every step 7 recompute against the
current plan's lane membership and live issue state: exclude only open issues
without a lane in this plan, retain this run's promoted lanes as awaiting merge
with dependents blocked until their merge is verified, and record closed issues
as `done` regardless of markers before releasing newly unblocked dependents.
Exclude a `needs-review` issue only when it is open and has no lane in the
current plan. A lane this run promoted stays in the plan as awaiting merge,
and its dependents stay blocked until step 7 releases them.
Current-plan ownership includes `verdict: "handed-off"` issues with a bound PR
in `plan.issues` or `merge_queue`, whether parked or promoted, even after their
`plan.lanes` entry releases its Working slot at handoff. Neither parked nor promoted handoffs
owned by this plan are excluded when `needs-review` is present; both stay
awaiting merge with dependents blocked until step 7 verifies the merge and
releases them.

### Wave release

Wave boundaries express preference order; `blocked_by` and overlap merge
prerequisites express code dependencies. Wave 1 is implicitly released. To
release the next wave, every issue in earlier waves must be `done` or
`handed-off` with a bound PR, and every merge prerequisite of an issue being
released must be `done`. A parked draft or merge-ready queue head qualifies
only after the live handoff check passes; labels alone prove nothing. Record
that check with `plan-revise.mjs handoff --issue <n> --pr <n> --check-result <gate.json> --reason <evidence>`
before releasing the next wave. The binding may be on the issue or in
`merge_queue` in older plans. A code dependency still waits for its merge,
recorded as `done`; a preference wave does not wait for human merges.

Use `dev-flow-support/assets/plan-revise.mjs wave-release --wave <n> --reason
<handoff-evidence>` with the common revision arguments below. It appends a
validated, digest-chained revision with `released: true` on the next wave and
the supplied reason, preserving issue membership, PR bindings, lane assignments
and merge order. It refuses a skipped wave, incomplete predecessor handoffs,
or an unmerged prerequisite. Existing plans without release markers retain
their implicitly released first wave; later waves need an explicit release.
The validator still rejects an oversized wave even after earlier lanes release their Working slots.

Release establishes eligibility; dispatch must respect both Working lanes
(`max_parallel_agents`) and all in-flight issues (`max_in_flight`, defaulting
to `max_parallel_agents` for older profiles). Count an issue once when it has
`claim:*` or an open delivery PR, including parked and promoted PRs. A release
does not reserve a slot or dispatch lanes. `run-record.mjs` enforces both
ceilings at `lane-init` and retained-lane reactivation, under a
shared dispatch mutex held through the admission writes. `provision-lane.mjs` uses `lane-init`. The run record
stores the slate, projected counts and admission time; monitor `activate` requires
that admission and performs no capacity read. `solo-init` creates a
separate single-lane `solo-*` slate and is outside these per-slate breadth limits.
The guard counts dispatched issues from durable run records and historical plan assignments,
plus delivery PRs bound in run records, issue `pr` fields or `merge_queue`,
within the candidate slate. An open issue counts as Working when it carries `claim:*`,
or has an admitted, non-terminal slate run that has not yet reached the `claim`
stage. The pre-claim reservation applies only to capacity. A [handoff](https://github.com/evanharmon1/harmon-devkit/blob/main/docs/glossary.md#handoff)
follows a passing [handoff check](https://github.com/evanharmon1/harmon-devkit/blob/main/docs/glossary.md#handoff-check),
when the claim is removed. Closed issues occupy neither Working nor in-flight slots; fresh PR state
retains parked and promoted open deliveries in flight.
The candidate occupies one slot in both counts, even before initialization.
Planned, undispatched lanes occupy neither. A failed or incomplete live read
refuses dispatch; a refusal names the ceiling and projected counts. Older
profiles default the in-flight ceiling to the parallel ceiling. Recording handoff,
done or base movement must not fail because that count is at its ceiling.
Plan revisions publish `slated` membership through `plan-revise.mjs`: each
addition or removal writes a structured session, slate and action comment.
If a GitHub write fails after the plan commits, rerun `plan-revise.mjs
membership --slate <id> --session <session> --owner-token <token>` to reconcile
the recorded plan; do not append another revision merely to retry. A repository
without the `slated` label is reported as skipped. `wave-release` writes no
GitHub labels.

### Working-slot release and reactivation

Draft publication keeps the lane's active claim and Working slot through
integration. When a draft PR opens, run two commands in order:

1. `plan-revise.mjs bind-pr --issue N --pr P --reason <reason>` — records
   `issue.pr` in the dispatch plan without changing `issue.verdict`, moving the
   lane out of `plan.lanes`, or releasing the claim.
2. `track-work/assets/lifecycle-labels.sh claim --repo <owner/repo> --issue N --pr P --branch <branch> --record-file <claim.md> --claim-label <label> --registry-snapshot <registry.json> ...`
   — mirrors the active `claim:*` labels onto draft PR `#P` (since the initial
   claim usually ran before the PR existed, `bind-pr` writes only plan state, and
   the live claim already on the issue takes `claim-transaction.sh`'s idempotent
   `resume_exact` path without recording a duplicate claim).

Send every pre-handoff draft remediation round to that live lane while it
holds its Working slot and claim (`fix-request` and `reactivate` accept bound
draft PRs in `plan.lanes` alongside retained handed-off lanes; `wave-release`
and `merge_queue` eligibility stay keyed on `handed-off` / `done`, never a
bound unhanded draft).

Handoff releases a Working slot; it does not tear down a lane. Only after a
passing live handoff check, run
`plan-revise.mjs handoff --issue N --pr P --check-result <gate.json> --reason <reason>`.
The writer refuses missing, stale, failing, bad-condition, or wrong-head gate
evidence against live `OPEN` PR state and `headRefOid` before touching the
claim, then releases the current branch's chain-owned claim through
`track-work/assets/release-claim.sh` (shared across both `plan-revise.mjs
handoff` and `lifecycle-labels.sh` `park`, `promote`, and `close` under the
canonical `{repo, issue, branch}` idempotency key, clearing both the issue and
every open same-repo delivery PR and verifying both by re-reading). A release
refusal or partial release is an error, never a successful handoff. The writer
then reads live labels on both the canonical issue and its delivery PR and
requires a valid response with no `claim:*` or `agent:*` marker; even a
successful release that preserves an unowned marker cannot publish a handoff.
Because `plan-revise.mjs` and `lifecycle-labels.sh` share that canonical key
and release semantics, after either writer finishes, the other sees an
idempotent retry with zero duplicate mutations, and a retry after a partial
release completes it. The plan moves the lane and its complete policy to typed
`retained_lanes`, with state `idle`. It counts only toward `max_in_flight`
while its delivery PR is open.
Only § Lane teardown removes worktrees, after merge; a PR
closed without merging still requires the maintainer's go-ahead for teardown.
A parked or blocked lane's pane may close under § Orchestrator autonomy
contract; its worktree and branch stay until merge or close.

Send every post-handoff code-change round—late finding, red required CI, or a
conflicting catch-up—to that lane's existing session while it is alive; if its
pane was closed under § Orchestrator autonomy contract, relaunch the lane from
its brief and disposition files and send the round there. Record
`plan-revise.mjs fix-request --issue N --reason <finding>` with the usual slate,
session and owner-token arguments. This records `pending` before admission.
Run `plan-revise.mjs reactivate --issue N --reason <round>` (with the claim
resolver's explicit `--claim-record-file`, `--claim-label`, `--model-label`,
`--family`, and fetched `--registry-snapshot` inputs plus optional
`--runtime-environment` / `--allow-label-less` / `--approve-review-pullback`
for a retained handed-off lane, or without restore flags when reactivating a
bound pre-handoff draft PR whose claim was never released). Never infer a model
or re-add a label directly. If a verified late-review fix explicitly requires
pulling back an existing `needs-review` marker, pass
`--approve-review-pullback` only with the human's approval; by default the
claim transaction continues to refuse that pull-back. When restoring a claim on
reactivation, `claim/assets/claim-transaction.sh` mirrors the active claim
labels onto both the issue and every open same-repo delivery PR and verifies
both by re-reading. The writer first holds the shared dispatch mutex and
checks the same capacity predicate as `lane-init`; only after admission and
the complete working-state plan candidate passes overlap and schema validation does it invoke
`claim/assets/claim-transaction.sh` (when restoring) and record `working`.
A failed helper leaves the plan pending; retry the same record through the
transaction helper's idempotent path. Pending open-PR fixes take the next free
Working slot before any new lane. On success, send the fix round; the lane now
counts toward both ceilings.
After another passing handoff check, `handoff --issue N --pr P --check-result <gate.json>
--expected-revision R` returns it to `idle`. Capture the plan's current revision
`R` with that check; the writer compares it under the plan mutex. An unqualified
or stale handoff cannot release a working retained lane. If the revision moved,
repeat the live check before retrying. Initial handoff needs no revision flag.
Handoff, re-handoff and terminal `done` bookkeeping never check either ceiling.

Where integrate §6 requires a fresh run, pass `--run-id <fresh-id>` to
`reactivate`, then initialize that retained lane with `run-record.mjs lane-init`
and its immutable policy projection. For a retained lane, `lane-init` also
activates the monitor, creates `branch.json`, and advances the branch's active
pointer to the next generation. Deliver its returned `branch`, `generation`,
and `active_state_path` together with `run_id` and `record_directory` to the
retained session. The previous run must be terminal and stays unchanged.
A fresh implementer/session is allowed only when the original session is gone;
the status update must name the crash, usage limit, ended cloud lane or pane
closed under § Orchestrator autonomy contract.

**Keep the session's live slate.** A session adds issues to its live slate as
its queue grows. Use `dev-flow-support/assets/plan-revise.mjs add-issue --input
<issue.json>` rather than creating a slate per issue. All revision commands
also require `--slate`, `--session`, `--owner-token` and `--reason`. The input is
`{issue, lane, profile: {lane, policy}, overlaps?: [...], waves?: [...]}`:
the new issue and lane, its complete resolved profile, resolutions and merge
dependencies for its overlaps with live lanes, and optional complete wave
placement. The writer computes pairwise intersections, stores the profile in
`plan.lane_profiles`, and widens the held lock through its existing owner-checked
acquire path before publication. Existing reservations remain held.

Use `dev-flow-support/assets/plan-revise.mjs expand --lane <lane> --path <path>`
for one authorized expansion. It stamps `{path, at, reason}` itself and refuses
a timestamp earlier than the last revision or a path covered by any other live
lane's effective fence, including globs and lanes in other waves. The optional
`--at` timestamp is for reproducible operator input, never backdating.

After verifying an external merge, use
`dev-flow-support/assets/plan-revise.mjs done --issue <n> --reason <evidence>`
to retain the verified issue as done while retiring its lane without requiring
a base move. For a path handoff use
`dev-flow-support/assets/plan-revise.mjs release --issue <finished-issue>
--lane <receiver> --path <path>... --reason <evidence>` instead. Both retire the
source and apply supplied release decisions in ONE revision. Their optional
`--input` file is `{releases?: [{lane, paths}], addition?: <add-issue input>,
waves?: [...]}`. Existing receivers gain dated expansions; a receiver first
introduced by `addition` gets the paths in its original fence. A previously
planned receiver always keeps its original fence, even before dispatch. Released
paths must belong to the finished lane and must not remain covered by another
live lane. Supply complete `waves` when a merge changes placement; the writer
updates lane wave assignments and validates the resulting graph.

Candidate overlaps and effective fences are checked with glob-aware coverage
across all live lanes in the same repository, not just one wave. An unresolved collision is refused.
The schema records exact candidate-file intersections: when a glob-only
intersection cannot be represented, the writer refuses and asks for a shared
candidate entry plus the operator's resolution. It never invents fence scope or
overlap decisions. `base-move` keeps its mechanical-only refusal contract.

## Durable orchestrator state

After a restart, first run `assets/dev-flow-monitor.sh resume --slate-id ID`.
This read-only command reconstructs the latest slate from the Git common
directory: live runs, stages, generations, branches, bound PRs, lane statuses,
unreconciled reservations, terminal pointer prune candidates, and watcher argv.
Run it from the conductor checkout (or pass `--repo-root DIR`). Its JSON output
includes `watcher.argv` for `lane-watch.sh`; review it before re-arming the watcher.
The recovered watcher observes GitHub and durable lane status without guessing
lost session names. Reconnect local session supervision explicitly when needed.
Recovered live lanes preserve bound PR numbers and use each brief's recorded
local worktree for status head checks, including foreign and unpushed branches.
Saved statuses are labelled `current`, `stale`, or `unverifiable` against the
captured `local_branch_head`; an unavailable local head cannot attest a status.
Watcher arguments bind the conductor's registry path and immutable kickoff
revision through `--registry` and `--registry-revision`, independent of the tool
checkout and subsequent registry edits. Watched runs must retain matching active
pointers with the same registry revision. A terminal PR whose pointer has been
retired cannot supply that evidence and blocks watcher reconstruction; its
summary remains available. Different pinned revisions also block a shared watcher.
A missing run record is
undispatched only when no dispatch evidence survives; retained lanes, attempt
records, run files or active pointers make that loss a blocker.
Missing or ambiguous attempt evidence is reported as a blocker rather than a
watcher specification. No locks, records, pointers or watcher state are written.

The same output carries a compact operational `checkpoint`: one object per lane
plus a slate rollup, so a fresh context identifies its next step without
reconstructing history. `--now <UTC timestamp>` fixes the evaluation instant
(default: the current time in whole seconds, so `evaluated_at` can be passed back
as `--now`; an explicit empty `--now` is refused); there is no environment clock,
and the instant used is reported as `evaluated_at`. Per lane it gives the approved scope (issue,
wave, the lane's own `base_sha` or else the plan's with the source named, the
complete fence items with their section notes, the pinned plan revision), the constraints (caps, breadth with the
brief builder's `max_in_flight` default applied, parallel cap, role tiers, and
the operator pins' count and digest, with the pins themselves only when a lane
profile differs from the slate's, which carries them once), the lane's stage,
generation, branch, PR and head freshness, the budgets (challenge and review
rounds against the authorized ceiling, agent-run reservations, the wall-clock
deadline from `run.json` `started_at` plus the cap), the last completed action
(the last exited stage transition, which is where a finished detached
verification is recorded), pending decisions, `next`, and links to the canonical
evidence files. Sources are named where the code has one (the scope's plan,
`policy_source`, each budget's `source`, the last completed action's source);
a value with no durable source is `{status: "missing"}` with its reason, never
a default, and a malformed agent-run budget, including a malformed reservation
entry, is reported that way rather than as a number. Pending owner actions and waits, the ownership epoch and the
outcome and next-action vocabulary have none yet (#1891, #1890, #1892), and
integration and remediation budgets are counted by the checker and exit engine
rather than a record this view reads, so they are missing and `next.action` is
provisional. `conditions` surfaces a stale head, a stale reservation (compared
against the local branch head, which is read with or without a saved lane
status), any disagreeing lane status (a status older than the run's last
transition is historical and triggers `verify-live-state` without contributing
its pending decision or blocked marker; `implement` and `verify` statuses agree
with every pre-confidence run stage, and a handoff status leads the run's
`security` stage), a brief that no longer
matches the plan (changed approval scope: issue, base, complete fence items with
their section notes, caps, role tiers, breadth, or a brief deadline that differs
from `started_at` plus the cap, reported as a `deadline` conflict), an exhausted
budget (of the current stage or a stage with no recorded exit) and a passed
deadline. A saved lane status that is stale, unverifiable or
in disagreement is never the basis for `next`: the disagreement appears in
`conflicts` and `next.action` becomes `verify-live-state`. A lane whose
checkpoint cannot be built is that lane's blocker; the rollup also lists blocked
and undispatched lanes. History appears only as counts and links, so the
projection stays small as a slate grows. It never grants authority: `next`
carries `authority: "none"` and `requires_live_check`, and the orchestrator
re-verifies against the linked evidence and live gates before acting.

The conductor owns slate plans, locks, run records, briefs, reports, sentinels
and the merge queue across repositories. Run control writers from its checkout.
`provision-lane.mjs` resolves foreign clones by verified GitHub origin in sibling
directories beside the conductor clone, or repeated explicit
`--repo-root owner/repo=/absolute/path` mappings. A missing, ambiguous or
wrong-origin clone is refused; directory names are never repository identity.
For a new foreign worktree, supply `facts.worktree_path` as
`<target-clone>/.worktrees/<lane>`; provisioning creates its branch at the
recorded lane base. Existing prepared worktrees must match clone, branch and base.
Do not infer a target clone from a fleet decisions file. Lane PR references
outside the conductor use `owner/repo#N`; watcher events name the repository.

Everything you need in order to resume lives under the Git common directory,
never in the session scratchpad, with one deliberate exception: the owner token
lives only in session context, never under the Git common directory. A scratchpad does not survive a session
restart, and one that was wiped mid-slate took every dispatch file, ruling
and watcher script with it (harmon-devkit#1296). The scratchpad is for
throwaway work only.

- **Run records:** `<git-common-dir>/dev-flow-v2/runs/<run-id>/run.json`,
  beside `monitor.json`.
- **Slate plan:** `<git-common-dir>/dev-flow-v2/slates/<slate-id>/plan.json`.
- **Your own working files** — dispatch files, rendered briefs, ruling files:
  `<git-common-dir>/dev-flow-v2/slates/<slate-id>/orchestrator/<run-id>/<attempt-nonce>/`,
  keyed by run id and attempt nonce the way lane reports are.
  `assets/dev-flow-monitor.sh orchestrator-dir --slate-id ID --run-id ID
  --nonce NONCE` prints the path.
- **Watcher state:** `<git-common-dir>/dev-flow-v2/slates/<slate-id>/lane-watch.state`.
- **Branch active pointers:** `<git-common-dir>/dev-flow-v2/active/`, one
  SHA-256-named pointer per branch. `promote` and `close` retire only the
  matching run's pointer after the validated terminal record is written and
  read back. A reserved monitor event on an ended run defers retirement and
  blocks a new activation on that branch.
  Every observation must match the reservation's event, action and expected head.
  Reconcile landed events. If a reserved action is observed absent, record that
  observation and cancel it with
  `assets/dev-flow-monitor.sh cancel --state <monitor.json> --run-id <run-id>
  --event <event-id> --observed <observation.json> --reason "<why>"`; landed
  actions still go through reconcile. Then retire the run or prune its pointer
  before retrying activation.
  `run-record.mjs prune --dry-run` reports
  which pointers are safe to remove; `prune` removes only valid pointers for
  terminal runs and reports open, malformed, mismatched, missing, reserved, or
  leftover entries it skips. A fresh run after retirement starts at generation
  1.

Use `dev-flow-support/assets/run-record.mjs` for the run-record operations
it supports, never a hand edit:

- `transition`, which also appends the matching transition receipt;
- `lane-init`, which creates a receipt-complete kickoff record and its dispatch
  policy projection for a lane in the last validated plan revision;
- `intervention` (including answered harness approval prompts);
- `authorize-cap` for one attributable maintainer instruction, shared with solo runs;
- `bind-pr`;
- `close`.

These record writes also follow Planning step 6's one-command rule.

Promotion is decided out of the readiness gate by the session that owns
integration — the orchestrator in an orchestrated run, the `/integrate`
session in a solo run — and every recorded run uses `integrate/assets/promote.sh`
as its only promotion path.

A run belongs to exactly one slate. Its first helper write needs the run to be
a lane in some revision of that slate's plan, and records the slate in
`runs/<run-id>/owner-slate`; every later write must name the same slate. Each write builds
a candidate, validates it with `validate-result-schemas.mjs run --receipts`
plus every adjudication document in the run directory, renames it over
`run.json` and validates the readback. A refused edge, a promotion dated
before the last transition, a promotion over an unsettled deferred finding,
or any entry written after the run has ended — promoted, capped, escalated or
abandoned — therefore never lands. The rest of the
record keeps its existing writers:

- the kickoff record — this skill, at activation;
- pass receipts, evidence registrations, splits and stage-advance
  transitions — `/review`'s own write recipe;
- settlements — `/integrate`.

All writes for a run are performed sequentially by its one supervising
orchestrator, including the `/review` and `/integrate` recipes above. Delegates
return evidence; they never write the run record. Each of those writers runs
the same candidate, validate, rename and readback sequence. Parallel writers
must first use `run-record.mjs`'s shared mutex and validated writer; its lock
does not protect a caller that bypasses it.

For a maintainer-authorized round above the resolved cap, use
`run-record.mjs authorize-cap --slate <id> --session <id> --owner-token <token> --run-id <id>
--stage <challenge|review|integration> --round <n> --actor <maintainer-identity>
--instruction '<verbatim session instruction>' --at <instruction-UTC-time>`.
An agent never authorizes itself: the writer records the maintainer's instruction,
which may precede or follow the round. For integration, `round` names the charged
cycle count, not a pass or retry. Each intervening over-cap round needs its own
entry; malformed or duplicate entries refuse. A cap of 0 stays disabled. Never
rewrite the resolved caps in `policy.json`. Continue the same run's numbering
and show `round n/cap (authorized) — maintainer authorized on <date>` in the
stage ledger, citing the instruction verbatim, actor and time; the PR body's
budget line discloses that same overage alongside rigor overrides
(harmon-devkit#683). Follow `/review`'s authorization procedure and ordinary
convergence rules. An older merge-base engine/schema under `--closure` fails
closed; report compatibility refusal rather than bypassing that trusted engine.

Point an intervention that rests on a ruling file at it with
`--ruling FILE`: the writer copies those bytes into the run's
`rulings/<sha256>` file without overwriting an existing snapshot, and the
note records that stable path and the file's SHA-256. The reference survives
archiving and subsequent source edits. That digest identifies the bytes you
relied on. It does not protect them: the note lives in a
lane-writable record and nothing verifies it automatically, so an edit is
caught only by someone who re-hashes the file and compares. `close` records a non-promotion outcome if
the run is still open, then moves the run's orchestrator directory into
`runs/<run-id>/orchestrator/`, so a stale dispatch file can never mislead a
later session. Files under `.git/` never show in `git status`.

Both writers take the **slate lock** (`run-record.mjs lock
acquire|release|status`), recorded under `<git-common-dir>/dev-flow-v2/locks/`
with the slate's milestone and issue set. Every run-record.mjs and
plan-revise.mjs write is refused while any lock other than this session's own
covers the same slate, the same milestone, or any of the same issues; the
owner-token caller contract below defines "own".
Take it before publishing the plan (§ Planning
step 6), with `--issues` and, for a milestone-backed slate, `--milestone`: an
unlocked slate refuses every run-record.mjs and plan-revise.mjs write except explicit `lock acquire`, and a plan
published before its reservation can overwrite another session's plan. Release it when the slate
ends. `--session` is the `/kickoff` session name recorded by `/claim` on the
claim comment's `session:` line; it is not a PID or a liveness signal.
A restart, `/clear` or compaction also loses the owner token; resume through
the recovery procedure below: operator confirmation, force release, then a
fresh `lock acquire`. A different session is refused even on the same host.
Follow “Owner-token caller contract” in `$support_dir/../SKILL.md`, with the support directory resolved physically via `cd … && pwd -P`.

Recovery is an explicit operator decision, never an automatic timeout or a
cross-host process probe. Inspect `lock status --slate <slate>`, have the
operator confirm that the previous session, its writers, and its lane watcher
have stopped, then
run `lock release --slate <slate> --session <recovering-session> --force
--reason "<operator attribution and why the old session is abandoned>"` once.
The helper records that request, its session, reason, timestamp and
previous lock metadata (including only the owner-token digest) in `locks/recoveries/<slate>/<id>.json` before removing the lock;
failure to record it leaves the lock held. Re-read status after any failure:
the audit records intent, so a crash may leave the lock still held. Acquire
normally as the recovering session only after release; ordinary scope
contention checks still apply. Once reacquisition succeeds, the completed
recovery transfers the writer identity to the recovering session: every later
write for that slate uses the recovering session's name, including after a
restart, instead of the original kickoff/claim identity. The recovery audit's
previous lock and recovering session identify the requested transfer; name both
identities, the completed transfer and that audit in the handoff.

Durable means *this clone*: the common directory survives restarts, `/clear`
and worktree removal, but not a fresh clone, a rebuilt devcontainer without a
persistent volume, or an ephemeral cloud session. GitHub evidence stays the
cross-machine record. Every worktree shares the directory, so a lane *can*
edit these files; re-hashing a ruling file against its recorded digest is the
only check that an edit happened.

## Lane briefs

Lane briefs consume the validated plan's last revision assignments, fences,
overlap choices, and merge dependencies rather than reconstructing them from
session prose.

Use `assets/provision-lane.mjs` to render a PR-owning lane brief from the last validated plan revision.
Run it from the conductor clone after preparing the lane facts and
transactionally refreshing its claim:

```sh
node assets/provision-lane.mjs --slate ID --session ID --owner-token TOKEN \
  --lane ID --facts lane-facts.json --policy resolved-lane-policy.json --nonce ATTEMPT
```

For an added lane, widen the lock with `run-record.mjs lock acquire --issues`
and the existing owner token, then publish the plan revision through #1410's
plan writer, then run `provision-lane.mjs`. Provisioning never widens the
reservation or writes a plan. A conflicting reservation, invalid plan or facts,
unknown lane, existing run, or unrecorded effective-fence overlap with another
live lane refuses before durable state is written. Plan-recorded `serialize`
and `split` overlaps provision with their overlap text and merge dependency.
For each shared path, the facts file must supply `fence_notes[path][lane]` section boundaries for both live lanes; both notes appear beside that path in the brief, and missing notes refuse provisioning before any write.
Fence checks include expansions and unmaterialized globs; a possible overlap
not covered by the recorded issue pair is refused for plan revision or judgment.

The command composes `run-record.mjs lane-init`, the monitor's `activate` and
`reserve-agent-run`, and the `brief` validator. It obtains its output directory
from `dev-flow-monitor.sh orchestrator-dir`, prints a JSON handoff including
the brief and report paths, and never mints, stores or prints an owner token.
Inspect durable state after an operational failure; an existing run is never
overwritten or silently resumed by provisioning.

`--policy` is the complete trusted `devflow-policy.mjs resolve --json` output
for this lane, as supplied to `solo-init`. Its dispatch fields must agree with
the last validated plan's lane profile. Both kickoff writers preserve the same
full projection, including finder slots, producer-tier order and push gates.

The facts file is a JSON object with only these per-lane dispatch facts:
`worktree_path`, `harness`, `harness_text`, `effort`, `codex_model_id`,
`codex_launch_flags`, `scratch_dir`, `repo_tier`, `gate_bounds_override`,
`gate_commands`, `git_sandbox_note`, `known_environmental_failure`, `unit_kind`,
`pr_title`, `verified_facts_and_rulings` (strings), and the authenticated
`claim_handoff` object described in the catalog below. Use `n/a` for inapplicable
Codex facts. All strings are nonempty except `effort`: use `''` when the harness declares an empty efforts list, and otherwise use one of its listed efforts (`''` is refused). No plan-owned value may be overridden in facts. The builder uses
the last revision's lane profile (or its slate profile when lane profiles are
absent), fence plus expansions, and other live lanes; overlap text is never
copied from a previous brief. A prepared worktree must belong to the lane's
verified repository clone, name the lane branch, and still be at its recorded
base (`plan.repository_bases` for a foreign repository), which must equal the
locally fetched target tracking head. Fetch and recheck target freshness under
§ Planning before invoking the command.

### File-scope fences

A file-scope fence is the closed list of paths and globs a lane may write. Before
provisioning, `assets/validator-dependency-scan.sh --check-plan <plan.json> --lane <id>`
scans exactly one hop from the lane's **original** `fence`: executable tests and
validators that name an original path, and tests or validators named by original
fenced text. Accepted `expansions` provide coverage and are checked for readability,
but never become scan sources. The candidate set therefore stays bounded when
expansions are appended. Reverse candidates must have a test/validator name, live
under a test directory with a supported code extension, or have an executable bit
or shebang. Taskfile and workflow wiring files are neither forward sources nor
reverse candidates. Plain reference documents and other prose that merely
mention a path are not rejecting validators and are excluded. It resolves component suffixes only against the repository
root and the referring file's directory. A reference whose suffix is neither
root-relative nor relative to the referring file's directory, such as
`$assets/promote.sh`, is not discovered;
review and add such tests by hand. [Issue #1766](https://github.com/evanharmon1/harmon-devkit/issues/1766)
tracks this limit. Shell and Markdown punctuation delimit path tokens; prose and
comments are included conservatively. Reverse consumer reads replace invalid UTF-8
bytes. Missing candidates refuse provisioning before durable writes. Unmatched fence globs and
fenced paths that cannot be read as text also refuse, naming the path and reason,
unless a dated expansion or exemption is recorded in the latest plan revision.
A candidate owned by another live lane in the same repository (including its
expansions) is a **shared-validator overlap**, not a missing path to take. Stop
provisioning until the orchestrator records a `serialize` or `split` overlap for
that lane pair and validator path, with its merge dependency, in a validated plan using
`plan-revise.mjs overlap --lane-a <lane> --lane-b <lane> --path <path> --resolution serialize|split --before <issue> --after <issue>` and the common slate owner arguments. The path must be covered by at least one
lane; an existing decision can gain a new path with the same resolution and order.
The scan honors that recorded decision; provisioning still requires the existing
overlap and section-note checks. Alternatively, sequence the validator edit in its
owning lane and revise the plan after that lane finishes, or explicitly reassign
ownership. An omission waiver alone does not settle shared ownership; do not
expand into another live fence without the recorded decision.
Fence expansions count as coverage. An orchestrator may waive a candidate by recording
`fence-waiver: <lane> <path>: <reason>` (or `fence-waiver: <path>: <reason>`)
in the latest plan's dated operator pins or revision reason. A path containing
whitespace, such as a Copier conditional path, is written double-quoted,
`fence-waiver: <lane> "<path>": <reason>`. The scan refuses an unquoted line
that could name a known whitespace path, and any `fence-waiver:` line that fits
neither form; any other unquoted line is read as written, so a whitespace path
in it is never waived and the check fails. Review each candidate and waiver;
the textual inventory over-approximates and cannot prove discovery of dynamic
references. Derive the fence from the issue's named surface and the candidates
reported by `assets/validator-dependency-scan.sh <path>...`. Inspect and add the
validators and tests that would reject the lane's change. The positional scan no
longer discovers consumers by manifest keys or enum values: that mode returned
266 noisy candidates versus 35 path-based candidates in the measured comparison.
Release-please's `CHANGELOG.md` is never
lane-owned and never belongs in a fence; lockfiles are ordinary fence entries.

Across live lanes, enforce one writer per file. When an overlap is unavoidable,
name the shared file and disjoint sections in both lane briefs' overlap lists
and record the branch-update or merge dependency that serializes them. A worker
has one bounded self-expansion route: a validator or test that rejects its
change and that no other live lane touches, recorded once for that file as
`YYYY-MM-DD fence expansion: path:line[-line] — reason` in its lane report.
Verify the dated entry and line scope, reject it if another live fence owns the
file, and record the accepted expansion as a `run.json` intervention with `kind: asked`.
The Planning section owns recording the same fact in `plan.json`.
Every other expansion requires an ownership check and an attributed re-brief
before the worker edits the file.

Before evaluating the readiness gate, run
`assets/fence-check.sh --brief <rendered.md>`.
It derives the comparison base from the brief's default branch, then reports
whether both sides of every changed path are covered by the rendered envelope
fence or a labelled expansion in the envelope's `report_path`. Its advisory
refusal is visible to the orchestrator.
This pre-gate subset check is not a readiness-gate condition.

The source catalog below is the complete render contract. It deliberately lives
in this procedure rather than in the dispatched template: substituting free-form
values into a catalog inside the output would duplicate them into a Markdown
table before their intended sections.

| Placeholder | Source |
| --- | --- |
| `{{brief-envelope-json}}` | JSON serialization of the exact `brief.envelope.schema.json` fact fields; `body` is omitted from the block because the validator derives it from all Markdown outside the delimiters |
| `{{lane-name}}` | Orchestrator lane plan |
| `{{run-id}}` | Active run's `run.json` |
| `{{branch}}` | Lane plan and `git branch --show-current` |
| `{{default-branch}}` | Target repository default branch |
| `{{base-sha}}` | Lane creation record |
| `{{worktree-path}}` | `git rev-parse --show-toplevel` in the lane |
| `{{harness}}` | Selected implementer's registry harness |
| `{{effort}}` | Reasoning effort the lane is expected to run at — the value its status line is checked against |
| `{{codex-model-id}}` | Model id the Codex pane was launched with, or `n/a` for a non-Codex harness |
| `{{codex-launch-flags}}` | The approval and sandbox policy the Codex pane was launched with. Default: `-a never -s workspace-write -c sandbox_workspace_write.network_access=true`. `--dangerously-bypass-approvals-and-sandbox` is a per-dispatch override, disclosed on the profile line; `n/a` for a non-Codex harness |
| `{{report-path}}` | Nonce-scoped path under the common Git directory, or a path whose worktree exclusion the orchestrator has installed and verified |
| `{{scratch-dir}}` | Per-lane subdirectory of the scratchpad, for throwaway files only — nothing needed to resume lives there; never the scratchpad root |
| `{{repo-tier}}` | `light`, `standard`, or `heavy` — resolved by the base template's strongest-signal-wins procedure, never by matching a row's description |
| `{{gate-bounds-override}}` | Repository's own measured gate bounds, or `None — use the base template's table.` |
| `{{gate-commands}}` | The repository's actual gate invocations, one per line |
| `{{generation}}` | Active pointer generation |
| `{{active-state-path}}` | `assets/dev-flow-monitor.sh active-path` |
| `{{conductor-common-dir}}` | Conductor common Git directory containing the validated run record directory |
| `{{record-directory}}` | Active run record directory |
| `{{policy-projection}}` | Resolved policy projection recorded at kickoff |
| `{{file-scope-fence}}` | Orchestrator's lane ownership plan |
| `{{live-lane-overlaps}}` | Body rendering is `None.` only when no other live lane exists; otherwise every other live lane, disjoint ones included, appears as a canonical entry prefixed with `-` and a space, one per line; the envelope grammar is defined in `brief.envelope.schema.json`. |
| `{{repository}}` | Lane repository from the plan, defaulting to conductor origin |
| `{{issue-reference}}` | Repository-qualified foreign issue reference; conductor-local #N |
| `{{issue-number}}` | Claimed GitHub issue number |
| `{{issue-title}}` | Fresh canonical-target `gh issue view` result |
| `{{issue-url}}` | Canonical target-repository issue URL |
| `{{unit-kind}}` | `implementation` or `proposal-only` — a proposal-only lane still runs every gate, commits, pushes and opens the draft PR; it stops there |
| `{{claim-handoff}}` | Transaction-refreshed claim for the provisioned lane branch: authenticated comment ID, author ID, `updated_at`, expected assignees, and expected claim labels |
| `{{verified-facts-and-rulings}}` | Orchestrator verification and attributed decisions |
| `{{git-sandbox-note}}` | Harness-specific sandbox policy, or `Not applicable.` |
| `{{known-environmental-failure}}` | Verified run exception, or `None.` |
| `{{rigor}}` | Trusted policy resolution |
| `{{rigor-source}}` | Policy resolver disclosure |
| `{{challenge-cap}}` | Selected rounds policy |
| `{{review-cap}}` | Selected rounds policy |
| `{{integration-cap}}` | Selected rounds policy |
| `{{remediation-cap}}` | Selected rounds policy |
| `{{min-rounds}}` | Selected rounds policy |
| `{{wall-clock-min}}` | Selected rounds policy |
| `{{deadline}}` | Active `run.json.started_at` plus `wall_clock_min` |
| `{{max-agent-runs}}` | Selected breadth envelope |
| `{{max-parallel-agents}}` | Selected breadth envelope |
| `{{max-in-flight}}` | Selected breadth max_in_flight, defaulting to max_parallel_agents for older profiles |
| `{{strategy}}` | Trusted policy resolution |
| `{{strategy-source}}` | Policy resolver disclosure |
| `{{role-tiers}}` | Resolved five-role tier projection, including the implementer's tier source (pinned, rigor, derived, default, or operator) and every `dev-flow-support/assets/tier-inputs.mjs disclose` line — a pin-caused invariant break, an overridden role label, a rejected role label (with the reader's reason), a tier warning, or a derived Tier left indeterminate |
| `{{operator-pins}}` | Attributed operator pins, or `None.` |
| `{{pr-title}}` | Orchestrator's release-title-compliant proposal |
| `{{ready-sentinel}}` | `MERGE-READY-<lane-label>` |
| `{{handoff-sentinel}}` | `DRAFT-PUBLISHED-<lane-label>` |
| `{{blocked-sentinel}}` | `BLOCKED-<lane-label>` |
| `{{attempt-nonce}}` | Fresh nonce for this dispatch attempt |

The sentinel placeholder values are kind/lane prefixes; the lane-brief template appends `-{{attempt-nonce}}` to form the complete sentinel.

Every local PR-owning lane brief MUST carry the active run identity so the lane worker can
route confidence stages through `/review` and publish a draft with v2 evidence;
the supervising orchestrator then invokes `/integrate` and retains every
finding disposition, PR-body edit, thread reply, readiness decision, and
promotion. (`retro-run-report.mjs` exit 10 `no-run-record` is the failure this
routing prevents.) The required fields are: run id, branch, generation,
active-state path, record directory, and policy projection. Without them the
lane worker falls back to the inline `task challenge` / `task review` procedure,
which produces no run record and no adjudication evidence.

Before draft publication, a confidence-stage finding uses the template's
decision handshake: the lane records a decision request and waits for a durable
orchestrator-authored disposition. With a compatible `/review`, a confirmed code
fix is performed by the fresh bounded implementer dispatched after the
orchestrator reserves its agent run. The inline fallback has no such dispatch
surface, so the orchestrator instead authorizes the original lane to apply only
the exact confirmed fixes in its recorded disposition and verifies the returned
gate/publication evidence. The post-draft handoff remains separate and transfers
integration to the supervising orchestrator. When the maintainer overrides that handoff and
tells a lane to drive its own integration, follow `integrate/SKILL.md` §2's rule for any session driving integration
(`check-codex-cloud-review.sh` and `readiness-gate.sh` wherever the vendored checker and gate apply,
never a hand-rolled poll or hand-evaluated table).

Render `assets/lane-brief.md` for every local end-to-end, PR-owning implementation lane
instead of hand-authoring a brief. Council proposal and synthesis implementers,
and bounded remediation implementers, use their schema-bound role briefs and
return the artifact or fix their dispatch requested; they do not receive this
draft-publication contract.

Never write an implementer brief freehand, whatever its shape. Outside a v2 run
— a dispatch with no run record — render the `implement` skill's
`assets/implementer-brief.md` against its own source catalog
(`implement/SKILL.md` § "Brief template source catalog") instead. That template
is the base contract this one extends: its § "Hard rules", § "Gate commands and
time bounds", § "Proposal-only units" and § "Delegation contract" are stated
there once, and `assets/lane-brief.md` § "Inherited base contract" names all
four and supplies their per-lane values rather than restating them. A brief
composed from memory is how the 2026-09-06 fan-out shipped three workers that
each broke a different one of those rules.

`implement` is a **required dependency** of this skill, declared in
`assets/policy-contract.json`. `assets/lane-brief.md` is the superset of that
skill's brief template and names four of its sections without restating them,
so a consumer holding `orchestrate` without `implement` renders a lane brief
whose hard rules, gate bounds, proposal-only clause and delegation contract are
absent. The lane brief therefore **blocks** when the base template is
unreadable, rather than degrading — a one-command vendoring fix, not a mode to
run in. The agent definitions under `ai/agents/` keep the discover-don't-require
degradation: a bounded role can return an honest typed result without the
contract, a lane cannot open an honest PR without it.

Neither template is a work contract for a **bounded role subagent**. Both
finish at a published draft PR, which `ai/agents/implementer.md` § "Never"
forbids non-overridably; a role agent gets its own schema-bound role brief and
returns a typed result. The delegation contract's rule 5 is the one place the
two audiences meet, and it splits there explicitly.

For a PR-owning lane, the source catalog above is the complete input contract: source every value, select the harness procedure
named by the rendered brief. Provision the lane branch/worktree, then
transactionally refresh the existing claim so its record names that exact branch.
Authenticate the refreshed claim into the handoff snapshot without transferring
its ownership.
As a render-time completeness check, compare the unrendered template's
placeholder set with the source catalog and the complete values set before
substitution. Substitute every value in one pass; do not rescan inserted values
for tokens, since a fact or issue title may legitimately contain one. The
`brief` validator checks double-brace tokens only inside the envelope block.
For local PR-owning lanes, validate the rendered brief before dispatch and refuse dispatch on any failure:
`node dev-flow-support/assets/validate-result-schemas.mjs brief "$brief_path"`.
Place the per-attempt report under the common Git directory, or install and
verify its worktree exclusion before dispatch; an assertion that it is excluded
is not evidence. Preserve its nonce-scoped sentinels. Prompts sent after dispatch
refer to that reporting contract indirectly and never quote a sentinel value,
because old pane output must not satisfy a later attempt.

## PR-open confirmation

Run vendored integrate assets from the lane worktree, or from a checkout at the PR base or newer; never from a main checkout that may be behind.

Before promoting a lane's PR, confirm the lane produced v2 evidence
appropriate to its topology and resolved policy for the lane's active
run ID. Each enabled confidence stage (resolved cap ≥ 1) must have its
own evidence — adjudication records from `/review`, not merely a kickoff
marker — and a disabled stage (cap 0) must have its authenticated
disabled-stage verdict; a single verdict never covers an enabled stage.
A lane dispatched under the fork topology or without a vendored
`/review` skill uses the inline fallback by design and produces no v2
evidence; the orchestrator accepts that limitation and does not require
evidence the procedure cannot produce. `retro-run-report.mjs` exit 10
(`no-run-record`) is the diagnostic for a lane that was expected to
produce evidence and did not; when the condition fails and the skill
path is available for the lane's topology, the routing failed and the
lane must be re-run before the PR is promoted.

**The implementer record is confirmed at PR open, and written here when the
lane cannot write it.** When a lane's draft PR opens, the four implementer
values (`model-family`, `model`, `model-version`, `model-effort`; harmon-devkit#1262)
must name the model that actually ran that lane — the family, model line,
version and effort this dispatch attested, never a value read back from the
lane's own output, the issue, or the branch. A lane whose harness writes labels
records them itself through `/implement` step 8; confirm it with the implement
skill's `assets/record-implementer.sh check --repo <repo> --pr <n> --registry
<default-branch registry snapshot> --harness <lane harness>`. **The orchestrator
writes on behalf of a lane whose harness cannot write labels** — an Antigravity
lane, or any lane briefed not to touch GitHub — by running the same asset's
`apply` with the lane's PR, its issue, and the dispatch-attested values; the
same applies whenever the orchestrator itself opened the lane's draft PR.
`apply` validates the values against the registry first and refuses
an unknown value rather than guessing one; a refusal is a blocker to report,
not a value to fill in. A harness whose registry entry declares no `efforts`
(a `claude-code-glm` lane, for example) records family, model and version only and leaves
`model-effort` unset — pass no `--effort` and never invent one — while a
harness that declares efforts still owes one from its list. On an
organization the issue takes the issue fields; on a personal account,
labels; the PR takes labels on both; and on the issue the last implementer
wins, which also clears an earlier implementer's effort when this one
records none. Like `claim:*`, the record is never a routing input — nothing here or in
any dispatch reads it back to choose a model.

For a recorded run, invoke integrate's `assets/promote.sh` with the existing
run identity and resolved gate inputs as the only promotion path. It owns the
immediate check → promote once → scalar read → fingerprint compare → head
re-read → run-record promotion. Freeze body and review content until it returns;
never concatenate a diagnostic gate with a bare ready command. A nonzero
result blocks the handoff. Apply `merge-ready`, and make any ready claim, only
when the live handoff check's own verdict on the current head is a pass.
A failed or indeterminate check leaves `merge-ready` off or removes it.
For promotion, the label write and the ready claim alike, branch on the gate's
exit status, never on a downstream command's; never concatenate a diagnostic
gate with an unconditional label write or ready claim. The later watch below is a separate act; reversing
a recorded handoff requires a fresh run as integrate §6 specifies, delivered to the same retained session while it is alive.

Before every maintainer-facing message calling a PR merge-ready, run a fresh
handoff check in the same turn, following
[AGENTS.md § Handoff check](https://github.com/evanharmon1/harmon-devkit/blob/main/AGENTS.md#handoff-check);
a previous check or promotion never authorizes a later ready claim.
**Invariant: the ready report is sent
only after a `PR-WATCHING` event for the promoted PR's current head with `draft=false` and
a fresh handoff re-read shows the same head, the same
readiness fingerprint, and every check still concluded green; any other
observation (any activity row, any changed
value, any indeterminate read) withdraws the report and re-arms.** The
re-read uses the same mechanisms `AGENTS.md` § Handoff check names for the
promotion-time check (`headRefOid`/`isDraft`, required CI status, and
`readiness-gate.sh fingerprint`); promotion itself is never reported as
readiness. An interim status reads "promoted; watching until merge or close".
Matching the vendored `/integrate` skill's own handling of an invalidated
promotion (`.claude/skills/integrate/SKILL.md` step 6): withdrawing runs
`gh pr ready --undo` and confirms the PR is draft on the current head
before deciding whether to re-verify or escalate. The mechanism that
satisfies this invariant — continuous PR observation and retry on an
indeterminate read — belongs to `assets/lane-watch.sh`; this section states only what must be true before
the report is sent, never the ordering or per-endpoint steps the watcher
uses to get there. The ready report does not stop observation. Until
`PR-MERGED` or `PR-CLOSED` ends the watch, handle late events under
`AGENTS.md` § "Merge queue and ownership".
This maintainer-facing report is distinct from § Persistent supervision's
internal per-lane ledger entry ("a ready PR is reported"), which is
orchestrator bookkeeping, not the maintainer-facing message this rule defines.

If the orchestrator reverses its own promotion (`gh pr ready --undo`, for any
reason, including mid-watch), the withdrawal is announced before anything
else in the next maintainer-facing message — "#n is no longer ready: `<reason>`; back to draft on `<head>`" — ahead of any other status in that same message.

## Lane teardown

After a lane's PR merges, the orchestrator tears down the lane. Verify the PR
is `MERGED` with a fresh `gh pr view <n> --repo <owner/repo> --json state,headRefOid`
or GitHub API read. Never trust a watcher `PR-MERGED` or `PR-CLOSED` event alone;
watcher close events can be spurious. A failed or indeterminate read stops
teardown and is reported.

**Check preconditions before closing the lane or removing its worktree.**
Resolve the recorded lane worktree and confirm its branch and path match the
lane assignment. It must have no uncommitted tracked changes (staged or
unstaged, including edits hidden by index flags), no in-progress Git operation
or autostash, and no commits that are not on the PR's head branch. Fetch and
compare against the live PR's `headRefOid`, never a stale upstream ref; if that
head cannot be fetched or any local commit is absent from it, stop teardown
and report the remaining work. Inspect untracked and ignored state too: preserve
anything outside the disposable state named below before proceeding. Any failed
precondition stops teardown and is reported; `--force` never overrides it.

Once those checks pass:

1. Close only the lane's own Herdr tab or pane that the orchestrator created
   for that lane, verified against the recorded tab/pane identity; never close
   another session's surface. If its identity cannot be verified, stop and
   report rather than guessing. The identity check is the tab/pane ID recorded
   at dispatch. Any signal follows the process-ending convention
   in § Lane launch and waits, subject to repository rules.
2. From outside that worktree, run `task worktree:rm -- <name>`. Use
   `task worktree:rm -- <name> --force` only after the preconditions above pass
   and a plain removal refuses solely because of disposable generated state on
   this allowlist: an empty (zero-byte) placeholder
   `.devcontainer/**/devcontainer.env`, the tool cache `.cache/uv`, and the
   throwaway anonymous Convex sandbox under `.convex/local/`. From the worktree
   root, list the state one file at a time with `git ls-files --others --exclude-standard`
   (untracked) and `git ls-files --others --ignored --exclude-standard` (ignored),
   and require every listed file to match the allowlist; a status form that
   collapses a directory into one entry is not an inventory.
   That allowlist is the only disposable local state this section authorizes
   force removal to discard; other local data, tracked edits, unpublished
   commits, or another refusal stop teardown and are reported.
   Confirm removal succeeded before retiring the lane.
3. Delete the lane's branch, local then remote, with
   `assets/delete-merged-branch.sh <owner/repo> <n> <branch> [<remote>]` and by
   no other command. It refuses, deleting nothing, unless on live reads the PR
   is `MERGED`, not cross-repository, with this branch as its head in
   `<owner/repo>`; the branch is not the default branch; no open PR has it as
   head; every fetch and push URL of the remote names that repository; the local
   branch (when it exists) is not checked out in any worktree and its tip is
   the PR's `headRefOid` or an ancestor of it (GitHub merged exactly that
   commit, so no file comparison is needed whatever the merge method); and the
   remote branch is absent or exactly at `headRefOid`. The local delete expects
   the tip it validated and the remote delete carries a lease on `headRefOid`,
   so a commit or push that lands after the read fails the delete instead of
   being discarded; a branch already gone is success. It also refuses a host
   other than github.com (`GH_HOST` or an enterprise token), modified history
   (a `refs/replace/` ref or `info/grafts`), and a symbolic local branch. A
   refusal, or a failed or indeterminate read, is reported, and the branch is
   not deleted without the maintainer's go-ahead. Whether this step runs unprompted also depends on
   § Orchestrator autonomy contract.
4. Drop the lane's spec (or its lost-session PR-only spec) from the
   watcher's lane list for the next re-arm. Preserve the same watcher state
   and every other lane's spec; do not stop another session's watcher.
5. Record the lane as retired in the slate plan with
   `dev-flow-support/assets/plan-revise.mjs done --issue <n> --reason <merge-evidence>`,
   or `base-move --done <n>` when recomputing after the merge. Use the common
   revision arguments and validated writer from § Planning; retain run records
   and lane reports in the common Git directory. Report any incomplete step.

**Authority:** teardown of a verified merged lane is a routine orchestrator
step and needs no per-lane approval. Repository rules still take precedence.
An unmerged lane — abandoned, closed without merge, or escalated — is torn down
only with the maintainer's go-ahead; a close event grants no teardown authority.
In the next status update, state which lanes were torn down and report any
lane whose teardown stopped or remains incomplete. Step 3 (branch deletion)
additionally needs the maintainer's own agent instructions to exempt a
verified-merged lane's branch from any rule that confirms branch deletion;
until they do, ask before step 3 and run every other step as above.

## Orchestrator autonomy contract

**When in doubt, act.** A step in this table proceeds without asking the
maintainer when every precondition in its row holds, each checked on a live read
at the point of action. A failed or indeterminate precondition, an item in the
always-ask list, or a step not listed here stops and asks. This table is the
authority, not per-agent memory. Repository and maintainer rules still take
precedence: the branch-deletion rows run unprompted only once the maintainer's
own agent instructions exempt a verified-merged lane's branch from any rule that
confirms branch deletion; until then they ask and no other row changes.

**Record every autonomous action** and state it in the next status update: while
the run is open, `run-record.mjs intervention --kind other --note 'autonomous: <row> — <evidence>'`
(the schema has no autonomous kind); once it has ended, the slate plan's
`done --reason` entry from § Lane teardown is the receipt. Herdr identity is
always the tab/pane ID recorded when the orchestrator created the surface.

| Action | Autonomous when |
| --- | --- |
| Merged lane: close its tab/pane, remove its worktree (allowlisted `--force`), delete its local and remote branch | § Lane teardown: live `MERGED`, clean worktree, recorded tab/pane ID; the branch deletion is `assets/delete-merged-branch.sh`, which owns its preconditions |
| Close a helper pane the orchestrator opened (Codex review, watcher, one-off command) | Its job has finished and its output is saved to a file; recorded pane ID |
| Close or replace a dead, stuck or replaced lane agent's pane | Worktree committed or pushed, report or transcript saved, recorded ID; a live original writer is confirmed stopped (process ended, or pane closed per the process-ending convention) BEFORE any replacement starts, a dead agent needs no stop, and a lane branch never has two live writers |
| Close the pane of a lane parked at a passing handoff or blocked | Only where the repository's own `AGENTS.md` permits closing a lane's pane or tab at a passing handoff; where it still requires the session to stay alive, the pane stays. Then: its report is saved and the PR is a draft or promoted per the handoff check; the pane closes but the worktree and branch are retained, and the lane is relaunched from its brief and disposition files for fix rounds; recorded ID |
| Herdr control commands (`tab close`, `pane close`, `agent get`) | Resolved outside this skill: the sandbox configuration allows the Herdr control socket, so no per-call prompt appears |
| Request a routine catch-up through `integrate/assets/update-branch.sh` (a draft at the gate, or the verified queue head under `--queue-head-upkeep`) | The bounds of `integrate/SKILL.md`'s "Standing routine catch-up authorization" paragraph; anything that paragraph excludes stops and asks |
| Fast-forward a lane worktree to a catch-up OID | `/integrate`'s update-branch checks verified the OID (parents, web-flow signature); `git merge --ff-only --no-edit <OID>` on that feature branch after an explicit fetch |
| `git fetch --prune` | Prunes only remote-tracking refs whose remote branch is already gone. Worktree records are cleaned only by `task worktree:rm`; never `git worktree prune` |
| Delete a stale local branch, or unset a stale upstream | The remote branch is gone (live read) and, for a deletion, `assets/delete-merged-branch.sh` accepts it: the local tip is the merged PR's head or an ancestor of it; local only |
| Add or remove `parked`, `blocked`, `merge-ready`, `needs-review` | Its condition changed; the label transition table decides which; a `blocked` label links its reason; route `review-entry`, `review-clear`, `fix-round`, `park`, `unpark`, `promote`, `unpromote`, `block`, `unblock`, `resume` and `close` through `track-work/assets/lifecycle-labels.sh` without `--record-file`; `claim` restoration stays with `/claim` and `plan-revise.mjs reactivate` (see the paragraph that coordinates these labels) |
| Reply in review threads with the adjudication; resolve settled threads | The finding is adjudicated and the reply carries the evidence; resolve only a thread the reviewer acknowledged or the agent answered last |
| Re-run a CI job once | Flake policy: the failing file is untouched by the PR; record the re-run; the second sighting is filed, never re-run |
| Post a Codex or Greptile trigger comment; post the stage ledger | The `/integrate` cadence calls for it on the current head |
| Record a fence expansion | The file is inside the lane's repository and issue scope and no other live fence overlaps (§ File-scope fences) |
| Release the slate lock | Every slate issue is `done` |
| Tick a post-merge criterion, close a verified completed slate issue, file a required flake or deferred-finding issue, publish the run summary on the dispatching epic | `track-work` § "Orchestrator-owned slate writes" |
| Lane read-only prompts (`gh api` GETs, public fetches), the orchestrator's own gate commands (`task verify`, `task security`, `task challenge`/`review`, Keychain `gh`) run unsandboxed | Resolved outside this skill, never by loosening a gate: lane launch, sandbox and permission configuration in the harmon-init repository |
| A lane branch tracking the default branch (a bare `git push` then looks like a push to it) | Resolved by provisioning: `assets/provision-lane.mjs` unsets that upstream |

**Always ask:** merging or enabling auto-merge; cutting a release; credential-store
writes; security-relevant settings; descoping or redesigning when a confirmed
P0/P1 invalidates the approach; tearing down an unmerged lane or deleting a
branch whose content is not in the merge; force-pushes and history rewrites;
anything whose precondition check fails or is indeterminate; surfaces the
orchestrator did not create; stopping the Herdr server.

**Before escalating:** deliver every pending disposition that does not depend
on the maintainer's answer and start every pass that is due.

**Non-blocking escalation:** while any other lane is live, ask the maintainer
in plain text. Send a push notification if the harness offers one. Otherwise,
the plain-text question stands on its own. Only the escalated lane waits.
Reserve a blocking question for when no other lane can move.

**Pass watchdog:** watch each dispatched challenger, reviewer or integrator
pass. After 30 minutes without a write to its scratch directory or record,
check the pass, nudge it if it is stalled, and replace it if it stays stalled.
Follow the process-ending convention before replacing the pass. A quiet lane
pane is never evidence that the pass is still working.

## Implementer selection

Select implementers only from
the resolved `[stage.implement].pool`, registry role eligibility, and resolved
family/harness preferences; council dispatches also enforce its
`distinct_families` requirement. Enforce one
writer per feature branch. A lane can commit only its lane branch; the feature
owner alone assembles selected lanes, then records the included/discarded lanes
and canonical SHA in that assembly's `run.json` stage transition before pushing
the feature branch. Under council with `synthesis = true`, dispatch one fresh
implementer with the ordered source proposals and accept its artifact only when
`result.implementer.payload.synthesis_of` names those proposal identities in
that same order; record every proposal's selection outcome in the assembly.
Reject a lane that requests feature-branch write authority.

Immediately before every implementer invocation—initial lanes, council
proposals and synthesis, and remediation—the feature owner calls
`assets/dev-flow-monitor.sh reserve-agent-run` with a deterministic dispatch
event and the resolved `[breadth].max_agent_runs`. Confidence finders and
fallbacks spend the independent rounds envelope and never this implementer
budget. The monitor pins the total implementer ceiling on the first reservation
and durably accounts every slot under the active-run lock. A crash after
reservation spends the slot; an exact event re-arm adopts it without spending
twice. A changed or exhausted budget blocks before dispatch.

## Lane launch and waits

A headless lane has nobody to answer an editor. Start every lane with
`GIT_MERGE_AUTOEDIT=no` and `GIT_EDITOR=true` in its environment: the first
keeps `git merge` from opening one, the second makes any command that still
asks for a message (`git commit` while finishing a conflicted merge,
`git merge --continue`) accept the prepared one instead of waiting. Under
herdr, set both on the tab and on every pane that hosts a lane, and never
start a lane in the root pane `herdr worktree open` or `worktree create`
gives you (neither takes `--env`); open a tab or split a pane with the
variables inside that workspace instead:

```bash
herdr tab create --workspace <workspace> --label <lane> --no-focus --env GIT_MERGE_AUTOEDIT=no --env GIT_EDITOR=true
herdr pane split --pane <pane-id> --direction <right|down> --cwd <worktree> --no-focus --env GIT_MERGE_AUTOEDIT=no --env GIT_EDITOR=true
```

Under any other launcher, export both into the lane's environment before the
harness starts. The variables are the backstop, not the instruction: if and
where a lane is permitted to merge the default branch into its own (this
skill's lane brief does not grant it; a consumer's may), every brief and every
relay spells the command `git merge --no-edit origin/<default-branch>`. A
merge that stops on a conflict is finished by resolving the files, `git add`
on each, then `git commit --no-edit --cleanup=strip` (the cleanup drops the
`# Conflicts:` comment block `--no-edit` would otherwise keep in the pushed
message); `git merge --abort` backs it out
instead. A lane stuck in an editor anyway reports BLOCKED and is escalated to
the orchestrator and the maintainer; any process-ending action follows the
convention below.

**Process-ending convention:** Before sending a signal, re-read the PID's
command to confirm it is the process you intend to end; PIDs are reused. Prefer
the process tree your own session or lane started. Send `TERM` before `KILL`.
Never kill by name pattern (`pkill`/`killall`): a pattern can match processes you did not start. Signal only the PID you confirmed.
A repository rule that still requires approval before ending a process takes
precedence over this convention.

`assets/settle-wait.sh` is the required primitive for every bounded lane
settle and CI settle. Both modes take **seconds**. A lane settle is two steps:
confirm the prompt was delivered, then settle:

```bash
herdr agent prompt <lane> "<text>" --wait --until working --timeout 30000
bash <skill-dir>/assets/settle-wait.sh agent <lane> --timeout-seconds 3600
bash <skill-dir>/assets/settle-wait.sh checks --repo <owner/repo> --pr <n> --head <pushed-sha> --timeout-seconds 1800 [--interval-seconds 30]
```

The delivery check is the one sanctioned raw herdr `--timeout`, and its unit
is **milliseconds** (`30000` is 30 seconds). It proves the prompt landed:
settling straight after a prompt without it can return on the idle state the
lane was in before the prompt arrived. Every longer wait goes through the
asset, which converts seconds to herdr's milliseconds itself; never pass a
raw `--timeout` to `herdr agent wait`, and never use `agent prompt --wait`
for the long settle. Without `--until`, `agent` waits on herdr's default
settled set (`idle`, `done`, `blocked`), then reads the lane with
`herdr agent get` and settles only on `idle` (tab seen) or `done` (the same
state, unseen); `--until <state>` is for a state-specific wait. `checks`
takes the full SHA you pushed as `--head` (required): while the PR still reports another head it is not settled, and it
reports a settle only when the PR head, re-read after the run reads, is still
that SHA. A `pull_request` run is scoped to `--pr` by its `pull_requests[]`:
one naming only other PRs is ignored, and one with an empty or unprovable
association (fork PRs list none) is counted on its own, never collapsed or
used to supersede. Of this PR's runs it keeps the newest run of each workflow,
so a cancelled or failed run superseded by a re-run no longer counts. The
superseded run's own read decides: it is dropped only when that read says
completed and its latest attempt started (`run_started_at`, else
`created_at`) before the newest run's did; one whose read is not completed
stays pending, and one manually re-run after the newest run started, or whose
start time either read lacks, counts on its own conclusion. It counts every
run of any other event, reads each counted run's own `.status` and
`.conclusion`, pages as far as GitHub's 1000-run search cap at any page size,
and is indeterminate when the run list reports that cap. As in GitHub's own check
rollup, the newest `pull_request` run is the verdict even if its jobs were
skipped, so a workflow that skips its tests on an `edited` re-run can hide an
earlier failure; never settle CI with
`gh run watch --exit-status` or `gh pr checks --watch`, which report stale or
partial conclusions across re-run attempts. It covers Actions workflow runs
GitHub has already created, not external status checks; the readiness gate
still owns the full check verdict.

The exit status is the verdict, and it means different things per mode. In
`checks` mode: 0 settled green, 1 settled with a failing run, 2 usage, 3
indeterminate (the PR head was not `--head` at the last poll, or that poll
could not be read, listed no runs, or hit the 1000-run cap), 4 expired with
runs pending. In `agent` mode the status is herdr's own except for 0 and 5:
0 settled (`idle` or `done`), 5 the lane is blocked at an approval or
question, `unknown`, or unreadable, and any other status is herdr's own and
not settled — herdr's 1 (server error) and 2 (usage) are not the `checks`
codes — with 124 when the backstop stopped an overrunning herdr (137 if it
had to be killed). Never follow a wait, or the delivery check, with `; echo`,
`|| true`, or anything else that discards that status: an expired wait must
never read as settled. `lane-watch.sh` below stays the persistent monitor;
this asset is for a single bounded wait.

If the harness streaming monitor cannot reach `gh` or `herdr`, run the
existing `settle-wait.sh` command as a finite background Bash pass from a
shell outside that sandbox and capture its full output and exit status; do
not send it through `Monitor`. Each pass ends at its requested timeout. If a
lane watcher is also active, keep its same
`<git-common-dir>/dev-flow-v2/slates/<slate>/lane-watch.state` across every
re-arm. A failed Herdr state read remains exit 5 and a failed GitHub read
remains exit 3; neither is settled.

### Antigravity (agy) lane permission posture

Choose the agy permission posture using `FOREMAN_DEVCONTAINER`: `bot`, `agent`,
or unset for dev or host (see `docs/glossary.md`).
With `FOREMAN_DEVCONTAINER` unset (dev or host), the orchestrator does not infer
the profile from settings. It dispatches agy lanes only after confirming that
the agy settings in effect (`~/.gemini/antigravity-cli/settings.json`) carry the
template dev-profile permissions from `antigravity-settings-dev.json`.
Otherwise it does not dispatch agy lanes, and in a dev devcontainer it reports
that a rebuild is needed. `HARMON_BOT_AUTONOMY_ANTIGRAVITY=enabled` gates installing
the bot wrapper and applying the dev settings, not profile selection.
Disclose the chosen posture in the lane brief's verified-facts/rulings text.
`--dangerously-skip-permissions` belongs only to the bot posture and is never
passed under dev, host or agent.

- **Bot:** `FOREMAN_DEVCONTAINER=bot`. When
  `HARMON_BOT_AUTONOMY_ANTIGRAVITY=enabled`, the template's
  bot-autonomy wrapper at `~/.local/bin/agy` injects
  `--dangerously-skip-permissions` into every agy argv except bare `agy` and
  the passthrough subcommands. Interactive pane launches with arguments receive
  the flag too. Bare interactive `agy` uses the bot's `always-proceed` settings;
  the wrapper injects no flag
  for bare interactive `agy` or the subcommands it passes through unchanged.
  Not every bot launch carries the flag. A launcher that resolves `agy`
  another way must pass `--dangerously-skip-permissions` itself for
  lane runs.
- **Dev:** `FOREMAN_DEVCONTAINER` is unset; use the template's
  `.devcontainer/config/antigravity-settings-dev.json`.
  With `HARMON_BOT_AUTONOMY_ANTIGRAVITY=enabled`, the dev profile's post-create
  step runs `apply-antigravity-settings.sh` to apply that file **user-global**
  at `~/.gemini/antigravity-cli/settings.json` inside the dev devcontainer.
  This settings posture applies to interactive agy panes; headless `agy -p`
  ignores settings allow-rules and auto-denies (see `docs/guides/devcontainers.md`).
  This posture holds only in a devcontainer built with the template's dev
  settings; a pre-existing container needs a rebuild before agy lanes run.
- **Host:** `FOREMAN_DEVCONTAINER` is unset; use the user's own agy settings;
  the template's dev-profile settings are not applied to the host.
  Dispatch agy lanes only once the gate above confirms the template dev-profile
  permissions are in effect; otherwise dispatch none.
  Headless `agy -p` ignores settings allow-rules and auto-denies (see
  `docs/guides/devcontainers.md`).
- **Agent:** `FOREMAN_DEVCONTAINER=agent`; agy is refused by
  `.devcontainer/config/agent/harnesses.json`;
  do not launch an agy lane in that profile.

The maintainer's 2026-10-18 ruling keeps the existing template dev settings:
this changes no lane-scoped allowlist. Refer to the template-owned settings
file rather than copying its contents here. This section documents the posture
and changes no live behaviour. The agy launch argv and lane workspace
directories belong to [#1290](https://github.com/evanharmon1/harmon-devkit/issues/1290).

### Cloud lanes

Cloud lanes are used only on the operator’s explicit request.
Never choose cloud lanes unprompted or recommend them. Local Herdr agents remain
the default. Render `assets/cloud-lane-brief.md`, checked by its own render check
in the cloud reference; the `brief` validator governs local PR-owning lanes. See
[Cloud lanes](references/cloud-lanes.md) for launch, messaging, GitHub watching,
environment limits, and the orchestrator-owned review and PR handoff. This mode
replaces local worktree, agent-settle, and report-file handling for that lane;
claims, policy resolution, fences, and readiness duties still bind.
The orchestrator names the cloud lane's `claude/*` branch before launch, so the
lane is planned, fenced and claimed like any other.

## Persistent supervision

Watching is the standing mode, not a one-shot step.
Consume the watcher's output unfiltered; never hide events for a lane still in
the current plan, including an idle handed-off lane. No noise reduction is
shipped.
Use only `assets/lane-watch.sh`; invoke that file rather than inlining its
loop or writing a substitute. Prefer the harness streaming monitor (Claude
Code: `Monitor`) when its command can reach both `gh` and `herdr`. It polls
fresh lane-agent and PR state and streams transitions (`idle`, `done`,
`blocked`, `unknown`, and PR deltas), approval prompts, stalls, and heartbeat
summaries.

If the streaming monitor is sandboxed from either `gh` or `herdr`, do not send
the watcher through `Monitor` and do not block while a bounded path is
available. From a shell outside that sandbox, launch a finite background Bash
pass of the same watcher, for example `bash <skill-dir>/assets/lane-watch.sh
--iterations <n> --state-file <same-state-file> --registry <kickoff-registry>
<latest-deadline> <lane-specs...>`, and capture the pass output for review.
The pass exits after `--iterations`; keep exactly one pass active per slate
and reuse the same `--state-file` on each re-arm. Events surface at pass end,
so the pass length bounds how long a lane can wait on an approval. On every
streaming-monitor expiry or nonterminal pass exit, re-arm first, before any
other tool call, with the same state file; then check lane staleness before
other work. Never interpret monitor or pass termination as human cancellation.
If neither the streaming monitor nor an outside-sandbox Bash pass can reach
both CLIs, block instead of falling back to manual polling.

On every other wakeup (a user message or monitor event), first compare the current
time with each lane's last observed change; read and act on any lane silent
past the stall threshold before other work.
Keep exactly one watcher per slate. Replace a streaming watcher by letting
its monitor expire on the harness's own schedule (Claude Code: within 30
minutes) and re-arming; bounded Bash passes exit naturally after their
iteration limit. For an early harness monitor-stop (Claude Code: `TaskStop` on
that monitor's task), follow the process-ending convention above.
Pass the watcher the latest `{{deadline}}` among the slate's live lanes, never the earliest: `lane-watch.sh` takes one deadline, so the earliest would stop supervising every later lane and make each re-arm exit at once. A lane past its own deadline is capped by the dispatch-time clock check below, not by the watcher, and its spec leaves the watcher only if it has no open delivery PR. Keep both session and PR observation for retained lanes past that deadline.
A `WALLCLOCK run: deadline <deadline> reached` event caps implementation time, not supervision of lanes with open delivery PRs: record their capped transitions and render their blockers before re-arming timed lanes with a later deadline. PR-only specs are re-armed regardless of that deadline until `PR-MERGED`, `PR-CLOSED`, or `PR-UNREADABLE`; an exit with outstanding active PR-only specs is an expiry to re-arm. `WATCH-COMPLETE run: no active specs` confirms that none remain. PR-only polling uses `--pr-interval-seconds` (default 300 seconds); timed lanes retain the fast cadence. `RATE-LIMITED github: until=<epoch>` pauses GitHub reads for the primary reset or secondary retry interval while local supervision continues. `PR-UNREADABLE <spec>: #<number> reason=<reason>` retires only that PR-only spec after six consecutive polls return definitive identity/access failures (NOT_FOUND, HTTP 404, or Could not resolve to a PullRequest or Repository). Temporary 5xx, timeout and transport failures stay degraded and keep polling at the PR-only cadence; they never retire a PR-only spec. A timed spec whose degradation window is exhausted keeps its existing `lane-watch: <label>` diagnostic and retires for the current process only. Other active specs keep polling; if none remain active, the watcher exits 1. The next re-arm with the same state file reads that timed spec again and resumes supervision once the read heals; a still-failing read retires it again in that process. Surface stderr on exit 1 and re-arm only after the failing read is reconciled. An exhausted shared Herdr-list episode retires the affected local specs for that process; other specs continue. Reconcile a `PR-UNREADABLE` spec’s access or identity before explicitly starting a new watch state. This event is never readiness.

Harness monitor primitives may run their command under a non-Bash shell, so
always invoke the file as
`bash <skill-dir>/assets/lane-watch.sh --state-file <git-common-dir>/dev-flow-v2/slates/<slate>/lane-watch.state --registry
<kickoff-registry-snapshot> <deadline> <agent:branch:nonce:owner/repo:report-path:lane-label>... 2>&1`;
never paste its loop inline. The first spec token is the **herdr agent name**;
herdr requires lowercase names (for example `lane-d1220`), while the brief's
lane label may be `L-d1220`. Pass the exact rendered `{{report-path}}` as an
absolute path and `{{lane-name}}` as the separate lane-label field. Neither
field may contain a colon. Four-field specs still default to
`<checkout>/.worktrees/<agent>/.lane-report.md` with lane-label equal to agent;
with `--workspace-root`, checkout is `<workspace-root>/<repo-name>`. A fifth
field of `cloud` retains the GitHub-only spec and takes no report or label.
Sentinels use the exact kind-first form
`(MERGE-READY|DRAFT-PUBLISHED|BLOCKED)-<lane-label>-<nonce>`, matching
`^(MERGE-READY|DRAFT-PUBLISHED|BLOCKED)-<lane-label>-<nonce>$`; labels and nonces contain
only ASCII letters, digits, underscores and hyphens. Both report and pane
observations match that whole final nonblank line.
A watcher recognizes only the sentinel grammar of its own version, so upgrade
the orchestrate skill only when no live lane was briefed under an older
grammar; confirm a lane that straddles an upgrade from its report or pane.
A DRAFT-PUBLISHED result emits its own `DRAFT-PUBLISHED <agent>: <sentinel>` transition alongside
`SENTINEL`; pane observations carry `(pane only)` and need report confirmation.
The watcher also emits these supervision events:

- `PROMPT <lane>: <approval request>` uses Herdr state for classified harnesses
  (parsed explain with null `fallback_reason`): an episode starts at `blocked`
  and ends when the lane leaves `blocked`. Pane text only quotes the request;
  unavailable text uses `(input requested; text not captured)`. For agy and
  fallback lanes, pane-text detection uses agy's approval strings instead.
  The quote is partial: Codex/Claude show only the dialog header; agy shows
  the first command line, cut at 300 bytes. Read the full pane with
  `herdr agent read` before approving; never approve from the event quote.
  A Herdr `blocked` state can be a question rather than an approval: answer
  or escalate questions. For approvals, read the full pane first, then:
  Inspect the request and approve or deny within your authority. Record every
  prompt answered by you or by a human in a pane through
  `run-record.mjs intervention --kind prompt --decision approved|denied --command TEXT --note TEXT`
  with the run/slate/session identity, `--at` set to the answer time, and
  optional `--answered-by orchestrator|human`. Record the full command named
  by the request; one record per answered prompt, never per repeated event.
  Each episode
  retains its first-seen time across redraws and restarts, repeats after
  `--prompt-reemit-seconds` (default 180), and starts anew after a poll outside
  the episode, even for identical text.
- `STALL <lane>: no pane change for <N>m` fires once per unchanged-pane episode
  after `--stall-minutes` (default 10). Read the pane and act: investigate,
  re-brief, or escalate within authority. Pane content or Herdr revision/state
  changes reset the timer; a terminal report or pane sentinel suppresses it.
- `OBSERVATION-DEGRADED <lane>: <detail>` fires once per failure episode when a
  Herdr or `gh` read fails (`herdr` names the shared agent-list read). A failed
  read is never absence or health: investigate the endpoint, and expect the
  affected timed specs to retire for this process if it keeps failing.
- `HEARTBEAT <lane>: state=<state> age=<seconds>s pr=<state>; ...` summarizes
  every lane after `--heartbeat-minutes` (default 15), including cloud lanes.
  Cloud age measures branch/PR changes; unavailable local progress has age
  `unknown`. A missing heartbeat means re-arm the watcher and investigate its
  exit, rather than assuming the lanes are healthy. When a slate ID is active
  (`--slate` or inferred from `--state-file .../slates/<slate>/...`) and
  `track-work/assets/label-lifecycle-audit.mjs` is present, the heartbeat also
  runs that read-only audit against each active repository in the slate and
  emits `LIFECYCLE-VIOLATION` lines (or `OBSERVATION-DEGRADED run: ...` if the
  audit fails) without failing or stopping the watch itself.

When `herdr agent explain --json` identifies fallback detection, a visible
approval prompt derives `blocked`; otherwise the watcher uses `unknown`.
These agent events and approval requests carry `(fallback)`; fallback alone
never proves `idle` or `done`. For a lane present in a successful agent list,
a failed or unparseable explain read carries no new state: retain the previous
AGENT state and emit no AGENT transition for that poll. A lane missing from a
successful list is `absent` regardless of explain. Cloud lanes have no pane,
so receive heartbeat summaries alongside their GitHub events, with no `PROMPT` or `STALL` events.
Keep the state file across re-arms so prompt episodes and re-emission times,
stall episodes, heartbeat timing, reported
sentinels and PR activity remain deduplicated. The watcher bounds
every `herdr` and `gh` read, prefers each lane's explicit report-path sentinel,
and tags pane-only fallback results. It watches reviews plus top-level and
inline comments (`PR-ACTIVITY`), new or reopened review threads (`PR-THREAD`),
required-CI conclusions (`PR-CI`, from the GraphQL check rollup), and base moves
that make the PR behind (`PR-BEHIND`, compare `behind_by` at most every 300s).
A complete observation emits `PR-WATCHING` for the head; this is observation,
not a readiness verdict. `PR-MERGED` and `PR-CLOSED` are terminal events.
There is no fixed post-promotion window.

At handoff, keep the live lane spec and its session, tab, panes, worktree and
branch; a pane closed for a parked or blocked lane under § Orchestrator autonomy
contract keeps the spec, worktree and branch. The watcher supervises both session and PR until merge or close; an
open delivery PR keeps observation alive beyond the run deadline. A deadline
still caps implementation work, never this supervision.
Only when the original session is gone (crash, usage limit, ended cloud lane, or
a pane closed under § Orchestrator autonomy contract) replace its spec with `'<label>:<pr-number>:<nonce>:<owner/repo>:pr'` and report
why a replacement session is needed. This PR-only watch uses no local session
or branch lookup. Keep the same state file so PR observations do not replay.
Keep the registry argument bound to the immutable kickoff snapshot across
every re-arm. It only reports events; the orchestrator remains responsible
for every action. The watcher-owned
`<git-common-dir>/dev-flow-v2/slates/<slate>/lane-watch.state` is separate from
the run's canonical `monitor.json`; never pass that JSON monitor state to
`--state-file`.

The watcher's restart durability does not make the orchestrator's event
consumption durable. Keep a durable log of `PR-ACTIVITY`, `PR-THREAD`,
`PR-CI`, `PR-BEHIND`, `PR-WATCHING`, `PR-MERGED`, `PR-CLOSED`,
`PR-UNREADABLE`, `RATE-LIMITED`, `WATCH-COMPLETE` and degradation events actually processed, or re-read those GitHub surfaces on resume.
Silence since an orchestrator restart never proves that nothing changed.

Every emitted transition terminates in a recorded action: idle reads and
adjudicates the lane status (including any unsupported claim that the user was
asked); done validates and assembles or records a blocker; blocked/unknown
surfaces the evidence and stops or re-briefs within authority; a ready PR is
reported with merge-queue externalities; a dirty PR returns to its owning lane;
and an external merge releases dependents, recomputes the queue, and advances
only its next eligible head under [Merge queue procedure](#merge-queue-procedure),
then rechecks stacked live lanes (branches built on another lane's branch or
with a branch-update dependency), while parked PRs are not caught up.
Keep a visible per-lane ledger of assignment, fresh state, last progress, and
next action. Hand off the run record before primary-session
context exhaustion so a fresh driver can re-arm the same monitor.

Resolve the shared run directory with `git rev-parse --git-common-dir`, never by
appending to a worktree's `.git` path (which is a file in linked worktrees).
`assets/dev-flow-monitor.sh state-path --run-id <run-id>` returns the canonical
`<git-common-dir>/dev-flow-v2/runs/<run-id>/monitor.json` path. Keep
the schema-valid `run.json` beside it. Resolve the branch's shared active pointer
with `active-path`, and activate a new run by compare-and-swap using
`--expected-predecessor <run-id|absent>` and `--expected-generation <n>`: pass
the observed predecessor identity and generation, or `absent` and `0` when no
pointer exists. Also pass the kickoff-pinned registry revision; the resulting
active pointer is the run's immutable registry binding. Activation also binds
each run ID to exactly one branch before any branch-specific pointer can write
its canonical monitor ledger. Every `reserve` and
`reconcile` supplies that canonical active path, run ID, branch, and generation,
and derives the canonical monitor-state path from the run ID; a superseded run
blocks even when it presents the same expected head. Before assembly, push, or
comment, first reserve an event/action/expected-head in monitor state. An
assembly reservation also persists the exact integrated and discarded lane
identities, and reconciliation requires the landed observation to reproduce
that selection before the run transition is written. Never reserve or replay a
merge.
For comments, also reserve the trusted immutable actor ID, deterministic marker,
SHA-256 digest of the exact body, and kickoff-pinned registry revision; the
monitor must resolve actor trust from that immutable registry snapshot, never
from a value declared only by the run or caller. On re-arm, inspect every `reserved` action's exact external
postcondition (assembled canonical SHA, remote branch SHA, or marker-bearing
comment candidates with ID/actor/marker/body digest) and reconcile it: `landed`
adopts the lowest authenticated matching comment ID and advances the durable event
cursor, `absent` keeps the reservation for one safe re-execution, and
`indeterminate` blocks the run. Never advance the cursor before this
reconciliation. A crash is therefore re-armed, not read as human cancellation.

Every terminal event has an action: lane result → validate/assemble or block;
failed gate → dispatch the bounded remediation; ready draft → run integration;
external merge → release dependents and recompute the queue; ambiguous scope,
product, safety, or consent decision → stop for a human. Persist the event ID,
reservation, observed postcondition, and action in monitor state so a resumed
session can adopt a crash-after-write action instead of duplicating it.

Treat resolved `rounds.wall_clock_min` as a ceiling for the whole run, measured
from `run.started_at`, not as a fresh allowance for each stage or resumed
session. Read a fresh trusted clock immediately before every dispatch,
reservation, replay, external action, and merge-queue mutation. Once the
deadline is reached, record the capped transition and render its blocker before
stopping. The sole external action still authorized after expiry is to reserve,
publish, and reconcile that exact terminal blocker through the monitor; forbid
all dispatches, code pushes, ordinary comment writes, and merge-queue mutations.
A cached time check or a check performed only after the write cannot enforce
this ceiling.

### Merge queue procedure

Follow [AGENTS.md § Merge queue and ownership](https://github.com/evanharmon1/harmon-devkit/blob/main/AGENTS.md#merge-queue-and-ownership)
and use the [glossary](https://github.com/evanharmon1/harmon-devkit/blob/main/docs/glossary.md)
for state names. Keep the ordered queue in the plan’s `merge_queue`, using the
validated `queue-order` writer. Order by `merge_dependency` first, then smaller
independent units first (fewer changed files, then the lower issue number);
use complete file lists and pairwise overlap to respect merge dependencies
and disclose catch-up and re-review costs.

- This orchestrator's own queue has at most one merge-ready head. Catch up
  that head, run the live handoff check, and promote through
  `integrate/assets/promote.sh` for recorded runs only when it passes;
  apply `merge-ready` only when a fresh live check on that head passes.
- When another owner's PR in the same repository already carries `merge-ready`,
  never touch that PR or its label; report the coexistence to the maintainer
  in the merge-ready report. Still apply the live check to this queue's head.
- Keep every other passed PR a draft labelled `parked`; report it as parked,
  report its base drift, and do not catch it up while parked.
- When the head merges, recompute the plan, catch up the next eligible PR once,
  re-check it, promote it, and apply `merge-ready` only after another live check passes.
  Use the server merge-mode update-branch procedure from AGENTS.md; never rebase.
- These routine catch-ups, of the queue head and of the next eligible PR, are
  the routine catch-up row of
  [Orchestrator autonomy contract](#orchestrator-autonomy-contract) rather
  than a fresh question; the live handoff check still runs on the new head.

The orchestrator owns promoted and parked PRs until merge or close; Working-slot release
never ends that ownership. Continue the session-and-PR watch and preserve
the withdrawal-first maintainer message above. A late review, red required CI,
or base move removes `merge-ready`; settle or remediate under the linked policy
before making another ready claim.

Coordinate `claim:*`, `needs-review`, `parked`, `blocked`, and `merge-ready`
through the canonical [label transition table](https://github.com/evanharmon1/harmon-devkit/blob/main/docs/dev-loop/label-lifecycle.md):
claim marks active work, needs-review marks agent review work owed, parked marks
a passed non-head draft, blocked names the missing human input while the PR
stays draft, and merge-ready marks only the checked, promoted queue head.
Use that table’s writer ownership, object scope and coexistence rules; confirm
`parked` and `merge-ready` are provisioned before applying either label. Run the events `review-entry`, `review-clear`, `fix-round`, `park`, `unpark`,
`promote`, `unpromote`, `block`, `unblock`, `resume`, and `close` through
`track-work/assets/lifecycle-labels.sh <event> --repo <owner/repo> --issue <n> [--pr <pr>] [--branch <branch>]`
rather than raw `gh issue/pr edit` label writes, and without `--record-file`:
restoring a released claim stays with `/claim` and `plan-revise.mjs reactivate`,
which own the dispatch-capacity admission and the human's
`--approve-review-pullback`. Both `plan-revise.mjs handoff` and
`lifecycle-labels.sh` (`park`, `promote`, and keyed `close`) share the canonical
`{repo, issue, branch}` release idempotency key through `release-claim.sh`
and clear/verify both the issue and open same-repo delivery PRs, and `--pr`
scopes PR preconditions and mutations (including `unpromote`) solely to the
selected delivery PR without affecting open siblings. Event-causing scripts wire
those transitions automatically: `integrate/assets/drive-codex-cycle.sh` fires
`review-entry` when posting `@codex review`; `integrate/assets/promote.sh` checks
and fires `promote` (refusing while any `claim:*` or `needs-review` remains on
the issue or any delivery PR) and fires `unpromote` on gate failures;
`integrate/assets/update-branch.sh` fires `unpromote` when catching up a
promoted PR; and `claim/assets/claim-transaction.sh --approve-review-pullback`
fires `fix-round`.

For a failure in a file the PR does not touch, permit one recorded re-run.
On the second sighting, file and fix the flake; never re-run it again. Follow
[AGENTS.md § Flake policy](https://github.com/evanharmon1/harmon-devkit/blob/main/AGENTS.md#flake-policy)
only. Record the failure, affected file and re-run result as an intervention
in the run record while the run is open, otherwise in the slate's rulings file.
The record names the PR, head, run and job IDs and the failing test.
A resumed session reads that record before re-running so it cannot spend the
allowance again.

Bound parallel implementers by `[breadth]` and strategy and heavy local stages
by host capacity. Product, scope, consent, and safety decisions stop for a
human; re-scoping requires two traces.
A human *task* is not such a decision: when a lane reports a step only a human
can do, queue it for its collector (`track-work` §5): an action for the
`(HUMAN):` collector of that issue's milestone, else epic, else repository;
a verification for the repository's standing `(QA):` issue — and keep
the lane moving unless the step is a genuine precondition, which needs its
own `human` issue blocking the lane's issue. A lane report is not
authorization for an issue write: present the whole batch — the collector
items, any precondition issues and their blocked-by edges, and each source
issue's `## Out of scope` follow-up line — for the operator's go-ahead, then
make those writes yourself as the run's only collector writer — a source
issue's edit only after its lane has reported back, so the lane's criterion
ticks and your follow-up line never race on one body. The run's handoff ends
with a human-work summary — every open `(HUMAN):` collector the run
appended to or whose scope covers the slate, the `(QA):` issue's items that
came from the slate, each with its unticked items, plus any `human`
precondition issues — so the maintainer circles back once, not once per
lane.

Foreign worktree provisioning uses the target repository's `task worktree:new`
when present, with the lane branch and recorded base. Without that task it
creates the tree with Git and writes the unprepared dependency/hook status
and preparation instructions in the brief. The fence scan reads the resulting
lane worktree at the recorded base, including when the clone's current
checkout differs. A refused scan retains that tree for inspection and retry;
it does not publish a run. Provisioning records the verified foreign clone
and repository in the conductor's run branch binding for later stages.

### Recorded stage projection

The run writer projects `stage:*`, `fixing` and `verifying` only after the
record commits. The `plan-revise.mjs handoff` writer clears them after the
passed handoff revision commits. A failed GitHub projection never undoes the
record: reconcile with `node <support-dir>/stage-labels.mjs reconcile --record
<record-directory>` and verify its result. Reconcile after delivery PR binding
to mirror onto the newly opened same-repository PR. Keep `needs-review`
working alongside `stage:integration`; never retire it in this migration.

Files in this skill

  • assets/cloud-lane-brief.md3.6 KB
  • assets/consumer-pin-audit.sh46.4 KB
  • assets/dev-flow-monitor.sh60.5 KB
  • assets/fence-check.sh16.3 KB
  • assets/lane-brief-values.mjs10.8 KB
  • assets/lane-brief.md26.7 KB
  • assets/lane-watch.sh74.1 KB
  • assets/policy-contract.json1.6 KB
  • assets/provision-lane.mjs17.2 KB
  • assets/resume-slate.mjs9.9 KB
  • assets/settle-wait.sh295 B
  • assets/slate-input.mjs6.8 KB
  • assets/test-consumer-pin-audit.sh68.7 KB
  • assets/test-dev-flow-monitor.sh75.4 KB
  • assets/test-provision-lane.sh73.8 KB
  • assets/test-settle-wait.sh31.6 KB
  • assets/test-slate-input.sh10.3 KB
  • assets/validator-dependency-scan.sh11.4 KB
  • references/cloud-lanes.md12.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.