You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: factory/coordinator.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,9 @@ For every `output_schema` subagent (research, writer, each reviewer, and revisio
18
18
19
19
Writer completion is valid only when its structured `completed` is true, `open_questions` is valid, and caught file validation confirms the four expected physical files (`research.md`, `meta.yaml`, `external.md`, and `speakeasy.md`) and allowed paths. Revision completion is valid only when its structured `completed` is true, `addressed` and `disputed` are valid arrays, caught file validation confirms allowed paths/artifacts, and a later confirmatory review wave verifies the edits. Structured claims never substitute for physical verification.
20
20
21
+
Perform phase artifact validation only through the repository-owned helper, using the exact command for the current phase: `bash factory/scripts/inspect-guide-artifacts.sh <slug> research`, `bash factory/scripts/inspect-guide-artifacts.sh <slug> writer`, or `bash factory/scripts/inspect-guide-artifacts.sh <slug> revision`. Run it from `/workspace` in a caught boundary and validate its JSON result. Do not construct ad hoc artifact-validation commands with `find`, `test`, `jq`, or another tool, and do not substitute the linter for this check.
22
+
Accept only the exact keys `slug`, `stage`, and `artifacts`, with string slug/stage values equal to the command arguments and a sorted, unique string artifact array. Research accepts exactly `["meta.yaml","research.md"]` or the full four-file array `["external.md","meta.yaml","research.md","speakeasy.md"]`. Writer and revision require the full four-file array. Any other output is a caught validation failure.
23
+
21
24
## Phase 1 — read inputs and resolve identity
22
25
23
26
Begin Phase 1 with one caught boundary executing exactly `bash factory/scripts/inspect-inputs.sh /input/issue.json /input/catalog.json`. Read issue evidence, catalog identity fields, available personas, and existing guide slugs only from that command's JSON output; do not construct another initial-inspection tool program or read either raw input another way. Resolve exactly one provider and lowercase kebab-case slug from this output. Prefer an existing slug on a confident match; never create an alias duplicate. If provider/slug is missing, conflicting, or ambiguous, choose `blocked`, leave all three identity fields null, and report without guide edits.
@@ -28,11 +31,11 @@ For a resolved slug, execute exactly `bash factory/scripts/inspect-guide-context
28
31
29
32
Scope-gate classification is strict. Material uncertainty is limited to an unknown authentication model, endpoint, required credential, security-sensitive operator choice, provider capability or feasibility, or an unresolved authoritative-source conflict that could make the guide unsafe or unusable. Presentation-only uncertainty never selects `awaiting_scope`. Missing exact UI labels, control names or locations, and equivalent Save/Update/Apply chrome are presentation-only when the underlying operation and required value are known. After a reasonable source search, preserve documented identifiers, write a resilient hedge such as the visible or equivalent control, record the documentation silence, and continue. Open questions alone do not select `awaiting_scope`; classify each by its effect on safe first connection.
30
33
31
-
Start the technical-research subagent in a caught boundary with the selected persona file, authority files, resolved identity/catalog facts, issue evidence, existing artifacts, primary-source requirement, and write access only to `research.md` and `meta.yaml`. Set `output_schema` to the exact `factory/schemas/research-status.schema.json`. Apply the universal transport/schema check and one-repair limit. In another caught file-validation boundary, confirm both artifacts are physical regular files and agree with the valid output. Only material unanswered decisions select `awaiting_scope`; authoritative evidence blockers select `blocked`; operational/caught errors select `failed`. Each terminal state skips later model phases and reaches reporting.
34
+
Start the technical-research subagent in a caught boundary with the selected persona file, authority files, resolved identity/catalog facts, issue evidence, existing artifacts, primary-source requirement, and write access only to `research.md` and `meta.yaml`. Set `output_schema` to the exact `factory/schemas/research-status.schema.json`. Apply the universal transport/schema check and one-repair limit. In another caught file-validation boundary, execute exactly `bash factory/scripts/inspect-guide-artifacts.sh <slug> research` and confirm its result agrees with the valid output. Only material unanswered decisions select `awaiting_scope`; authoritative evidence blockers select `blocked`; operational/caught errors select `failed`. Each terminal state skips later model phases and reaches reporting.
32
35
33
36
## Phase 3 — writer
34
37
35
-
Start one writer in a caught boundary with `doctrine/roles/writer.md`, the selected persona file, doctrine, `research.md`, and `meta.yaml`; forbid external research. Set `output_schema` to a strict object with only `completed` (boolean) and `open_questions` (array of nonempty strings). Apply the universal one-repair protocol and writer completion verification. Only material factual decisions under the Phase 2 scope-gate definition select `awaiting_scope`; presentation-only uncertainty must be hedged and rendered, and caught errors select `failed`.
38
+
Start one writer in a caught boundary with `doctrine/roles/writer.md`, the selected persona file, doctrine, `research.md`, and `meta.yaml`; forbid external research. Set `output_schema` to a strict object with only `completed` (boolean) and `open_questions` (array of nonempty strings). Apply the universal one-repair protocol and writer completion verification. Writer completion verification must execute exactly `bash factory/scripts/inspect-guide-artifacts.sh <slug> writer` in a caught boundary. Only material factual decisions under the Phase 2 scope-gate definition select `awaiting_scope`; presentation-only uncertainty must be hedged and rendered, and caught errors select `failed`.
36
39
37
40
## Phase 4 — bounded concurrent review/revision state machine
38
41
@@ -44,7 +47,7 @@ REVIEWER 3/3 — editorial clarity and audience fit, using `doctrine/roles/revie
44
47
45
48
Each reviewer runs in its own caught boundary with `output_schema` equal to `factory/schemas/review-findings.schema.json` and the universal one-repair protocol. The full concurrent dispatch/collection runs in an enclosing caught boundary. Run the shell/linter in its own caught boundary from `/workspace`, exactly `/usr/local/bin/lint-guide --json /workspace/guides/<slug>`; never invoke `go` or `go run`. Validate parsed linter JSON before use. A completed review wave means valid output from all 3 reviewers plus a successfully parsed linter result. A failed reviewer output, malformed output after repair, linter failure, or invalid linter JSON fails the wave and must not complete the wave and therefore do not increment `review_rounds`; it selects `failed` and routes to reporting.
46
49
47
-
Only after a completed review wave increment actual `review_rounds` by one (maximum 3). Normalize semantic duplicates without dropping sources; linter blockers equal reviewer blockers. If there are no blockers, select `converged`. If blockers remain and `review_rounds < 3`, start exactly one revision in a caught boundary with all normalized findings, doctrine, current files, and the selected persona; forbid external research and outside edits. Revision agents must not run validation commands; the coordinator owns post-edit file validation and the next complete review wave. Explicitly prohibit validation including `go`, `go run`, `npx`, Python, and `/usr/local/bin/lint-guide`; tell the revision agent to make only the requested allowed-path edits and return its structured result. Its strict `output_schema` has only `completed` (boolean), `addressed` (array), and `disputed` (array). Apply one repair and revision completion verification, then always run a confirmatory review wave; a revision can never directly converge. Repeat while capacity remains. If the confirmatory third wave has final-round blockers, select `blocked`; do not revise again. Thus at most three review/revision rounds occur, represented by at most three complete waves, and the report records the actual count.
50
+
Only after a completed review wave increment actual `review_rounds` by one (maximum 3). Normalize semantic duplicates without dropping sources; linter blockers equal reviewer blockers. If there are no blockers, select `converged`. If blockers remain and `review_rounds < 3`, start exactly one revision in a caught boundary with all normalized findings, doctrine, current files, and the selected persona; forbid external research and outside edits. Revision agents must not run validation commands; the coordinator owns post-edit file validation and the next complete review wave. Explicitly prohibit validation including `go`, `go run`, `npx`, Python, and `/usr/local/bin/lint-guide`; tell the revision agent to make only the requested allowed-path edits and return its structured result. Its strict `output_schema` has only `completed` (boolean), `addressed` (array), and `disputed` (array). Apply one repair, then execute exactly `bash factory/scripts/inspect-guide-artifacts.sh <slug> revision` in a caught boundary for revision completion verification. Always run a confirmatory review wave; a revision can never directly converge. Repeat while capacity remains. If the confirmatory third wave has final-round blockers, select `blocked`; do not revise again. Thus at most three review/revision rounds occur, represented by at most three complete waves, and the report records the actual count.
48
51
49
52
Deterministic scenario rulings: failed reviewer output -> `failed`, zero increment, report; malformed output -> one same-session repair then `failed` on exhaustion; successful revision -> mandatory confirmatory review wave; final-round blockers -> `blocked` with `review_rounds = 3`.
0 commit comments