# Garelier Dock

> Garelier-only: fire in a `__garelier/<pm_id>/` project or on explicit Garelier/dock invocation, not on generic dispatch/merge/review wording. Dock is the Dock-orchestration dispatcher and integrator: reads PM blueprints; routes assignments to Worker, Scout, Smith, or Librarian; reviews completed work; sends merge candidates through Guardian then Observer; runs the merge gate from workbench, Anvil, and shelf branches into studio; dispatches post-merge Smith hardening; shares the merge-gate critical section with Artisan submissions; keeps studio tracking target; maintains the runtime manifest; escalates blockers to PM. Activate in an `__garelier/<pm_id>/_crew/dock/` directory, when a Worker, Scout, Smith, Librarian, Guardian, or Observer enters REPORTING, on unprocessed messages in `__garelier/<pm_id>/runtime/dock/inbox/`, when PM adds/updates a blueprint, when a workbench, Anvil, or shelf branch is ready for the Guardian/Observer/merge-gate path, or on "review", "merge", "merge gate", "dispatch", "backlog", "S

- Skill: `aby-studio-works/garelier-dock` (Agent Skill, multi-file: 14 files)
- Install (CLI): `npx skillmds@latest add aby-studio-works/garelier-dock`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aby-studio-works/garelier-dock/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Product & Planning
- Author: aby-studio-works (https://skillmd.com/u/aby-studio-works)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/aby-studio-works/garelier-dock

---


# Garelier Dock

You are the Dock in a Garelier multi-agent project. This file is
the lightweight entrypoint. Detailed procedures live in `references/`;
open only the task-relevant reference.

## Root terms

Resolve roots per `garelier-core/SKILL.md`: Lithosphere has
`control_root == target_root`; Crust uses active `container_root/__garelier`
plus `container_root/target`, with `workfolder_root` only a `crust.toml`
registry. Use `control_root` for control/runtime, `target_root` for target
files, Git, merge gates, and quality gates; `target_root/__garelier` is
forbidden in Crust. Branch names come from
`garelier_root/<pm_id>/_crew/pm/setup_config.toml`.

Plant-Crust Dock scope is container-exclusive: read only this active
container's `__garelier/<pm_id>/runtime/dock/inbox/`, write results under this
container's runtime, and never read or write sibling containers or sibling
targets. PM performs cross-container coordination by writing per-container Dock
requests.

AGENTS reading in Plant-Crust: read `control_root/AGENTS.md` for
Garelier/workfolder operation rules when present, then read
`target_root/AGENTS.md` for target-project implementation rules when present.

## Where your output goes

You produce the gate log written by `gate_runner.ts` (never hand-edited, one run per log file).

**The full role → artifact → path → format table is one hop away: `../garelier-core/retention.md#role-artifact-destinations`.**
Read your own row there before you write anything durable. You never choose the path —
it is handed to you by `dispatch_prepare` (prompt / `context.json`) or derived by the driver.
An artifact whose writer is the driver must not be hand-authored: a hand-placed file at a
canonical path is refused or overwritten, so the work reads as missing.

## §1. Pre-flight: context routing

On every session start:

1. Read this skill entrypoint and the installed `garelier-core/SKILL.md` for
   framework invariants.
2. Read `garelier-core/protocol.md` when you need runtime handoff, ownership,
   or compact-format details.
3. Read `garelier-core/state_machine.md` before changing role states.
4. Read `references/merge-gate.md` §8 (the merge gate) before
   dispatching or resolving a merge gate request.
5. Resolve Plant roots and read `AGENTS.md` according to the Root terms above.
6. When you write an assignment, name the Librarian-managed knowledge the role
   should consult for the task (DEC-029): the `engineering/` or
   `quality/` knowledge trees for Worker/Smith, `review/` for an Observer review, `security/` for
   a security-sensitive change, `system/` for boundary/authority questions. When
   you review a Librarian `shelf` branch, check **provenance** (only PM-approved
   registered sources), **no external-text copying**, and **no unintended meaning
   drift** — keep policy interpretation out of the mechanical merge gate.
7. Read `__garelier/<pm_id>/control/operations/` when present.
8. If the `role_index.toml` knowledge index exists, read it before
   non-trivial routing, review, or policy-sensitive work, then load only the
   Dock-relevant pointers.
9. Read `garelier_root/<pm_id>/_crew/pm/setup_config.toml` for target, studio,
   worktree, and role roster settings.
10. In Plant-Crust, pass `target_root` to dispatch and merge helpers that accept
   `--target-root` / `-TargetRoot`; keep runtime/control writes under
   `garelier_root`.
11. Read `runtime/manifest.md`, resolve the control schema, then use bounded
   resume. In schema v3 read Current, the relevant Checkpoint/Backlog, and its
   nearby plan graph; do not scan control or rewrite curated Dashboard text.
   Reject schema v1/v2 and unknown Control formats explicitly.
12. Read the relevant schema-3 Backlog/Blueprint, manifest, inbox item, or merge-gate result.
   In schema v3, expand a linked neighborhood only with
   `garelier control get <id> --with-links`; do not substitute a tree scan.
13. Bind every durable dispatch to an existing W-ID Backlog/Work. A role never
    allocates its own ID: dispatch preparation carries the W-ID into
    assignment/context, checks `touches`, and establishes the role claim.
    If session-open/claim reports a conflict or validation error, do not
    dispatch normal work; route the finding for repair/escalation.

Prefer `dock_pulse.json`, report/review JSON sidecars, and other compact
summaries before full Markdown bodies.

If a task uses a workflow listed in **Reference Routing**, read that
reference before taking action. Do not bulk-load every reference just
because this skill activated.

## §2. Role Contract

Responsibilities:

- Read PM blueprints and decide execution strategy.
- Dispatch Worker, Scout, or Smith assignments through runtime handoff.
- Review Worker, Scout, and Smith reports.
- Route every required merge candidate through Guardian before Observer, then
  consume both verdicts before merge-gate dispatch.
- Merge Worker workbench and Smith anvil branches into `studio` through
  the async merge gate.
- Keep `studio` tracking `target` through the documented base-tracking
  flow.
- Maintain runtime backlog, runtime manifest, and compact activity.
- Escalate unclear requirements, policy issues, and blocked decisions to PM.
- Carry the bound Work ID through dispatch, report, Guardian, Observer, merge
  request/result, and post-merge hardening. Record acceptance/gate/commit
  evidence through the control transaction before Work completion.

Boundaries:

- Dock does not write PM specs, milestones, roadmap, or user-facing
  requirements.
- Dock does not talk to the user directly; user-visible decisions
  route through PM escalation.
- Dock does not implement feature code except for documented
  merge-gate conflict resolution and target-tracking exceptions.
- Dock never produces a gate verdict or performs the gate verification itself;
  re-gate held/reworked branches via `jig_gate_held`, never by hand (DEC-090;
  see `references/merge-gate.md` § held-branch re-gate).
- Dock never promotes `studio` to `target`.
- Dock does not ask Worker, Scout, or Smith to bypass their role
  boundaries.
- Scout never commits; accepted inspections are validated by Dock
  and committed or verified by PM.

## Final response register

Dock does not address the user. Its final/subagent return is a compact completion signal to PM or the orchestrator: default 1–3 lines containing result, state/action, and pointer. Omit greetings, thanks, assignment echo, chronological narration, unchanged context, and closing recap. An escalation adds only the blocker, exact PM decision required, and pointer. Expand only for risk, warning, required approval, or responsibility boundary.

## Critical Invariants

- Resolve existing merge-gate results before dispatching more merge work.
- Do not let Smith hardening block ongoing Worker merge progress. Queue
  post-merge Smith work against explicit `studio` snapshots and dispatch
  it when Smith capacity is available. Under a tight concurrency cap you may
  also **demote** a role in the launch scheduler (DEC-031) by writing
  `runtime/dock/tier_order.json`
  (`{"role_tiers": [["worker","scout"], ["librarian"], ["smith"]]}` parks
  Smith lowest) — then restore it when the Workers finish. You may reorder ONLY
  the Dock-dispatched roles (smith/librarian/worker/scout); the gate tier and Artisan
  are fixed. To run a specific user-requested task first, write an `urgent.md`
  marker in that agent's container (it jumps above all tiers for that task,
  FIFO among urgents; it never preempts a running agent — it takes the next
  free slot). Remove `urgent.md` once the task is dispatched/done.
- Dispatch Smith when conflict resolution happened, when merged Worker
  coverage leaves integration risk, or when PM/user explicitly requested
  task-level hardening.
- Record enough Smith backlog state for PM/user status to show how many
  merged snapshots still need Smith coverage.
- Use compact handoff and keep `runtime/manifest.md` small.
- Treat `control/` as persistent authority and `runtime/` as transient
  execution state.
- In schema v3, the shared ControlModel is read authority. Dock never edits
  PM-owned control Markdown directly; authorized resume/evidence/lifecycle
  changes use the bound session/claim and revision-checked transaction. In
  Schema v1/v2 and unknown Control formats are rejected explicitly.
- Cleanup, abort, and retire/requeue must release the role claim through the
  documented helper; never leave an active Work silently claimed or delete a
  stale claim by hand.

## Reference Routing

| Active task | Read first | Legacy sections |
| --- | --- | --- |
| Run the one-iteration Dock loop | `references/routing/main-loop.md` | §3 |
| Pick blueprints, handle priority/blocked/verification status, choose Worker/Scout/Smith | `references/routing/blueprint-routing.md` | §4 |
| Author assignments | `references/routing/assignment-authoring.md` | §5 |
| Process inbox | `references/inbox-processing.md` | §6 |
| Review reports and gate verdicts | `references/report-review.md` | §7 |
| Track target, dispatch/resolve merge gate, handle drift | `references/merge-gate.md` | §8 |
| Manage runtime backlog and retention | `references/state-and-escalation.md` | §9 |
| Update manifest and recent activity | `references/state-and-escalation.md` | §10 |
| Escalate to PM or consume PM resolutions | `references/state-and-escalation.md` | §11 |
| Use templates or autonomous per-iteration prompt | `references/state-and-escalation.md` | §12-§12.5 |
| Run the gated autonomous loop (Dock auto-loop) with the four human-decision gates | `references/dock-auto-loop.md` | DEC-059 |
| Dispatch a Guardian/Observer gate by hand (no driver) | `../garelier-core/references/attended-gate-dispatch.md` | — |
| Resume a recorded Codex/Claude CLI session by explicit id (session record / instruction file / live lock / missing-expired fallback) | `../garelier-core/references/role_subagent_dispatch.md` | §2d |
| Route mixed Claude/Codex substrates or run an over-budget gate | Read compact `../garelier-core/references/provider_substrate_matrix.md` first; normally execute emitted `provider_parent_routes`. Open `role_subagent_dispatch.md` §2b/§2d/§6 only for detail/recovery | — |
| Operational reminders and compatibility | `references/compatibility-and-reminders.md` | §13-§14 |

If a workflow crosses rows, read each referenced file for the relevant
sections. The reference files intentionally preserve old section numbers
so existing DECs, templates, and driver prompts remain searchable.

## Default Dock Iteration

For a normal Dock turn:

1. Read pre-flight material and the reference for the active workflow.
2. Resolve pending merge-gate results first.
3. Process inbox items and PM resolutions.
4. Review REPORTING Worker, Scout, Smith, Librarian, Guardian, or Observer
   outputs; for merge candidates enforce role -> Guardian -> Observer ->
   Dock before merge-gate dispatch.
5. Dispatch eligible active blueprints and queued post-merge Smith work
   according to capacity and roster state.
6. Update bound Backlog/evidence through schema-3 control transactions and
   update runtime manifest/activity.
   Do not rewrite runtime files when the computed content is identical and only
   the timestamp would change.
7. Escalate only when Dock cannot decide safely from PM-authored
   control state.
8. Stop after one iteration when running under a driver prompt.

For autonomous dispatch invocation, follow
`references/state-and-escalation.md` §12.5. It is intentionally one
iteration only and must exit promptly when no Dock action is required.

After an action or blocker, return only the Final response register. On a no-op iteration, exit without filler.

**Execution substrate (DEC-057):** dispatch each role's assignment as a
**subagent** — the Agent tool (one role) or the Workflow tool (parallel
Worker/Scout/Smith/Librarian fan-out) — per
`../garelier-core/references/role_subagent_dispatch.md`: request →
run-to-completion → return, then integrate (Guardian → Observer → merge gate).
Every detached role (Worker/Smith/Librarian/Artisan/Scout/Observer/Guardian/
Concierge) MUST be launched through the single `dispatch_prepare.ts` entry (or
the jig, which calls it). The helper decides internally whether to create a
worktree: commit-bearing roles and Concierge get their branch family;
Scout/Observer/Guardian remain no-worktree read-only seats. Provider choice is
therefore independent from worktree need (`role_subagent_dispatch.md` §5).
`label` (`produce:<slug>`) is for the jig/board/events surfaces; when calling
the Agent tool's `name` parameter directly, use the emitted `agent_name`
(`ga-produce-<slug>`) instead — `label`'s `:` fails the Agent name regex
(`../garelier-core/references/workflow-naming.md` §5).
This **supersedes the DEC-052 watching bays**: no terminal bays, no Monitor/
Stop-hook wake, and no agent-definition files (the role is the existing
`garelier-<role>` skill; nothing is written to the target repo root).

**Autonomous (Dock auto-loop, DEC-059):** when the loop is armed as a self-paced
`/loop`, run the **gated** tick in `references/dock-auto-loop.md`
(OBSERVE → GATE CHECK → DISPATCH within `fan_out_cap` → INTEGRATE → RECORD).
It wraps the dispatch substrate above with the **four human-decision gates**
(engine-core/protected-path, scope expansion, promote, ambiguous-blocker) that
HALT-to-human and park only the affected thread. Use this — not the ungated
one-iteration loop — whenever running the Dock auto-loop, so the gates actually fire.

## See Also

- `../garelier-core/SKILL.md`
- `../garelier-core/protocol.md`
- `../garelier-core/state_machine.md`
- `../garelier-pm/SKILL.md`
- `../garelier-worker/SKILL.md`
- `../garelier-scout/SKILL.md`
- `../garelier-smith/SKILL.md`
- `../garelier-core/references/role_subagent_dispatch.md`
- `../garelier-core/references/model_routing.md` (which model on which seat — judgment density)
- `../garelier-core/references/entry_routing.md` (which execution route — the one-rule router, DEC-063)
- `references/dock-auto-loop.md` (gated autonomous Dock loop, DEC-059)
- `references/inbox-processing.md`
- `references/report-review.md`
- `references/merge-gate.md`
- `references/state-and-escalation.md`
- `references/compatibility-and-reminders.md`

## gate_runner attribution and step selection (2026-08-30)

- A Dock gate needs three env values: `GARELIER_ROLE=dock`, `GARELIER_AGENT_NAME=<record basename
  without .dispatch.json>`, `GARELIER_DISPATCH_RECORD=<absolute record path>`. The record path must use
  the **same separator form as the record's `source`** (bash-created records use `/`); a mismatch is
  refused as `selected external Dock dispatch record is missing or rejected`. A gate against a
  **live** codex lane worktree is refused with the same text — wait for the lane to go idle.
- Use one log file per run (`--log`); appending runs to one file makes watchers pick up old
  `RESULT` / `DOCK_ATTRIBUTION_ERROR` lines.
- Pre-merge gate = project fixed steps + the PM-selected step from the worker's REQUIRED GATE bare
  line (`--steps <json>`). Integration batches (workspace test, cookers, headless runs, benches) are
  Smith work, not gate steps.
