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.
@@ -21,22 +21,24 @@ For loop-oriented supervisor work, define how the workflow uses Codex goals afte
21
21
  - goal_state_mirror_cadence: each work unit, each verification result, each repair loop, and final outcome
22
22
  - goal_completion_rule: evidence required before completion
23
23
  - goal_blocked_rule: same material blocker across the required consecutive goal turns and no meaningful progress
24
- - goal_resume_rule: read active goal before workflow docs, then reconcile
24
+ - goal_resume_rule: read active goal before workflow docs, reconcile state, and continue from the recorded next action after human decisions
25
+ - human_decision_resume_rule: ask the smallest blocking decision, update state, invalidate only affected downstream artifacts, and resume without restarting intake unless intake changed
25
26
 
26
27
  Do not create goals for small direct tasks. A goal is the state container for open-ended loops, not a wrapper around every command.
27
28
 
28
29
  ## Policy Dimensions
29
30
 
31
+ - Profile: `lean_work_unit_runner`, `strict_full_workflow`, or `planning_only`; choose before heavy artifacts, goals, workers, or implementation.
30
32
  - Intake: whether every required intake decision has an explicit user answer, and which unanswered items must be re-asked before any work can start.
31
33
  - Execution path: autonomous_goal or human_in_loop, from completed intake only.
32
34
  - Mode: sequential, parallel, staged parallel, or discovery-first, from completed intake only.
33
35
  - Approval: none, before worker delegation, before implementation, before verification, before repair, before publication, before irreversible action, before each unit, or path-gated.
34
- - Delegation orchestration: selected transport, adapter availability, naming scheme, start timing, supervisor checkpoint cadence, terminal report collection, and stop behavior when automated delegation is unavailable.
36
+ - Delegation orchestration: selected transport, adapter availability, naming scheme, start timing, supervisor checkpoint cadence, terminal report collection, native resource close behavior, and stop behavior when automated delegation is unavailable.
35
37
  - Repair limit: maximum repair loops per unit.
36
38
  - Budget: time, token, command, cost, or file-change limits.
37
39
  - Escalation: when to ask the user, delegate to a specialist worker, or stop.
38
40
  - Completion: evidence required before marking done.
39
- - Resume: artifacts needed before pausing or compacting.
41
+ - Resume: artifacts needed before pausing, compacting, or waiting for a human decision.
40
42
  - Mutation conflict: whether units touch the same mutable surfaces or decisions.
41
43
 
42
44
  ## Default Policy
@@ -44,25 +46,38 @@ Do not create goals for small direct tasks. A goal is the state container for op
44
46
  Use this default unless the task says otherwise:
45
47
 
46
48
  ```yaml
49
+ profile_selection: before goal creation, heavy planning, worker delegation, implementation, verification, repair, final disposition, publication, or irreversible action
50
+ profiles:
51
+ lean_work_unit_runner: large bounded backlog, pure work units, low-footprint direct execution, compact ledger, no default subagents
52
+ strict_full_workflow: ambiguous, high-risk, delegated, source-of-truth, security, external-service, publication, or broad interpretation work
53
+ planning_only: intake, scope review, sequencing, risks, and recommendations without implementation
47
54
  intake_required_when: every supervisor invocation before goal creation, planning beyond intake, worker delegation, implementation, verification, repair, final disposition, publication, or irreversible action
48
55
  intake_question_count: ask the complete intake packet first; on follow-up ask every unanswered or ambiguous item
49
- required_intake_decisions: objective_and_source, execution_path, mode, delegation, final_disposition, mutation_boundaries, state_artifacts
56
+ required_intake_decisions: objective_and_source, profile, execution_path, mode, delegation, final_disposition, mutation_boundaries, state_artifacts
50
57
  use_judgment_defaults: none; user must answer every required intake decision explicitly
51
- keyword_shortcuts: forbidden; do not infer path, mode, delegation, final disposition, or boundaries from prompt keywords
58
+ keyword_shortcuts: forbidden for path, mode, delegation, final disposition, and boundaries; profile may be selected only from explicit user intent plus controlling source
52
59
  mode: from completed intake only
53
60
  execution_path: from completed intake only
54
61
  approval_gate: path-gated; complete intake before any path-specific plan; human approval for human_in_loop plans; explicit completed-intake authorization for autonomous_goal; explicit completed-intake authorization for irreversible or user-visible publication
55
62
  repair_limit_per_unit: 2
56
63
  parallel_allowed_when: units do not share mutable surfaces
57
- worker_delegation_rule: after complete intake, path gate, concrete dossier, and supported automated transport
58
- native_transport_rule: after complete intake, path gate, and concrete dossier when the environment exposes approved thread or subagent tools
64
+ worker_delegation_rule: strict mode after complete intake, path gate, concrete dossier, supported automated transport, and supported resource close; lean mode only after explicit authorization or escalation trigger
65
+ native_transport_rule: after complete intake, path gate, concrete dossier, and confirmed close operation when the environment exposes approved thread or subagent tools
59
66
  worker_name_template: wf/<workflow-slug>/<unit-id>-<role>-<dossier-slug>
60
- supervisor_checkpoint_cadence: after worker start, terminal report, repair ticket creation, re-verification, and final disposition
67
+ supervisor_checkpoint_cadence: after worker start, native resource id capture, terminal report, native resource close, repair ticket creation, re-verification, and final disposition
68
+ native_worker_lifecycle:
69
+ required_fields: worker_name, transport, native_resource_id, status, terminal_report, close_action, close_result
70
+ codex_close_action: close_agent
71
+ final_outcome_gate: blocked if any native worker lacks close_result
72
+ lean_checkpoint_cadence: after each unit ledger update, at user-selected batch size, on blocker, on risk escalation, and final outcome
73
+ lean_unit_readiness: id, source_ref, scope, done, check, status
74
+ lean_resource_gates: no unapproved subagents, no broad scans unless needed for current unit, one active unit by default, stop or ask when memory/process churn threatens throughput
61
75
  final_disposition_policy: from completed intake only; if set to ask_at_end, stop and ask at final disposition
62
76
  workflow_unit_blocked_after: first material blocker may stop the unit while the Codex goal remains active
63
77
  codex_goal_blocked_after: same material blocker across 3 consecutive goal turns and no meaningful progress
64
78
  completion_requires: acceptance evidence plus residual risk report
65
79
  resume_requires: workflow state or outcome doc for long workflows
80
+ human_decision_resume_rule: record blocker and next action before asking; after answer, update Q&A/decision/coverage state, re-run only affected downstream steps, invalidate stale artifacts, and continue from recorded next action
66
81
  missing_prerequisites: discovery-first, not failure
67
82
  goal_start: after complete intake only; create only when completed intake and environment authorize goal binding, otherwise mirror state in docs
68
83
  goal_state_mirror_cadence: after unit terminal states and final outcome
@@ -86,11 +101,21 @@ Do not run units in parallel when they edit the same files, documents, datasets,
86
101
 
87
102
  ```yaml
88
103
  workflow:
104
+ profile:
89
105
  intake:
90
106
  execution_path:
91
107
  mode:
92
108
  approval_gates:
93
109
  delegation_policy:
110
+ native_worker_lifecycle:
111
+ required_close_action:
112
+ open_native_workers:
113
+ lean_policy:
114
+ ledger:
115
+ unit_readiness:
116
+ batch_checkpoint:
117
+ focused_check:
118
+ escalation_triggers:
94
119
  repair_limit:
95
120
  parallel_rules:
96
121
  budgets:
@@ -98,6 +123,7 @@ escalation_rules:
98
123
  stop_gates:
99
124
  completion_rule:
100
125
  resume_artifacts:
126
+ human_decision_resume_rule:
101
127
  goal_policy:
102
128
  final_disposition_policy:
103
129
  ```
@@ -43,6 +43,23 @@ Work-unit drafts coarse done criteria only. Use `$acceptance-matrix` when those
43
43
 
44
44
  For over-broad one-pass requests, produce a sequencing recommendation and invoke or mirror `$loop-policy` fields for mode, parallel safety, approval gates, and repair limits.
45
45
 
46
+ ## One-Pass Collapse Guard
47
+
48
+ Do not collapse a multi-phase roadmap, spec, or "source of truth" corpus into one broad implementation unit unless every material requirement can be completed and verified inside that unit. If the source contains phases, exit criteria, named integrations, scale targets, or different risk classes, split them into independently verifiable units.
49
+
50
+ Treat these as separate-unit signals:
51
+
52
+ - roadmap phases or milestones
53
+ - multiple external data sources, providers, services, or credentials
54
+ - live system integration plus local artifact fallback
55
+ - extraction/indexing/retrieval/evaluation/reporting layers with different evidence needs
56
+ - numeric targets such as corpus size, eval question count, latency budget, or coverage threshold
57
+ - implementation work that would otherwise be described as residual risk, future work, or next recommended action
58
+
59
+ If a supervisor provides a source-requirement coverage ledger, every `in_current_scope` material requirement must appear in at least one work unit's done criteria. Every `explicit_user_deferred`, `blocked_needs_decision`, or `out_of_scope_by_user` item must remain visible in `blocked_units` or a separate deferral list; do not hide it inside a unit note.
60
+
61
+ Create exactly one `WU-001` only when the task is genuinely tiny or the full current-scope ledger can be implemented, verified, and documented as one bounded unit without deferred material requirements.
62
+
46
63
  ## Output Shape
47
64
 
48
65
  ```yaml
@@ -60,10 +77,12 @@ units:
60
77
  forbidden_surfaces:
61
78
  readiness:
62
79
  done_criteria:
80
+ source_requirements_covered:
63
81
  verification:
64
82
  sequence:
65
83
  parallel_groups:
66
84
  blocked_units:
85
+ deferred_or_out_of_scope_requirements:
67
86
  first_recommended_unit:
68
87
  ```
69
88
 
@@ -61,17 +61,19 @@ For documentation work, start with `DOCUMENTATION-BRIEF.md` unless the user prov
61
61
  ## Artifact Selection
62
62
 
63
63
  - `.workflow/WORKFLOW.md`: overall objective, policy, state, units, and next action.
64
+ - `.workflow/LEDGER.md`: compact lean-runner state for large bounded backlogs, with one row per work unit and targeted check evidence.
64
65
  - `.workflow/SOURCE-CORPUS.md`: source map, authority ranking, contradictions, gaps.
66
+ - `.workflow/SPEC.md`: human-reviewable interpretation contract, requirement coverage, Q&A, and approval decision before final work units.
65
67
  - `.workflow/WORK-UNITS.md`: decomposition and sequencing.
66
68
  - `.workflow/DOSSIER.md`: delegation contract for one unit.
67
- - `.workflow/WORKER-MAP.md`: worker names, roles, transports, dossiers, dependencies, start conditions, report status, and supervisor checkpoints.
69
+ - `.workflow/WORKER-MAP.md`: worker names, roles, transports, native resource ids, dossiers, dependencies, start conditions, report status, close actions, close results, and supervisor checkpoints.
68
70
  - `.workflow/ACCEPTANCE-MATRIX.md`: verifiable done criteria.
69
71
  - `.workflow/VERIFICATION-REPORT.md`: evidence-backed PASS/FAIL/BLOCKED report.
70
72
  - `.workflow/REPAIR-TICKETS.md`: actionable repair tasks from verifier findings.
71
73
  - `.workflow/DECISIONS.md`: durable decisions, assumptions, and reversals.
72
74
  - `.workflow/HANDOFF.md`: resume state for another agent or session.
73
75
  - `.workflow/OUTCOME.md`: final status, checks, risks, and next step.
74
- - `.workflow/GOAL-STATE.md`: optional fallback record when a Codex goal tool is unavailable or goal state must be mirrored for continuation.
76
+ - `.workflow/GOAL-STATE.md`: optional fallback or mirror for Codex goal state, terminal blocked-goal history, and human-decision resume checkpoints.
75
77
  - `.workflow/DOCUMENTATION-BRIEF.md`: audience, purpose, document type, reader task, channel, owner, approvers, and success criteria.
76
78
  - `.workflow/CONTENT-INVENTORY.md`: existing materials, reusable sections, gaps, stale areas, and owners.
77
79
  - `.workflow/OUTLINE.md`: information architecture, section hierarchy, and required content.
@@ -12,19 +12,28 @@ In Git-backed codebases, ensure `<workspace>/.gitignore` contains `.workflow/` b
12
12
  ## Goal Binding
13
13
 
14
14
  - Goal Binding: created | reused | skipped | unavailable | conflict
15
- - Goal Status: active | complete | blocked | unknown
15
+ - Goal Status: active | complete | blocked | blocked old | unknown
16
16
  - Last Goal Tool Action: get_goal | create_goal | update_goal | none
17
17
  - Next Allowed Goal Action:
18
18
  - Goal Objective:
19
+ - Previous Blocked Goal Reference:
20
+ - Human Decision Needed:
21
+ - Human Decision Answer:
22
+ - Resume From:
23
+ - Artifacts To Refresh:
24
+ - Stale Artifacts Invalidated:
19
25
  ```
20
26
 
21
27
  ## Goal-Aware OUTCOME.md Fields
22
28
 
23
29
  ```md
24
30
  Goal Binding: created | reused | skipped | unavailable | conflict
25
- Goal Status: active | complete | blocked | unknown
31
+ Goal Status: active | complete | blocked | blocked old | unknown
26
32
  Last Goal Tool Action: get_goal | create_goal | update_goal | none
27
33
  Next Allowed Goal Action:
34
+ Previous Blocked Goal Reference:
35
+ Resume From:
36
+ Human Decision Resume Status:
28
37
  ```
29
38
 
30
39
  ## GOAL-STATE.md
@@ -40,10 +49,18 @@ created | reused | skipped | unavailable | conflict
40
49
 
41
50
  ## Goal Status
42
51
 
43
- active | complete | blocked | unknown
52
+ active | complete | blocked | blocked old | unknown
44
53
 
45
54
  ## Why A Goal Was Created Or Skipped
46
55
 
56
+ ## Previous Blocked Goal
57
+
58
+ Goal Reference:
59
+
60
+ Reason:
61
+
62
+ Use As History Only: yes | no
63
+
47
64
  ## Active Goal Conflict
48
65
 
49
66
  ## Last Tool Action
@@ -56,9 +73,37 @@ get_goal | create_goal | update_goal | none
56
73
 
57
74
  ## Current Work Unit
58
75
 
76
+ ## Current Blocker
77
+
78
+ ## Human Decision Needed
79
+
80
+ Question:
81
+
82
+ Smallest Sufficient Answer:
83
+
84
+ ## Human Decision Answer
85
+
86
+ Answer:
87
+
88
+ Decision Type: clarification | scope change | requirement waiver | explicit deferral | blocker resolution | final disposition | intake change | workflow cancellation
89
+
90
+ ## Resume Checkpoint
91
+
92
+ Last Completed Step:
93
+
94
+ Next Action:
95
+
96
+ Artifacts To Refresh:
97
+
98
+ Stale Artifacts Invalidated:
99
+
59
100
  ## Completion Rule
60
101
 
61
102
  ## Blocked Rule
62
103
 
63
104
  ## Resume Instructions
64
105
  ```
106
+
107
+ ## Human Decision Resume Rule
108
+
109
+ When a workflow pauses for a human answer, record the blocker before asking. After the answer arrives, update the decision log, SPEC Q&A, coverage dispositions, and goal mirror before continuing. Resume from the recorded next action and re-run only affected downstream steps. Do not restart complete intake unless the answer changes a required intake decision. If the previous Codex goal is terminal blocked and cannot be reopened, keep that goal reference as history and continue with workflow docs or a newly authorized goal binding.
@@ -34,6 +34,7 @@ Includes:
34
34
 
35
35
  - `WORKFLOW.md`
36
36
  - `SOURCE-CORPUS.md`
37
+ - `SPEC.md`
37
38
  - `WORK-UNITS.md`
38
39
  - `DOSSIER.md`
39
40
  - `WORKER-MAP.md`
@@ -42,6 +43,7 @@ Includes:
42
43
  - `REPAIR-TICKETS.md`
43
44
  - `DECISIONS.md`
44
45
  - `HANDOFF.md`
46
+ - `GOAL-STATE.md`
45
47
  - `OUTCOME.md`
46
48
 
47
49
  ## Goal And Resume
@@ -38,9 +38,57 @@ Git rule: in a Git-backed codebase, ensure `<workspace>/.gitignore` contains `.w
38
38
 
39
39
  ## Stop Gates
40
40
 
41
+ ## Blocking Decision
42
+
43
+ | ID | Blocked Artifact | Question | Affected Requirements | Affected Work Units | Status | Answer Source |
44
+ |---|---|---|---|---|---|---|
45
+
46
+ ## Resume Checkpoint
47
+
48
+ Last Completed Step:
49
+
50
+ Next Action:
51
+
52
+ Artifacts To Refresh:
53
+
54
+ Stale Artifacts Invalidated:
55
+
41
56
  ## Next Action
42
57
  ```
43
58
 
59
+ ## LEDGER.md
60
+
61
+ Use this for `lean_work_unit_runner` when the backlog is already bounded and the workflow needs high throughput with human-verifiable state.
62
+
63
+ ```md
64
+ # Lean Work Unit Ledger
65
+
66
+ Profile: lean_work_unit_runner
67
+ Execution Path:
68
+ Mode:
69
+ Delegation:
70
+ Final Disposition:
71
+ Batch Checkpoint:
72
+
73
+ ## Scope Contract
74
+
75
+ Objective:
76
+ Controlling Backlog Or Source:
77
+ Allowed Surfaces:
78
+ Forbidden Surfaces:
79
+ Escalation Triggers:
80
+
81
+ ## Units
82
+
83
+ | ID | Source Ref | Scope | Done Signal | Check | Status | Touched Surfaces | Evidence | Blocker Or Next Action |
84
+ |---|---|---|---|---|---|---|---|---|
85
+
86
+ ## Batch Checkpoints
87
+
88
+ | Batch | Units | Result | Checks | Human Review Needed | Next Action |
89
+ |---|---|---|---|---|---|
90
+ ```
91
+
44
92
  ## SOURCE-CORPUS.md
45
93
 
46
94
  ```md
@@ -65,6 +113,80 @@ Git rule: in a Git-backed codebase, ensure `<workspace>/.gitignore` contains `.w
65
113
  ## Allowed Next Action
66
114
  ```
67
115
 
116
+ ## SPEC.md
117
+
118
+ ```md
119
+ # SPEC
120
+
121
+ Status: Draft | Approved | Needs Revision | Blocked
122
+
123
+ ## Objective
124
+
125
+ ## Source Of Truth
126
+
127
+ | Source | Role | Notes |
128
+ |---|---|---|
129
+
130
+ ## Interpreted Scope
131
+
132
+ ## Non-Goals
133
+
134
+ ## Requirement Coverage
135
+
136
+ | ID | Source Ref | Requirement | Proposed Disposition | Final Disposition | Decision Source | Work Unit | Acceptance Row |
137
+ |---|---|---|---|---|---|---|---|
138
+
139
+ ## Deferred, Out-Of-Scope, Or Blocked Items
140
+
141
+ | ID | Requirement | Status | Reason | Needed Decision |
142
+ |---|---|---|---|---|
143
+
144
+ ## Proposed Work Units
145
+
146
+ | Work Unit | Objective | Depends On | Verification |
147
+ |---|---|---|---|
148
+
149
+ ## Acceptance Summary
150
+
151
+ ## Assumptions And Risks
152
+
153
+ ## Open Questions
154
+
155
+ | ID | Question | Asked By | Answer | Status |
156
+ |---|---|---|---|---|
157
+
158
+ ## Q&A Log
159
+
160
+ | ID | Question | Answer | Spec Change Required | Status |
161
+ |---|---|---|---|---|
162
+
163
+ ## Resume Checkpoint
164
+
165
+ Blocked At:
166
+
167
+ Required Human Decision:
168
+
169
+ Affected Requirement IDs:
170
+
171
+ Affected Work Units:
172
+
173
+ Next Action After Answer:
174
+
175
+ Artifacts To Refresh:
176
+
177
+ Stale Artifacts Invalidated:
178
+
179
+ ## Human Verification
180
+
181
+ Reviewer:
182
+
183
+ Decision: Approved | Needs Revision | Blocked
184
+
185
+ Decision Source:
186
+
187
+ Notes:
188
+ ```
189
+
68
190
  ## WORK-UNITS.md
69
191
 
70
192
  ```md
@@ -137,14 +259,16 @@ Git rule: in a Git-backed codebase, ensure `<workspace>/.gitignore` contains `.w
137
259
  ```md
138
260
  # Worker Map
139
261
 
140
- | Worker Name | Role | Transport | Work Unit | Dossier | Start Condition | Dependencies | Status | Terminal Report |
141
- |---|---|---|---|---|---|---|---|---|
262
+ | Worker Name | Role | Transport | Native Resource ID | Work Unit | Dossier | Start Condition | Dependencies | Status | Terminal Report | Close Action | Close Result |
263
+ |---|---|---|---|---|---|---|---|---|---|---|---|
142
264
 
143
265
  ## Supervisor Checkpoints
144
266
 
145
267
  ## Blocked Workers
146
268
 
147
269
  ## Closed Workers
270
+
271
+ Closed means the terminal report has been consumed and any native thread or subagent resource has a recorded close result. For Codex subagents, record the `spawn_agent` id as Native Resource ID and `close_agent` as Close Action. A workflow with open native workers must remain BLOCKED until the close result is recorded.
148
272
  ```
149
273
 
150
274
  ## ACCEPTANCE-MATRIX.md
@@ -249,6 +373,66 @@ Acceptance Criteria:
249
373
  ## Next Recommended Action
250
374
  ```
251
375
 
376
+ ## GOAL-STATE.md
377
+
378
+ ```md
379
+ # Goal State
380
+
381
+ ## Objective
382
+
383
+ ## Goal Binding
384
+
385
+ created | reused | skipped | unavailable | conflict
386
+
387
+ ## Goal Status
388
+
389
+ active | complete | blocked | blocked old | unknown
390
+
391
+ ## Previous Blocked Goal
392
+
393
+ Goal Reference:
394
+
395
+ Reason:
396
+
397
+ Use As History Only: yes | no
398
+
399
+ ## Last Tool Action
400
+
401
+ get_goal | create_goal | update_goal | none
402
+
403
+ ## Next Allowed Goal Action
404
+
405
+ ## Last Completed Step
406
+
407
+ ## Current Work Unit
408
+
409
+ ## Current Blocker
410
+
411
+ ## Human Decision Needed
412
+
413
+ Question:
414
+
415
+ Smallest Sufficient Answer:
416
+
417
+ ## Human Decision Answer
418
+
419
+ Answer:
420
+
421
+ Decision Type: clarification | scope change | requirement waiver | explicit deferral | blocker resolution | final disposition | intake change | workflow cancellation
422
+
423
+ ## Resume Checkpoint
424
+
425
+ Next Action:
426
+
427
+ Artifacts To Refresh:
428
+
429
+ Stale Artifacts Invalidated:
430
+
431
+ ## Completion Rule
432
+
433
+ ## Blocked Rule
434
+ ```
435
+
252
436
  ## OUTCOME.md
253
437
 
254
438
  ```md