workflow-supervisor 0.1.0 → 0.1.1

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.
package/docs/artifacts.md CHANGED
@@ -4,13 +4,15 @@
4
4
 
5
5
  Default location: create Markdown workflow artifacts under `<workspace>/.workflow/`. Use another directory only when the user names one, the project already has a clearer workflow-state convention, or the artifact is a final deliverable that belongs elsewhere.
6
6
 
7
+ In Git-backed codebases, `.workflow/` is local working state. Ensure `<workspace>/.gitignore` contains `.workflow/` before creating artifacts there, and do not commit that directory unless the user explicitly makes workflow state a deliverable.
8
+
7
9
  ## Workflow Control
8
10
 
9
11
  - `.workflow/WORKFLOW.md`
10
12
  - `.workflow/SOURCE-CORPUS.md`
11
13
  - `.workflow/WORK-UNITS.md`
12
14
  - `.workflow/DOSSIER.md`
13
- - `.workflow/THREAD-MAP.md`
15
+ - `.workflow/WORKER-MAP.md`
14
16
  - `.workflow/ACCEPTANCE-MATRIX.md`
15
17
  - `.workflow/VERIFICATION-REPORT.md`
16
18
  - `.workflow/REPAIR-TICKETS.md`
@@ -37,4 +39,4 @@ Default location: create Markdown workflow artifacts under `<workspace>/.workflo
37
39
 
38
40
  ## State Medium
39
41
 
40
- Markdown is the default, but state may also be an inline brief, spreadsheet tab, ticket set, design annotation, CRM note, runbook, decision log, slide appendix, whiteboard note, or chat handoff.
42
+ Markdown is the default, but state may also be an inline brief, spreadsheet tab, ticket set, design annotation, CRM note, runbook, decision log, slide appendix, whiteboard note, or chat continuation note.
package/docs/cli.md CHANGED
@@ -25,30 +25,39 @@ workflow-supervisor list
25
25
 
26
26
  ### `validate`
27
27
 
28
- Validate skill folder structure, `SKILL.md` frontmatter, required metadata, and opt-in policy.
28
+ Validate skill folder structure, `SKILL.md` frontmatter, required metadata, opt-in policy, adapter metadata, and the `WorkerReportV1` and `DossierV1` schema artifacts.
29
29
 
30
30
  ```bash
31
31
  workflow-supervisor validate
32
32
  ```
33
33
 
34
+ ### `validate-dossier`
35
+
36
+ Validate one machine-checkable `DossierV1` contract before delegation. The command accepts JSON, YAML, or fenced YAML in a Markdown file.
37
+
38
+ ```bash
39
+ workflow-supervisor validate-dossier .workflow/dossiers/U1-implementer.yaml --role implementer --unit U1 --json
40
+ ```
41
+
42
+ The validator rejects missing fields, unresolved open questions, broad mutable surfaces such as `all files`, missing forbidden surfaces, role mismatches, unit mismatches, missing acceptance rows, and worker prompts that do not require `WorkerReportV1`.
43
+
34
44
  ### `doctor`
35
45
 
36
46
  Print package, target, and skill discovery information.
37
47
 
38
48
  ```bash
39
49
  workflow-supervisor doctor --agent codex
50
+ workflow-supervisor doctor --agent claude-code
40
51
  workflow-supervisor doctor --agent generic --target ./agent-skills
41
52
  ```
42
53
 
43
54
  ### `install`
44
55
 
45
- Install skills into an agent target.
56
+ Install skills into a supported agent target.
46
57
 
47
58
  ```bash
48
59
  workflow-supervisor install --agent codex
49
- workflow-supervisor install --agent claude-code --target ~/.claude/skills
50
- workflow-supervisor install --agent opencode --target ~/.config/opencode/skills
51
- workflow-supervisor install --agent hermesagent --target ~/.hermes/skills
60
+ workflow-supervisor install --agent claude-code
52
61
  workflow-supervisor install --agent generic --target ./agent-skills
53
62
  workflow-supervisor install --agent all --scope project --project .
54
63
  workflow-supervisor uninstall --agent codex --scope user
@@ -57,10 +66,10 @@ workflow-supervisor uninstall --agent codex --scope user
57
66
  Options:
58
67
 
59
68
  ```text
60
- --agent codex|claude-code|opencode|hermesagent|generic|all
69
+ --agent codex|claude-code|generic|all
61
70
  --scope user|project Install to user-level or project-level location where supported.
62
71
  --project <path> Project root for project-scope installs.
63
- --target <path> Override install directory. Required for generic.
72
+ --target <path> Override install directory. Required for generic installs.
64
73
  --skills all|a,b Install all skills or a comma-separated subset.
65
74
  --force Replace existing installed skill folders.
66
75
  --dry-run Validate and print intended action without writing.
@@ -75,13 +84,11 @@ Default targets:
75
84
  | Codex | project | `<project>/.agents/skills` |
76
85
  | Claude Code | user | `${CLAUDE_HOME:-~/.claude}/skills` |
77
86
  | Claude Code | project | `<project>/.claude/skills` |
78
- | OpenCode | user | `${OPENCODE_HOME:-~/.config/opencode}/skills` |
79
- | OpenCode | project | `<project>/.opencode/skills` |
80
- | HermesAgent | user | `${HERMESAGENT_HOME:-${HERMES_HOME:-~/.hermes}}/skills` |
81
- | HermesAgent | project | `<project>/.hermes/skills` |
82
87
  | Generic | any | requires `--target` |
83
88
 
84
- HermesAgent project scope is a package-local convention for portable installs. Use `--target` if your HermesAgent setup expects another directory.
89
+ `--agent all` installs only the certified target set: Codex and Claude Code. Use `generic` with `--target` when you want a Markdown instruction bundle for another environment.
90
+
91
+ Project-scope installs also ensure `<project>/.gitignore` contains `.workflow/`. Workflow artifacts are local supervisor state by default and should not be pushed with the consuming repository unless the user explicitly makes them deliverables.
85
92
 
86
93
  ### `uninstall`
87
94
 
@@ -94,17 +101,17 @@ workflow-supervisor uninstall --agent generic --target ./agent-skills
94
101
 
95
102
  ### `emit-context`
96
103
 
97
- Create a portable instruction file for agents that do not natively discover `SKILL.md` folders. The output embeds the selected `SKILL.md` files and bundled Markdown references, so the receiving agent can use the skills without separately reading the skill directory.
104
+ Create a portable instruction file for a Markdown-reading workspace. The output embeds the selected `SKILL.md` files and bundled Markdown references, so the receiving agent can use the skills without separately reading the skill directory.
98
105
 
99
106
  ```bash
100
107
  workflow-supervisor emit-context --agent generic --target ./agent-skills --out AGENTS.md
101
- workflow-supervisor emit-context --agent opencode --skills workflow-supervisor,workflow-docs --out AGENTS.md
108
+ workflow-supervisor emit-context --agent claude-code --skills workflow-supervisor,workflow-docs --out CLAUDE.md
102
109
  ```
103
110
 
104
111
  Options:
105
112
 
106
113
  ```text
107
- --agent codex|claude-code|opencode|hermesagent|generic
114
+ --agent codex|claude-code|generic
108
115
  --scope user|project
109
116
  --project <path>
110
117
  --target <path>
@@ -113,6 +120,61 @@ Options:
113
120
  --root <path> Use another package root.
114
121
  ```
115
122
 
123
+ ### `delegate`
124
+
125
+ Run one role-scoped worker through an installed Codex or Claude Code CLI and print exactly one normalized `WorkerReportV1` JSON object. Missing or invalid `DossierV1` contracts, missing CLIs, invalid worker output, timeouts, non-zero PASS results, PASS without evidence, forbidden-surface changes, and verifier mutations become `BLOCKED` reports instead of unstructured prose.
126
+
127
+ The report schema lives at `schemas/worker-report-v1.schema.json`. The Codex adapter passes it via `--output-schema`; the Claude Code adapter passes it via `--json-schema`; every adapter is still wrapper-validated after the run.
128
+
129
+ `--dossier` is a hard preflight gate. It must parse as `DossierV1` and pass concrete-field checks before the worker process starts. The delegate command uses `allowed_surfaces` and `forbidden_surfaces` from the dossier as surface guards unless explicit CLI surface flags are provided.
130
+
131
+ ```bash
132
+ workflow-supervisor delegate --agent codex --role implementer --unit U1 --cwd . --dossier .workflow/DOSSIER.md --allowed-surfaces src,tests
133
+ workflow-supervisor delegate --agent claude-code --role verifier --unit U1 --cwd . --dossier .workflow/DOSSIER.md --forbidden-surfaces src
134
+ ```
135
+
136
+ Options:
137
+
138
+ ```text
139
+ --agent codex|claude-code
140
+ --role implementer|verifier|repair|documenter
141
+ --unit <id> Work unit ID copied into WorkerReportV1.
142
+ --cwd <path> Workspace for the worker command. Defaults to current directory.
143
+ --dossier <path> Role-scoped dossier to include in the worker prompt.
144
+ --allowed-surfaces a,b Optional comma-separated mutable boundaries.
145
+ --forbidden-surfaces a,b Optional comma-separated forbidden boundaries.
146
+ --timeout-ms <ms> Subprocess timeout. Defaults to 120000.
147
+ --allow-dirty Allow mutable delegation when git status is already dirty.
148
+ --adapter-command <json> Override the adapter command as a JSON array of strings.
149
+ --prompt-mode stdin|arg Send the prompt on stdin or as the final argument. Overrides default only with --adapter-command.
150
+ ```
151
+
152
+ Adapter commands live in `adapters/<agent>/adapter.json` as command arrays, not shell strings. Use `--adapter-command` for local testing or platform setups whose executable name differs from the default. Override commands run with `--cwd` as their working directory, so use absolute paths for custom scripts unless they live in that workspace.
153
+
154
+ ### `delegate-doctor`
155
+
156
+ Inspect a delegate adapter. Without `--probe`, this checks whether the executable is present. With `--probe`, it runs a trivial worker delegation and validates the normalized report path.
157
+
158
+ ```bash
159
+ workflow-supervisor delegate-doctor --agent all
160
+ workflow-supervisor delegate-doctor --agent all --probe --require-pass
161
+ workflow-supervisor delegate-doctor --agent claude-code
162
+ workflow-supervisor delegate-doctor --agent codex --adapter-command '["codex","exec","--json"]' --probe
163
+ ```
164
+
165
+ Options:
166
+
167
+ ```text
168
+ --agent codex|claude-code|all
169
+ --adapter-command <json> Override the adapter command as a JSON array of strings.
170
+ --prompt-mode stdin|arg
171
+ --probe Run a trivial WorkerReportV1 delegation check.
172
+ --require-pass Exit nonzero when any inspected adapter is BLOCKED.
173
+ --cwd <path>
174
+ ```
175
+
176
+ Use `workflow-supervisor delegate-doctor --agent all --probe --require-pass` as the certification gate in CI or in an environment where both target CLIs are installed. The command still prints JSON diagnostics when it exits nonzero.
177
+
116
178
  ## Exit Codes
117
179
 
118
180
  - `0`: command succeeded
@@ -1,12 +1,12 @@
1
1
  # Agent Compatibility
2
2
 
3
- The pack is built around portable `SKILL.md` folders. Codex consumes those folders directly. Other agents can use the same content as explicit prompt skills, context packs, or project-local instructions.
3
+ The certified support set is intentionally small: Codex and Claude Code for automated delegation, plus `generic` for emitting or installing Markdown instructions into a custom directory.
4
4
 
5
- ## Skills, Threads, And Subagents
5
+ ## Skills And Workers
6
6
 
7
- Loading a skill does not spawn a thread or subagent. A skill is instruction context for the current agent until the environment explicitly uses a separate execution tool.
7
+ Loading a skill does not spawn a worker, thread, or subagent. A skill is instruction context for the current agent until the supervisor uses an approved delegation mechanism.
8
8
 
9
- `$workflow-supervisor` can plan worker threads or subagents, but they start only after complete intake, the workflow path gate, a concrete dossier, and target-environment delegation support are all satisfied. If those tools are unavailable or user-visible thread creation is not approved, use the generated handoff prompts or workflow docs as the fallback.
9
+ `$workflow-supervisor` can plan role-scoped workers, but they start only after complete intake, the workflow path gate, a concrete dossier, and target-environment delegation support are all satisfied. The portable mechanism is the one-shot `workflow-supervisor delegate` command described in [portable-delegation.md](portable-delegation.md). Native Codex threads or Claude subagents are adapter optimizations, not workflow requirements.
10
10
 
11
11
  ## Codex
12
12
 
@@ -32,54 +32,28 @@ Use $workflow-supervisor to supervise this migration. It should ask the complete
32
32
 
33
33
  ## Claude Code
34
34
 
35
- Claude Code environments vary by local setup. Install to the skill or prompt directory your setup uses, or choose a project-local target.
35
+ Claude Code support uses the same `SKILL.md` folders and the `claude` CLI for one-shot delegated workers.
36
36
 
37
37
  ```bash
38
- npx workflow-supervisor install --agent claude-code --target ~/.claude/skills
38
+ npx workflow-supervisor install --agent claude-code --scope user
39
+ npx workflow-supervisor install --agent claude-code --scope project --project .
39
40
  ```
40
41
 
41
42
  If native discovery is unavailable, emit a context file:
42
43
 
43
44
  ```bash
44
- npx workflow-supervisor emit-context --agent claude-code --target ~/.claude/skills --skills workflow-supervisor,workflow-docs --out CLAUDE.md
45
+ npx workflow-supervisor emit-context --agent claude-code --skills workflow-supervisor,workflow-docs --out CLAUDE.md
45
46
  ```
46
47
 
47
48
  Codex goal APIs degrade to `.workflow/GOAL-STATE.md` and workflow docs.
48
49
 
49
- ## OpenCode
50
-
51
- Install to an OpenCode skill/prompt directory or project-local target:
52
-
53
- ```bash
54
- npx workflow-supervisor install --agent opencode --target ~/.config/opencode/skills
55
- npx workflow-supervisor install --agent opencode --scope project --project .
56
- ```
57
-
58
- If OpenCode does not read `agents/openai.yaml`, ignore that file and invoke by explicit skill names from `SKILL.md`.
59
-
60
- ## HermesAgent
61
-
62
- Install to the HermesAgent skill/prompt directory configured by your environment:
63
-
64
- ```bash
65
- npx workflow-supervisor install --agent hermesagent --target ~/.hermes/skills
66
- npx workflow-supervisor install --agent hermesagent --scope project --project .
67
- ```
68
-
69
- User scope follows HermesAgent's documented `~/.hermes/skills` location. Project scope uses the package-local fallback `<project>/.hermes/skills` so `--agent all --scope project` can create a complete portable skill bundle.
70
-
71
- If native discovery is unavailable:
72
-
73
- ```bash
74
- npx workflow-supervisor emit-context --agent hermesagent --target ~/.hermes/skills --skills workflow-supervisor,workflow-docs --out HERMES.md
75
- ```
76
-
77
50
  ## Generic Agent
78
51
 
79
- Use `generic` for any agent that can read a directory of Markdown instructions.
52
+ Use `generic` only for Markdown instruction export or installation into a custom directory. It is not a certified automated delegation adapter.
80
53
 
81
54
  ```bash
82
55
  npx workflow-supervisor install --agent generic --target ./agent-skills
56
+ npx workflow-supervisor emit-context --agent generic --skills workflow-supervisor,workflow-docs --out AGENTS.md
83
57
  ```
84
58
 
85
- Then point the agent at `./agent-skills/WORKFLOW_SKILL_PACK.md` and the individual `SKILL.md` files.
59
+ Then point the receiving agent at `./agent-skills/WORKFLOW_SKILL_PACK.md`, the individual `SKILL.md` files, or the emitted context file.
@@ -0,0 +1,189 @@
1
+ # Portable Delegation
2
+
3
+ The workflow pack must stay a small skill pack. It must not become a daemon, queue, server, scheduler, dashboard, or full agent harness. The portable execution primitive is one supervised, one-shot delegation to an already-installed Codex or Claude Code CLI.
4
+
5
+ ## Goal
6
+
7
+ Keep the same workflow semantics on Codex and Claude Code:
8
+
9
+ ```text
10
+ complete intake
11
+ -> source grounding
12
+ -> work units
13
+ -> role-scoped implementer delegation
14
+ -> role-scoped verifier delegation
15
+ -> repair delegation only when verification fails or blocks with actionable findings
16
+ -> re-verification
17
+ -> documenter or outcome delegation when evidence exists
18
+ -> final supervisor report
19
+ ```
20
+
21
+ The supervisor remains the only coordinator. Workers do not ask the human questions, choose final disposition, expand scope, approve plans, or talk to each other. If a worker needs a decision, it returns `BLOCKED` with a `blocking_question`; only the supervisor asks the user.
22
+
23
+ ## Non-Goals
24
+
25
+ - No long-running workflow daemon.
26
+ - No queue or mailbox protocol.
27
+ - No manual copy/paste handoff as the primary path.
28
+ - No platform-specific workflow semantics.
29
+ - No claim of automated delegation support for OpenCode, HermesAgent, Pi/PiAgent, OpenClaw, or other agents in this package version.
30
+ - No guarantee that every worker succeeds.
31
+ - No guarantee that every platform produces identical prose.
32
+
33
+ The guarantee is narrow and testable: Codex and Claude Code either return the same `WorkerReportV1` shape from [worker-report-v1.schema.json](../schemas/worker-report-v1.schema.json), or the delegate command returns a normalized `BLOCKED` report explaining why it could not.
34
+
35
+ Delegation also requires a concrete `DossierV1` contract from [dossier-v1.schema.json](../schemas/dossier-v1.schema.json). A missing, vague, or role-mismatched dossier blocks before any worker CLI starts.
36
+
37
+ ## Primitive
38
+
39
+ Use one small command in the existing npm package:
40
+
41
+ ```bash
42
+ workflow-supervisor delegate \
43
+ --agent <codex|claude-code> \
44
+ --role <implementer|verifier|repair|documenter> \
45
+ --unit <unit-id> \
46
+ --cwd <workspace> \
47
+ --dossier <path>
48
+ ```
49
+
50
+ The command does five things:
51
+
52
+ 1. Validates the supervisor dossier as `DossierV1`.
53
+ 2. Builds a role-scoped prompt from the supervisor dossier and report schema.
54
+ 3. Spawns the selected agent CLI with an adapter command array, not shell interpolation.
55
+ 4. Captures stdout, stderr, exit code, timeout, and optional JSON or JSONL events.
56
+ 5. Extracts and validates a `WorkerReportV1` object.
57
+ 6. Runs post-run guards and prints one normalized JSON report to stdout.
58
+
59
+ There is no resident process. Each worker is a fresh, isolated delegation.
60
+
61
+ ## WorkerReportV1
62
+
63
+ Every adapter must normalize into this shape:
64
+
65
+ ```json
66
+ {
67
+ "schema": "WorkerReportV1",
68
+ "status": "PASS",
69
+ "role": "verifier",
70
+ "unit_id": "U2",
71
+ "summary": "",
72
+ "changed_surfaces": [],
73
+ "evidence": [],
74
+ "checks_run": [],
75
+ "skipped_checks": [],
76
+ "findings": [],
77
+ "blocking_question": null,
78
+ "next_action": "",
79
+ "adapter": {
80
+ "agent": "codex",
81
+ "command": "codex exec",
82
+ "exit_code": 0,
83
+ "timed_out": false
84
+ },
85
+ "guard": {
86
+ "allowed_surface_violations": [],
87
+ "role_violations": []
88
+ }
89
+ }
90
+ ```
91
+
92
+ `PASS`, `FAIL`, and `BLOCKED` mean the same thing on both platforms. A worker report without evidence for material acceptance rows is invalid. Invalid output is converted into a deterministic normalized `BLOCKED` report by default. The package does not make a second live worker call to repair formatting, because a second call can mutate state, consume budget, or produce another non-portable transcript.
93
+
94
+ The schema is a package artifact at `schemas/worker-report-v1.schema.json`. Codex receives it through `--output-schema`; Claude Code receives it through `--json-schema`; both adapters are still wrapper-validated after the run.
95
+
96
+ ## Adapter Evidence
97
+
98
+ The delegation design is grounded in documented one-shot or headless execution for the certified target platforms:
99
+
100
+ | Agent | Automation primitive | Report confidence |
101
+ |---|---|---|
102
+ | Codex | `codex exec --json --skip-git-repo-check -c service_tier="fast" --output-schema <schema>` for scripted runs; prompt string or stdin; JSONL events; output schema support. | Strong |
103
+ | Claude Code | `claude -p --output-format json --json-schema <schema>` print mode; piped input; JSON and stream JSON output; JSON schema support. | Strong |
104
+
105
+ Use this as the certification gate in any environment claiming support:
106
+
107
+ ```bash
108
+ workflow-supervisor delegate-doctor --agent all --probe --require-pass
109
+ ```
110
+
111
+ The command prints structured diagnostics and exits nonzero when either adapter is missing, unauthenticated, or unable to produce `WorkerReportV1`.
112
+
113
+ ## Supervisor Semantics
114
+
115
+ The supervisor does not generate every role for every unit up front. It follows the loop:
116
+
117
+ - Implementer: when a unit is ready and mutable work is allowed.
118
+ - Verifier: after implementer report or for read-only units.
119
+ - Repair: only after verifier returns `FAIL` or actionable `BLOCKED`.
120
+ - Re-verifier: only after repair.
121
+ - Documenter: after planning evidence, implementation evidence, verification evidence, or final outcome evidence exists.
122
+
123
+ This preserves the current input and output contract while replacing the transport:
124
+
125
+ ```text
126
+ Codex thread tools or Claude-specific subagent mechanisms
127
+ ```
128
+
129
+ become:
130
+
131
+ ```text
132
+ workflow-supervisor delegate --agent <codex|claude-code> --role <role> --unit <unit>
133
+ ```
134
+
135
+ ## Required Guards
136
+
137
+ The delegate command is small, but five guards are non-negotiable:
138
+
139
+ 1. `delegate-doctor`: proves the selected executable exists. With `--probe`, it runs a trivial delegation and verifies that the adapter can produce or be normalized into `WorkerReportV1`.
140
+ 2. `validate-dossier`: rejects missing fields, vague placeholders, broad mutable surfaces, unresolved open questions, role mismatches, unit mismatches, and worker prompts that do not require `WorkerReportV1`.
141
+ 3. Schema validation: rejects missing evidence, missing role/unit IDs, unknown statuses, and worker attempts to ask the human directly.
142
+ 4. Surface guard: captures before/after state and fails the report if the worker changed forbidden surfaces or if a read-only role changed files.
143
+ 5. Timeout and exit handling: converts hangs, crashes, auth failures, and non-zero exits into normalized `BLOCKED` reports.
144
+
145
+ For git workspaces, the surface guard compares pre/post git status. Mutable roles block before delegation when the git workspace is already dirty unless `--allow-dirty` is set. For non-git workspaces, explicit `--allowed-surfaces` and `--forbidden-surfaces` are hashed and watched. If the guard cannot prove the relevant boundary, the report includes a guard warning and the supervisor must treat broad mutable delegation as unsafe.
146
+
147
+ ## What-If Matrix
148
+
149
+ | What if | Answer |
150
+ |---|---|
151
+ | Agent CLI is missing | `delegate-doctor` fails; `delegate` returns normalized `BLOCKED` with `reason: adapter_cli_missing`. Supervisor asks for another supported agent or uses same-session phased mode only if intake allowed it. |
152
+ | Agent is not authenticated | Return normalized `BLOCKED` with `reason: adapter_auth_unavailable`. |
153
+ | Agent outputs Markdown around JSON | Extract the first valid `WorkerReportV1` object and validate it. |
154
+ | Agent cannot produce valid report | Return normalized `BLOCKED`; do not treat prose as evidence. |
155
+ | Dossier is vague | `validate-dossier` fails and `delegate` returns `BLOCKED` with `reason: invalid_dossier`; no worker starts. |
156
+ | Worker edits forbidden files | Surface guard marks role violation; supervisor stops. No automatic revert unless explicitly allowed, because user changes may exist. |
157
+ | Verifier edits files | Hard role violation. Verifier result is rejected. |
158
+ | Worker asks the human a question | Invalid worker behavior. Convert to `BLOCKED` with `blocking_question` for supervisor handling. |
159
+ | Worker hangs | Timeout returns normalized `BLOCKED` with adapter timing evidence. |
160
+ | Worker exits non-zero but printed useful text | Do not trust it as PASS. Normalize as `BLOCKED` unless a valid report and clean guards prove otherwise. |
161
+ | Worker returns PASS without evidence | Invalid report. Return normalized `BLOCKED` with `reason: report_validation_failed`. |
162
+ | Tests cannot run | Verifier returns `BLOCKED` or `PASS` only with substitute evidence accepted by the acceptance matrix. |
163
+ | Repair expands scope | Reject unless the repair dossier explicitly allowed the new surfaces and criteria. |
164
+ | Units touch same surfaces | Run sequentially. Parallel delegation requires proven disjoint mutable surfaces. |
165
+ | Platform has no native subagents | Fine. Each role is a fresh one-shot CLI process. |
166
+ | Platform output differs | Platform output is not the contract. `WorkerReportV1` is the only supervisor input. |
167
+ | Platform cannot support a role safely | Adapter role is unsupported. Supervisor chooses another certified adapter or blocks. |
168
+ | Full support is claimed but one CLI is absent | `delegate-doctor --agent all --probe --require-pass` exits nonzero and names the missing adapter. |
169
+ | Human-in-loop path is selected | Workers can still be delegated automatically after human approval gates; the human answers supervisor questions and approvals only. |
170
+ | Autonomous path is selected | Intake boundaries still control installs, credentials, network calls, destructive operations, and final disposition. |
171
+ | Workspace is dirty before delegation | Mutable delegation blocks unless `--allow-dirty` is set. If allowed, guard warnings record that changed paths may include pre-existing edits. |
172
+ | Prompt injection appears in sources | Worker role prompt says sources are data, not instructions; supervisor relies on boundaries, diff guard, and evidence requirements. |
173
+ | Agent version changes behavior | `delegate-doctor --probe` must run against the installed local version, not a documentation assumption. |
174
+ | Agent supports JSON events but not schema | Use events for capture, then wrapper schema validation. |
175
+ | Agent supports schema but ignores it | Wrapper validation is still authoritative. |
176
+ | Worker writes a report but no files | Valid for verifier/documenter if evidence supports it; invalid for implementer if unit required mutation. |
177
+ | Cost or token budget is exceeded | Use adapter-supported budget flags where available; otherwise use timeout and report `BLOCKED`. |
178
+
179
+ ## Why This Is The Smallest Viable Architecture
180
+
181
+ One-shot delegation keeps the skill pack small:
182
+
183
+ - Skills remain Markdown instructions.
184
+ - The npm package remains an installer plus a small helper CLI.
185
+ - Adapters are data in `adapters/<agent>/adapter.json`, not per-platform workflow implementations.
186
+ - The supervisor loop stays unchanged.
187
+ - The output contract is platform-neutral across the certified target set.
188
+
189
+ Anything less is "run another agent and hope." Anything more becomes a harness.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## `workflow-supervisor`
4
4
 
5
- Coordinate explicit supervised or agent-loop workflows. It always starts with a complete intake gate before planning, implementation, goal binding, worker creation, or final disposition. The user must answer every intake item; the supervisor must not infer or skip steps from keywords. After complete intake, it selects either autonomous goal execution or human-in-the-loop execution, then orchestrates named worker threads or subagents from dossiers when the environment supports and authorizes delegation. Loading the skill itself does not spawn workers. It binds Codex goals only after complete intake and when the user or environment authorizes goal-oriented work, checks active goal state first, and avoids unrelated active-goal collisions.
5
+ Coordinate explicit supervised or agent-loop workflows. It always starts with a complete intake gate before planning, implementation, goal binding, worker delegation, or final disposition. The user must answer every intake item; the supervisor must not infer or skip steps from keywords. After complete intake, it selects either autonomous goal execution or human-in-the-loop execution, then orchestrates named workers from dossiers through the portable delegate command or an approved native adapter. Loading the skill itself does not spawn workers. It binds Codex goals only after complete intake and when the user or environment authorizes goal-oriented work, checks active goal state first, and avoids unrelated active-goal collisions.
6
6
 
7
7
  ## `source-corpus`
8
8
 
@@ -14,7 +14,7 @@ Split broad work into bounded units with objective, scope, dependencies, readine
14
14
 
15
15
  ## `dossier-builder`
16
16
 
17
- Create a handoff contract for one already-bounded work unit. Use it for another agent, thread, future session, or formal worker prompt, not ordinary same-thread direct work. Dossiers can include deterministic thread names, start conditions, handoff messages, checkpoints, and report schemas.
17
+ Create a delegation contract for one already-bounded work unit. Use it for another agent, automated worker run, future session, or formal worker prompt, not ordinary same-session direct work. Dossiers can include deterministic worker names, delegation transports, start conditions, worker prompts, checkpoints, and report schemas.
18
18
 
19
19
  ## `worker-roles`
20
20
 
@@ -22,11 +22,11 @@ Define role contracts and solo-mode phase separation. It prevents role bleed: ve
22
22
 
23
23
  ## `acceptance-matrix`
24
24
 
25
- Create formal evidence-mapped acceptance rows for high-risk, supervised, ambiguous, resumable, or handoff workflows.
25
+ Create formal evidence-mapped acceptance rows for high-risk, supervised, ambiguous, resumable, or delegated workflows.
26
26
 
27
27
  ## `loop-policy`
28
28
 
29
- Define execution path, execution mode, thread or subagent orchestration, approval gates, repair limits, parallel safety, no-progress rules, and Codex goal tool policy.
29
+ Define execution path, execution mode, worker delegation, approval gates, repair limits, parallel safety, no-progress rules, and Codex goal tool policy.
30
30
 
31
31
  ## `workflow-docs`
32
32
 
@@ -17,7 +17,7 @@ Then verify the target directory contains folders such as `workflow-supervisor/S
17
17
 
18
18
  ## Goal tools are unavailable
19
19
 
20
- Use `.workflow/GOAL-STATE.md` or a workflow handoff document. The supervisor skill explicitly falls back to workflow docs when goal tools are unavailable or not permitted.
20
+ Use `.workflow/GOAL-STATE.md` or a workflow continuation document. The supervisor skill explicitly falls back to workflow docs when goal tools are unavailable or not permitted.
21
21
 
22
22
  ## Too many docs are created
23
23
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "workflow-supervisor",
3
- "version": "0.1.0",
4
- "description": "Installable workflow supervision skills for Codex, Claude Code, OpenCode, HermesAgent, and generic agent workspaces.",
3
+ "version": "0.1.1",
4
+ "description": "Portable workflow supervision skills for Codex, Claude Code, and generic agent workspaces.",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -18,6 +18,7 @@
18
18
  "files": [
19
19
  "skills",
20
20
  "adapters",
21
+ "schemas",
21
22
  "docs",
22
23
  "assets",
23
24
  "bin",
@@ -32,8 +33,6 @@
32
33
  "keywords": [
33
34
  "codex",
34
35
  "claude-code",
35
- "opencode",
36
- "hermesagent",
37
36
  "skills",
38
37
  "workflow",
39
38
  "agent"
@@ -0,0 +1,139 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workflow-supervisor.local/schemas/dossier-v1.schema.json",
4
+ "title": "DossierV1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": [
8
+ "schema",
9
+ "workflow",
10
+ "work_unit",
11
+ "dossier_id",
12
+ "worker_name",
13
+ "worker_role",
14
+ "delegation_transport",
15
+ "start_condition",
16
+ "title",
17
+ "objective",
18
+ "non_goals",
19
+ "source_corpus",
20
+ "must_read",
21
+ "allowed_surfaces",
22
+ "forbidden_surfaces",
23
+ "acceptance_matrix",
24
+ "adversarial_checks",
25
+ "required_commands_or_evidence",
26
+ "worker_prompt",
27
+ "supervisor_checkpoints",
28
+ "completion_report_schema",
29
+ "verification_report_schema",
30
+ "stop_gates",
31
+ "assumptions",
32
+ "open_questions"
33
+ ],
34
+ "properties": {
35
+ "schema": {
36
+ "type": "string",
37
+ "const": "DossierV1"
38
+ },
39
+ "workflow": {
40
+ "type": "string",
41
+ "minLength": 1
42
+ },
43
+ "work_unit": {
44
+ "type": "string",
45
+ "minLength": 1
46
+ },
47
+ "dossier_id": {
48
+ "type": "string",
49
+ "minLength": 1
50
+ },
51
+ "worker_name": {
52
+ "type": "string",
53
+ "minLength": 1
54
+ },
55
+ "worker_role": {
56
+ "type": "string",
57
+ "enum": ["implementer", "verifier", "repair", "documenter"]
58
+ },
59
+ "delegation_transport": {
60
+ "type": "string",
61
+ "enum": ["portable_delegate", "native_thread", "native_subagent", "same_session_phased"]
62
+ },
63
+ "start_condition": {
64
+ "type": "string",
65
+ "minLength": 1
66
+ },
67
+ "title": {
68
+ "type": "string",
69
+ "minLength": 1
70
+ },
71
+ "objective": {
72
+ "type": "string",
73
+ "minLength": 1
74
+ },
75
+ "worker_prompt": {
76
+ "type": "string",
77
+ "minLength": 1
78
+ },
79
+ "completion_report_schema": {
80
+ "type": "string",
81
+ "minLength": 1
82
+ },
83
+ "verification_report_schema": {
84
+ "type": "string",
85
+ "minLength": 1
86
+ },
87
+ "non_goals": {
88
+ "$ref": "#/$defs/stringList"
89
+ },
90
+ "source_corpus": {
91
+ "$ref": "#/$defs/stringList"
92
+ },
93
+ "must_read": {
94
+ "$ref": "#/$defs/stringList"
95
+ },
96
+ "allowed_surfaces": {
97
+ "$ref": "#/$defs/stringList"
98
+ },
99
+ "forbidden_surfaces": {
100
+ "$ref": "#/$defs/stringList"
101
+ },
102
+ "read_only_neighbors": {
103
+ "$ref": "#/$defs/stringList"
104
+ },
105
+ "work_points": {
106
+ "$ref": "#/$defs/stringList"
107
+ },
108
+ "acceptance_matrix": {
109
+ "$ref": "#/$defs/stringList"
110
+ },
111
+ "adversarial_checks": {
112
+ "$ref": "#/$defs/stringList"
113
+ },
114
+ "required_commands_or_evidence": {
115
+ "$ref": "#/$defs/stringList"
116
+ },
117
+ "supervisor_checkpoints": {
118
+ "$ref": "#/$defs/stringList"
119
+ },
120
+ "stop_gates": {
121
+ "$ref": "#/$defs/stringList"
122
+ },
123
+ "assumptions": {
124
+ "$ref": "#/$defs/stringList"
125
+ },
126
+ "open_questions": {
127
+ "$ref": "#/$defs/stringList"
128
+ }
129
+ },
130
+ "$defs": {
131
+ "stringList": {
132
+ "type": "array",
133
+ "items": {
134
+ "type": "string",
135
+ "minLength": 1
136
+ }
137
+ }
138
+ }
139
+ }