workflow-supervisor 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,96 @@
1
1
  ---
2
2
  name: workflow-supervisor
3
- description: Coordinate supervised multi-agent workflows. Trigger whenever the user explicitly invokes workflow-supervisor, $workflow-supervisor, supervised workflow, dossiers, work units, worker agents, handoffs, approval gates, durable resume, or workflow-state documentation. When explicitly invoked, always run the full strict supervisor workflow regardless of task size; do not downscope, skip human approval or complete intake, skip dossiers, skip work units, skip worker-agent contracts, skip worker handoffs, or skip verification because a task appears simple. When not explicitly invoked, use only for workflows with hard supervisor triggers such as multi-agent handoff, durable resume, high-risk verification, contradictory or missing sources, multi-unit scope, repair loops, approval gates, or workflow-state documentation.
3
+ description: Coordinate supervised workflows with profile-based overhead. Trigger whenever the user explicitly invokes workflow-supervisor, $workflow-supervisor, supervised workflow, lean work-unit runner, dossiers, work units, worker agents, handoffs, approval gates, durable resume, or workflow-state documentation. When explicitly invoked, first select the correct profile: lean_work_unit_runner for large already-bounded backlogs or low-footprint direct execution, strict_full_workflow for ambiguous/high-risk/source-of-truth/delegated work, or planning_only for intake and sequencing. Do not run strict ceremony just because the skill was named. When not explicitly invoked, use only for workflows with hard supervisor triggers such as multi-agent handoff, durable resume, high-risk verification, contradictory or missing sources, multi-unit scope, repair loops, approval gates, or workflow-state documentation.
4
4
  ---
5
5
 
6
6
  # Workflow Supervisor
7
7
 
8
- Use this skill as the coordinating spine for supervised multi-agent work. The supervisor owns decomposition, worker-agent handoff quality, loop discipline, stop gates, and outcome reporting. It may do source discovery and reporting itself, but implementation, verification, repair-ticket writing, and documentation must be treated as separate worker-agent responsibilities when an automated worker path is available. Native threads, subagents, or the portable delegate command are transports for those worker agents.
8
+ Use this skill as the coordinating spine for supervised work. The supervisor owns decomposition, execution profile selection, loop discipline, stop gates, optional worker-agent handoff quality, and outcome reporting. It may do source discovery, implementation, focused verification, and reporting itself in lean mode. In strict mode, implementation, verification, repair-ticket writing, and documentation must be treated as separate worker-agent responsibilities when an automated worker path is available. Native threads, subagents, or the portable delegate command are transports for those worker agents.
9
9
 
10
- ## Strict Explicit Invocation Contract
10
+ ## Execution Profiles
11
11
 
12
- When the user explicitly invokes `workflow-supervisor`, `$workflow-supervisor`, or says to use this skill, the workflow is in `strict_full_workflow` mode. Task size is irrelevant. Do not decide that a request is too small, too easy, local-only, or single-file to receive the full workflow.
12
+ When the user explicitly invokes `workflow-supervisor`, `$workflow-supervisor`, or says to use this skill, first classify the workflow profile before creating heavy artifacts, goals, worker plans, dossiers, or subagents.
13
+
14
+ Use `lean_work_unit_runner` when the source already contains bounded work units, tickets, issues, checklist rows, or backlog entries and the user's priority is throughput, low memory, direct execution, or many pure units. Lean mode is for "do the next unit" execution, not for interpreting a broad source of truth from scratch.
15
+
16
+ Use `strict_full_workflow` when the task is ambiguous, high-risk, source-of-truth driven, regulated, delegated to multiple workers, externally published, security-sensitive, cross-system, or missing clear work-unit boundaries.
17
+
18
+ Use `planning_only` when the user wants intake, backlog shaping, sequencing, risk review, or a plan without implementation.
19
+
20
+ If the profile is unclear after reading the user's request and controlling source, ask one profile question and stop. Do not default to strict ceremony merely because the skill was named.
21
+
22
+ ### Lean Work Unit Runner
23
+
24
+ Lean mode optimizes for large-unit throughput while preserving non-ambiguity and human-verifiable state. It keeps work units as the backbone and removes per-unit ceremony that does not directly improve execution.
25
+
26
+ Lean mode requires exactly one upfront scope contract before the first unit starts:
27
+
28
+ - objective and controlling backlog/source
29
+ - selected profile: `lean_work_unit_runner`
30
+ - execution path: `autonomous_goal` or `human_in_loop`
31
+ - execution mode: usually `sequential`; parallel only for proven disjoint surfaces
32
+ - delegation: default `same_session_phased`; workers/subagents only with explicit authorization for a specific batch or risk
33
+ - final disposition and mutation boundaries
34
+ - state medium: one compact ledger, usually inline or `.workflow/LEDGER.md`
35
+ - batch size or checkpoint cadence for human review
36
+
37
+ Lean mode requires a backlog where each executable unit has:
38
+
39
+ ```yaml
40
+ id:
41
+ source_ref:
42
+ scope:
43
+ done:
44
+ check:
45
+ status: pending | active | pass | fail | blocked | escalated
46
+ notes:
47
+ ```
48
+
49
+ Do not start a lean unit unless its boundary and done signal are clear. If a unit lacks `scope`, `done`, or `check`, mark it `blocked` and ask for the smallest missing decision, or split it into smaller units. Do not hide ambiguity in notes.
50
+
51
+ Lean per-unit loop:
52
+
53
+ 1. Select the next ready unit from the ledger.
54
+ 2. Inspect only the files, artifacts, or source slices needed for that unit.
55
+ 3. Apply the smallest implementation that satisfies the unit.
56
+ 4. Run the unit's targeted check, or record the exact reason the check is blocked.
57
+ 5. Update one ledger row with status, touched surfaces, check result, and residual risk if any.
58
+ 6. Continue to the next ready unit until the batch checkpoint, blocker, resource gate, or final disposition.
59
+
60
+ Lean mode must not create per-unit SPEC files, full dossiers, worker maps, repair-ticket documents, or documenter passes by default. Use inline unit contracts and one compact ledger. Batch documentation and outcome reporting at checkpoints or final closeout.
61
+
62
+ Escalate a lean unit to `strict_full_workflow` or pause for human review when:
63
+
64
+ - source requirements conflict or are materially incomplete
65
+ - the unit touches broad architecture, security, data loss, credentials, production systems, billing, legal/compliance, public API contracts, migrations, or destructive operations
66
+ - the unit cannot name a targeted check or human-inspectable evidence
67
+ - multiple units unexpectedly touch the same shared surface and need re-sequencing
68
+ - repair repeats without new evidence
69
+ - the user asks for independent verification, subagents, PR, deploy, publish, or external-service action
70
+ - memory, process count, broad scans, or context churn threatens execution throughput
71
+
72
+ Lean verification is proportional. Use `focused-check` for the unit or batch. Use `independent-verifier` only when a risk trigger or user instruction justifies the extra cost. A lean PASS requires the ledger to show every completed unit's source reference, done signal, check or substitute evidence, and touched surfaces.
73
+
74
+ ### Strict Full Workflow
13
75
 
14
76
  Strict mode always requires:
15
77
 
16
78
  1. Complete intake before planning, goal creation, worker delegation, implementation, publication, or irreversible action.
17
79
  2. A human approval question before implementation unless completed intake explicitly selects `autonomous_goal`.
18
80
  3. A source corpus map, even if the source corpus is only "user prompt plus current workspace".
19
- 4. At least one bounded work unit, even for a tiny change. Use `WU-001` when there is only one unit.
20
- 5. A dossier for each implementation work unit before implementation begins.
21
- 6. An acceptance matrix or acceptance draft with evidence expectations before implementation begins.
22
- 7. A worker-agent plan with implementer, verifier, repair-author, and documenter agents.
23
- 8. A worker lifecycle record using `planned -> handed_off -> acknowledged -> reported -> verified -> closed`.
24
- 9. Verification labeled as `self-check`, `focused-check`, or `independent-verifier`.
25
- 10. A final disposition question or recorded completed-intake final disposition after verification.
81
+ 4. A source-requirement coverage ledger before work-unit finalization.
82
+ 5. A SPEC review packet or `.workflow/SPEC.md` before work-unit finalization.
83
+ 6. At least one bounded work unit, even for a tiny change. Use `WU-001` when there is only one unit.
84
+ 7. A dossier for each implementation work unit before implementation begins.
85
+ 8. An acceptance matrix or acceptance draft with evidence expectations before implementation begins.
86
+ 9. A worker-agent plan with implementer, verifier, repair-author, and documenter agents.
87
+ 10. A worker lifecycle record using `planned -> handed_off -> acknowledged -> reported -> verified -> resource_closed -> closed`.
88
+ 11. Verification labeled as `self-check`, `focused-check`, or `independent-verifier`.
89
+ 12. A final disposition question or recorded completed-intake final disposition after verification.
26
90
 
27
- Worker agents are mandatory when the environment provides worker, subagent, thread, or portable delegation tools. The supervisor must hand off implementation, verification, repair-authoring when needed, and documentation to separate agents with scoped dossiers and the required report schema. Run worker agents sequentially by default unless completed intake explicitly authorizes parallelism.
91
+ Worker agents are mandatory when strict mode is selected and the environment provides worker, subagent, thread, or portable delegation tools with a complete lifecycle: start, terminal report collection, and resource close. The supervisor must hand off implementation, verification, repair-authoring when needed, and documentation to separate agents with scoped dossiers and the required report schema. Run worker agents sequentially by default unless completed intake explicitly authorizes parallelism.
28
92
 
29
- If the environment cannot create, message, or delegate to worker agents, record `worker_agent_unavailable` and stop for the human decision unless completed intake explicitly selected `same_session_phased`. Do not silently collapse worker agents into same-session work.
93
+ If the environment cannot create, message, delegate to, and close worker agents, record `worker_agent_unavailable` or `worker_resource_close_unavailable` and stop for the human decision unless completed intake explicitly selected `same_session_phased`. Do not silently collapse worker agents into same-session work.
30
94
 
31
95
  Do not nest supervisors recursively. A worker agent that receives a supervisor-scoped dossier must perform its assigned role instead of spawning another supervisor layer unless the parent supervisor explicitly asks for a child supervisor.
32
96
 
@@ -36,6 +100,60 @@ This workflow must work without a repository, codebase, existing docs, or instal
36
100
 
37
101
  When no source corpus exists, make the first work unit a discovery/intake unit instead of inventing prerequisites. Do not require `AGENTS.md`, a repo, commands, or Markdown files unless the specific task provides them or needs them.
38
102
 
103
+ ## Source Requirement Coverage Gate
104
+
105
+ After the source corpus map and before final work units, extract the material requirements from the controlling sources into a coverage ledger. Include explicit user constraints, source deliverables, roadmap phases, exit criteria, named integrations, scale targets, verification requirements, and forbidden surfaces.
106
+
107
+ For every source requirement, record:
108
+
109
+ - source reference: file, ticket, prompt, section, line, or artifact id when available
110
+ - requirement statement using the source's own strength, including numbers, named systems, and "must"/"exit criteria" language
111
+ - disposition: `in_current_scope`, `explicit_user_deferred`, `blocked_needs_decision`, `out_of_scope_by_user`, or `non_material_context`
112
+ - planned work unit id or blocking question
113
+ - planned acceptance row id or waiver evidence
114
+
115
+ Do not weaken requirements while translating them into units or acceptance rows. Examples of forbidden downgrades:
116
+
117
+ - "live service import and query verification" to "generated export or optional loader"
118
+ - "required validation corpus size" to "small starter checks exist"
119
+ - "named providers A and B" to "one provider plus an extension hook"
120
+ - "required batch analysis and report generation" to "metadata says reports are possible"
121
+ - "provider-backed extraction and indexing" to "deterministic placeholder logic"
122
+
123
+ Treat roadmap phases, source "Build" lists, and exit criteria as material when the user says the source is the source of truth, asks to implement everything, or does not explicitly narrow the scope. If the user wants only a first slice, record every non-slice material item as `explicit_user_deferred`; otherwise create work units for it or stop as `blocked_needs_decision`.
124
+
125
+ Create exactly one implementation work unit only when all current-scope material requirements can be implemented and verified inside that one unit without hiding source requirements in residual risks, skipped checks, future work, or next recommended actions. For multi-phase, dependency-heavy, or roadmap-driven work, create one work unit per independently verifiable phase, integration, data slice, or risk boundary.
126
+
127
+ Before final closeout, audit the coverage ledger. The workflow may be PASS only when every material requirement is mapped to a PASS acceptance row, explicitly waived by the user, or blocked and reported as not complete.
128
+
129
+ ## SPEC Review And Q&A Gate
130
+
131
+ Before final work units, create a concise reviewable spec as `.workflow/SPEC.md` when workflow docs are enabled, or as an inline SPEC review packet when state is inline. The SPEC is the human-readable contract for interpretation, not the execution plan.
132
+
133
+ The SPEC must include:
134
+
135
+ - status: `Draft`, `Approved`, `Needs Revision`, or `Blocked`
136
+ - objective and non-goals
137
+ - source of truth summary
138
+ - interpreted scope
139
+ - requirement coverage ledger or summary
140
+ - deferred, out-of-scope, and blocked items
141
+ - proposed work units summary
142
+ - acceptance summary
143
+ - assumptions, risks, and open questions
144
+ - Q&A log
145
+ - human verification decision with reviewer, decision, notes, and date when known
146
+
147
+ In `human_in_loop`, stop after presenting the draft SPEC and ask for review. The human may ask questions, request revisions, block, defer requirements, change dispositions, or approve. Continue to final work units, dossiers, or implementation only after the SPEC has `Decision: Approved` or an equivalent explicit approval in the conversation.
148
+
149
+ If the human asks questions, answer them and update the Q&A log before proceeding. If the answers change scope, sources, dispositions, work units, or acceptance, revise the SPEC and ask for approval again. If the human marks `Needs Revision`, revise and re-present. If the human marks `Blocked`, stop and record the blocker.
150
+
151
+ In `autonomous_goal`, create or record the SPEC and continue only when no blocking questions remain and no higher-priority instruction requires approval. Do not fabricate human approval; use `Approval: not required by autonomous_goal intake` or equivalent wording instead.
152
+
153
+ Agents may propose dispositions such as `proposed_current_scope` or `proposed_deferred`, but only explicit user approval may convert them into `in_current_scope`, `explicit_user_deferred`, or `out_of_scope_by_user` when the distinction changes scope. Keep proposed agent interpretation separate from final human decisions.
154
+
155
+ If `autonomous_goal` finds a blocking question or human decision point, use Resume After Human Decision instead of treating the autonomous path as failed. Autonomous execution may pause for the smallest necessary decision and then continue from the saved checkpoint after the human answers.
156
+
39
157
  ## Codex Goal Lifecycle
40
158
 
41
159
  This skill is loop-oriented. Complete intake is mandatory before goal binding. After all required intake decisions are answered, bind the workflow to a Codex goal only when the completed intake and governing environment both authorize goal-oriented work.
@@ -53,10 +171,31 @@ Use this lifecycle:
53
171
  9. Use `update_goal` only for terminal `complete` or `blocked` states when the environment supports that action.
54
172
  10. Mark the goal complete only after acceptance evidence supports completion and no required supervisor work remains.
55
173
  11. Distinguish workflow/unit BLOCKED from Codex goal blocked. Mark a Codex goal blocked only after the same material blocker repeats across the required consecutive goal turns and no meaningful progress remains.
56
- 12. On resume after compaction or continuation, read the active goal first, then reconcile workflow docs and current artifacts.
174
+ 12. On resume after compaction, continuation, or human answer, read the active goal first, then reconcile workflow docs and current artifacts.
175
+ 13. If the prior Codex goal is terminal `blocked old`, do not assume it can be reopened. Continue from workflow state when safe; create or reuse a new active workflow state only when complete intake still authorizes goal binding, and reference the old blocked goal as history.
57
176
 
58
177
  If the environment has no goal tool or goal creation is not permitted, state the intended goal objective in the supervisor report and continue with workflow docs or another state artifact as the fallback state container.
59
178
 
179
+ ## Resume After Human Decision
180
+
181
+ Use this protocol when `autonomous_goal` or another supervised path stops to ask a human for clarification, scope disposition, approval, waiver, final disposition, or any other blocking decision.
182
+
183
+ Before asking the human:
184
+
185
+ - Record the blocker in `.workflow/SPEC.md`, `.workflow/WORKFLOW.md`, `.workflow/GOAL-STATE.md`, or the inline state packet. Include the blocked artifact, exact question, affected requirement ids, affected work units, last completed step, and recorded next action.
186
+ - Ask the smallest decision that can unblock progress. Do not re-ask complete intake unless a required intake decision is missing, contradicted, or directly changed by the blocker.
187
+ - Mark the workflow, SPEC item, unit, or worker as waiting or blocked. Do not mark the Codex goal terminal `blocked` for a first material blocker when meaningful progress can continue after the human answers.
188
+
189
+ When the human answers:
190
+
191
+ - Classify the answer as one or more of: clarification, scope change, requirement waiver, explicit deferral, blocker resolution, final disposition, intake change, or workflow cancellation.
192
+ - Update the SPEC Q&A log, requirement coverage dispositions, decision source, and any `DECISIONS.md`, `WORKFLOW.md`, or `GOAL-STATE.md` resume fields before continuing.
193
+ - Do not restart intake unless the answer changes a required intake decision: objective/source, execution path, mode, delegation, final disposition, mutation boundaries, or state artifacts. If it does, ask only the affected intake item(s), then resume.
194
+ - Re-run only the affected downstream steps: source coverage, SPEC, work-unit split, acceptance rows, dossiers, worker plan, verification, or final disposition. Preserve unaffected completed units and evidence.
195
+ - Invalidate stale work units, acceptance rows, dossiers, or worker reports whose assumptions changed. Do not reuse them as green evidence.
196
+ - Continue from the recorded `Next Action`. If the recorded next action is missing, derive the next action from the latest non-terminal workflow artifact and state the derivation in the report.
197
+ - If the old Codex goal is still active and relevant, reuse it. If it is terminal `blocked old` and cannot be reopened, reference it as history and continue with workflow docs or a newly authorized goal binding.
198
+
60
199
  ## Operating Contract
61
200
 
62
201
  - After complete intake, ground the workflow in sources before creating work units.
@@ -64,16 +203,21 @@ If the environment has no goal tool or goal creation is not permitted, state the
64
203
  - Run the complete intake gate before goal creation, worker delegation, implementation, publication, or other irreversible action.
65
204
  - Do not infer execution path, mode, delegation, final disposition, or boundaries from keywords, action verbs, or intent guesses.
66
205
  - Classify the workflow as `autonomous_goal` or `human_in_loop` only from completed intake answers before delegating workers or beginning implementation.
67
- - Explicit invocation always requires complete intake, work units, dossiers, worker-agent contracts, scoped handoffs, report schema, and verification; do this even for trivial tasks.
206
+ - Explicit invocation always requires profile selection before heavy planning. `strict_full_workflow` requires complete intake, work units, dossiers, worker-agent contracts, scoped handoffs, report schema, and verification. `lean_work_unit_runner` requires an upfront scope contract, bounded work units, a compact ledger, focused checks, and escalation gates instead of full per-unit ceremony.
207
+ - Preserve source-scope fidelity: do not translate controlling-source requirements into weaker proxy checks unless the user explicitly approves the narrower scope or waiver.
68
208
  - Always produce a plan after complete intake. In `human_in_loop`, make it an approval packet and stop for approval. In `autonomous_goal`, make it an execution plan and continue only when the completed intake authorizes that path.
69
- - Do not begin implementation until complete intake and the path gate are satisfied, at least one work unit exists, at least one concrete dossier exists, worker-agent contracts exist, and no stop gate applies.
209
+ - Do not begin strict implementation until complete intake and the path gate are satisfied, at least one work unit exists, at least one concrete dossier exists, worker-agent contracts exist, and no stop gate applies.
210
+ - Do not begin lean implementation until the scope contract is recorded, the backlog contains at least one ready unit, the compact ledger exists or can be kept inline, the current unit has source reference, scope, done signal, and check, and no escalation gate applies.
70
211
  - Delegate workers only through an automated supported delegation transport after complete intake and the path gate authorize delegation. If no supported transport exists, use same-session phased mode only when intake allowed it; otherwise stop as `worker_agent_unavailable`.
71
212
  - Do not start implementer, verifier, repair-author, or documenter workers before complete intake and the path gate are satisfied; role-specific start conditions are additional gates after that.
213
+ - Do not use native thread or native subagent workers unless the environment exposes a close operation for that transport. For Codex subagents, the supervisor must call `close_agent` for every `spawn_agent` id after the worker reaches a terminal report, times out, blocks, fails validation, is cancelled, or is no longer needed.
72
214
  - Keep roles separate: implementers implement, verifiers verify, repair authors write tickets, documenters update workflow artifacts, and the supervisor coordinates.
73
215
  - Treat same-session verification as a self-check, not independent verification. Separate verifier-agent verification may be labeled `independent-verifier` only when genuinely performed by a separate worker agent or thread.
74
216
  - Prefer explicit PASS/FAIL/BLOCKED states over soft completion language.
75
217
  - Stop instead of improvising when sources are missing, contradictory, materially stale, or too vague to produce acceptance criteria.
218
+ - Treat unimplemented material source requirements found in residual risks, skipped checks, future work, or `next_recommended_action` as open work, not PASS evidence.
76
219
  - Keep provenance optional; require enough outcome detail for another agent to resume.
220
+ - When resuming after a human decision, update state first, invalidate changed downstream artifacts, and continue from the recorded next action instead of restarting the whole workflow.
77
221
  - Treat companion skills as optional phase tools, not an automatic cascade. Use the smallest set needed for the current risk.
78
222
 
79
223
  ## Skills And Workers
@@ -85,11 +229,26 @@ Treat these as distinct mechanisms:
85
229
  - Skill: reusable instructions loaded into the current agent.
86
230
  - Worker: a role-scoped automated execution run that receives one dossier and returns one terminal report.
87
231
  - Portable worker delegation: the package helper command, `workflow-supervisor delegate --agent <agent> --role <role> --unit <unit-id> --cwd <workspace> --dossier <path>`, which invokes an installed platform CLI and normalizes its report.
88
- - Native thread or subagent: an environment-specific transport a worker adapter may use when it is available and authorized.
232
+ - Native thread or subagent: an environment-specific transport a worker adapter may use only when it can also close the native worker resource after use.
89
233
  - Same-session phased mode: the current agent performs roles sequentially. Verification in this mode is a self-check, not independent verification.
90
234
 
91
235
  Start workers only after complete intake and the path gate are satisfied, at least one work unit exists, a concrete dossier exists, the loop policy authorizes delegation, and the environment exposes an automated supported transport. If environment rules require explicit user approval for user-visible native thread creation, obtain it before using that transport. Do not use manual copy/paste handoff as the primary path. If automated delegation is unavailable, mark the unit `worker_agent_unavailable` unless completed intake explicitly selected same-session phased work.
92
236
 
237
+ ### Native Worker Resource Lifecycle
238
+
239
+ Logical worker completion is not enough for native thread or subagent transports. A worker is not `closed` until its native resource has also been released.
240
+
241
+ For every native worker:
242
+
243
+ 1. Record the native resource id immediately after creation, such as the Codex `agent_id` returned by `spawn_agent`, in the worker map.
244
+ 2. Record transport, worker name, role, work unit, dossier, start time, and close requirement before waiting on the worker.
245
+ 3. Collect one terminal report or mark the worker `BLOCKED` because of timeout, invalid output, unavailable adapter, cancellation, or missing evidence.
246
+ 4. Call the native close operation as soon as the terminal report or blocker is captured. For Codex subagents, call `close_agent` with the recorded `agent_id`.
247
+ 5. Record the close result and previous native status. Only then move the worker to `resource_closed` and then `closed`.
248
+ 6. Before final workflow outcome, audit the worker map. If any native worker has no close result, final status is `BLOCKED` with reason `open_native_worker`.
249
+
250
+ Native worker ids are resource handles, not evidence. Do not use a completed worker report, a subagent notification, or a wait result as a substitute for closing the native worker. If the close operation fails or is unavailable, stop and report `worker_resource_close_failed` or `worker_resource_close_unavailable`; do not keep spawning replacement workers.
251
+
93
252
  ## Worker Report Schema
94
253
 
95
254
  Every worker report back to the supervisor must use this schema:
@@ -121,6 +280,7 @@ Do not use keywords to skip intake. Words such as "autonomous", "agent loop", "w
121
280
  Required intake decisions:
122
281
 
123
282
  - Objective and source: what artifact, spec, repo path, document, ticket, or source set controls the work.
283
+ - Profile: `lean_work_unit_runner`, `strict_full_workflow`, or `planning_only`.
124
284
  - Execution path: `autonomous_goal` or `human_in_loop`.
125
285
  - Execution mode: `sequential`, `parallel_where_safe`, or `staged_parallel`.
126
286
  - Delegation: `automated_worker_delegation`, `native_threads_or_subagents_if_available`, or `same_session_phased`.
@@ -135,49 +295,64 @@ Use this question shape for the first intake ask:
135
295
  ```text
136
296
  Before I start the supervisor loop, answer every intake item:
137
297
  1. Objective and source: what artifact, spec, repo path, document, ticket, or source set controls the work?
138
- 2. Execution path: autonomous_goal or human_in_loop?
139
- 3. Mode: sequential, parallel where safe, or staged parallel?
140
- 4. Delegation: automated worker delegation, native threads/subagents if available, or same-session phased?
141
- 5. Final disposition: keep local, open PR, push main, deploy/publish, or ask at the end?
142
- 6. Boundaries: may I install dependencies, call external services, use credentials, or only edit local files?
143
- 7. State artifacts: create `.workflow/` docs, use another artifact directory, or keep state inline?
298
+ 2. Profile: lean_work_unit_runner, strict_full_workflow, or planning_only?
299
+ 3. Execution path: autonomous_goal or human_in_loop?
300
+ 4. Mode: sequential, parallel where safe, or staged parallel?
301
+ 5. Delegation: same-session phased, automated worker delegation, or native threads/subagents if available?
302
+ 6. Final disposition: keep local, open PR, push main, deploy/publish, or ask at the end?
303
+ 7. Boundaries: may I install dependencies, call external services, use credentials, or only edit local files?
304
+ 8. State artifacts: compact ledger, `.workflow/` docs, another artifact directory, or inline state?
144
305
  ```
145
306
 
146
307
  If the user answers only some intake items, ask only the unanswered or ambiguous item(s) again and stop. If the user says "use your judgment", treat that item as unanswered; do not substitute defaults. Continue prompting until every required intake decision has an explicit user answer.
147
308
 
148
- Treat `autonomous_goal`, PR creation, direct push, deploy, publication, paid operations, production data changes, and credential use as satisfied only by completed intake answers, not by keywords elsewhere in the prompt.
309
+ Treat `strict_full_workflow`, `autonomous_goal`, PR creation, direct push, deploy, publication, paid operations, production data changes, and credential use as satisfied only by completed intake answers or an explicit profile selection, not by vague keywords elsewhere in the prompt.
149
310
 
150
311
  Negative example: "Using Workflow Supervisor, generate an API and create the project" is not autonomous authorization and is not complete intake. It names the supervisor and objective, but leaves required intake decisions unresolved. Ask the complete intake packet and stop before implementation.
151
312
 
152
313
  ## Supervisor Loop
153
314
 
154
315
  1. Run the complete intake gate. Record explicit user answers. If any required intake answer is missing, vague, or delegated to judgment, ask for the unresolved item(s) and stop.
155
- 2. Restate the objective, constraints, non-goals, known sources, and unknowns from the completed intake.
316
+ 2. Restate the selected profile, objective, constraints, non-goals, known sources, and unknowns from the completed intake.
156
317
  3. Bind or reconcile the Codex goal only after complete intake and only when no unrelated active goal prevents binding.
157
- 4. Build or request a source corpus map. Use `$source-corpus` when source authority, freshness, or contradictions matter.
158
- 5. Split the objective into bounded work units. Use `$work-unit` for ambiguous or multi-phase goals. If the task is tiny, create exactly one work unit named `WU-001`.
159
- 6. Choose a loop policy before starting work: sequential or parallel, retry limits, approval gates, budgets, goal update cadence, and blocker rules. Use `$loop-policy` when the policy is not obvious.
160
- 7. Build dossiers for the first implementation units and any planned verification, repair, or documentation workers. Use `$dossier-builder` when delegating work to another agent or when the task has boundaries.
161
- 8. Assign worker roles with explicit allowed and forbidden behavior. Use `$worker-roles` for multi-agent, native-thread, or portable-worker work.
162
- 9. Select the execution path:
318
+ 4. If the profile is `lean_work_unit_runner`, run the lean loop:
319
+ - Confirm the source contains bounded work units or create a short upfront backlog contract. If not possible, pause for a decision or switch to `planning_only` or `strict_full_workflow`.
320
+ - Create or select one compact ledger instead of full workflow docs.
321
+ - Verify each ready unit has `id`, `source_ref`, `scope`, `done`, `check`, and `status`.
322
+ - Present a concise batch plan in `human_in_loop`, or continue in `autonomous_goal` when intake permits it.
323
+ - Execute one unit at a time with targeted inspection, smallest patch, focused check, ledger update, and checkpoint cadence.
324
+ - Escalate only the affected unit or batch when a strict-mode trigger appears; do not convert the whole backlog to strict mode unless the source contract is invalid.
325
+ - Finish with a compact outcome naming units completed, blocked, failed, escalated, checks, skipped checks, residual risks, and final disposition.
326
+ 5. If the profile is `planning_only`, stop after source grounding, backlog shape, risks, recommended profile, and approval questions. Do not implement.
327
+ 6. If the profile is `strict_full_workflow`, continue the strict loop below.
328
+ 7. Build or request a source corpus map. Use `$source-corpus` when source authority, freshness, or contradictions matter.
329
+ 8. Create the source-requirement coverage ledger. If any material source requirement cannot be classified, mapped to work, or explicitly deferred, stop and ask for the missing scope decision.
330
+ 9. Create the SPEC review packet or `.workflow/SPEC.md` from the source corpus and coverage ledger.
331
+ 10. Run the SPEC Q&A gate. In `human_in_loop`, stop until the human asks questions, receives answers or revisions, and explicitly approves the SPEC. In `autonomous_goal`, continue only when no blocking questions remain and approval is not required by intake.
332
+ 11. Split the objective into bounded work units from the approved or non-blocked SPEC and coverage ledger. Use `$work-unit` for ambiguous or multi-phase goals. If the task is tiny and the ledger has no deferred material requirements, create exactly one work unit named `WU-001`.
333
+ 12. Choose a loop policy before starting work: sequential or parallel, retry limits, approval gates, budgets, goal update cadence, and blocker rules. Use `$loop-policy` when the policy is not obvious.
334
+ 13. Build dossiers for the first implementation units and any planned verification, repair, or documentation workers. Use `$dossier-builder` when delegating work to another agent or when the task has boundaries.
335
+ 14. Assign worker roles with explicit allowed and forbidden behavior. Use `$worker-roles` for multi-agent, native-thread, or portable-worker work.
336
+ 15. Select the execution path:
163
337
  - `human_in_loop`: use when selected in completed intake or when a higher-priority rule requires human approval after intake.
164
338
  - `autonomous_goal`: use only when selected in completed intake and no higher-priority rule requires human approval.
165
- 10. If `.workflow/` artifacts will be used in a Git-backed codebase, ensure `.gitignore` contains `.workflow/` before writing them.
166
- 11. Present the path-specific plan:
339
+ 16. If `.workflow/` artifacts will be used in a Git-backed codebase, ensure `.gitignore` contains `.workflow/` before writing them.
340
+ 17. Present the path-specific plan:
167
341
  - `human_in_loop`: approval packet with plan, work units, worker delegation plan, approval gates, stop gates, and first dossiers. Stop until the human approves or revises it.
168
342
  - `autonomous_goal`: execution plan with the same contents plus autonomous boundaries, allowed actions, stop gates, repair limits, and final disposition policy. Continue after recording it only when complete intake authorized that path.
169
- 12. After the path gate is satisfied, delegate named workers from the worker delegation plan through the selected automated transport. Send each worker only its role, dossier, sources, acceptance rows, stop gates, and report schema.
170
- 13. Collect one terminal report from each worker. If a worker asks a human-facing question, convert it to `BLOCKED` and have the supervisor ask the user only when the path policy permits.
171
- 14. Verify independently where possible. Use `$acceptance-matrix` to map every requirement to evidence. Start verifier workers only after the relevant implementer report is available.
172
- 15. If verification FAILs, convert findings into repair tickets and route them to a repair-author or implementer repair worker. Do not expand scope during repair.
173
- 16. Re-run verification after repairs. Continue only until PASS, BLOCKED, repair limit, or path stop.
174
- 17. Start documenter workers only after source, implementation, verification, or repair evidence exists, unless the documenter is explicitly creating planning state.
175
- 18. If verification BLOCKs, report the blocker and stop or ask for the missing decision.
176
- 19. Use `$workflow-docs` to create or refresh reusable Markdown artifacts under `<workspace>/.workflow/` when the workflow must persist across context loss, agents, or sessions.
177
- 20. When all material acceptance rows are PASS or waived, apply the final disposition policy:
343
+ 18. After the path gate is satisfied, delegate named workers from the worker delegation plan through the selected automated transport. Send each worker only its role, dossier, sources, acceptance rows, stop gates, and report schema. For native threads or subagents, record the native resource id immediately and confirm a close operation exists before starting more workers.
344
+ 19. Collect one terminal report from each worker. If a worker asks a human-facing question, convert it to `BLOCKED` and have the supervisor ask the user only when the path policy permits. For native threads or subagents, close the native resource after the report or blocker is captured.
345
+ 20. Verify independently where possible. Use `$acceptance-matrix` to map every requirement to evidence. Start verifier workers only after the relevant implementer report is available.
346
+ 21. If verification FAILs, convert findings into repair tickets and route them to a repair-author or implementer repair worker. Do not expand scope during repair.
347
+ 22. Re-run verification after repairs. Continue only until PASS, BLOCKED, repair limit, or path stop.
348
+ 23. Start documenter workers only after source, implementation, verification, or repair evidence exists, unless the documenter is explicitly creating planning state.
349
+ 24. If verification BLOCKs, record the resume checkpoint, report the blocker, and stop or ask for the missing decision. When the human answers, use Resume After Human Decision.
350
+ 25. Use `$workflow-docs` to create or refresh reusable Markdown artifacts under `<workspace>/.workflow/` when the workflow must persist across context loss, agents, or sessions.
351
+ 26. Audit skipped checks, residual risks, future work, and next recommended actions against the source-requirement coverage ledger. If any material source requirement appears there without an explicit user deferral or waiver, mark the workflow FAIL/BLOCKED and create more work units or ask for a scope decision.
352
+ 27. When all material acceptance rows are PASS or waived, apply the final disposition policy:
178
353
  - `human_in_loop`: use the completed intake final disposition; if it is `ask_at_end`, ask the human to choose PR, push main, or keep local.
179
354
  - `autonomous_goal`: use the completed intake final disposition. If it is `ask_at_end`, stop and ask before taking any final disposition action.
180
- 21. Finish with an outcome report that names execution path, goal status, sources, work units, delegated workers, checks, skipped checks, residual risks, final disposition decision, and next action.
355
+ 28. Finish with an outcome report that names profile, execution path, goal status, sources, SPEC decision when strict, coverage or ledger disposition, work units, delegated workers or same-session execution, native worker close status, checks, skipped checks, residual risks, final disposition decision, and next action.
181
356
 
182
357
  ## Execution Paths
183
358
 
@@ -185,10 +360,14 @@ Negative example: "Using Workflow Supervisor, generate an API and create the pro
185
360
 
186
361
  Use `human_in_loop` when the completed intake selects it, or when a higher-priority rule requires human approval after intake. If the user has not answered the execution-path intake item, stop and ask for that answer instead of inferring a path.
187
362
 
188
- The first supervisor deliverable is a plan for approval, not implementation. The approval packet must include:
363
+ In `lean_work_unit_runner`, the first review deliverable is the scope contract plus compact ledger and batch checkpoint policy. Stop for approval before the first batch unless the user explicitly selected autonomous execution.
364
+
365
+ In `strict_full_workflow`, the first review deliverable after source coverage is the SPEC review packet, not implementation. After the SPEC Q&A gate is approved, the supervisor presents the implementation approval packet. The approval packet must include:
189
366
 
190
367
  - objective and non-goals
191
368
  - source corpus summary and gaps
369
+ - source-requirement coverage ledger summary
370
+ - SPEC review status, Q&A summary, and decision
192
371
  - work units and sequence
193
372
  - worker delegation plan with names, roles, dossiers, dependencies, start conditions, and transport
194
373
  - acceptance matrix summary
@@ -203,6 +382,8 @@ Use `autonomous_goal` only when the completed intake selects it. Phrases such as
203
382
 
204
383
  - objective and non-goals
205
384
  - source corpus summary and gaps
385
+ - source-requirement coverage ledger summary
386
+ - SPEC review status, Q&A summary, and approval policy
206
387
  - work units and sequence
207
388
  - worker delegation plan with names, roles, dossiers, dependencies, start conditions, and transport
208
389
  - acceptance matrix summary
@@ -210,13 +391,17 @@ Use `autonomous_goal` only when the completed intake selects it. Phrases such as
210
391
  - stop gates, repair limits, budgets, and escalation rules
211
392
  - final disposition policy: `open_pr_when_green`, `push_main_when_green`, or `keep_local_when_green`
212
393
 
394
+ For `lean_work_unit_runner`, replace SPEC, coverage-ledger, and worker-delegation details with the scope contract, compact ledger path, unit readiness fields, batch checkpoint cadence, resource gates, focused-check policy, and strict-mode escalation triggers.
395
+
213
396
  The final disposition must come from the completed intake. Direct push to the main branch, PR creation, deploy, publication, paid operations, production data changes, credential use, and destructive operations require explicit answers in the relevant intake fields.
214
397
 
215
398
  Even in `autonomous_goal`, stop and ask when any required intake answer is missing or ambiguous, required sources are missing, acceptance cannot be verified, a worker needs scope expansion, an irreversible action lacks intake authorization, or higher-priority instructions require approval.
216
399
 
400
+ When `autonomous_goal` stops for a human decision, it should usually leave the Codex goal active and mark only the workflow artifact, SPEC item, work unit, or worker as waiting or blocked. After the human answers, resume from the recorded next action and refresh only the affected downstream artifacts.
401
+
217
402
  ## Portable Worker Delegation
218
403
 
219
- After the path gate is satisfied, use the selected automated worker transport. The portable default is the package helper:
404
+ After the path gate is satisfied, use the selected automated worker transport. Prefer the portable delegate path when it satisfies the work because it is one-shot and does not leave a native thread or subagent resource open. The portable default is the package helper:
220
405
 
221
406
  ```text
222
407
  workflow-supervisor delegate --agent <agent> --role <role> --unit <unit-id> --cwd <workspace> --dossier <path>
@@ -230,7 +415,7 @@ workflow-supervisor validate-dossier <path> --role <role> --unit <unit-id> --jso
230
415
 
231
416
  If the dossier does not pass `DossierV1` validation, do not start the worker. Create a discovery dossier, ask for the missing decision, or mark the unit BLOCKED.
232
417
 
233
- Adapters may use native threads, native subagents, or one-shot CLI execution underneath, but the supervisor consumes only the normalized worker report. Use `workflow-supervisor delegate-doctor --agent <agent> --probe` to test the installed local adapter before relying on it for a workflow. If automated delegation is unavailable, mark execution as `worker_agent_unavailable` unless completed intake selected `same_session_phased`.
418
+ Adapters may use native threads, native subagents, or one-shot CLI execution underneath, but the supervisor consumes only the normalized worker report plus the transport lifecycle result. Use `workflow-supervisor delegate-doctor --agent <agent> --probe` to test the installed local adapter before relying on it for a workflow. If automated delegation is unavailable, mark execution as `worker_agent_unavailable` unless completed intake selected `same_session_phased`. If native delegation is available but native close is unavailable, mark execution as `worker_resource_close_unavailable` and choose portable delegation or same-session phased only when intake permits it.
234
419
 
235
420
  Name workers deterministically from the workflow, unit, role, and dossier:
236
421
 
@@ -252,7 +437,7 @@ Use one worker per role per work unit unless the loop policy explicitly allows b
252
437
  - kickoff: role, dossier, sources, acceptance rows, stop gates, report schema
253
438
  - checkpoint: request status, blockers, or clarification without expanding scope
254
439
  - repair delegation: failed rows, verifier findings, allowed repair surfaces, checks
255
- - closeout: collect terminal report and confirm no further action is expected
440
+ - closeout: collect terminal report, close any native worker resource, and confirm no further action is expected
256
441
 
257
442
  Workers must not ask the human questions directly, choose final disposition, approve plans, expand scope, or message each other. They return `PASS`, `FAIL`, or `BLOCKED` using the assigned report schema. The supervisor routes blockers, repairs, and human questions.
258
443
 
@@ -289,10 +474,16 @@ If any item is unknown and material, stop and ask for the missing decision or ma
289
474
 
290
475
  Stop when:
291
476
 
477
+ - the profile is missing or unclear and cannot be selected from explicit user intent plus controlling source
292
478
  - any required intake answer is missing, vague, delegated to judgment, or contradicted by another intake answer
293
479
  - source authority cannot be established
294
480
  - sources contradict each other on a material requirement
295
481
  - the requested scope cannot fit into a bounded work unit
482
+ - `lean_work_unit_runner` is selected but the backlog lacks clear unit ids, source references, boundaries, done signals, or targeted checks
483
+ - `lean_work_unit_runner` finds a strict-mode risk trigger and the user has not authorized escalation, deferral, or a narrower unit
484
+ - the coverage ledger is missing, incomplete, or contains material requirements classified as future work without explicit user deferral
485
+ - human-in-loop SPEC approval is missing, marked Needs Revision, marked Blocked, or has unanswered Q&A
486
+ - a human decision was answered but affected downstream coverage, SPEC, work units, acceptance, dossiers, or verification have not been refreshed
296
487
  - mandatory approval packet, work unit, dossier, worker-agent contract, or acceptance matrix is missing
297
488
  - allowed and forbidden surfaces cannot be named
298
489
  - acceptance cannot be verified with evidence
@@ -302,22 +493,29 @@ Stop when:
302
493
  - the selected path is `autonomous_goal` but it was inferred from prompt wording instead of a completed intake answer
303
494
  - an irreversible action is requested without explicit authorization in the completed intake
304
495
  - a worker asks to expand scope without supervisor or human approval
496
+ - a native thread or subagent worker has no recorded close result
305
497
  - final verification is not green and no waiver evidence exists
498
+ - residual risks, skipped checks, future work, or next actions contain unimplemented material source requirements
306
499
 
307
500
  ## Final Report Shape
308
501
 
309
502
  Report:
310
503
 
311
504
  - Status: PASS, FAIL, BLOCKED, or PARTIAL
505
+ - Profile: lean_work_unit_runner, strict_full_workflow, or planning_only
312
506
  - Execution path: autonomous_goal or human_in_loop
313
507
  - Goal status and whether a Codex goal was created, reused, skipped, completed, or blocked
314
508
  - Objective handled
315
509
  - Sources used and gaps
316
- - Work units completed or remaining
510
+ - SPEC status, Q&A summary, and human decision or autonomous approval policy
511
+ - Source-requirement coverage ledger summary, including deferred or blocked material requirements
512
+ - Work units completed, blocked, failed, escalated, or remaining
513
+ - Compact ledger path or inline ledger summary when in lean mode
317
514
  - Approval question id and whether `WAITING_FOR_HUMAN -> ACTIVE` occurred
515
+ - Human decision resume status, affected artifacts, and whether stale downstream artifacts were invalidated
318
516
  - Dossiers created or missing
319
517
  - Workers delegated, blocked, unavailable, or skipped
320
- - Worker lifecycle status for each role
518
+ - Worker lifecycle status for each role, including native resource ids and close results when native threads or subagents were used
321
519
  - Verification evidence
322
520
  - Repairs performed or recommended
323
521
  - Checks run and skipped
@@ -1,7 +1,7 @@
1
1
  interface:
2
2
  display_name: "Workflow Supervisor"
3
- short_description: "Run autonomous or human-gated workflows"
4
- default_prompt: "Use $workflow-supervisor to run the complete intake gate first. Ask every required intake question and stop until the user explicitly answers all of them. Do not infer or skip steps from keywords such as autonomous, work until done, approval, generate, or create. Start planning or work only after complete intake is satisfied."
3
+ short_description: "Run lean, strict, or planning-only supervised workflows"
4
+ default_prompt: "Use $workflow-supervisor to select the execution profile first: lean_work_unit_runner for large bounded backlogs and low-footprint direct execution, strict_full_workflow for ambiguous/high-risk/delegated work, or planning_only for sequencing without implementation. Ask required intake questions and stop until the user explicitly answers all missing items. Do not infer path, mode, delegation, final disposition, or boundaries from vague keywords. In lean mode, keep work units and a compact ledger, avoid subagents unless explicitly authorized, run targeted checks, and escalate unclear or risky units. In strict mode, create a source-requirement coverage ledger and SPEC review gate before work units, preserve source requirements in acceptance rows, and do not hide unimplemented material requirements in residual risks or future work. Prefer one-shot portable delegation when it satisfies the work. If native threads or subagents are used, record each native resource id, call the native close action such as close_agent after terminal report or blocker capture, and block final outcome if any native worker lacks a close result."
5
5
 
6
6
  policy:
7
7
  allow_implicit_invocation: false