refactor: single-source carrier/handoff contracts across skills
Apply the debug-skill pattern (commits 6410732..de42974) to the remaining skills: the agent file is the single source for each interface field's semantics; the SKILL.md copy is reduced to field names plus a pointer, marking the agent's contract table authoritative. Because SKILL.md loads into orchestrator context and agents/*.md into the subagent's fresh system prompt with no transclusion, duplicated field tables drift apart over time. - brainstorm: carrier (spec_path/iteration_scope) -> grounding-check; the absolute-path requirement now lives only in the agent. - planner: carrier (spec_path/iteration_scope/focus_hint) -> plan-recon, including the mandatory/optional markers and the BLOCKED-on-missing rule SKILL.md had omitted. - fieldtest: carrier + produced fields -> fieldtester; the skill-level `status` roll-up (clean/friction_found/bugs_found/infra_blocked), which is not part of the agent's run-status protocol, stays defined in SKILL.md only. - docwriter: carrier + produced fields -> docwriter agent. - implement: carrier (iter_id scratch-dir/stats/not-a-branch semantics) -> implement-orchestrator; per-task sub-status vocabulary moved into the orchestrator-agent (it runs the loop in a fresh context and could not read SKILL.md at runtime, yet referenced "the sub-status table" by name); task_text_path single-sourced in implementer with spec-reviewer cross-referencing. audit was already the reference implementation (pointers, no restated contracts) and is unchanged. closes #2 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+24
-27
@@ -59,32 +59,22 @@ ON `PARTIAL` OR `BLOCKED`, THE ORCHESTRATOR-AGENT WRITES `BLOCKED.md` AT THE REP
|
||||
|
||||
## Per-task sub-status mechanics
|
||||
|
||||
The orchestrator-agent reads and follows this table verbatim
|
||||
every dispatch. Sub-status values are *internal* to the
|
||||
orchestrator-agent — they describe the state of an inline
|
||||
role-phase, not the status of a separate subagent. The
|
||||
vocabulary is preserved because it maps 1:1 to the phase
|
||||
reference files (`implementer.md` / `spec-reviewer.md` /
|
||||
`quality-reviewer.md`) the orchestrator-agent consults at
|
||||
each role-switch.
|
||||
Each dispatch, the orchestrator-agent runs an internal per-task
|
||||
loop over a sub-status vocabulary — `DONE`, `DONE_WITH_CONCERNS`,
|
||||
`NEEDS_CONTEXT`, `non_compliant` / `changes_requested`, `BLOCKED`,
|
||||
`unclear`, and tool/infra errors — bounded by a 2-retries-per-
|
||||
failure-mode re-loop limit (the 3rd attempt escalates to
|
||||
`BLOCKED`). These values are *internal* to the orchestrator-agent:
|
||||
they describe the state of an inline role-phase, not a separate
|
||||
subagent, and are not reported upstream.
|
||||
|
||||
| Sub-status | Action |
|
||||
|------------|--------|
|
||||
| `DONE` | next phase / next task |
|
||||
| `DONE_WITH_CONCERNS` | accumulate concern, next phase |
|
||||
| `NEEDS_CONTEXT` (1st–2nd) | re-attempt the phase with expanded context |
|
||||
| `NEEDS_CONTEXT` (3rd) | stop → `BLOCKED` to orchestrator, reason `context-exhausted` |
|
||||
| `non_compliant` / `changes_requested` (1st–2nd) | switch back to implementer mindset, repair with the check's report as repair brief, then re-run the check phase |
|
||||
| `non_compliant` / `changes_requested` (3rd) | stop → `BLOCKED` to orchestrator, reason `review-loop-exhausted` |
|
||||
| `BLOCKED` (implementer phase) | stop → `BLOCKED` to orchestrator, reason verbatim |
|
||||
| `unclear` (spec-compliance phase) | stop → `BLOCKED` to orchestrator, reason `spec-ambiguous` |
|
||||
| Tool / infra error | stop → `BLOCKED` to orchestrator, reason `infra` + raw error |
|
||||
|
||||
Re-loop limit: 2 retries per failure-mode per task. The 3rd
|
||||
is `BLOCKED` to the orchestrator. `skip task K, continue` is
|
||||
intentionally NOT a mode — tasks have implicit ordering
|
||||
dependencies and the orchestrator-agent does not know the
|
||||
dependency graph.
|
||||
The mapping of each value to its action (and the `BLOCKED` reasons
|
||||
`context-exhausted` / `review-loop-exhausted` / `spec-ambiguous` /
|
||||
`infra`) is defined authoritatively under **Per-task sub-status
|
||||
vocabulary** in `agents/implement-orchestrator.md` — the file the
|
||||
agent actually carries at runtime in its fresh context. That table
|
||||
is the single source; it is deliberately not restated here, so the
|
||||
two files cannot drift.
|
||||
|
||||
## The Process — orchestrator side
|
||||
|
||||
@@ -95,9 +85,9 @@ For a standard iteration:
|
||||
```
|
||||
Agent("implement-orchestrator", {
|
||||
mode: "standard",
|
||||
iter_id: "<iter_id>", // e.g. "ct.2.3", "or.1", "23.4"
|
||||
iter_id: "<iter_id>",
|
||||
plan_path: "<path under paths.plan_dir>",
|
||||
task_range: [3, 8] // optional
|
||||
task_range: [3, 8]
|
||||
})
|
||||
```
|
||||
|
||||
@@ -113,6 +103,13 @@ Agent("implement-orchestrator", {
|
||||
})
|
||||
```
|
||||
|
||||
The blocks above show the call shape; each field's semantics
|
||||
(including the load-bearing `iter_id` rule — it names the scratch
|
||||
dir and stats filename, NOT a branch) are defined authoritatively
|
||||
under **Carrier contract** in `agents/implement-orchestrator.md`.
|
||||
That table is the single source for the field semantics; they are
|
||||
deliberately not restated here, so the two files cannot drift.
|
||||
|
||||
Before dispatch: ensure the working tree is clean
|
||||
(`git status --porcelain` empty). The orchestrator-agent's
|
||||
Phase 0 will refuse to start on a dirty tree.
|
||||
|
||||
@@ -49,7 +49,10 @@ Additionally, every dispatch:
|
||||
|
||||
## Carrier contract
|
||||
|
||||
You receive from the outer orchestrator:
|
||||
You receive from the outer orchestrator the following fields. This
|
||||
table is the authoritative definition of each field's semantics;
|
||||
the dispatching skill shows the call shape but references this table
|
||||
rather than restating the semantics.
|
||||
|
||||
| Field | Content |
|
||||
|-------|---------|
|
||||
@@ -147,6 +150,34 @@ them as you switch roles:
|
||||
- Spec-compliance check reference: `spec-reviewer.md`
|
||||
- Quality check reference: `quality-reviewer.md`
|
||||
|
||||
##### Per-task sub-status vocabulary (authoritative)
|
||||
|
||||
The phases below produce these sub-status values. They are
|
||||
*internal* to you — they describe the state of an inline
|
||||
role-phase, not the status of a separate subagent, and are not
|
||||
reported upstream. This table is the authoritative definition of
|
||||
the vocabulary and the re-loop rule; the per-phase prose that
|
||||
follows applies it, and the dispatching skill names it but
|
||||
references this table. The vocabulary maps 1:1 to the phase
|
||||
reference files listed above.
|
||||
|
||||
| Sub-status | Action |
|
||||
|------------|--------|
|
||||
| `DONE` | next phase / next task |
|
||||
| `DONE_WITH_CONCERNS` | accumulate concern, next phase |
|
||||
| `NEEDS_CONTEXT` (1st–2nd) | re-attempt the phase with expanded context |
|
||||
| `NEEDS_CONTEXT` (3rd) | stop → `BLOCKED` to orchestrator, reason `context-exhausted` |
|
||||
| `non_compliant` / `changes_requested` (1st–2nd) | switch back to implementer mindset, repair with the check's report as repair brief, then re-run the check phase |
|
||||
| `non_compliant` / `changes_requested` (3rd) | stop → `BLOCKED` to orchestrator, reason `review-loop-exhausted` |
|
||||
| `BLOCKED` (implementer phase) | stop → `BLOCKED` to orchestrator, reason verbatim |
|
||||
| `unclear` (spec-compliance phase) | stop → `BLOCKED` to orchestrator, reason `spec-ambiguous` |
|
||||
| Tool / infra error | stop → `BLOCKED` to orchestrator, reason `infra` + raw error |
|
||||
|
||||
Re-loop limit: 2 retries per failure-mode per task. The 3rd is
|
||||
`BLOCKED` to the orchestrator. `skip task K, continue` is
|
||||
intentionally NOT a mode — tasks have implicit ordering
|
||||
dependencies and you do not know the dependency graph.
|
||||
|
||||
#### 2.1 — Implementer phase (inline)
|
||||
|
||||
Read `/tmp/iter-<iter_id>/task-K.md`. Adopt the implementer
|
||||
|
||||
@@ -51,7 +51,7 @@ whole component.
|
||||
|
||||
| Field | Content |
|
||||
|-------|---------|
|
||||
| `task_text_path` | Absolute path to a file (typically `/tmp/iter-<iter_id>/task-<N>.md`) containing the verbatim task block extracted from the plan. Read this file as your first action. |
|
||||
| `task_text_path` | Absolute path to a file (typically `/tmp/iter-<iter_id>/task-<N>.md`) containing the verbatim task block extracted from the plan. Read this file as your first action. This row is the authoritative definition of `task_text_path`; `spec-reviewer` receives the same field and cross-references it. |
|
||||
| `scene_set` | Parent cycle, where this task fits, dependencies on earlier completed tasks |
|
||||
| `cross_task_context` | Shared types, file structure decisions, naming conventions agreed for the iteration |
|
||||
| `mode` | `standard` (plan-driven) or `mini` (debug handoff: RED test path + cause summary + minimal-fix constraint) |
|
||||
|
||||
@@ -61,7 +61,7 @@ your spec for this review.
|
||||
|
||||
| Field | Content |
|
||||
|-------|---------|
|
||||
| `task_text_path` | Absolute path (typically `/tmp/iter-<iter_id>/task-<N>.md`) — same file the implementer received. Read this file as your first action. |
|
||||
| `task_text_path` | The same file the implementer received — see the authoritative `task_text_path` definition in `agents/implementer.md`. Read this file as your first action. |
|
||||
| `diff_command` | The shell command that produces the diff to review. Default and almost-always value: `git diff HEAD` (the working tree's full unstaged diff, accumulated across all tasks of this iter so far). Earlier tasks' changes are visible in this diff because no per-task commits are made — that is intentional; focus on the files the current task block claims it touches |
|
||||
| `status_from_implementer` | `DONE` or `DONE_WITH_CONCERNS` — if `DONE_WITH_CONCERNS`, the concerns are quoted so you can decide if they affect spec compliance |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user