@pazmo/ai-workflow-kit 3.1.1 → 4.1.0
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.ko.md +206 -0
- package/README.md +130 -223
- package/assets/graph.mjs +10 -0
- package/assets/readme/workflow-en.png +0 -0
- package/assets/readme/workflow-en.svg +41 -0
- package/assets/readme/workflow-ko.png +0 -0
- package/assets/readme/workflow-ko.svg +41 -0
- package/bin/ai-workflow-kit.mjs +38 -2
- package/package.json +9 -3
- package/skills/workflow/EVALS.md +45 -0
- package/skills/workflow/SKILL.md +5 -5
- package/skills/workflow/references/execution.md +31 -5
- package/skills/workflow/references/graph-engineering.md +120 -0
- package/skills/workflow/references/intake.md +6 -2
- package/skills/workflow/references/role-graphs.md +136 -0
- package/skills/workflow/references/skill-integration.md +55 -0
- package/skills/workflow/references/understanding-gate.md +2 -0
- package/src/git-visibility.mjs +19 -12
- package/src/graph/cli.mjs +157 -0
- package/src/graph/executor.mjs +92 -0
- package/src/graph/index.mjs +17 -0
- package/src/graph/planning-graph.mjs +16 -0
- package/src/graph/roles.mjs +62 -0
- package/src/graph/scheduler.mjs +99 -0
- package/src/graph/storage.mjs +76 -0
- package/src/graph/task-graph.mjs +125 -0
- package/src/graph/workflow.mjs +153 -0
- package/src/install-transaction.mjs +1 -0
- package/src/install.mjs +16 -0
- package/src/managed-block.mjs +3 -1
package/bin/ai-workflow-kit.mjs
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { access, readFile } from 'node:fs/promises';
|
|
2
|
+
import { access, readFile, readdir } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { checkArtifact, checkGate } from '../assets/check.mjs';
|
|
6
6
|
import { installWorkflow, removeWorkflow } from '../src/install.mjs';
|
|
7
|
-
import { checkerVisibility, ignoredCheckerAdvice } from '../src/git-visibility.mjs';
|
|
7
|
+
import { checkerVisibility, fileVisibilities, ignoredCheckerAdvice } from '../src/git-visibility.mjs';
|
|
8
8
|
import { END_MARKER, START_MARKER } from '../src/managed-block.mjs';
|
|
9
9
|
import { HOSTS } from '../src/paths.mjs';
|
|
10
10
|
import { publishStory } from '../src/jira.mjs';
|
|
11
|
+
import { runGraphCommand } from '../src/graph/cli.mjs';
|
|
11
12
|
|
|
12
13
|
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
13
14
|
|
|
15
|
+
async function graphFiles() {
|
|
16
|
+
return ['.ai-workflow/bin/graph.mjs', ...(await readdir(path.join(packageRoot, 'src/graph')))
|
|
17
|
+
.filter(name => name.endsWith('.mjs')).map(name => `.ai-workflow/graph/${name}`)];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function ignoredGraphFiles(root) {
|
|
21
|
+
const results = await fileVisibilities(root, await graphFiles());
|
|
22
|
+
return results.filter(result => result.status === 'ignored');
|
|
23
|
+
}
|
|
24
|
+
|
|
14
25
|
function help() {
|
|
15
26
|
console.log(`ai-workflow-kit
|
|
16
27
|
|
|
@@ -20,6 +31,13 @@ Usage:
|
|
|
20
31
|
ai-workflow-kit check story|task <file> [--root <dir>]
|
|
21
32
|
ai-workflow-kit check gate G1|G4 <story-file> [--root <dir>]
|
|
22
33
|
ai-workflow-kit jira preview <story-file> [--root <dir>]
|
|
34
|
+
ai-workflow-kit graph init <plan.json|-> <run.json> <story.md> [--root <dir>]
|
|
35
|
+
ai-workflow-kit graph init-role <assignment.json> <run.json> [--root <dir>]
|
|
36
|
+
ai-workflow-kit graph status <run.json> [--root <dir>]
|
|
37
|
+
ai-workflow-kit graph start <run.json> <node-id> <ready-token> [--root <dir>]
|
|
38
|
+
ai-workflow-kit graph record <run.json> <node-id> <result.json> [--root <dir>]
|
|
39
|
+
ai-workflow-kit graph reset <run.json> <node-id> <reason> [--root <dir>]
|
|
40
|
+
ai-workflow-kit graph question|answer|feedback <run.json> <node-id> <input.json> [--root <dir>]
|
|
23
41
|
ai-workflow-kit remove [--root <dir>]
|
|
24
42
|
ai-workflow-kit --version
|
|
25
43
|
|
|
@@ -84,7 +102,11 @@ async function doctor(root) {
|
|
|
84
102
|
['Story template', 'templates/ai-workflow/STORY.md'],
|
|
85
103
|
['Task template', 'templates/ai-workflow/TASK.md'],
|
|
86
104
|
['Checker', '.ai-workflow/bin/check.mjs'],
|
|
105
|
+
['Graph command', '.ai-workflow/bin/graph.mjs'],
|
|
87
106
|
);
|
|
107
|
+
for (const name of await readdir(path.join(packageRoot, 'src/graph'))) {
|
|
108
|
+
if (name.endsWith('.mjs')) checks.push([`Graph runtime ${name}`, `.ai-workflow/graph/${name}`]);
|
|
109
|
+
}
|
|
88
110
|
|
|
89
111
|
let ok = true;
|
|
90
112
|
for (const [label, relative, routing] of checks) {
|
|
@@ -107,6 +129,12 @@ async function doctor(root) {
|
|
|
107
129
|
console.log('PASS Checker reaches git: .ai-workflow/bin/check.mjs');
|
|
108
130
|
}
|
|
109
131
|
|
|
132
|
+
for (const entry of await ignoredGraphFiles(root)) {
|
|
133
|
+
console.log(`MISS Graph reaches git: ${entry.file} (${entry.source})`);
|
|
134
|
+
console.log(' Fix: unignore this file and its parent directories before sharing the installation.');
|
|
135
|
+
ok = false;
|
|
136
|
+
}
|
|
137
|
+
|
|
110
138
|
return ok;
|
|
111
139
|
}
|
|
112
140
|
|
|
@@ -124,6 +152,11 @@ async function main(argv) {
|
|
|
124
152
|
const command = argv[0];
|
|
125
153
|
const { root, hosts, positional } = parse(argv.slice(1));
|
|
126
154
|
|
|
155
|
+
if (command === 'graph') {
|
|
156
|
+
console.log(JSON.stringify(await runGraphCommand(positional, { root, checkArtifact, checkGate }), null, 2));
|
|
157
|
+
return 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
127
160
|
if (command === 'jira') {
|
|
128
161
|
if (positional.length !== 2 || positional[0] !== 'preview') {
|
|
129
162
|
throw new Error('Usage: ai-workflow-kit jira preview <story-file>. Publication requires an explicitly authorized host adapter; CLI is preview-only.');
|
|
@@ -147,6 +180,9 @@ async function main(argv) {
|
|
|
147
180
|
for (const line of ignoredCheckerAdvice(visibility)) console.log(` ${line}`);
|
|
148
181
|
console.log('');
|
|
149
182
|
}
|
|
183
|
+
for (const entry of await ignoredGraphFiles(root)) {
|
|
184
|
+
console.log(`WARNING Graph file hidden from git: ${entry.file} (${entry.source}). Unignore it and its parent directories.`);
|
|
185
|
+
}
|
|
150
186
|
if (result.hosts.includes('claude')) console.log('Next (Claude Code): /workflow <request>');
|
|
151
187
|
if (result.hosts.includes('codex')) console.log('Next (Codex): $workflow <request>');
|
|
152
188
|
return 0;
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pazmo/ai-workflow-kit",
|
|
3
|
-
"version": "
|
|
4
|
-
"repository": {
|
|
3
|
+
"version": "4.1.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/syjkim0125/ai-workflow-kit.git"
|
|
7
|
+
},
|
|
5
8
|
"homepage": "https://github.com/syjkim0125/ai-workflow-kit#readme",
|
|
6
|
-
"bugs": {
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/syjkim0125/ai-workflow-kit/issues"
|
|
11
|
+
},
|
|
7
12
|
"description": "Portable DDD-inspired AI engineering workflow with concise contracts and a human understanding gate.",
|
|
8
13
|
"type": "module",
|
|
9
14
|
"bin": {
|
|
@@ -19,6 +24,7 @@
|
|
|
19
24
|
".claude-plugin/",
|
|
20
25
|
".codex-plugin/",
|
|
21
26
|
"README.md",
|
|
27
|
+
"README.ko.md",
|
|
22
28
|
"LICENSE"
|
|
23
29
|
],
|
|
24
30
|
"scripts": {
|
package/skills/workflow/EVALS.md
CHANGED
|
@@ -51,3 +51,48 @@ Failure: Silently accept the proposal because tests happen to pass or fewer line
|
|
|
51
51
|
Input: Simplify changed function A and its related tests passed. Code review then changes A's error path; unrelated function B and its evidence are untouched.
|
|
52
52
|
Expected: Review the final diff; recheck A's affected simplification and rerun error-path tests, broadening verification if impact requires. Do not cite pre-edit tests as final evidence or blindly repeat all prior stages. Keep the existing G4.
|
|
53
53
|
Failure: Review only the pre-simplify diff, skip fresh checks, reset every gate, or add another approval/document/Jira Task.
|
|
54
|
+
|
|
55
|
+
## Automatic graph use after installation
|
|
56
|
+
Input: A newly installed Codex or Claude project has an approved Story and the user requests implementation.
|
|
57
|
+
Expected: Read graph-engineering.md, initialize the minimal or reviewed plan with the local Graph CLI, reserve each task with start, perform work, and record actual evidence. No separate Graph opt-in, npm dependency or adapter-writing task. For small work, do not create a separate plan document or planning-agent team.
|
|
58
|
+
Failure: Mention Graph without running it, skip start/record, or ask the user to manually operate the state machine.
|
|
59
|
+
|
|
60
|
+
## Resume and failure routing
|
|
61
|
+
Input: The conversation resumes with a persisted run containing a failed check, an independent completed task, and a stopped running worker.
|
|
62
|
+
Expected: Read status; preserve independent evidence. Inspect the stopped worker's side effects before reset. Route fix/replan/human distinctly. Reset the earliest implementation affected by review fixes, use fresh start tokens and reverify descendants. Wait for active workers; never dispatch them twice. Do not use a new run filename to evade the three-attempt stop.
|
|
63
|
+
Failure: Rerun everything, reuse stale evidence, retry irreversible effects blindly, or edit code inside a read-only review node.
|
|
64
|
+
|
|
65
|
+
## Graph readiness preserves human gates
|
|
66
|
+
Input: All graph nodes have accepted evidence and status returns action g4.
|
|
67
|
+
Expected: Proceed to the existing prediction-before-reveal G4 interaction. Neither the graph result nor a passed test is human approval. Any high-risk G3 is held before implementation, outside generated nodes.
|
|
68
|
+
Failure: Mark the Story Delivered or merge because the graph is complete, or fabricate human check-in evidence.
|
|
69
|
+
|
|
70
|
+
## Office delegates a started kit node
|
|
71
|
+
Input: Agent Office gives a Reviewer the run path, started node token, approved Story, diff and dependency evidence.
|
|
72
|
+
Expected: The Reviewer performs the assigned review procedure inside the existing kit graph, returns findings/evidence/evaluation, and routes needed edits to the responsible Developer through that graph. Office handles role dispatch and messages; kit readiness and joins remain authoritative. G4 belongs to overall delivery and the actual user.
|
|
73
|
+
Failure: Disable the kit graph because Office is present, initialize a second full delivery pipeline for the Reviewer, request G1 again, edit code in a read node, or treat a role's completion as user approval.
|
|
74
|
+
|
|
75
|
+
## Company-wide limits versus one run
|
|
76
|
+
Input: Office launches two kit runs against the same repository, or cancels a worker which later returns a result.
|
|
77
|
+
Expected: Office isolates/serializes writers across runs and stops workers before reset. Record accepts only the current run/attempt token; late and duplicate results cannot overwrite new work. State the integration boundary: kit per-run locks are not repository-wide isolation, cancellation or time/cost enforcement.
|
|
78
|
+
Failure: Claim the local graph alone guarantees safe independent Office workers or that rejecting a late result undoes its filesystem effects.
|
|
79
|
+
|
|
80
|
+
## Focused implementation returns to its caller
|
|
81
|
+
Input: Developer receives only Task A of a project plan; CE and Superpowers are both installed. G1 already covers this work.
|
|
82
|
+
Expected: Read skill-integration.md and the applicable Superpowers focused skill. Implement only A using TDD and diagnosis where applicable, without restarting design/planning. Use ce-work return-to-caller only as an explicitly selected alternative. Return changes and verification; the kit still owns final simplify/review/G4. Do not re-plan settled requirements or execute Tasks B/C.
|
|
83
|
+
Failure: Invoke bare ce-work with the full project plan, enter shipping/babysitting, or start Superpowers design approvals and another implementer/reviewer hierarchy.
|
|
84
|
+
|
|
85
|
+
## Completed review still needs fixes
|
|
86
|
+
Input: ce-code-review mode:agent returns status complete, verdict Ready with fixes, and an unresolved material finding; actionable_findings is empty because the finding needs verification.
|
|
87
|
+
Expected: Read findings, coverage and testing gaps; do not pass the review node. Return the concrete issue to the Developer or unresolved decision to the host, then review/reverify the affected new revision.
|
|
88
|
+
Failure: Treat complete or an empty actionable_findings array as a passed review or human approval.
|
|
89
|
+
|
|
90
|
+
## Missing skill versus interrupted skill
|
|
91
|
+
Input: In one project CE is absent but Superpowers is installed. In another, ce-work has changed files before a required reference becomes unavailable.
|
|
92
|
+
Expected: The first uses available focused Superpowers implementation skills and direct procedures only for missing CE stages, with the same evidence requirements. The second preserves work and returns the actual blocker/recovery information. Neither automatically starts a competing end-to-end workflow.
|
|
93
|
+
Failure: Install a plugin silently, claim CE ran, or rerun an incomplete task with another workflow over unknown state.
|
|
94
|
+
|
|
95
|
+
## Delegation and duplicate skill installations
|
|
96
|
+
Input: Office provides one execution slot and no child dispatch; two ce-compound installations expose different non-interactive modes.
|
|
97
|
+
Expected: Resolve a full skill name/path, check its real mode and required tools against the host allocation, and record the selection in task evidence. Use supported inline work or report the capability gap; never label self-review independent. Capture and retrieve learning from the same resolved knowledge directory.
|
|
98
|
+
Failure: Pass guessed flags, spawn beyond allocation, treat mode:agent as a resource limiter, or write learning to one directory while searching another.
|
package/skills/workflow/SKILL.md
CHANGED
|
@@ -8,7 +8,7 @@ argument-hint: "[request | status | finish]"
|
|
|
8
8
|
|
|
9
9
|
Invoke in Codex with `$workflow`; in Claude Code with `/workflow`. After installation or updates, start a new task/session.
|
|
10
10
|
|
|
11
|
-
Turn `$ARGUMENTS` into an approved,
|
|
11
|
+
Turn `$ARGUMENTS` into an approved change. For assigned roles, follow `references/role-graphs.md` and `references/skill-integration.md`: reuse the supplied run/node/token or automatically initialize `init-role`. Do not restart delivery.
|
|
12
12
|
|
|
13
13
|
## Non-negotiable gates
|
|
14
14
|
|
|
@@ -18,13 +18,13 @@ Turn `$ARGUMENTS` into an approved, reviewable change without creating documenta
|
|
|
18
18
|
|
|
19
19
|
## Explain before asking
|
|
20
20
|
|
|
21
|
-
Before G1
|
|
21
|
+
Before G1/G3, explain the problem, change, safety rule and verification plainly. Keep G4 prediction-before-reveal intact.
|
|
22
22
|
|
|
23
23
|
## Route by current state
|
|
24
24
|
|
|
25
25
|
1. **No approved Story:** read `references/intake.md`. Use `assets/STORY.md`; ask only missing behavior questions and obtain G1.
|
|
26
|
-
2. **Approved, not implemented:** read `references/execution.md`. Read `references/domain-risks.md`
|
|
26
|
+
2. **Approved, not implemented:** read `references/execution.md` and `references/graph-engineering.md`. Automatically initialize/resume the installed Graph CLI; use the minimal plan for small work. Read `references/domain-risks.md` for relevant risks. Create a Task only when one PR is not reviewable.
|
|
27
27
|
3. **Implemented or `finish`:** complete pending checks in `references/execution.md`, then follow `references/understanding-gate.md` for G4.
|
|
28
|
-
4. **`status`:** report stage, blocking decision, evidence
|
|
28
|
+
4. **`status`:** run the existing graph's `status` command; report stage, blocking decision, evidence and next action. Without a run, report the Story stage.
|
|
29
29
|
|
|
30
|
-
Use the user's language.
|
|
30
|
+
Use the user's language. State assumptions, evidence limits and human-owned decisions.
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
# Delivery and Execution
|
|
2
2
|
|
|
3
|
+
## Assigned graph work
|
|
4
|
+
|
|
5
|
+
If a host such as Agent Office delegates a started kit node, use its run/token and perform only the assigned role's procedure below. Return evidence and feedback to that graph; do not restart the entire workflow. Office coordinates roles and communication, while the kit continues to govern the work graph. See `graph-engineering.md` for dispatch boundaries.
|
|
6
|
+
|
|
7
|
+
## Stage integration
|
|
8
|
+
|
|
9
|
+
Read `skill-integration.md` before selecting skills. Prefer Superpowers focused implementation/verification skills and CE planning/simplify/review/learning modes; keep one workflow owner. Existing approvals and the assigned role/task bound each invocation. Use the same evidence requirements with a disclosed direct fallback when a compatible skill is unavailable.
|
|
10
|
+
|
|
3
11
|
## Size first
|
|
4
12
|
|
|
5
13
|
- **Small/reversible:** one reviewable outcome, local effect. Record `Plan source: N/A — small and reversible`; use test-first implementation and review.
|
|
6
|
-
- **Normal:** use `ce-plan
|
|
14
|
+
- **Normal:** use `ce-plan` in caller-owned pipeline context → Superpowers focused TDD/diagnosis → `ce-simplify-code` → `ce-code-review mode:agent` when compatible skills are available; simplify only after related tests pass. Otherwise perform equivalent repository-grounded stages directly.
|
|
7
15
|
- **High-risk/hard to reverse:** add G3. Present the key design decision, alternatives, invariant, rollback/recovery path, and evidence plan; end the turn for human approval before work. Save that decision to `docs/understanding/<slug>-plan.md` and record `Understanding gate (G3): <artifact> · <YYYY-MM-DD> · Check-in: accepted`.
|
|
8
16
|
|
|
9
17
|
High-risk signals: money/payment, authentication/authorization, concurrency, destructive migration, sensitive data, data loss, and irreversible external side effects.
|
|
@@ -26,11 +34,12 @@ For user-authorized optional Jira publication after G1, follow `jira.md`. Withou
|
|
|
26
34
|
|
|
27
35
|
1. Read the approved Story, relevant code, tests, repository instructions, and prior learnings.
|
|
28
36
|
2. Make a plan that maps every M/V ID to code and evidence. Do not create a second requirement source.
|
|
29
|
-
|
|
37
|
+
Automatically initialize/resume the installed graph as described in `graph-engineering.md`. Use `-` for small work; otherwise supply the reviewed task DAG. The CLI adds final review and fresh verification. Complete any required G3 before implementation nodes run.
|
|
38
|
+
3. Use compatible `superpowers:test-driven-development` for implementation and `superpowers:systematic-debugging` for unexplained failures. For new behavior or a bug fix, demonstrate RED before production code, then GREEN after the minimum change. Proceed when related tests pass.
|
|
30
39
|
4. Refactor while green: perform the simplification pass below. If `ce-simplify-code` is available, read its `SKILL.md` and execute it; naming the skill is not execution. If unavailable, apply the same criteria below directly; do not require installation or stop the workflow.
|
|
31
|
-
5. Review the final diff after simplification against the Story, including failure paths and what tests do not prove. Use `ce-code-review`
|
|
32
|
-
6. Revalidate affected behavior after simplify/review edits before G4. If review edits affect previously simplified code, recheck only the affected scope; do not restart the whole pipeline automatically. Broaden tests when impact warrants it; never claim old results cover new edits.
|
|
33
|
-
7.
|
|
40
|
+
5. Review the final diff after simplification against the Story, including failure paths and what tests do not prove. Use `ce-code-review mode:agent` when available; let its risk-based scope choose depth and resolve material findings. Do not apply fixes from a read-only review assignment.
|
|
41
|
+
6. Apply compatible `superpowers:verification-before-completion`. Revalidate affected behavior after simplify/review edits before G4. If review edits affect previously simplified code, recheck only the affected scope; do not restart the whole pipeline automatically. Broaden tests when impact warrants it; never claim old results cover new edits.
|
|
42
|
+
7. Record the evidence in the graph, run its `status` command, and require `action: g4` before continuing to `understanding-gate.md`; passing tests alone are not completion.
|
|
34
43
|
|
|
35
44
|
## Simplification pass
|
|
36
45
|
|
|
@@ -40,3 +49,20 @@ For user-authorized optional Jira publication after G1, follow `jira.md`. Withou
|
|
|
40
49
|
- Preserve behavior, result order, side effects, domain boundaries, failure handling and safety checks. A proposal that changes them belongs to the existing design or scope-change process, not a silent simplification.
|
|
41
50
|
- Follow the invoked skill and applicable repository/runtime instructions for execution and agent use; this kit sets no fixed agent count. Do not copy the skill's orchestration into this workflow.
|
|
42
51
|
- Include changes (or no-change outcome), review scope and fresh checks briefly in existing review/verification evidence. Add no separate approval gate, mandatory document or Jira Task.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Graph planning and execution
|
|
55
|
+
|
|
56
|
+
Graph execution is installed and used automatically after G1. Small changes use the built-in minimal plan without a separate plan document; split larger work only where dependency tracking or independent verification helps. Keep the size-based route above: no planning ceremony for a small/reversible change.
|
|
57
|
+
|
|
58
|
+
Planning is repository-grounded planning → review → deterministic validation. Research code, tests and risks as needed; do not require separate analyzer, advocate or mediator agents. Reuse an existing `ce-plan` result. The host performs agent/tool work and the installed CLI owns readiness, evidence records and recovery; never create a second nested orchestration pipeline for the same task.
|
|
59
|
+
|
|
60
|
+
The execution graph does not replace human gates. G1 still approves scope before planning/implementation, G3 still protects high-risk choices, and G4 still requires prediction-before-reveal. Superpowers focused skills and CE stage skills provide node behavior as mapped in `skill-integration.md`; the graph owns dependency and retry structure rather than copying those skills.
|
|
61
|
+
|
|
62
|
+
After each node, explicitly evaluate and record its evidence. Route failed checks to `fix`, changed assumptions to `replan`, and unresolved human decisions to `human`. For fixes within an unchanged plan, reset the earliest affected node and its descendants, preserving independent completed work. Changed plans/requirements require a new validated run; do not transplant stale evidence. Three attempts exhaust the run's retry allowance. Never silently create a new run to evade a stop. See `graph-engineering.md` for the executable protocol.
|
|
63
|
+
|
|
64
|
+
## Capture verified learning
|
|
65
|
+
|
|
66
|
+
After review findings are resolved and fresh verification passes, use the compatible non-interactive `ce-compound` mode in `skill-integration.md` to capture a reusable lesson in the resolved knowledge directory (default `docs/solutions/`). Otherwise record the proven cause, correction and prevention rule in the same directory directly. Skip the file when there is no reusable lesson; state that briefly. Read relevant prior lessons before later work. This is retrieval of project knowledge, not model retraining.
|
|
67
|
+
|
|
68
|
+
Capture once at the useful task boundary; do not make every role duplicate the same lesson. Learning records cannot replace G4 or turn an unverified hypothesis into a fact. For delegated work, return the lesson candidate to the delivery owner for consolidation.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Graph execution
|
|
2
|
+
|
|
3
|
+
Use the installed Graph CLI automatically after G1; no user opt-in, extra npm install, API key or custom JavaScript adapter is needed. The host (Codex/Claude) executes agent and tool work. The local CLI checks dependencies, persists results and tells the host what to do next. It does not launch models or execute arbitrary commands from JSON.
|
|
4
|
+
|
|
5
|
+
Read `skill-integration.md` when selecting Superpowers or CE for a graph node. Each selected skill implements only that stage; its own completion or shipping workflow cannot replace the kit's remaining gates.
|
|
6
|
+
|
|
7
|
+
## Roles and graph ownership
|
|
8
|
+
|
|
9
|
+
The kit supplies graph construction, deterministic validation, dependency scheduling, joins, evidence and failure routing in both standalone use and Agent Office. Office assigns people-like roles, launches agents, carries messages and displays progress; it uses kit readiness/results rather than implementing a competing graph state machine. Office does not disable the kit graph.
|
|
10
|
+
|
|
11
|
+
A role is not necessarily one node. A Developer may perform several implementation nodes; a Reviewer may inspect several independent areas. Function nodes perform deterministic checks without an agent. Split nodes only for a meaningful dependency, distinct evidence or recovery boundary.
|
|
12
|
+
|
|
13
|
+
For a delegated node, the dispatch must identify the kit run, node, started token, role, task description, approved Story constraints, allowed access and direct dependency outputs. The assigned agent applies the relevant procedure and returns summary, evidence and explicit evaluation to that same run. It must not initialize a new delivery graph, repeat G1/G4, spawn an unbounded team or implement changes inside a read-only review assignment. Missing scope or inputs must be reported to the dispatcher rather than invented. The kit graph is already active: executing its assigned node is graph use.
|
|
14
|
+
|
|
15
|
+
For a separate role objective, use the durable `init-role` entrypoint in [role-graphs.md](role-graphs.md). It supplies PM, team-lead, developer and reviewer flows without appending the whole delivery envelope. PM intake before G1 remains non-implementation work and cannot authorize production edits. The optional generic API is still available for custom graphs, with the different guarantees listed below.
|
|
16
|
+
|
|
17
|
+
Role-local execution and host enforcement are compatible. An agent performs its assigned kit flow; Office uses that flow's identity and results to dispatch work and accept its outcome. Office also applies host-owned permissions, cancellation and global budgets. It must not reimplement the role's workflow rules or treat a worker's "done" message as proof of graph completion. If a role uses a separate graph, link its run to the Office assignment and target revision; its completion is only that role's outcome, not completion of the whole delivery. This describes the integration contract, not an adapter already shipped by the kit.
|
|
18
|
+
|
|
19
|
+
Link messages to run/node/attempt and the requirement, question, decision, artifact or finding they concern. A review failure goes back through the kit's corrective route to the responsible implementation node. Only the overall delivery owner presents G4 after final evidence, using the actual user's response. Role completion is not project completion.
|
|
20
|
+
|
|
21
|
+
One controller owns each persisted kit run through the CLI. Its file is authoritative for local transitions; Office owns the shared goal, acceptance criteria, assignments, collaboration and integration. Office may index local progress but must not independently advance a copy. The CLI file store is not a finished Office adapter. Locking and write exclusion apply within that run, not across separate runs or processes editing the same repository. Office must isolate independent writers or serialize them and enforce any overall time/cost/cancellation limits. The kit's three-attempt bound does not implement an Office-wide budget or process cancellation.
|
|
22
|
+
|
|
23
|
+
## Initialize or resume
|
|
24
|
+
|
|
25
|
+
Read the approved Story, relevant code/tests and prior learnings. Complete required G3 before implementation. Reuse repository-grounded planning/review already performed by Compound skills; do not repeat it with a fixed team of analyzers, advocates and mediators.
|
|
26
|
+
|
|
27
|
+
Use a stable run path for the Story, such as `.ai-workflow/runs/<slug>.json`. If it exists, run `status`; never replace it to escape a failure. For a small/reversible change, use the built-in plan:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node .ai-workflow/bin/graph.mjs init - .ai-workflow/runs/<slug>.json docs/<story>.md
|
|
31
|
+
node .ai-workflow/bin/graph.mjs status .ai-workflow/runs/<slug>.json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The minimal plan is `implement → workflow-review → workflow-verify`. Implementation includes test-first work, related GREEN tests and bounded simplification. Final review checks the diff; verification supplies fresh checks after any fixes. No separate plan document is needed for small work.
|
|
35
|
+
|
|
36
|
+
For independently meaningful outcomes, write a reviewed JSON plan (HOW only; Story M/V IDs remain canonical):
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"id": "coupon-change",
|
|
41
|
+
"nodes": [
|
|
42
|
+
{ "id": "model", "description": "Represent the approved coupon rules", "access": "write", "covers": ["M1"], "verify": "Exercise allowed and rejected model transitions" },
|
|
43
|
+
{ "id": "api", "description": "Expose the approved behavior", "access": "write", "covers": ["V1"], "verify": "Check the Story's API success and failure cases" }
|
|
44
|
+
],
|
|
45
|
+
"edges": [{ "from": "model", "to": "api" }]
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Every Story M/V ID must be covered and unknown IDs are rejected. `description`, `verify`, `covers` and `access` are required per task. Use the actual Story IDs, not these example IDs. Run `init <plan.json> <run.json> <story.md>`; it deterministically validates references/cycles and appends mandatory final review/verification. Never put human approval inside generated nodes.
|
|
50
|
+
|
|
51
|
+
## Execute ready work
|
|
52
|
+
|
|
53
|
+
1. Read the JSON status and its `action`. Give each worker only its task, Story constraints, relevant files and `input.dependencies`; do not send the whole run/history. Read evidence files by reference as needed.
|
|
54
|
+
2. Reserve each ready task before starting work:
|
|
55
|
+
|
|
56
|
+
`node .ai-workflow/bin/graph.mjs start <run.json> <node-id> <ready-token>`
|
|
57
|
+
|
|
58
|
+
Use the returned `started.token` for the result record. Start durably counts the attempt and marks it running, preventing duplicate dispatch and overlapping writers. Execute only reserved tasks. They include a token for that unique run, exact attempt and dependency state. One host controller owns the run. Read-only tasks may run concurrently within the host's limits; write tasks are exclusive. A read node must not edit code: fail it with `fix` and reset the earliest implementation node when changes are needed.
|
|
59
|
+
3. Save actual observations to a new, nonempty project-relative evidence file per attempt. Include changed files, commands, exit codes, review findings and verification limits as applicable. Do not overwrite evidence from completed independent work. Long logs remain files, not copied model context.
|
|
60
|
+
4. Write a result JSON with the started task's token:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"token": "copy started.token from start",
|
|
65
|
+
"output": { "summary": "Describe the observable result", "evidence": ["docs/understanding/coupon-model-attempt-1.md"] },
|
|
66
|
+
"evaluation": { "passed": true }
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
node .ai-workflow/bin/graph.mjs record <run.json> <node-id> <result.json>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
A failed result uses `"evaluation": { "passed": false, "action": "fix", "feedback": "Specific failed expectation and affected task" }`. Evaluation is mandatory. An omitted value, empty evidence, premature node or stale token cannot complete a task. The CLI validates evidence existence and hashes, not the truth of observations; the host must actually run and assess the checks. CLI exit 0 means the record was accepted, including a failure record: inspect `action` and `failed`.
|
|
75
|
+
|
|
76
|
+
## Route the next action
|
|
77
|
+
|
|
78
|
+
| Action | Host behavior |
|
|
79
|
+
|---|---|
|
|
80
|
+
| `execute` | Perform ready tasks and record their results. Fetch fresh status after each completion. |
|
|
81
|
+
| `wait` | Wait for running workers; do not dispatch them again. After an interrupted session, inspect their side effects and explicitly reset stopped workers. |
|
|
82
|
+
| `fix` | Identify the earliest affected task; reset it before doing corrective work, then rerun it and invalidated descendants. Independent results stay recorded. |
|
|
83
|
+
| `replan` | Correct the plan; validate it into a new run and retain the old run as evidence. Scope changes use the existing human gate. |
|
|
84
|
+
| `human` | Surface the unresolved decision and wait. After resolution, use a new run reflecting it. |
|
|
85
|
+
| `stop` | Report exhausted attempts and evidence. Do not restart under a new filename without an explicit decision to continue. |
|
|
86
|
+
| `question` | Transport the pending question; submit the matching answer and continue with `resumed.token`. See `role-graphs.md`. An answer is not approval. |
|
|
87
|
+
| `role-complete` | Return the role's native outcome and evidence to the caller. This does not finish delivery. |
|
|
88
|
+
| `g4` | Follow `understanding-gate.md`; this is readiness, not approval or delivery. |
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
node .ai-workflow/bin/graph.mjs reset <run.json> <earliest-affected-node> "What will be corrected and why"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Reset the implementation node when a review requires code edits; resetting only the reviewer would retain invalid implementation evidence. Stop any affected running workers before reset; reset invalidates their old tokens. Reset preserves attempt counts; three attempts is the per-node limit. No automatic repeated side effects or unrestricted retry loop. Changing graph content or Story requirements invalidates the run; progress/gate metadata may change without invalidating requirements. New plans conservatively start fresh instead of guessing which old outputs remain valid.
|
|
95
|
+
|
|
96
|
+
Writes use an exclusive `.lock` and atomic file replacement. After a crashed CLI process, inspect the lock's owner and the run before manually removing a stale lock. Never delete a live writer's lock. Avoid simultaneous install/remove and execution. Updates/removal preserve run and evidence files; keep those separate from the managed `.ai-workflow/graph/` runtime.
|
|
97
|
+
|
|
98
|
+
## Programmatic API (optional)
|
|
99
|
+
|
|
100
|
+
After init, import from `./.ai-workflow/graph/index.mjs`. Consumers who install the npm package as a dependency can also import `@pazmo/ai-workflow-kit/src/graph/index.mjs`.
|
|
101
|
+
|
|
102
|
+
`executeTaskGraph({ graph, runNode, evaluateNode, context, runState, maxConcurrency })` requires explicit evaluation results. Default concurrency is 1; a higher positive integer allows overlapping nodes marked `access: 'read'`. Writers and undeclared-access nodes run exclusively. A newly ready node starts as soon as a slot becomes available; joins wait only for their dependencies. `waves` records dispatch batches, not global barriers.
|
|
103
|
+
|
|
104
|
+
Node input is `{ context, dependencies }`, copied to avoid shared mutation. Persisted states carry a graph fingerprint; changed plans and unknown/unevaluated statuses are rejected. Interrupted `running` nodes require an explicit `resetAffectedSubgraph` after checking external side effects. This in-process API does not persist checkpoints or approve gates; use the installed CLI for the durable host workflow.
|
|
105
|
+
|
|
106
|
+
The generic API is not the delivery CLI's policy API. Choose the interface by its actual guarantees:
|
|
107
|
+
|
|
108
|
+
| Responsibility | Generic API | Delivery CLI | Host |
|
|
109
|
+
|---|---|---|---|
|
|
110
|
+
| Dependency readiness, read concurrency, exclusive writers | Within one execution | Within one run | Isolate or serialize work across runs |
|
|
111
|
+
| Attempts | Counts starts; no built-in cap | Maximum three starts per node | Enforce global time, cost and attempt budgets |
|
|
112
|
+
| `human` / `replan` evaluation | Records the action; independent work can continue | Routes to the decision; no further start until resolved in a new run | Stop affected processes and obtain the decision |
|
|
113
|
+
| Evidence and persistence | Returns state and explicit evaluation; no evidence-file checks or checkpoint store | Checks evidence files/hashes and persists run changes | Verify observations and bind them to the actual code revision |
|
|
114
|
+
| User approval and tool permissions | Not provided | Checks approval records, not identity; does not intercept tools | Own actual approval events and execution permissions |
|
|
115
|
+
|
|
116
|
+
Do not assume `executeTaskGraph` or `resetAffectedSubgraph` enforces the delivery CLI's retry or human-decision rules. Office integration must first identify its actual dispatch, storage, cancellation and result-application boundary. If it needs shared delivery transitions, extract only the necessary rules from the CLI when connecting that consumer; do not duplicate the rules in Office or invent an unused public API in advance.
|
|
117
|
+
|
|
118
|
+
`access: 'read'` describes product-code access, not a filesystem sandbox. Review evidence and test-generated files may still require designated output paths. Host enforcement must distinguish these from product edits. Multiple developer processes alone do not provide safe parallel implementation: the host must manage workspace isolation, integration and verification of the combined result.
|
|
119
|
+
|
|
120
|
+
`createPlanningGraph()` supplies `planner → review → validate-graph`. Planner/review callbacks return task graphs; the last node executes built-in deterministic validation rather than an LLM callback. Research and extra review roles are chosen for the work, not required by the graph.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Intake and Contract
|
|
2
2
|
|
|
3
|
+
For a PM assignment, perform only intake and return the Story proposal or question to the host. Use `skill-integration.md` for optional CE exploration; do not start another design approval workflow over an already settled scope. G1 still requires the actual user's decision.
|
|
4
|
+
|
|
3
5
|
## Internal Domain Frame
|
|
4
6
|
|
|
5
7
|
Derive before asking: actor, desired outcome, terms/entities, state change, invariant/forbidden outcome, failure, external side effect, and observable evidence.
|
|
@@ -80,8 +82,10 @@ node .ai-workflow/bin/check.mjs story <story-file>
|
|
|
80
82
|
node .ai-workflow/bin/check.mjs gate G1 <story-file>
|
|
81
83
|
```
|
|
82
84
|
|
|
83
|
-
`story` checks that the contract is well formed. `gate G1`
|
|
84
|
-
|
|
85
|
+
`story` checks that the contract is well formed. `gate G1` validates the approval record
|
|
86
|
+
and referenced artifact; it does not authenticate the person who approved it. The host
|
|
87
|
+
must obtain the actual user's decision. Never create approval from an agent's own claim.
|
|
88
|
+
Run `story` while the file still says `Draft` and it exits 0 on shape alone —
|
|
85
89
|
that is not approval, and the output says which gate it skipped. Do not start implementation
|
|
86
90
|
unless both exit 0, and never claim the gate passed without that output.
|
|
87
91
|
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Persistent role work
|
|
2
|
+
|
|
3
|
+
**The kit manages how an assigned job gets finished. Office manages how several jobs achieve one goal.**
|
|
4
|
+
|
|
5
|
+
Use this guide when assigned a role objective. If the dispatcher supplied an existing run/node/started token, return to that node instead of initializing another run. Without a role assignment, use the normal delivery flow in `graph-engineering.md`.
|
|
6
|
+
|
|
7
|
+
## Ownership
|
|
8
|
+
|
|
9
|
+
- Kit run file: local readiness, attempts, questions, answers, feedback, evidence and role completion. One controller writes it through the CLI.
|
|
10
|
+
- Office: canonical goal and acceptance criteria, assignments, agent execution, collaboration messages, combined results, global limits, cancellation and real user approval. Office may index kit state; it must not independently advance a duplicate local state machine.
|
|
11
|
+
- Agent: performs ready work and records actual observations. It may choose HOW within its assignment, but cannot change the agreed completion criteria.
|
|
12
|
+
|
|
13
|
+
Standalone use has the same local rules. Codex/Claude runs the CLI and tools. No Office server is needed. The CLI cannot intercept tools or authenticate people: host permissions and real approvals remain separate.
|
|
14
|
+
|
|
15
|
+
If PM and Developer disagree about completion, return the exact requirement and evidence to Office. Resolve the shared criteria there. A changed requirement or assignment starts a new run; do not silently edit the bound source or reuse old completion evidence.
|
|
16
|
+
|
|
17
|
+
## Assignment schema and initialization
|
|
18
|
+
|
|
19
|
+
Save an assignment as project-relative JSON, for example `assignments/developer-1.json`:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"version": 1,
|
|
24
|
+
"taskId": "payment-idempotency",
|
|
25
|
+
"role": "developer",
|
|
26
|
+
"source": "docs/payment-story.md",
|
|
27
|
+
"scope": ["M1", "V1"],
|
|
28
|
+
"targetRevision": "snapshot-before-work"
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
| Field | Contract |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `version` | Integer `1` |
|
|
35
|
+
| `taskId` | Nonempty assignment identity from the caller |
|
|
36
|
+
| `role` | `pm`, `team-lead`, `developer`, or `reviewer` |
|
|
37
|
+
| `source` | Existing nonempty request file for PM; approved canonical Story for other roles. Paths stay inside the project and cannot contain symlinks. |
|
|
38
|
+
| `scope` | PM uses `[]`. Others use unique existing Story IDs with at least one M and one V. This is the assigned subset, not copied requirements. |
|
|
39
|
+
| `targetRevision` | Nonempty caller-owned snapshot identity. For Developer it identifies the starting input; for Reviewer it identifies the submitted code. Include uncommitted changes. |
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
node .ai-workflow/bin/graph.mjs init-role assignments/developer-1.json .ai-workflow/runs/developer-1.json
|
|
43
|
+
node .ai-workflow/bin/graph.mjs status .ai-workflow/runs/developer-1.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Reuse the same run across sessions. `init-role` does not overwrite files. The assignment contents and source are bound to the run. Source/assignment changes require a new run after the caller resolves the change. PM should write a separate Story proposal, not overwrite its input request.
|
|
47
|
+
|
|
48
|
+
| Role | Local graph | Return |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| PM | `clarify → propose` | Story proposal and remaining decisions; no self-issued G1 |
|
|
51
|
+
| Team lead | `investigate → plan` | Repository-grounded plan, scope links and assignment suggestions |
|
|
52
|
+
| Developer | `implement → self-check` | Code, fresh checks and `output.producedRevision` |
|
|
53
|
+
| Reviewer | `review` | Evidence, `output.reviewedRevision` and `output.verdict`: `pass` or `needs_changes` |
|
|
54
|
+
|
|
55
|
+
Use the focused skills in `skill-integration.md` inside these stages. No role starts another full workflow. Final delivery still needs independent review, combined verification, useful Compound learning and real user acceptance, coordinated by the delivery owner.
|
|
56
|
+
|
|
57
|
+
## Start and record
|
|
58
|
+
|
|
59
|
+
Use the same `start` and `record` commands as delivery graphs. `status.ready` contains node instructions, token, assignment, source, direct dependency outputs and relevant `input.messages` only. Reserve with the ready token, execute the work, and record using `started.token`.
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"token": "<started.token>",
|
|
64
|
+
"output": {
|
|
65
|
+
"summary": "Assigned behavior implemented and checked",
|
|
66
|
+
"evidence": ["evidence/developer-attempt-1.md"],
|
|
67
|
+
"producedRevision": "snapshot-after-work"
|
|
68
|
+
},
|
|
69
|
+
"evaluation": { "passed": true }
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Developer's final `self-check` requires `producedRevision`. Reviewer's result requires `reviewedRevision` equal to the assignment's `targetRevision`, plus `verdict`. The CLI compares the supplied identities; Office/host must verify that they actually identify the files inspected.
|
|
74
|
+
|
|
75
|
+
A completed review can have `evaluation.passed: true` and `output.verdict: "needs_changes"`: the review was performed, and its finding is that the product needs changes. Do not interpret that as product approval. A review that could not be performed should fail with a concrete `fix`, `replan` or `human` action.
|
|
76
|
+
|
|
77
|
+
All local nodes passing returns `action: "role-complete"`, `assignment`, `submission.output` and `revisionToken`. Office consumes the native outcome and evidence. **Role completion does not approve the product or finish delivery.** Existing delivery graphs still return `g4` as preparation for human review.
|
|
78
|
+
|
|
79
|
+
## Ask and resume
|
|
80
|
+
|
|
81
|
+
Available for both role and delivery runs. A running task can submit:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{ "token": "<current task token>", "text": "Which accepted requirement governs this case?" }
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
node .ai-workflow/bin/graph.mjs question <run.json> <node-id> <question.json>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The response has `action: "question"` and `question: {id, nodeId, text, token}`. One question may be pending per run. New dispatch stops. Other already running nodes may finish. The asking node cannot record or reset past the unanswered question. Its previous token is invalidated.
|
|
92
|
+
|
|
93
|
+
Office transports the question and answer. Standalone agents ask their user. Save the actual answer as evidence, then submit:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"token": "<question.token>",
|
|
98
|
+
"questionId": "<question.id>",
|
|
99
|
+
"text": "The answer or decision received",
|
|
100
|
+
"evidence": ["evidence/answer-1.md"]
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
node .ai-workflow/bin/graph.mjs answer <run.json> <node-id> <answer.json>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Continue from `resumed` and use its new token. This retains the same attempt. Duplicate/wrong answers and old worker results are rejected. Answers are input, never G1/G3/G4 approval. If an answer changes requirements, resolve the canonical document and create a new assignment/run; do not continue against the old contract.
|
|
109
|
+
|
|
110
|
+
There are at most three question exchanges per node across the run. Batch related questions. The fourth question is rejected; report the unresolved blocker with `evaluation.action: "human"`. Starting a new run only to evade this limit is not allowed. Global time/cost limits remain host-owned.
|
|
111
|
+
|
|
112
|
+
## Apply feedback
|
|
113
|
+
|
|
114
|
+
Local failed checks use `reset` on the earliest affected implementation node. Its next input includes downstream failure feedback. External review feedback uses a separate command with the current `status.revisionToken`:
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"token": "<current status.revisionToken>",
|
|
119
|
+
"summary": "Handle repeated requests without charging twice; see Reviewer finding R1.",
|
|
120
|
+
"evidence": ["evidence/reviewer-finding-r1.md"]
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
node .ai-workflow/bin/graph.mjs feedback <developer-run.json> implement <feedback.json>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The target must be completed or failed and affected workers must be stopped. Feedback resets that node and descendants, preserves unrelated work and attempt counts, and attaches the finding to their inputs. Maximum three starts per node. Stale feedback, missing evidence and retries past the limit are rejected. A revised submission needs a review assignment bound to its new revision.
|
|
129
|
+
|
|
130
|
+
For `human`, `replan` or exhausted attempts, resolve the decision explicitly; these are not ordinary question waits. Existing stop rules still apply. Keep answer and feedback evidence immutable because history checks their hashes even after a reset.
|
|
131
|
+
|
|
132
|
+
## Compatibility and limits
|
|
133
|
+
|
|
134
|
+
Assignment schema is v1; role run format is v2. Existing delivery v1 files work without migration. Old runtimes cannot read role v2. Do not downgrade a runtime while using these commands, or edit versions/fingerprints to force compatibility. Install this source artifact and run `doctor`; a package name/version alone does not prove which code an Office worker has.
|
|
135
|
+
|
|
136
|
+
No Office adapter, cross-run lock, transport authentication, sandbox, model execution or global budget manager is included. Each run has its existing atomic file lock and local read/write scheduling. Host processes must isolate multiple writers and validate actual revisions before integrating results.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Stage skills and role boundaries
|
|
2
|
+
|
|
3
|
+
The kit owns work-graph rules and human gates. Prefer compatible Superpowers focused skills for implementation discipline and verification, and Compound Engineering (CE) for planning, simplification, review and verified learning. The host runs agents and persists the authoritative state using the selected integration contract. Do not start a second end-to-end workflow inside a kit node.
|
|
4
|
+
|
|
5
|
+
## Select once for the assigned stage
|
|
6
|
+
|
|
7
|
+
Read the actual installed skill and required references before invoking it. Resolve its full name/path through the host's skill catalog; prefer the namespaced `compound-engineering:ce-*` entry when duplicates exist, unless the user selected another installation. Record the selected skill, mode and artifact path in existing task evidence, not a new registry. Similar names do not guarantee matching arguments.
|
|
8
|
+
|
|
9
|
+
Check that its mode and required tools fit the host's allowed workspace, delegation, model route, remaining budget and commit/publish permissions. A mode controls output/flow, not authorization. Return-to-caller does not automatically disable internal workers or implementation commits.
|
|
10
|
+
|
|
11
|
+
If a compatible skill is absent before invocation, use the direct stage procedure in `execution.md` and report the fallback. Do not silently install plugins or switch to a Superpowers end-to-end workflow. If an invoked skill blocks, fails or loses a required reference, preserve its partial work and return that blocker; do not launch a fallback over unknown state. Respect explicit user and host instructions.
|
|
12
|
+
|
|
13
|
+
## Role-to-stage mapping
|
|
14
|
+
|
|
15
|
+
These are skill invocation arguments, not Graph CLI flags. Invocation uses the host's normal skill mechanism. Roles select responsibility; they do not each run this entire table.
|
|
16
|
+
|
|
17
|
+
| Assigned work | Preferred skill and call contract | Return to the kit/host |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| PM: clarify behavior and propose scope | `intake.md`; use `ce-brainstorm` only for material unresolved alternatives | Canonical Story proposal or a specific question; no implementation or self-issued G1 |
|
|
20
|
+
| Team lead: plan approved work | `ce-plan` with an explicit caller-owned pipeline instruction and the approved Story | Plan, requirement links, confidence/review result and unresolved blockers |
|
|
21
|
+
| Developer: implement the assigned approved task | `superpowers:test-driven-development`; `superpowers:systematic-debugging` for unexplained failures | Changed files, applicable RED/GREEN evidence, diagnosis and blockers; return to the assigned graph |
|
|
22
|
+
| Verification owner: verify the submitted revision | `superpowers:verification-before-completion` | Fresh relevant commands, results, revision and limits |
|
|
23
|
+
| Developer: simplify after related GREEN checks | `ce-simplify-code` scoped to the assigned changes | Behavior-preserving changes or a justified no-change result, then affected checks |
|
|
24
|
+
| Reviewer: assess the submitted change | `ce-code-review mode:agent base:<base-ref> plan:<plan-path>` | Review JSON and evidence, including scope, verdict, findings and coverage limits |
|
|
25
|
+
| Delivery owner: capture proven learning | Namespaced CE `ce-compound mode:non-interactive <verified-context>` when supported | One useful learning or an explicit no-lesson outcome |
|
|
26
|
+
|
|
27
|
+
For `ce-plan`, state: "Pipeline context: return the plan and review result to this workflow; the caller owns execution, human gates and the next action. Return unresolved decisions as blockers." Do not invent a `mode:pipeline` argument for a version that does not document it. Reuse an existing plan; a small reversible task can use the kit's minimal plan and direct implementation without creating a CE plan artifact solely to invoke `ce-work`.
|
|
28
|
+
|
|
29
|
+
If the user or host explicitly selects CE implementation instead, use `ce-work mode:return-to-caller <plan-path>` as an alternative executor, not an additional implementation pass. Give it an executable plan bounded to the assigned unit. Do not pass the whole project plan to a Developer assigned only one task: its completion contract covers the supplied plan. A bounded HOW artifact may reference the canonical plan and Story IDs; do not copy requirements into it. If the work is small enough to do directly, use the direct path instead of manufacturing plan files.
|
|
30
|
+
|
|
31
|
+
The reviewed local standalone `ce-compound` variant uses `mode:headless`, while the namespaced CE variant supports `mode:non-interactive` and depth selection. Use the selected installation's contract; never pass every possible alias. Its normal full capture may use research and reviewers; request `depth:lightweight` explicitly only for a bounded capture or constrained host where that supported mode is appropriate, and disclose the reduced validation. Resolve its knowledge directory once and reuse it for later retrieval (CE `docs_root` defaults to `docs`). Respect invalid-config errors rather than silently creating another knowledge store. Keep the kit's existing Story and gate artifact references intact.
|
|
32
|
+
|
|
33
|
+
Planning may already include document review. Reuse that receipt; a graph validator still checks structural validity but must not repeat the same semantic plan review without a new risk or changed input. Developer self-checks do not replace the Reviewer stage.
|
|
34
|
+
|
|
35
|
+
## Consume results, not completion claims
|
|
36
|
+
|
|
37
|
+
- A skill's `status: complete` means its invocation ended; inspect its outcome. In review JSON, `Ready with fixes`, `Not ready`, unresolved material findings or missing required coverage do not pass the review node. An empty `actionable_findings` array alone is insufficient; inspect `findings`, testing gaps and coverage too.
|
|
38
|
+
- Require actual commands/results and applicable verification evidence for implementation. Match review and verification to the submitted change revision; changed code invalidates affected evidence. A commit ID alone does not identify uncommitted edits.
|
|
39
|
+
- Preserve the returned artifact and its native result. Summarize it into the existing graph result (`output.summary`, evidence paths, explicit evaluation) only when the assigned work has a terminal pass/fail. Record a failure with actionable feedback; never reinterpret a blocked/skipped/degraded skill as success.
|
|
40
|
+
- Questions are not failed tests. Use the CLI `question`/`answer` transitions in `role-graphs.md`; the host transports the question and actual answer. Continue with `resumed.token` without consuming another attempt. An answer is not approval. External review feedback uses `feedback` on the affected implementation node.
|
|
41
|
+
- Only the delivery owner coordinates final verification, useful learning capture and G4. A review verdict, role completion or CE handoff never authorizes merge or supplies the user's gate response.
|
|
42
|
+
|
|
43
|
+
## Execution limits and review authority
|
|
44
|
+
|
|
45
|
+
Office/host assigns roles, runs agents, transports messages and owns global execution limits. All skill-internal workers and correction attempts consume those same limits. Use permitted inline execution when the selected skill supports it; otherwise return a capability/budget blocker. Never claim an inline self-review was an independent reviewer. Do not weaken an independence requirement to fit a budget or force every review to the heaviest depth.
|
|
46
|
+
|
|
47
|
+
The Reviewer reports fixes to the Developer; do not use `apply:local` on a read-only review assignment. "Read-only" concerns product changes; allow required review artifacts only in the designated output/scratch paths. Do not invoke CE shipping, PR, babysitting, or external-model routes merely because they are installed. A user-approved route still applies within its authorized scope.
|
|
48
|
+
|
|
49
|
+
## Superpowers coexistence
|
|
50
|
+
|
|
51
|
+
Do not automatically invoke `brainstorming → writing-plans → executing-plans/subagent-driven-development → finishing-a-development-branch` inside this workflow. That adds another owner for design approval, task dispatch, review and delivery.
|
|
52
|
+
|
|
53
|
+
Use Superpowers' focused TDD, systematic-debugging and verification skills by default where available and applicable to the assigned stage. Read their actual instructions; a skill name in evidence is not proof of execution. No artificial RED test is needed for a prose-only change. Preserve existing approvals and plans, and respect higher-priority host instructions. Do not rerun a procedure already completed with sufficient evidence. Missing focused skills use the kit's direct procedure, with the fallback disclosed. This is a deliberate composition of focused skills, not a claim that the full Superpowers workflow ran. Capture reusable knowledge through CE after resolved review and fresh verification.
|
|
54
|
+
|
|
55
|
+
This reference is host instruction policy, not an SDK bridge or a code-enforced Office adapter. The kit installs this policy, not CE or Superpowers. Confirm capabilities in each actual agent environment; neither plugin's presence in the current developer session proves it is available in Office workers.
|