@mrciphersmith/keryx 0.4.39 → 0.4.40
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/dist/cli.js +178 -101
- package/dist/core.js +2 -2
- package/dist/keryx-general-worker-entry.js +4 -4
- package/package.json +1 -1
- package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/SKILL.md +174 -463
- package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.detail.md +154 -584
- package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +212 -852
|
@@ -13,7 +13,7 @@ triggers:
|
|
|
13
13
|
- "flow orchestration"
|
|
14
14
|
metadata:
|
|
15
15
|
author: "MrCipherSmith"
|
|
16
|
-
version: "1.
|
|
16
|
+
version: "1.5.0"
|
|
17
17
|
category: "orchestration"
|
|
18
18
|
compatible_harnesses: "cursor,codex,zed,opencode,claude"
|
|
19
19
|
license: "MIT"
|
|
@@ -27,300 +27,181 @@ Run in the main session: this skill dispatches workers. Without a subagent-spawn
|
|
|
27
27
|
|
|
28
28
|
## Purpose
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
**You are the orchestrator** — the Task Manager-aware implementation orchestrator. You plan, dispatch workers, commit at task boundaries and move the flow through `keryx flow`; workers write the code. Use this skill instead of `job-orchestrator` when the user wants a managed story/issue lifecycle with frozen acceptance criteria, task state, an explicit completion choice, Code Health, and a durable flow package in `.metaproject/flows/`. Where a `keryx flow` or `keryx review` command computes, gates or refuses something, this file names the command and what to do with its output; it does not restate the rule. Read the output and act on it.
|
|
31
|
+
|
|
32
|
+
Plan bridge: publish the tasks with `plan_set` under the ids `T1`…`Tn`, mirror each `keryx flow task done` with `plan_update`, and publish Phase 4's completion choice as `proposed` — see the `session-plan-bridge` rule.
|
|
33
|
+
|
|
34
|
+
| | keryx shell | Claude Code | other hosts |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| Spawn | `spawn_subagent` | `Agent` (`subagent_type` = the worker skill; no such type: `general-purpose` with the worker's `SKILL.md` path in the prompt) | its spawn tool |
|
|
37
|
+
| Question | `ask_user` (a card where one exists) | `AskUserQuestion`, one question with options | one question in your reply, then wait |
|
|
38
|
+
| Plan | `plan_set`, `plan_update` | its todo list | its plan tool, else a checklist in your reply |
|
|
32
39
|
|
|
33
40
|
## Hard Preconditions
|
|
34
41
|
|
|
35
42
|
1. Read `.metaproject/index.md` and `.metaproject/metaproject.json`.
|
|
36
|
-
2.
|
|
37
|
-
- `.metaproject/metaproject.json` must contain `modules.tasks.enabled: true`;
|
|
38
|
-
- `.metaproject/skills/flow/SKILL.md` should exist.
|
|
39
|
-
3. If Task Manager is not enabled, stop and tell the user to run:
|
|
43
|
+
2. Task Manager must be enabled: `modules.tasks.enabled: true` in `metaproject.json`, and `.metaproject/skills/flow/SKILL.md` present. If not, stop and tell the user to run `keryx update` or initialize with the Task Manager module enabled. Do not emulate flow state by hand.
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
## The record
|
|
46
|
+
|
|
47
|
+
Flow state lives in `.metaproject/flows/<dir>/`. The CLI owns `flow.json` (read it freely, never write it), status transitions (`keryx flow …`), task status (`keryx flow task done`), attempt counts (`keryx flow task attempt`) and frozen acceptance criteria (`keryx flow ac update <id> --reason "<why>"`, or `--criterion ACn --text "…" --reason "<why>"` to rewrite one line). You edit `description.md`, `context.md`, `plan.md`, `tasks.md` (task definitions only) and `journal.md`.
|
|
48
|
+
|
|
49
|
+
Never bypass the CLI for a state change, never let a worker edit `flow.json` or frozen AC or decide completion, and never reword a criterion to fit what was built: change it through `keryx flow ac update` with the reason. Read broad source trees only after gdgraph/gdctx/wiki/memory have narrowed the context.
|
|
50
|
+
|
|
51
|
+
## Workflow
|
|
52
|
+
|
|
53
|
+
Keep this as your todo list (Claude Code) or plan; tick each item when its artifact exists.
|
|
44
54
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
- task attempt
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
- `description.md`
|
|
64
|
-
- `context.md`
|
|
65
|
-
- `plan.md`
|
|
66
|
-
- `tasks.md` for task definitions only
|
|
67
|
-
- `journal.md`
|
|
68
|
-
|
|
69
|
-
## Lifecycle
|
|
70
|
-
|
|
71
|
-
```mermaid
|
|
72
|
-
flowchart TD
|
|
73
|
-
A["User issue / feature request"] --> B["flow-orchestrator"]
|
|
74
|
-
B --> C["keryx flow init"]
|
|
75
|
-
C --> D["flow-init context enrichment"]
|
|
76
|
-
D --> E["freeze AC + start flow"]
|
|
77
|
-
E --> F["dispatch tests-creator / task-implementer"]
|
|
78
|
-
F --> FG{"first green: ask operator - open PR or harden first"}
|
|
79
|
-
FG --> G["code-verifier + review-orchestrator"]
|
|
80
|
-
G --> H{"All tasks, checks, review OK?"}
|
|
81
|
-
H -- "no" --> F
|
|
82
|
-
H -- "yes" --> I{"Ask user how to finish"}
|
|
83
|
-
I -- "create PR" --> J["create PR; each round = review start on the new head (delta)"]
|
|
84
|
-
J --> K{"review clean, PR mergeable?"}
|
|
85
|
-
K -- "no, attempts < 5" --> J
|
|
86
|
-
K -- "no, attempts = 5 or repetition detected" --> R["enrich context and change fix strategy"]
|
|
87
|
-
R --> J
|
|
88
|
-
K -- "yes" --> L["merge PR into recorded base branch"]
|
|
89
|
-
L --> M["keryx flow implemented --pr"]
|
|
90
|
-
M --> N["confirm AC evidence"]
|
|
91
|
-
N --> O["keryx flow complete"]
|
|
92
|
-
I -- "verified handoff" --> P["report completion; keep flow in-progress"]
|
|
93
|
-
I -- "keep open" --> Q["journal next steps; keep flow in-progress"]
|
|
55
|
+
```
|
|
56
|
+
Flow Orchestrator Progress:
|
|
57
|
+
- [ ] 0.0 `keryx flow list`; an interrupted flow → ask resume or new (question tool)
|
|
58
|
+
- [ ] 0.1 route to an existing flow, or `keryx flow init` with `--base`; `keryx flow status <id>`
|
|
59
|
+
- [ ] 1 execution-metrics question (direct user run only)
|
|
60
|
+
- [ ] 1 context from gdgraph, gdctx, gdwiki, memory, health/testing; read the required rules
|
|
61
|
+
- [ ] 1 write description.md, context.md, plan.md (state × event matrix or "not applicable"), tasks.md
|
|
62
|
+
- [ ] 1 every verification step of the plan added as a task (`keryx flow task add`)
|
|
63
|
+
- [ ] 1 acceptance-criteria.md: one `[verify: …]` marker per criterion; one kinds question to the operator if any is unclear
|
|
64
|
+
- [ ] 1 sourced from a finding: `review-premise` before freeze
|
|
65
|
+
- [ ] 1 `keryx flow freeze <id> --yes`, `keryx flow start <id>`; publish T1…Tn to the plan
|
|
66
|
+
- [ ] 2 once: worktree path resolved and branch checked; JEV edit guard checked
|
|
67
|
+
- [ ] 2 per task: resolve-context → attempt `started` → dispatch (Worker brief) → read STATUS → validate → boundary commit → `flow task done`
|
|
68
|
+
- [ ] 3 focused tests, `code-verifier`, `keryx health run`; first-green question; budget check; `review-orchestrator` inline; fix rounds; skill learning
|
|
69
|
+
- [ ] 4 completion question (A/B/C), or the typed input of a dispatched run; A: PR review/fix loop, merge, `keryx flow implemented`
|
|
70
|
+
- [ ] 5 `keryx flow ac confirm` per criterion, `keryx flow check-complete`, `keryx flow complete`
|
|
71
|
+
- [ ] Completion report
|
|
94
72
|
```
|
|
95
73
|
|
|
96
74
|
## Phase 0: Route And Resume
|
|
97
75
|
|
|
98
|
-
### 0.0 State
|
|
99
|
-
|
|
100
|
-
The input contract accepts `mode: "resume"`; this is the procedure behind it.
|
|
101
|
-
Run it before asking the user anything, on **every** invocation — not only when
|
|
102
|
-
`mode` is `resume`. A session that restarts mid-flow remembers nothing of what
|
|
103
|
-
it already tried. The flow package does.
|
|
104
|
-
|
|
105
|
-
1. Run `keryx flow list`. Any flow whose status is `in-progress`,
|
|
106
|
-
`implemented`, `completing`, or `blocked` is an interrupted flow.
|
|
107
|
-
2. If one exists, ASK the user, with the concrete numbers, once:
|
|
108
|
-
"Found an in-flight flow `<id>` '<title>' (status `<status>`, tasks
|
|
109
|
-
`<done>/<total>`). Resume it, or start a new flow?" Never guess.
|
|
110
|
-
3. If resume:
|
|
111
|
-
1. Run `keryx flow status <id>` and read the flow package —
|
|
112
|
-
`description.md`, `plan.md`, `context.md`, `journal.md`, and the frozen
|
|
113
|
-
`acceptance-criteria.md`.
|
|
114
|
-
2. Read `.metaproject/flows/<dir>/flow.json` (read-only; it stays CLI-owned)
|
|
115
|
-
and take `tasks[].attempts.count` and `tasks[].attempts.log` for every
|
|
116
|
-
task that is not `done`. **That is the attempt count. Never count
|
|
117
|
-
attempts from your own context** — a resumed session's context starts at
|
|
118
|
-
zero while the real count does not, and a loop bound computed from zero
|
|
119
|
-
is not a bound.
|
|
120
|
-
3. Ask the record which task is next, rather than deriving it:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
keryx flow next <id> --json
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
This is the first task not `done` whose declared `dependsOn` are all
|
|
127
|
-
`done` — computed from the package, not re-derived from prose.
|
|
128
|
-
|
|
129
|
-
4. **Read the `resume` field before dispatching anything.** It has three
|
|
130
|
-
answers and they are not interchangeable:
|
|
131
|
-
|
|
132
|
-
- `never-started` — nothing has been tried. Dispatch normally.
|
|
133
|
-
- `ended` — a previous attempt reported how it finished. This is a retry;
|
|
134
|
-
the budget in step 6 applies.
|
|
135
|
-
- `unresolved` — an attempt was opened and **no end was ever recorded**.
|
|
136
|
-
Whether its work already landed is UNKNOWN. Do NOT treat this as
|
|
137
|
-
`never-started`. Inspect the working tree and the task's
|
|
138
|
-
`evidenceRefs` first, decide whether the work is there, and only then
|
|
139
|
-
either close the stale attempt
|
|
140
|
-
(`keryx flow task attempt <id> <Tn> --outcome failed --detail "<what you found>"`)
|
|
141
|
-
or close the task (`keryx flow task done <id> <Tn>`). Re-dispatching
|
|
142
|
-
over an unresolved attempt is how the same work gets done twice.
|
|
143
|
-
|
|
144
|
-
`keryx flow next` also lists, under `unresolved`, every OTHER not-done task with an
|
|
145
|
-
unresolved attempt (parallel dispatches that never reported back); resolve them the same way.
|
|
146
|
-
|
|
147
|
-
5. Before dispatching a worker for that task, record the attempt:
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
keryx flow task attempt <id> <Tn> --outcome started --detail "resumed after session restart"
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
6. Apply the Phase 4 attempt budget against the **persisted** count. If
|
|
154
|
-
`attempts.count` for the task has already reached **five**, do not
|
|
155
|
-
re-dispatch the same approach: go to the re-planning step (Phase 4, PR
|
|
156
|
-
review/fix loop, step 4) and record the decision in `journal.md`.
|
|
157
|
-
7. Run the repetition check before spending an attempt, whatever the count
|
|
158
|
-
says:
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
keryx review loop --flow <id> --task <Tn>
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
A non-zero exit means the same finding recurred or two consecutive rounds
|
|
165
|
-
produced identical output: go straight to the re-planning step, whatever budget is left.
|
|
166
|
-
8. If the flow is `blocked`, read the blocking reason from `journal.md`,
|
|
167
|
-
resolve or escalate it, then `keryx flow unblock <id>`.
|
|
168
|
-
4. If the user wants a new flow, continue at 0.1.
|
|
169
|
-
|
|
170
|
-
Record attempts as they happen, not only on resume:
|
|
76
|
+
### 0.0 State resumption check — every invocation, before asking anything
|
|
171
77
|
|
|
172
|
-
|
|
173
|
-
keryx flow task attempt <id> <Tn> --outcome started|failed|blocked [--detail "<what happened>"]
|
|
174
|
-
```
|
|
78
|
+
The input contract's `mode: "resume"` runs this, but so does every other invocation: a restarted session remembers nothing; the flow package does.
|
|
175
79
|
|
|
176
|
-
|
|
80
|
+
1. Run `keryx flow list`. A flow in `in-progress`, `implemented`, `completing` or `blocked` is interrupted.
|
|
81
|
+
2. If one exists, ask once, with the numbers: "Found an in-flight flow `<id>` '<title>' (status `<status>`, tasks `<done>/<total>`). Resume it, or start a new flow?" Never guess.
|
|
82
|
+
3. On resume:
|
|
83
|
+
1. `keryx flow status <id>`; read `description.md`, `plan.md`, `context.md`, `journal.md` and the frozen `acceptance-criteria.md`.
|
|
84
|
+
2. Read `flow.json` (read-only) for `tasks[].attempts.count` and `tasks[].attempts.log` of every task not `done`. **That is the attempt count. Never count attempts from your own context** — a resumed session starts at zero, the real count does not.
|
|
85
|
+
3. `keryx flow next <id> --json` names the next task (first not `done` whose `dependsOn` are all `done`). Do not derive it from prose.
|
|
86
|
+
4. **Read its `resume` field before dispatching anything:**
|
|
87
|
+
- `never-started` — dispatch normally.
|
|
88
|
+
- `ended` — a retry; the attempt budget applies.
|
|
89
|
+
- `unresolved` — an attempt opened with no recorded end; whether its work landed is UNKNOWN. Inspect the working tree and the task's `evidenceRefs`, then either close the stale attempt (`keryx flow task attempt <id> <Tn> --outcome failed --detail "<what you found>"`) or close the task (`keryx flow task done <id> <Tn>`). Never re-dispatch over an unresolved attempt.
|
|
177
90
|
|
|
178
|
-
|
|
91
|
+
Resolve every other task `keryx flow next` lists under `unresolved` the same way.
|
|
92
|
+
5. Record the attempt before dispatching: `keryx flow task attempt <id> <Tn> --outcome started --detail "resumed after session restart"`.
|
|
93
|
+
6. If the task's persisted `attempts.count` has already reached **five**, do not re-dispatch the same approach: go to the re-planning step (Phase 4 loop, step 5) and journal the decision.
|
|
94
|
+
7. Whatever the count says, run `keryx review loop --flow <id> --task <Tn>` before spending an attempt; a non-zero exit (a recurring finding, or two identical rounds) sends you straight to re-planning.
|
|
95
|
+
8. A `blocked` flow: read the reason in `journal.md`, resolve or escalate it, then `keryx flow unblock <id>`.
|
|
96
|
+
4. A new flow: continue at 0.1.
|
|
179
97
|
|
|
180
|
-
|
|
181
|
-
2. If an active flow obviously matches the user request, use it.
|
|
182
|
-
3. If multiple active flows could match, ask one concise question.
|
|
183
|
-
4. If no flow exists and the request is multi-step, create one:
|
|
98
|
+
Record attempts as they happen, not only on resume: `keryx flow task attempt <id> <Tn> --outcome started|failed|blocked [--detail "<what happened>"]`. The count lives in `flow.json`; a counter in your context resets exactly when the bound matters.
|
|
184
99
|
|
|
185
|
-
|
|
186
|
-
keryx flow init --issue <url>
|
|
187
|
-
```
|
|
100
|
+
### 0.1 Route
|
|
188
101
|
|
|
189
|
-
|
|
102
|
+
1. Reuse the `keryx flow list` output. An active flow that obviously matches the request: use it. Several could match: ask one concise question.
|
|
103
|
+
2. No flow and a multi-step request: create one, always recording the base branch the work must land on:
|
|
190
104
|
|
|
191
|
-
```bash
|
|
192
|
-
keryx flow init --
|
|
193
|
-
|
|
105
|
+
```bash
|
|
106
|
+
keryx flow init --issue <url> --base "<branch>"
|
|
107
|
+
keryx flow init --title "<short formalized problem>" --base "<branch>" [--owner "<name>"]
|
|
108
|
+
```
|
|
194
109
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
gate reads it. Note it in `context.md` and `journal.md` as well if it helps a
|
|
198
|
-
reader, but prose is not what the gate checks: before this flag the base
|
|
199
|
-
survived only as something an agent had written down, which is detectable at
|
|
200
|
-
dispatch and undetectable at completion.
|
|
110
|
+
`--base` puts the base in the record, where the completion gate reads it; prose in `context.md` is not checked.
|
|
111
|
+
3. `keryx flow status <id>` and read the package.
|
|
201
112
|
|
|
202
113
|
## Phase 1: Initialize The Flow Package
|
|
203
114
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
Required context sources:
|
|
115
|
+
Follow `.metaproject/skills/flow/init.md`.
|
|
207
116
|
|
|
208
|
-
-
|
|
209
|
-
- gdctx for compact command/search/diff output;
|
|
210
|
-
- gdwiki for architecture, domain rules, business behavior and decisions;
|
|
211
|
-
- memory for lessons learned, repeated failures and historical constraints;
|
|
212
|
-
- health/testing reports for baseline risk.
|
|
117
|
+
Execution metrics (opt-in): when a USER runs this orchestrator directly, at the start ask "Collect execution statistics for this run? (yes/no)" per `rules/process/execution-metrics.md`. If yes, append the `## Execution Metrics` section at the end and save it under `<flow-dir>/metrics/`. Never ask or emit it when dispatched as a subagent.
|
|
213
118
|
|
|
214
|
-
|
|
119
|
+
Context sources: gdgraph (impacted files, dependencies), gdctx (compact command/search/diff output), gdwiki (architecture, domain rules, decisions), memory (lessons, repeated failures, constraints), health/testing reports (baseline risk).
|
|
215
120
|
|
|
216
|
-
|
|
217
|
-
- `.metaproject/rules/process/implementation-plans.mdc`
|
|
218
|
-
- `.metaproject/rules/process/subagent-context-construction.md`
|
|
219
|
-
- `.metaproject/rules/process/subagent-status-protocol.md`
|
|
220
|
-
- `.metaproject/rules/core/tdd-workflow.mdc`, and per role `.metaproject/rules/activity/implement.mdc`, `test.mdc` or `review.mdc`
|
|
221
|
-
- `.metaproject/rules/stacks/react/code-style-patterns.mdc`
|
|
222
|
-
- `.metaproject/rules/core/error-handling.mdc`
|
|
223
|
-
- `.metaproject/rules/process/implementation-doc-mandate.mdc`
|
|
224
|
-
- `.metaproject/rules/process/execution-metrics.md`
|
|
121
|
+
Rules to read and apply:
|
|
122
|
+
- `.metaproject/rules/process/requirements-management.mdc`, `implementation-plans.mdc`, `implementation-doc-mandate.mdc`, `execution-metrics.md`
|
|
123
|
+
- `.metaproject/rules/process/subagent-context-construction.md`, `subagent-status-protocol.md`
|
|
225
124
|
- `.metaproject/rules/process/git-concurrency.mdc` — no `git stash`, no unscoped `git add`, pin every dispatch to its worktree
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
start ask "Collect execution statistics for this run? (yes/no)" per
|
|
229
|
-
`rules/process/execution-metrics.md`. If yes, append the `## Execution Metrics`
|
|
230
|
-
section at the end and save it under the flow dir (`<flow-dir>/metrics/`). Never
|
|
231
|
-
ask or emit it when dispatched as a subagent.
|
|
125
|
+
- `.metaproject/rules/core/tdd-workflow.mdc`, `.metaproject/rules/core/error-handling.mdc`, and per role `.metaproject/rules/activity/implement.mdc`, `test.mdc` or `review.mdc`
|
|
126
|
+
- `.metaproject/rules/stacks/react/code-style-patterns.mdc`
|
|
232
127
|
|
|
233
128
|
Write or update:
|
|
129
|
+
- `description.md` — problem, expected outcome, out of scope;
|
|
130
|
+
- `context.md` — compact links and findings, not raw dumps;
|
|
131
|
+
- `plan.md` — chosen approach and trade-offs, plus the state × event matrix below;
|
|
132
|
+
- `tasks.md` — task definitions grouped by context, test, implement, review, docs;
|
|
133
|
+
- `acceptance-criteria.md` — verifiable `ACn` criteria, each ending in one marker: [verify: exec `<command>`] or [verify: invariant `<command>`] (a backticked command), [verify: judged] (a human checks: live run, operator decision, text quality), or [verify: none — <reason>]. If a kind is unclear, ask the operator ONE question listing the criteria with proposed kinds, before `flow freeze`. Behaviour with an external dependency or a failure path gets its own failure-scenario criterion with an observable result (saved, error visible, retry creates no duplicate); a check claimed to catch a regression carries `· sensitive: revert|mutation|failure-scenario` and the confirm note carries `evidence: <ref>` (revert/mutation run or failure-scenario reference). Put the marker on every criterion before freeze: an `unclassified` criterion cannot become data afterwards without a recorded rewrite (`keryx flow ac update <id> --criterion ACn --text "…" --reason "<why>"`). `keryx flow ac kinds <id>` shows the kind each criterion parsed to.
|
|
234
134
|
|
|
235
|
-
|
|
236
|
-
- `context.md` - compact links and findings, not raw dumps;
|
|
237
|
-
- `plan.md` - chosen approach and trade-offs;
|
|
238
|
-
- `tasks.md` - task definitions grouped by context, test, implement, review, docs;
|
|
239
|
-
- `acceptance-criteria.md` - verifiable `ACn` criteria, each ending in one marker: [verify: exec `<command>`] or [verify: invariant `<command>`] (a backticked command), [verify: judged] (a human checks: live run, operator decision, text quality), or [verify: none — <reason>]. If a kind is unclear, ask the operator ONE question listing the criteria with proposed kinds, before `flow freeze`. Behaviour with an external dependency or a failure path gets its own failure-scenario criterion with an observable result (saved, error visible, retry creates no duplicate); a check claimed to catch a regression carries `· sensitive: revert|mutation|failure-scenario` and the confirm note carries `evidence: <ref>` (revert/mutation run or failure-scenario reference).
|
|
135
|
+
### State × event matrix in plan.md
|
|
240
136
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
When the scope touches UI, a store, or other code that holds state across events, `plan.md` carries a state × event matrix before `flow freeze`. Rows are the states the surface can be in (for example loading, loaded, empty, missing, first-load failed, refresh failed); columns are the events that reach it (for example the user switches selection, unmount, workspace or context change, retry). Each cell is one line: what the user sees and which state survives, citing the project's styling/UX rules where they decide it. Every non-trivial cell gets an `ACn` row, or one AC per group of cells with the same result; a cell that is genuinely "no change" needs none. List only the states and events the change reaches:
|
|
137
|
+
When the scope touches UI, a store, or other code that holds state across events, `plan.md` carries a state × event matrix before `flow freeze`. Rows are the states the surface can be in (loading, loaded, empty, missing, first-load failed, refresh failed); columns are the events that reach it (selection change, unmount, workspace or context change, retry). Each cell is one line: what the user sees and which state survives, citing the project's styling/UX rules where they decide it. List only the states and events the change reaches. Every non-trivial cell gets an `ACn` (or one AC per group of cells with the same result); a "no change" cell needs none.
|
|
244
138
|
|
|
245
139
|
| state \ event | user switches selection | unmount | retry |
|
|
246
140
|
|---|---|---|---|
|
|
247
141
|
| loading | drop the stale response; loading shows for the new one | no state write after unmount | — |
|
|
248
142
|
| refresh failed | keep loaded data; the error does not follow to the new selection | — | re-fetch; error stays inline until success |
|
|
249
143
|
|
|
250
|
-
|
|
144
|
+
No UI or state in scope (CLI output, pure functions, docs, build config): write `State × event matrix: not applicable — <why>` in `plan.md`. Workers and fix rounds check behaviour against the matrix; a choice no cell decides is a `behavior_changes` question for the operator (Phase 2).
|
|
251
145
|
|
|
252
146
|
### A verification step in the plan is a task, not a sentence
|
|
253
147
|
|
|
254
|
-
Every check the plan says must happen before the work is accepted
|
|
255
|
-
|
|
256
|
-
The failure this prevents is specific and has happened: a plan listed "confirm both components agree on the same input" as step 5, the implementation shipped without it, and review found that the two did not agree at all - the change could not work in production. The check had been identified correctly and then skipped, because nothing made skipping it visible.
|
|
257
|
-
|
|
258
|
-
Tasks are the mechanism for this. `keryx flow complete` runs a `tasks` gate over them, so an unrun verification step keeps the flow open instead of being quietly dropped.
|
|
148
|
+
Every check the plan says must happen before the work is accepted — run it end to end, confirm two components agree, exercise the path no test covers — is added with `keryx flow task add <id> --title "<check>" --kind verify` and closed with `keryx flow task done`. Prose in `plan.md` blocks nothing; a task is what `keryx flow complete`'s `tasks` gate reads. Close a task that turned out unneeded with `keryx flow task done <id> <Tn> --disposition skipped --reason "<why it was not needed>"`; a `failed`, `blocked` or reasonless `skipped` task fails the gate. If the `tasks` line of `flow check-complete`/`flow complete` says `skipped` (a package older than the gate), the gate did not run: verify the task list by hand.
|
|
259
149
|
|
|
260
|
-
|
|
150
|
+
### A flow sourced from a finding: check its premise before freeze
|
|
261
151
|
|
|
262
|
-
-
|
|
263
|
-
- a task fails the gate when its status is not `done`; when its disposition is `failed`; when its disposition is `blocked` (terminal, but the work did not happen — and the harness emits this disposition on its own for a run that ended blocked); when its disposition is `skipped` with no recorded reason; or when its disposition is a value this build does not recognise. An unrecognised disposition FAILS rather than falling through: a gate whose default for the unknown case is "pass" is not a gate;
|
|
264
|
-
- to close a task as deliberately not needed, record why:
|
|
152
|
+
A follow-up issue filed from a review, or an external review comment, is a premise to check, not a settled requirement. Before `flow freeze`, dispatch `review-premise` with `source: follow-up-issue` or `external-comment` and the finding shaped as its Input Contract `source` row says (the issue number or the comment's `C-NNN` as `id`, its URL as `url`). Skip it when the dispatch says the premise is already recorded (`review-pr-feedback` rule 7 sends a `premise:` constraint). No review package exists, so no `ingest` or `decide-premise` runs: save its claims as `<flow-dir>/premise/<n>.json`, and apply every refusal of the merge by hand, as that `source` row lists them (`PREMISE_REJECTION_REASONS`, `src/review/premise.ts`): a refused claim leaves the finding upheld. On `challenged` or `owner-decision` ask the operator its question with its options (`ask_user` in keryx shell, the host's question tool elsewhere), journal their answer, and plan only what the operator upholds.
|
|
265
153
|
|
|
266
|
-
|
|
267
|
-
keryx flow task done <id> <Tn> --disposition skipped --reason "<why it was not needed>"
|
|
268
|
-
```
|
|
154
|
+
### Freeze and start
|
|
269
155
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
**A flow sourced from a finding: check its premise before freeze.** A follow-up issue filed from a review, or an external review comment, is a premise to check, not a settled requirement. Before `flow freeze`, dispatch `review-premise` with `source: follow-up-issue` or `external-comment` and the finding shaped as its Input Contract `source` row says (the issue number or the comment's `C-NNN` as `id`, its URL as `url`). Skip it when the dispatch says the premise is already recorded (`review-pr-feedback` rule 7 sends a `premise:` constraint). No review package exists, so no `ingest` or `decide-premise` runs: save its claims as `<flow-dir>/premise/<n>.json`, and apply every refusal of the merge by hand, as that `source` row lists them (`PREMISE_REJECTION_REASONS`, `src/review/premise.ts`): a refused claim leaves the finding upheld. On `challenged` or `owner-decision` ask the operator its question with its options (`ask_user` in keryx shell, the host's question tool elsewhere), journal their answer, and plan only what the operator upholds.
|
|
273
|
-
|
|
274
|
-
Then freeze and start (`--yes`: the operator already answered the kinds question, so the freeze must not prompt):
|
|
156
|
+
`--yes`: the operator already answered the kinds question, so the freeze must not prompt.
|
|
275
157
|
|
|
276
158
|
```bash
|
|
277
159
|
keryx flow freeze <id> --yes
|
|
278
160
|
keryx flow start <id>
|
|
279
161
|
```
|
|
280
162
|
|
|
281
|
-
|
|
163
|
+
Then publish `T1`…`Tn` to the plan (plan bridge).
|
|
282
164
|
|
|
283
|
-
|
|
165
|
+
## Phase 2: Execute Tasks
|
|
284
166
|
|
|
285
|
-
|
|
167
|
+
Use existing gdskills as workers; do not duplicate their internal workflows, and never do a task's work yourself.
|
|
286
168
|
|
|
287
169
|
| Flow task kind | Worker skill |
|
|
288
170
|
|---|---|
|
|
289
171
|
| `context` | `context-collector` |
|
|
290
172
|
| `test` | `tests-creator` or `test-gen` |
|
|
291
173
|
| `implement` | `task-implementer` |
|
|
292
|
-
| `review` | `review-orchestrator` |
|
|
174
|
+
| `review` | `review-orchestrator` (inline, Phase 3) |
|
|
293
175
|
| `docs` | `prd-creator`, a documentation-specific project skill, or `keryx job document` to file a document in a job folder |
|
|
294
176
|
|
|
295
|
-
|
|
177
|
+
### Once, before the first dispatch
|
|
178
|
+
|
|
179
|
+
- **Worktree.** `<worktree_path>` is the absolute root of the checkout this flow's work happens in (the git worktree, or the project root in the main checkout). Resolve it with `git rev-parse --show-toplevel`, check `git -C <worktree_path> branch --show-current` is the branch the work belongs on, and pin every dispatch to it (`rules/process/git-concurrency.mdc`, "Pinning A Dispatch To Its Worktree").
|
|
180
|
+
- **Edit guard.** Before the first `task-implementer` dispatch of the run, when `review.jev.edit_guard` is on (`.metaproject/tasks.config.json`), confirm the guard is active — `keryx review jev-edit-guard status`, else `keryx review jev-edit-guard install` — and say why in one line.
|
|
296
181
|
|
|
297
|
-
###
|
|
182
|
+
### Per dispatch
|
|
298
183
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
`subagent-dispatch`
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
line is `STATUS: <status>`
|
|
306
|
-
(`.metaproject/rules/process/subagent-status-protocol.md`).
|
|
184
|
+
1. **Resolve project context.** Before every `test`, `implement` and fix dispatch, run `keryx skills resolve-context --for test|implement --files <the task's target files, comma-joined> --task-type <type> --task-text '<the task's title and description>' --out .metaproject/flows/<dir>/resolved/<Tn>.<for>.json` (a fix dispatch re-resolves on the new head) and pass that path as `resolved_context_file`: a `context_refs` entry plus the constraint below. Single-quote the text (a `'` inside becomes `'\''`): double quotes let the shell run a backtick or `$(...)` from the description. `--task-text` (`task_text` in the harness and MCP) is what lets a `references.json` keyword match; without it only globs promote.
|
|
185
|
+
2. **Record the attempt:** `keryx flow task attempt <id> <Tn> --outcome started --detail "<dispatch_id>"`.
|
|
186
|
+
3. **Build the dispatch** — a `subagent-dispatch` (`.metaproject/core/gdskills/contracts/subagent-dispatch.schema.json`); workers inherit no session state (`rules/process/subagent-context-construction.md`). Tick the Worker brief below, then `keryx skills contracts validate <dispatch.json> --schema subagent-dispatch` and fix what it names.
|
|
187
|
+
4. **Dispatch**, then read the reply by the STATUS table.
|
|
188
|
+
5. **Validate the reply** before accepting it: `keryx skills contracts validate <result.json> --schema task-implementer-output|tests-creator-output --resolved <that file>`. Under `gdskills.projectContext.enforcement: block` a miss is a refusal (re-dispatch); under `warn`, journal it. It checks that each promoted `must_read` entry (reason `condition:glob:<g>` or `condition:keyword:<k>`) is cited in `project_context_applied` with `path`, whole-file `sha256`, `anchor`, a `summary` in the worker's words and `how` `read` or `followed`.
|
|
189
|
+
6. **Boundary commit, then `keryx flow task done`** (below).
|
|
307
190
|
|
|
308
|
-
|
|
309
|
-
happens in: the git worktree the flow runs in, or the project root when it runs
|
|
310
|
-
in the main checkout. Resolve it once, before the first dispatch
|
|
311
|
-
(`git rev-parse --show-toplevel` from that checkout), check
|
|
312
|
-
`git -C <worktree_path> branch --show-current` is the branch the work belongs
|
|
313
|
-
on, and pin every dispatch to it (`rules/process/git-concurrency.mdc`, "Pinning A
|
|
314
|
-
Dispatch To Its Worktree").
|
|
191
|
+
### Worker brief — required contents (every dispatch)
|
|
315
192
|
|
|
316
|
-
|
|
317
|
-
auto-commit off (task-implementer's `automation.auto_commit: false`). A
|
|
318
|
-
`subagent-dispatch` has no `automation` field, so the setting travels as the
|
|
319
|
-
explicit constraint below — never as the worker's default, which is `true`.
|
|
193
|
+
A line left out is a defect of the brief, whatever schema validation says. Pointers, not paraphrases: give paths and do not restate their text.
|
|
320
194
|
|
|
321
|
-
|
|
195
|
+
- [ ] A `run_id` = flow id; `dispatch_id` = `<flow-id>-<Tn>`, the same across retries of that task.
|
|
196
|
+
- [ ] B `target_skill` from the routing table; `task` = title, description, `intent`.
|
|
197
|
+
- [ ] C `acceptance_criteria` = the frozen `ACn` lines this task must satisfy, verbatim.
|
|
198
|
+
- [ ] D `context_refs` = the flow's `context.md`, `plan.md`, `acceptance-criteria.md`, and the resolved file of step 1.
|
|
199
|
+
- [ ] E `files_to_read` = only the files gdgraph/gdctx narrowed to.
|
|
200
|
+
- [ ] F `constraints`, every one of: never edit `flow.json`; never edit frozen AC; the `resolved_context_file:` line; return a `subagent-result` whose first line is `STATUS:`; the agent-conduct "Dispatch form" line verbatim; git-concurrency (no `git stash`, no `git add -A`); the `Root:` pin to `<worktree_path>`; auto-commit off.
|
|
201
|
+
- [ ] G `allowed_actions`, `output_contract` (`subagent-result`, artifact `journal.md`), `budget`, `provenance`.
|
|
202
|
+
- [ ] H Fix dispatch only: `fix_context.review_feedback` = each finding's `id` and `suggested_fix` (held findings never), reviewers' red probes as `test_case_specs`, and `premise_verdict`/`premise_answer` for an upheld held finding (Phase 3 step 6).
|
|
322
203
|
|
|
323
|
-
|
|
204
|
+
Workers do not commit: you own every commit. A `subagent-dispatch` has no `automation` field, so auto-commit off travels as the constraint below — task-implementer's own default is `true`.
|
|
324
205
|
|
|
325
206
|
```json
|
|
326
207
|
{
|
|
@@ -354,12 +235,23 @@ Dispatch payload, bound to the flow (map `target_skill` from the routing table):
|
|
|
354
235
|
}
|
|
355
236
|
```
|
|
356
237
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
`
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
238
|
+
### Reading the reply (STATUS protocol)
|
|
239
|
+
|
|
240
|
+
Read the `STATUS:` line first; never infer the outcome from prose (`rules/process/subagent-status-protocol.md`). A reply without one is `NEEDS_CONTEXT`: re-request one properly formatted `subagent-result`.
|
|
241
|
+
|
|
242
|
+
| Worker `status` | Action |
|
|
243
|
+
|---|---|
|
|
244
|
+
| `DONE` | Accept, boundary commit, `keryx flow task done <id> <Tn>`. |
|
|
245
|
+
| `DONE_WITH_CONCERNS` | Accept, boundary commit, record every concern in `journal.md`, decide continue vs. a fix task, then `flow task done`. Never drop a concern. |
|
|
246
|
+
| `NEEDS_CONTEXT` | Not a failure. Enrich `context_refs`/`files_to_read` from gdgraph/gdctx/wiki/memory and re-dispatch the same `dispatch_id`. |
|
|
247
|
+
| `BLOCKED` | `keryx flow task attempt <id> <Tn> --outcome blocked --detail "<worker reason>"`, `keryx flow block <id> --reason "<worker reason>"`; resolve or escalate one concise question, `flow unblock`, re-dispatch. Never implement it yourself. |
|
|
248
|
+
| `FAILED` | Only harness child workers emit it (`src/harness/child/contract.ts`; `task-implementer` maps its `failed` onto `BLOCKED`). Retry once with the same dispatch; a second failure blocks the flow and goes to the user. |
|
|
249
|
+
|
|
250
|
+
**A `behavior_changes` entry with `needs_operator: true` is a question, not a concern to journal.** Before accepting that result, ask the operator with the question tool — one question per entry, the implemented choice and each of its `alternatives` as options — and record the answer in `journal.md`. An answer other than the implemented one is a fix task on the same `Tn` before the boundary commit.
|
|
251
|
+
|
|
252
|
+
### Task boundary commit
|
|
253
|
+
|
|
254
|
+
After every accepted result (`DONE` or `DONE_WITH_CONCERNS`), commit exactly the worker's `changed_files` that git still shows as changed — never `-A`/`--all`/`.` (`rules/process/git-concurrency.mdc` rule 4) — then mark the task done. Nothing left (a worker that reported no files, or committed its own stubs like tests-creator) skips cleanly:
|
|
363
255
|
|
|
364
256
|
```bash
|
|
365
257
|
set -- <each changed_files path, single-quoted: 'src/a.ts' 'docs/b c.md'> # may be none; an unquoted path with a space splits and is skipped
|
|
@@ -378,48 +270,16 @@ fi
|
|
|
378
270
|
keryx flow task done <id> <Tn>
|
|
379
271
|
```
|
|
380
272
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
If new work is discovered:
|
|
384
|
-
|
|
385
|
-
```bash
|
|
386
|
-
keryx flow task add <id> --title "<task>" --kind <kind>
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
### Interpreting worker results (STATUS protocol)
|
|
390
|
-
|
|
391
|
-
Read the worker's `STATUS:` line first; never infer the outcome from prose. A
|
|
392
|
-
reply with no `STATUS:` line is treated as `NEEDS_CONTEXT` — re-request one
|
|
393
|
-
properly formatted `subagent-result`.
|
|
394
|
-
|
|
395
|
-
| Worker `status` | flow-orchestrator action |
|
|
396
|
-
|---|---|
|
|
397
|
-
| `DONE` | Accept, run the task boundary commit (above), `keryx flow task done <id> <Tn>`. Continue. |
|
|
398
|
-
| `DONE_WITH_CONCERNS` | Accept, run the task boundary commit (above), record every concern in `journal.md`, decide continue vs. add a fix task, then `flow task done`. Never silently drop concerns. |
|
|
399
|
-
| `NEEDS_CONTEXT` | Do not fail. Enrich `context_refs`/`files_to_read` from gdgraph/gdctx/wiki/memory, then re-dispatch the same `dispatch_id`. |
|
|
400
|
-
| `BLOCKED` | `keryx flow block <id> --reason "<worker reason>"`; resolve or escalate one concise question, then `flow unblock` and re-dispatch. |
|
|
401
|
-
| `FAILED` | Emitted by harness **child** workers (`src/harness/child/contract.ts`), never by skill workers — `task-implementer` maps its own `failed` onto `BLOCKED`. Retry once with the same dispatch. If it fails again, block the flow and surface the error to the user. |
|
|
402
|
-
|
|
403
|
-
**A `behavior_changes` entry with `needs_operator: true` is a question, not a concern to journal.** task-implementer lists every user-visible tradeoff it made (message wording, error placement, state reset) there. Before accepting that result, ask the operator with the question tool — one question per entry, the implemented choice and each of its `alternatives` as options — and record the answer in `journal.md`. An answer other than the implemented one is a fix task on the same `Tn` before the boundary commit, not a review finding later.
|
|
404
|
-
|
|
405
|
-
Carry `run_id`/`dispatch_id` across retries so the flow journal stays traceable,
|
|
406
|
-
and record every dispatch against the task's persisted counter so a session
|
|
407
|
-
restart does not reset the budget:
|
|
408
|
-
|
|
409
|
-
```bash
|
|
410
|
-
keryx flow task attempt <id> <Tn> --outcome started --detail "<dispatch_id>"
|
|
411
|
-
# on a BLOCKED or unusable reply, before re-dispatching:
|
|
412
|
-
keryx flow task attempt <id> <Tn> --outcome blocked --detail "<worker reason>"
|
|
413
|
-
```
|
|
273
|
+
The per-path check and the trailing `-- "${PENDING[@]}"` keep a file another lane staged out of this commit. New work discovered on the way: `keryx flow task add <id> --title "<task>" --kind <kind>`.
|
|
414
274
|
|
|
415
275
|
## Phase 3: Verification And Review
|
|
416
276
|
|
|
417
277
|
Before accepting implementation:
|
|
418
278
|
|
|
419
|
-
1. Run focused tests for touched scope.
|
|
279
|
+
1. Run focused tests for the touched scope.
|
|
420
280
|
2. Run `code-verifier`.
|
|
421
281
|
3. Run `keryx health run` when Code Health is enabled.
|
|
422
|
-
4. **First-green gate, once per flow.** The first time every implement/test task is `done` and steps 1–3 pass, ask the operator one question (question tool, options) before any review round: `issue AC met — open the PR with the standard review`, or `harden first` with each extra matrix cell or failure path you would add as its own option.
|
|
282
|
+
4. **First-green gate, once per flow.** The first time every implement/test task is `done` and steps 1–3 pass, ask the operator one question (question tool, options) before any review round: `issue AC met — open the PR with the standard review`, or `harden first` with each extra matrix cell or failure path you would add as its own option. Journal the answer; picked hardening becomes `keryx flow task add` tasks (plus `keryx flow ac update` when it adds criteria) before review. A dispatched run has no operator: it takes the standard review and journals that the dispatch answered the gate.
|
|
423
283
|
5. Check the bounds, then run `review-orchestrator` with relevant domains — in this session,
|
|
424
284
|
never handed whole to one subagent: one without a dispatch tool returns `STATUS: BLOCKED`.
|
|
425
285
|
```bash
|
|
@@ -427,36 +287,21 @@ Before accepting implementation:
|
|
|
427
287
|
```
|
|
428
288
|
A non-zero exit means the spend ceiling (3 USD by default) has been reached:
|
|
429
289
|
**stop and ask the user** rather than dispatching another fan-out — never shrink the fan-out to fit.
|
|
290
|
+
Pass `--outstanding` every time: keryx cannot see subagents running in this session, so without it the cap bounds nothing. `--full` for `--all`.
|
|
430
291
|
Dispatch prompts point at sources (files, SHAs, the PR) and never paraphrase a contract.
|
|
431
292
|
Every round opens with `keryx review start` on the current head, never a hand-built range (Phase 4 loop, step 1).
|
|
293
|
+
6. Findings that need code changes: a fix round through `task-implementer`, recorded as a flow fix task:
|
|
294
|
+
- **Scope freeze.** A fix round fixes the round's findings and nothing else. Hardening, refactors or new cells a fix suggests go to the operator as a question (as in step 4).
|
|
295
|
+
- **Red probes → ONE implementer.** Reviewers' red probes (failing tests or commands on the findings) go as `test_case_specs` to one `task-implementer` dispatch — no separate `tests-creator` task. `tests-creator` runs only for a new contract no probe covers.
|
|
296
|
+
- **A held finding is not fixed.** A finding `review-premise` held (`challenged` or `owner-decision`) is neither fixable nor clean: it never goes into `fix_context.review_feedback` and it blocks the loop until answered. Ask the operator as `review-orchestrator` "Wave D" says (the card in keryx shell; elsewhere the host's question tool, naming the finding id, then `keryx review decide-premise` with `--answered-by <source>:<ref> --answer-text … --question-text …`) and journal the answer; only an upheld finding enters a fix round, carrying `premise_verdict` and `premise_answer` as task-implementer's `FIX_CONTEXT` defines them. A dispatched run leaves it held and journals it.
|
|
297
|
+
- **`suggested_fix` is a hypothesis.** Pass each finding's `id` and `suggested_fix` in `fix_context.review_feedback`; the implementer reproduces it (red), checks the suggestion against the state × event matrix, then fixes (task-implementer 1.3). Journal every `suggested_fix diverged` / `did not reproduce` note it returns.
|
|
298
|
+
7. Close the skill-learning loop (`rules/process/skill-lifecycle.mdc`). Collect the `skill_drift` fields from task-implementer results and the `## Skill Learning` block from review-orchestrator. For each flagged project skill, dispatch a subagent — on a cheaper model if `keryx review tier --findings 1 --diff-lines 0` resolves one (`rules/process/model-selection.mdc`), otherwise the session model — to run `keryx skills learn --from-review <report> --skill <m>/<s>` and return the proposal. Read it, then `skills learn apply` it or discard it. Never apply unread; never put `learn` in a hook. Record applied updates in the completion report.
|
|
432
299
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
6. If findings require code changes, run a fix round through `task-implementer`, recorded as a flow fix task:
|
|
436
|
-
- **Scope freeze.** A fix round fixes the round's findings and nothing else. Hardening, refactors or new cells a fix suggests go to the operator as a question (as in step 4); never grow scope inside a fix round.
|
|
437
|
-
- **Red probes → ONE implementer.** When reviewers left red probes (failing tests or commands on the findings), pass them as `test_case_specs` to one `task-implementer` dispatch — no separate `tests-creator` task. `tests-creator` runs only for a new contract no probe covers.
|
|
438
|
-
- **A held finding is not fixed.** A finding `review-premise` held (`challenged` or `owner-decision`) is neither fixable nor clean: it never goes into `fix_context.review_feedback` and it blocks the loop until answered. Ask the operator about it as `review-orchestrator` "Wave D" says (the card in keryx shell; elsewhere the host's question tool, naming the finding id, then `keryx review decide-premise` with `--answered-by <source>:<ref> --answer-text … --question-text …` to record the answer) and journal the recorded answer; only an upheld finding enters a fix round, carrying `premise_verdict` and `premise_answer` as task-implementer's `FIX_CONTEXT` defines them. A dispatched run leaves it held and journals it.
|
|
439
|
-
- **`suggested_fix` is a hypothesis.** Pass each finding's `id` and `suggested_fix` in `fix_context.review_feedback`; the implementer reproduces the finding (red), checks the suggestion against the state × event matrix, then fixes (task-implementer 1.3). Journal every `suggested_fix diverged` / `did not reproduce` note it returns.
|
|
440
|
-
7. Close the skill-learning loop (see `rules/process/skill-lifecycle.mdc`). Collect
|
|
441
|
-
the `skill_drift` fields from task-implementer results and the
|
|
442
|
-
`## Skill Learning` block from review-orchestrator. For each flagged
|
|
443
|
-
project-skill, dispatch a subagent — on a cheaper / non-flagship model if one
|
|
444
|
-
is available (`keryx review tier --findings 1 --diff-lines 0` resolves one from runtime
|
|
445
|
-
provider detection; see `rules/process/model-selection.mdc`), otherwise the session model — to run
|
|
446
|
-
`keryx skills learn --from-review <report> --skill <m>/<s>` and return the
|
|
447
|
-
proposal. Then read the proposal and `skills learn apply` it, or discard it.
|
|
448
|
-
Never apply unread; never put `learn` in a hook.
|
|
449
|
-
|
|
450
|
-
The implementer never self-accepts. Only flow-orchestrator decides whether the
|
|
451
|
-
flow can move to `implemented`. Record any applied skill updates in the
|
|
452
|
-
completion report.
|
|
300
|
+
The implementer never self-accepts: only you decide whether the flow can move to `implemented`.
|
|
453
301
|
|
|
454
302
|
## Phase 4: Completion Choice
|
|
455
303
|
|
|
456
|
-
When tasks, verification and review are complete:
|
|
457
|
-
|
|
458
|
-
1. Stop before creating a PR or changing the flow to `implemented`.
|
|
459
|
-
2. Ask the user how to finish. Do not infer that every flow needs a PR:
|
|
304
|
+
When tasks, verification and review are complete, stop before creating a PR or changing the flow to `implemented`, and ask the user how to finish (question tool; no default, wait for the answer). Not every flow needs a PR:
|
|
460
305
|
|
|
461
306
|
```text
|
|
462
307
|
How should this flow end?
|
|
@@ -464,179 +309,79 @@ How should this flow end?
|
|
|
464
309
|
A) Create a PR, review it, merge it into the flow's base branch, and complete the managed flow
|
|
465
310
|
B) Finish with a verified handoff and no PR
|
|
466
311
|
C) Keep the flow open for more work
|
|
467
|
-
|
|
468
|
-
> pick a letter (no default; wait for the user)
|
|
469
312
|
```
|
|
470
313
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
- **
|
|
474
|
-
opened against the base recorded at initialization. Do not mark the flow
|
|
475
|
-
implemented or complete before the PR is merged into that branch.
|
|
476
|
-
|
|
477
|
-
`keryx flow complete` now checks this rather than asking you to confirm it by
|
|
478
|
-
eye: its `base-branch` condition compares where the merge landed against the
|
|
479
|
-
base in the record, and refuses when they differ. It reports three states,
|
|
480
|
-
and only one of them is a pass — a flow that recorded no base gets
|
|
481
|
-
`not recorded`, which is not a pass either. So the useful thing to do here is
|
|
482
|
-
make sure the base WAS recorded, not to re-verify the merge yourself.
|
|
314
|
+
- **A — Create PR and merge:** create or confirm a PR in the author's name against the base recorded at init, run the PR review/fix loop below, merge, then `keryx flow implemented`. Never mark the flow implemented or complete before the merge into that base. The `base-branch` gate of `keryx flow complete` compares where the merge landed with the recorded base; a flow with no recorded base fails it (`not recorded`), so make sure `--base` was recorded at init.
|
|
315
|
+
- **B — Verified handoff without PR:** no PR, no `keryx flow implemented`, no `keryx flow complete`. Produce the completion report with verification and acceptance-criteria evidence, record that the implementation work is finished, and leave the flow `in-progress`, explaining that the CLI requires a recorded PR before it can move the flow to `done`.
|
|
316
|
+
- **C — Keep open:** record remaining or deferred work in `journal.md`, report the current verification state, leave the flow `in-progress` for resume.
|
|
483
317
|
|
|
484
318
|
### A dispatched run answers the question from its input
|
|
485
319
|
|
|
486
|
-
The choice
|
|
487
|
-
skill is dispatched by another skill the answer arrives in the input, and asking
|
|
488
|
-
anyway is how a dispatched run stalls forever on a prompt nobody will read.
|
|
489
|
-
|
|
490
|
-
Read it from the **typed fields**, and validate them first:
|
|
320
|
+
The choice is the USER's, and a subagent has no user to ask: a dispatched run that asks stalls on a prompt nobody reads. Validate the input first:
|
|
491
321
|
|
|
492
322
|
```bash
|
|
493
323
|
keryx skills contracts validate <dispatch.json> --schema flow-orchestrator-input
|
|
494
324
|
```
|
|
495
325
|
|
|
496
|
-
`base_branch`, `completion_outcome` and `operator_confirmed` are properties of
|
|
497
|
-
that contract, not constraint strings. The distinction is the whole point:
|
|
498
|
-
nothing parses `constraints[]`, so a load-bearing value misspelled there is
|
|
499
|
-
dropped in silence and the run merges wherever it resolved a base on its own.
|
|
500
|
-
`constraints[]` carries advisory scope and policy — never a merge target.
|
|
501
|
-
|
|
502
|
-
`completion_outcome` is **required** by the contract, so an absent one is a
|
|
503
|
-
refused dispatch rather than a question. That is deliberate: the previous rule
|
|
504
|
-
here said "ask", prescribed fourteen lines after this section says asking is how
|
|
505
|
-
a dispatched run stalls on a prompt nobody reads — and it left the
|
|
506
|
-
`create-pr-and-merge` conditional reachable-around by simply omitting the field.
|
|
507
|
-
A dispatched run that cannot name its outcome returns **BLOCKED** naming the
|
|
508
|
-
missing field. Only an interactive run asks. Record in `journal.md` which field
|
|
509
|
-
answered it and who is behind it.
|
|
326
|
+
`base_branch`, `completion_outcome` and `operator_confirmed` are properties of that contract, not constraint strings. Nothing parses `constraints[]`, so a value placed there is dropped in silence; `constraints[]` carries advisory scope and policy — never a merge target. `completion_outcome` is required: a dispatched run without it returns **BLOCKED** naming the missing field. Only an interactive run asks. Journal which field answered and who is behind it.
|
|
510
327
|
|
|
511
328
|
| Input | Obey it as |
|
|
512
329
|
|---|---|
|
|
513
|
-
| `base_branch` | Cut the flow branch from **that** branch and merge back into it. Never substitute the repository default: a fix aimed at a pull request's own branch
|
|
514
|
-
| `completion_outcome: create-pr-and-merge` | Skip the Completion Choice question and run the PR review/fix loop. Merge into `base_branch` only on the explicit merge ask (`rules/process/agent-conduct.mdc` rule 2)
|
|
515
|
-
| `operator_confirmed` | The human decision behind an outward-facing completion.
|
|
516
|
-
| `review: the caller owns the reply on #<n>` | Pass it through to every `review-orchestrator` dispatch. Reviews of **this flow's own** PR reply as normal — that is a separate conversation
|
|
517
|
-
| `attempt budget: at most <n> attempts` | A
|
|
518
|
-
| `completion: <anything>` as a constraint STRING | **Not an outcome. Refuse it and ask for the typed field.**
|
|
519
|
-
|
|
520
|
-
A constraint that would raise this skill's own attempt budget is **not** obeyed.
|
|
521
|
-
The five-attempt bound and the `keryx review loop` repetition check are this
|
|
522
|
-
skill's, they are evidence-backed, and a caller asking for "loop until clean" gets
|
|
523
|
-
the bound plus an escalation — never an unbounded loop.
|
|
524
|
-
|
|
525
|
-
### PR review/fix loop
|
|
330
|
+
| `base_branch` | Cut the flow branch from **that** branch and merge back into it. Never substitute the repository default: a fix aimed at a pull request's own branch lands inside that pull request. Absent: resolve the base yourself and record what you resolved. |
|
|
331
|
+
| `completion_outcome: create-pr-and-merge` | Skip the Completion Choice question and run the PR review/fix loop. Merge into `base_branch` only on the explicit merge ask (`rules/process/agent-conduct.mdc` rule 2), which for a dispatch is `operator_confirmed`: it must name the human who asked. |
|
|
332
|
+
| `operator_confirmed` | The human decision behind an outward-facing completion. |
|
|
333
|
+
| `review: the caller owns the reply on #<n>` | Pass it through to every `review-orchestrator` dispatch. Reviews of **this flow's own** PR reply as normal — that is a separate conversation; the round must not answer `#<n>`. |
|
|
334
|
+
| `attempt budget: at most <n> attempts` | A ceiling BELOW your own bound is obeyed; one at or above it is not. |
|
|
335
|
+
| `completion: <anything>` as a constraint STRING | **Not an outcome. Refuse it and ask for the typed field.** |
|
|
526
336
|
|
|
527
|
-
|
|
528
|
-
2. If findings (held ones aside: Phase 3 step 6) or required check failures remain, run a fix round under Phase 3 step 6 (flow fix task, `task-implementer`), push the fix, and run the next round as in step 1.
|
|
337
|
+
A constraint that would raise this skill's own attempt budget is **not** obeyed. The five-attempt bound and the `keryx review loop` repetition check are this skill's; "loop until clean" gets the bound plus an escalation, never an unbounded loop.
|
|
529
338
|
|
|
530
|
-
|
|
339
|
+
### PR review/fix loop
|
|
531
340
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
an attempt when review/check results are available, including a clean result,
|
|
535
|
-
and record it with `keryx flow task attempt <id> <Tn> --outcome ...` so the
|
|
536
|
-
count survives a session restart. Read the budget from that task's
|
|
537
|
-
`attempts.count` in `flow.json`, never from this session's memory.
|
|
341
|
+
1. Each round — the first and every one after a fix — is `keryx review start` on the PR's current head, then `review-orchestrator` from that package (Phase 3 step 5). `review start` finds the previous round itself and, when the previously reviewed head is an ancestor, reviews the delta with the prior findings attached. Never pass a whole-branch range or `--all` per round; `<package>/round.json` records the round, its source and its mode.
|
|
342
|
+
2. Findings (held ones aside: Phase 3 step 6) or required check failures remain: run a fix round under Phase 3 step 6, push the fix, run the next round as in step 1.
|
|
538
343
|
|
|
539
|
-
|
|
540
|
-
iterations account for most achievable gains"*
|
|
541
|
-
([arXiv:2607.05197](https://arxiv.org/abs/2607.05197)); correctness falls
|
|
542
|
-
**0.820 -> 0.673** across two forced revisions while cumulative ever-correct
|
|
543
|
-
is **0.847** ([arXiv:2607.24604](https://arxiv.org/abs/2607.24604)) — the
|
|
544
|
-
agent finds the fix and then destroys it, throwing away ~15 points by not
|
|
545
|
-
stopping. Other agent tools hardcode the same bound (`max_reflections = 3`).
|
|
546
|
-
Rounds four through six of a self-fix loop were not buying convergence; they
|
|
547
|
-
were buying regressions. Review rounds are the exception, as stated above.
|
|
344
|
+
**A required check failure is not automatically a fix task.** When `review.jev.ci_triage` is on, run `keryx review ci-triage --run <id> --json` on each failed run first: `top: flaky` (or a `deterministic` override) → rerun once (`gh run rerun --failed <id>`), journal it, and treat a second failure as `real-regression`; `top: real-regression` → investigate and fix; `top: infra` → report it in the completion notes and leave the code alone. The verdict is advisory, never the sole reason to skip a fix task.
|
|
548
345
|
|
|
549
|
-
|
|
550
|
-
|
|
346
|
+
**The threshold is `minor`.** The loop exits when the round reports zero findings at `blocker`, `major` or `minor` that are not held, and no held finding awaits the operator; `info` does not hold it. While a held finding is unanswered, run no fix round for it and stop to ask (unattended: stop and report the held list). List the remaining `info` findings in the completion report instead of fixing them. A caller may lower the threshold in `constraints`; it cannot raise it to merge over a `minor`.
|
|
347
|
+
3. Allow at most **five** review/fix attempts for the current approach (loop while attempts < 5). Count an attempt when review/check results are available, a clean result included, and record it with `keryx flow task attempt <id> <Tn> --outcome ...`; read the budget from that task's `attempts.count` in `flow.json`, never from memory. Five by operator decision (message 178020: review findings surface across rounds, and the repetition check stops a loop that is not converging); self-fix loops in `task-implementer` and `job-orchestrator` stay at three, where the evidence is: most gains come in the first three to four repair iterations ([arXiv:2607.05197](https://arxiv.org/abs/2607.05197)), correctness falls 0.820 → 0.673 across two forced revisions ([arXiv:2607.24604](https://arxiv.org/abs/2607.24604)), and other agent tools hardcode `max_reflections = 3`.
|
|
348
|
+
4. **Before** spending an attempt, however much budget is left, run `keryx review loop --flow <id> --task <Tn>`. A non-zero exit (the same finding in two rounds, or two consecutive identical rounds) escalates to step 5 now.
|
|
349
|
+
5. Fifth attempt not clean, **or the repetition check escalated**: do not repeat the same loop. Enrich context from the findings, the affected graph, the relevant wiki and health/testing artifacts; identify the likely cycle cause; choose a materially different fix strategy or split the work into narrower tasks; journal the decision; continue with the enriched context. The review round count is not reset: past `REVIEW_ROUND_CAP` rounds on one merge-base..HEAD, report to the operator instead of running another round.
|
|
350
|
+
6. Never merge while findings or required checks remain unresolved. If the re-planned approach still cannot produce a mergeable PR, leave the flow `in-progress` and report the blocker.
|
|
551
351
|
|
|
552
|
-
|
|
553
|
-
keryx review loop --flow <id> --task <Tn>
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
It escalates (non-zero exit) when the same finding recurs in two rounds, or
|
|
557
|
-
two consecutive rounds produce identical review output. It reads the review
|
|
558
|
-
packages on disk and the persisted `attempts.count`, not this session's
|
|
559
|
-
memory, and it deliberately never reads the remaining budget — an agent
|
|
560
|
-
emitting the identical failing output three times must be caught on the
|
|
561
|
-
second, not after the budget runs out.
|
|
562
|
-
|
|
563
|
-
5. If the fifth attempt is not clean, **or the repetition check escalated
|
|
564
|
-
earlier**, do not blindly repeat the same loop. Enrich context from the
|
|
565
|
-
findings, affected graph, relevant wiki, and health/testing artifacts;
|
|
566
|
-
identify the likely cycle cause; choose a materially different fix strategy
|
|
567
|
-
or split the work into narrower tasks; record the decision in `journal.md`;
|
|
568
|
-
then continue with the enriched context. The review round count is not reset:
|
|
569
|
-
past `REVIEW_ROUND_CAP` rounds on one merge-base..HEAD, report to the operator
|
|
570
|
-
instead of running another round.
|
|
571
|
-
6. Never merge while findings or required checks remain unresolved. If the
|
|
572
|
-
re-planned approach still cannot produce a mergeable PR, leave the flow
|
|
573
|
-
`in-progress` and report the blocker instead of forcing completion.
|
|
574
|
-
|
|
575
|
-
When the PR is mergeable, required checks are green and the merge was explicitly asked for (the user picked A in this session, or `operator_confirmed`; otherwise stop and ask — agent-conduct rule 2), merge it into the
|
|
576
|
-
recorded base branch (the branch from which the flow branch was created),
|
|
577
|
-
verify that the merge completed, and only then record it through the CLI:
|
|
352
|
+
When the PR is mergeable, required checks are green and the merge was explicitly asked for (the user picked A in this session, or `operator_confirmed`; otherwise stop and ask — agent-conduct rule 2), merge it into the recorded base branch, verify that the merge completed, and only then record it:
|
|
578
353
|
|
|
579
354
|
```bash
|
|
580
355
|
keryx flow implemented <id> --pr <pr-url>
|
|
581
356
|
```
|
|
582
357
|
|
|
583
|
-
|
|
584
|
-
`keryx flow implemented` or `keryx flow complete`. Produce the completion
|
|
585
|
-
report with verification and acceptance-criteria evidence, record that the
|
|
586
|
-
implementation work is finished, and leave the Task Manager flow
|
|
587
|
-
`in-progress`. Explain that the current CLI requires a recorded PR before it
|
|
588
|
-
can transition the flow to `done`.
|
|
589
|
-
- **C - Keep open:** record remaining or deferred work in `journal.md`, report
|
|
590
|
-
the current verification state, and leave the flow `in-progress` for resume.
|
|
591
|
-
|
|
592
|
-
Only continue to Phase 5 after the user selects A, the review/fix loop is
|
|
593
|
-
clean, and the merge into the recorded base branch is confirmed.
|
|
358
|
+
Continue to Phase 5 only after the user selected A, the loop is clean, and the merge into the recorded base is confirmed.
|
|
594
359
|
|
|
595
360
|
## Phase 5: Complete The Flow
|
|
596
361
|
|
|
597
|
-
|
|
362
|
+
Follow `.metaproject/skills/flow/complete.md`. The flow folder is committed in the same PR as the code; never retarget or close against a branch other than the recorded base.
|
|
598
363
|
|
|
599
|
-
For every acceptance criterion, verify evidence and confirm
|
|
364
|
+
1. For every acceptance criterion, verify its evidence and run `keryx flow ac confirm <id> ACn --note "<evidence>"` (`--signed-by "<name>"` names the signer; otherwise `KERYX_ACTOR` or the git identity is recorded, as a claim).
|
|
365
|
+
2. Run `keryx flow check-complete <id>`: it lists every completion gate and the PR's merge state and writes nothing. For each refusal, run the fix it names (owner, committed folder, confirmation token, …) and check again. `keryx flow check` reports an id clash with a remote branch (`keryx flow renumber <dir> --to <free id> --reason "<why>"`).
|
|
366
|
+
3. A flow created with `--require-confirmation` needs `--confirm-token <token>`: in keryx shell call the `flow_confirm` tool (the operator answers a card; never send them to a terminal); elsewhere the operator mints it with `keryx flow confirm <id>` in their terminal.
|
|
367
|
+
4. `keryx flow complete <id>`. Gates that fail return the flow to `in-progress`: journal it, create fix tasks, repeat Phase 2. A flow stuck in `completing` after a crash or interrupted attempt (never a normal gate failure): `keryx flow recover <id> --reason "<why>"`.
|
|
600
368
|
|
|
601
|
-
|
|
602
|
-
keryx flow ac confirm <id> ACn --note "<evidence>"
|
|
603
|
-
```
|
|
604
|
-
|
|
605
|
-
Then run:
|
|
606
|
-
|
|
607
|
-
```bash
|
|
608
|
-
keryx flow complete <id>
|
|
609
|
-
```
|
|
610
|
-
|
|
611
|
-
Completion is allowed only after the PR merge has been confirmed. The merge
|
|
612
|
-
target must be the base branch captured when the flow was created; do not
|
|
613
|
-
silently retarget or close against another branch. The flow folder is committed in the same PR as the code; the commit at closing is a rule to follow, not one the gate checks. `flow complete` fails the `folder-committed` gate while the flow's `flow.json` is not in `HEAD` (flows created from 0.3.53 on; commit it with `git add .metaproject/flows/<dir> && git commit`, then run `flow complete` again). `flow init` and `flow renumber` avoid numbers used on known remote branches, and `keryx flow check` reports a clash with a remote branch (repair with `keryx flow renumber <dir> --to <free id> --reason "<why>"`) and warns about a folder that is not committed. Flows created since the owner gate fail completion while no owner is set (`keryx flow owner set <id> --owner "<name>" --reason "<why>"`); `ac confirm` and `flow complete` append a signature — `--signed-by "<name>"` names the signer, otherwise `KERYX_ACTOR` or the local git identity is recorded, as a claim. A flow created with `--require-confirmation` needs one more gate — `--confirm-token <token>` from `keryx flow confirm <id>`, a short-lived single-use token. In keryx shell call the `flow_confirm` tool (the operator answers it as a card; never send the operator to a terminal); outside it, a typed challenge in a terminal mints it. It proves an interactive step ran, not that a human ran it. A flow left stuck in `completing` by a crash or interrupted attempt (never a normal gate failure) recovers with `keryx flow recover <id> --reason "<why>"`.
|
|
614
|
-
|
|
615
|
-
For released work with known refusals, read [completion-exceptions.md](completion-exceptions.md) before closing: require fresh operator words, preserve failing gates, and never call it clean.
|
|
616
|
-
|
|
617
|
-
If gates fail, the CLI returns the flow to `in-progress`. Add a journal note,
|
|
618
|
-
create fix tasks, and repeat Phase 2.
|
|
369
|
+
Released work whose remaining refusal is known: read [completion-exceptions.md](completion-exceptions.md) before closing — fresh operator words, failing gates preserved, never called clean.
|
|
619
370
|
|
|
620
371
|
## Completion Report
|
|
621
372
|
|
|
622
|
-
Finish with:
|
|
623
|
-
|
|
624
373
|
- flow id and final status;
|
|
625
374
|
- selected completion outcome;
|
|
626
375
|
- PR URL when a PR was created;
|
|
627
376
|
- tasks completed;
|
|
628
|
-
- acceptance
|
|
629
|
-
- verification/review results;
|
|
377
|
+
- acceptance-criteria evidence summary;
|
|
378
|
+
- verification/review results, applied skill updates;
|
|
630
379
|
- unresolved risks or blocked gates.
|
|
631
380
|
|
|
632
|
-
For a verified handoff without PR, distinguish "implementation work finished"
|
|
633
|
-
from Task Manager status `done`: report the flow as `in-progress` and explain
|
|
634
|
-
why it was intentionally not transitioned.
|
|
381
|
+
For a verified handoff without PR, distinguish "implementation work finished" from Task Manager status `done`: report the flow as `in-progress` and say why it was intentionally not transitioned.
|
|
635
382
|
|
|
636
383
|
## Contracts
|
|
637
384
|
|
|
638
|
-
flow-orchestrator communicates through explicit schemas, not free prose:
|
|
639
|
-
|
|
640
385
|
| Direction | Schema |
|
|
641
386
|
|---|---|
|
|
642
387
|
| Skill input | `skills/gdskills/orchestration/flow-orchestrator/input-contract.schema.json` |
|
|
@@ -645,38 +390,4 @@ flow-orchestrator communicates through explicit schemas, not free prose:
|
|
|
645
390
|
| Worker result | `core/gdskills/contracts/subagent-result.schema.json` |
|
|
646
391
|
| Durable flow state | `.metaproject/flows/<id>/flow.json` (CLI-owned; never agent-written) |
|
|
647
392
|
|
|
648
|
-
Validate
|
|
649
|
-
|
|
650
|
-
```bash
|
|
651
|
-
keryx skills contracts validate <file> --schema subagent-dispatch
|
|
652
|
-
keryx skills contracts validate <file> --schema subagent-result
|
|
653
|
-
```
|
|
654
|
-
|
|
655
|
-
## Boundaries
|
|
656
|
-
|
|
657
|
-
- Do not replace `job-orchestrator`. This is the Task Manager variant.
|
|
658
|
-
- Do not bypass the flow CLI for state changes.
|
|
659
|
-
- Do not let `task-implementer` edit `flow.json`, frozen AC, or decide
|
|
660
|
-
completion.
|
|
661
|
-
- Do not read broad source trees when gdgraph/gdctx/wiki/memory can first
|
|
662
|
-
narrow context.
|
|
663
|
-
|
|
664
|
-
## Red Flags
|
|
665
|
-
|
|
666
|
-
Stop and re-read this skill if you are thinking:
|
|
667
|
-
|
|
668
|
-
| Rationalization | Rebuttal |
|
|
669
|
-
|---|---|
|
|
670
|
-
| "The worker's reply reads like it finished, so the task is done." | The STATUS protocol says read the `STATUS:` line first and never infer the outcome from prose. A reply without one is `NEEDS_CONTEXT` — a confident-sounding summary is exactly what an unusable result looks like. |
|
|
671
|
-
| "`DONE_WITH_CONCERNS` is still done, so I can move on." | Every concern goes into `journal.md` and gets an explicit continue-or-fix decision before `flow task done`. Concerns dropped at the task boundary are invisible by the completion report, which is where they would have mattered. |
|
|
672
|
-
| "The acceptance criterion no longer matches what we built, so I'll reword it." | Frozen AC changes only through `keryx flow ac update <id> --reason "<why>"`, or `--criterion ACn --text "<criterion>" --reason "<why>"` to rewrite the line itself. Rewriting a criterion to fit the implementation makes the flow pass a gate it actually failed, and leaves no record that it moved. |
|
|
673
|
-
| "`flow.json` is just a file — editing one field is faster than the CLI." | `flow.json`, status transitions, task status and attempt counts are CLI-owned. A hand-written field desynchronises the durable state from the flow's own history, and the CLI's next gate check reads yours, not reality. |
|
|
674
|
-
| "Tests pass and the review is clean, so I'll open the PR and complete the flow." | Phase 4 stops and asks the user how the flow should end; not every flow wants a PR. And completion requires a confirmed merge into the base branch captured at creation — not a green local run. |
|
|
675
|
-
| "The worker returned BLOCKED twice — faster if I implement this task myself." | The implementer never self-accepts and the orchestrator never implements. Block the flow, escalate one concise question, then unblock and re-dispatch. Doing the work here erases the boundary the whole flow model rests on. |
|
|
676
|
-
| "Verification is described in the plan, so it will happen." | A verification step in the plan is a task, not a sentence. If it is not a task with a status, nothing records whether it ran, and the flow reaches `implemented` with an unrun gate. |
|
|
677
|
-
| "The review fan-out is cheap, so the budget check can wait." | `keryx review budget --spent … --outstanding …` gates the fan-out, and `review-orchestrator` runs inline in this same main session, where keryx cannot see the in-flight subagents; declare them with `--outstanding`. Skipping the check means the cap bounds nothing. |
|
|
678
|
-
| "The reviewer wrote the fix; applying it is the fastest close." | A `suggested_fix` is a hypothesis. Most majors in a long fix loop are introduced by fixes: reproduce the finding red, check the suggestion against the state × event matrix, then fix (Phase 3 step 6). |
|
|
679
|
-
| "The finding came from a review, so its premise is settled." | A finding can reproduce and still not be a defect. Never pass a held finding in `fix_context.review_feedback`; ask the operator as `review-orchestrator` "Wave D" says (Phase 3 step 6); a flow sourced from a finding runs `review-premise` before freeze (Phase 1). |
|
|
680
|
-
| "While I'm in this code, the fix round can also harden the empty state." | Scope freeze: a fix round fixes findings. New hardening is an operator decision at the first-green gate or as an explicit question, never silent growth. |
|
|
681
|
-
| "The implementer journaled its UX choice, so it is decided." | A `behavior_changes` entry with `needs_operator: true` is decided by the operator, asked with options before the result is accepted (Phase 2). A journal line decides nothing. |
|
|
682
|
-
| "I'll set the verification kind later." | An `unclassified` criterion cannot become data afterwards without a recorded rewrite: `keryx flow ac update <id> --criterion ACn --text "…" --reason "<why>"`. Put the `[verify: …]` marker on every criterion before `flow freeze`. |
|
|
393
|
+
Validate any of them with `keryx skills contracts validate <file> --schema <name>`.
|