Replace the inline LOOP_HOST_CONTRACT constant in the Capability Registry generator with a generated-from-workflows contract (ADR-894 §3). The contract is now derived from inert `<!-- gsd:loop-host ... -->` marker blocks in the five step workflows, emitted as the committed gsd-core/bin/lib/loop-host-contract.cjs, and required by gen-capability-registry.cjs — one source of truth, no drift. Drift guards in gen-loop-host-contract.cjs: per-step point ownership (each step must declare exactly its canonical loop points), multiple-block + duplicate-key hard errors, and a word-boundary agent-role cross-check. Contract content is byte-identical to the former constant; registry-only, nothing wired into the live loop. Closes #903 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
105
gsd-core/bin/lib/loop-host-contract.cjs
Normal file
105
gsd-core/bin/lib/loop-host-contract.cjs
Normal file
@@ -0,0 +1,105 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* loop-host-contract.cjs — generated by scripts/gen-loop-host-contract.cjs
|
||||
* DO NOT EDIT BY HAND. Run: node scripts/gen-loop-host-contract.cjs --write
|
||||
* ADR-894 §3 — Loop Host Contract, generated from workflow markers.
|
||||
* 12 points: discuss:pre/post, plan:pre/post, execute:pre/wave:pre/wave:post/post,
|
||||
* verify:pre/post, ship:pre/post. Per-step agentRoles and coreArtifacts.
|
||||
*/
|
||||
|
||||
const LOOP_HOST_CONTRACT = [
|
||||
{
|
||||
"step": "discuss",
|
||||
"points": [
|
||||
"discuss:pre",
|
||||
"discuss:post"
|
||||
],
|
||||
"agentRoles": [
|
||||
"orchestrator"
|
||||
],
|
||||
"coreArtifacts": {
|
||||
"produces": [
|
||||
"CONTEXT.md"
|
||||
],
|
||||
"consumes": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "plan",
|
||||
"points": [
|
||||
"plan:pre",
|
||||
"plan:post"
|
||||
],
|
||||
"agentRoles": [
|
||||
"researcher",
|
||||
"planner",
|
||||
"checker"
|
||||
],
|
||||
"coreArtifacts": {
|
||||
"produces": [
|
||||
"PLAN.md"
|
||||
],
|
||||
"consumes": [
|
||||
"CONTEXT.md"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "execute",
|
||||
"points": [
|
||||
"execute:pre",
|
||||
"execute:wave:pre",
|
||||
"execute:wave:post",
|
||||
"execute:post"
|
||||
],
|
||||
"agentRoles": [
|
||||
"executor",
|
||||
"verifier"
|
||||
],
|
||||
"coreArtifacts": {
|
||||
"produces": [
|
||||
"SUMMARY.md"
|
||||
],
|
||||
"consumes": [
|
||||
"PLAN.md"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "verify",
|
||||
"points": [
|
||||
"verify:pre",
|
||||
"verify:post"
|
||||
],
|
||||
"agentRoles": [
|
||||
"orchestrator"
|
||||
],
|
||||
"coreArtifacts": {
|
||||
"produces": [
|
||||
"UAT.md"
|
||||
],
|
||||
"consumes": [
|
||||
"SUMMARY.md"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "ship",
|
||||
"points": [
|
||||
"ship:pre",
|
||||
"ship:post"
|
||||
],
|
||||
"agentRoles": [
|
||||
"orchestrator"
|
||||
],
|
||||
"coreArtifacts": {
|
||||
"produces": [],
|
||||
"consumes": [
|
||||
"UAT.md"
|
||||
]
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
module.exports = { LOOP_HOST_CONTRACT };
|
||||
@@ -1,3 +1,10 @@
|
||||
<!-- gsd:loop-host
|
||||
step: discuss
|
||||
points: discuss:pre, discuss:post
|
||||
agent-roles: orchestrator
|
||||
produces: CONTEXT.md
|
||||
consumes:
|
||||
-->
|
||||
<purpose>
|
||||
Extract implementation decisions that downstream agents need. Analyze the phase to identify gray areas, let the user choose what to discuss, then deep-dive each selected area until satisfied.
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<!-- gsd:loop-host
|
||||
step: execute
|
||||
points: execute:pre, execute:wave:pre, execute:wave:post, execute:post
|
||||
agent-roles: executor, verifier
|
||||
produces: SUMMARY.md
|
||||
consumes: PLAN.md
|
||||
-->
|
||||
<purpose>
|
||||
Execute all plans in a phase using wave-based parallel execution. Orchestrator stays lean — delegates plan execution to subagents.
|
||||
</purpose>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<!-- gsd:loop-host
|
||||
step: plan
|
||||
points: plan:pre, plan:post
|
||||
agent-roles: researcher, planner, checker
|
||||
produces: PLAN.md
|
||||
consumes: CONTEXT.md
|
||||
-->
|
||||
<purpose>
|
||||
Create executable phase prompts (PLAN.md files) for a roadmap phase with integrated research and verification. Default flow: Research (if needed) -> Plan -> Verify -> Done. Orchestrates gsd-phase-researcher, gsd-planner, and gsd-plan-checker agents with a revision loop (max 3 iterations).
|
||||
</purpose>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<!-- gsd:loop-host
|
||||
step: ship
|
||||
points: ship:pre, ship:post
|
||||
agent-roles: orchestrator
|
||||
produces:
|
||||
consumes: UAT.md
|
||||
-->
|
||||
<purpose>
|
||||
Create a pull request from completed phase/milestone work, generate a rich PR body from planning artifacts, optionally run code review, and prepare for merge. Closes the plan → execute → verify → ship loop.
|
||||
</purpose>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<!-- gsd:loop-host
|
||||
step: verify
|
||||
points: verify:pre, verify:post
|
||||
agent-roles: orchestrator
|
||||
produces: UAT.md
|
||||
consumes: SUMMARY.md
|
||||
-->
|
||||
<purpose>
|
||||
Validate built features through conversational testing with persistent state. Creates UAT.md that tracks test progress, survives /clear, and feeds gaps into /gsd:plan-phase --gaps.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user