kaizen-agent 1.13.2 → 1.14.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/README.md CHANGED
@@ -163,7 +163,7 @@ kaizen Done, and reviewed. Two things found:
163
163
  ## Why people use it
164
164
 
165
165
  - **It isn't just for code.** Emails, docs, runbooks, research. kaizen works out what *done* and *wrong* mean for each request, so a book chapter is never reviewed for race conditions.
166
- - **The reviewer has nothing to defend.** It starts cold, sees only the plan and the result, and finds what the builder talked itself past.
166
+ - **The reviewer has nothing to defend.** It starts cold, sees only your request, the plan and the result, and finds what the builder talked itself past.
167
167
  - **A board for all your work.** Run `kaizen` in a terminal, or `kaizen web` in the browser. Ideas, plans, builds and reviews across every project, updating live. Start a run, approve or revise a plan, answer its questions, pick which findings to fix, then commit and push, all without opening a terminal.
168
168
  - **Requests come to you.** Paste a Google Sheet or Doc link and every request in it lands on the board as an idea.
169
169
  - **Notes and voice, offline.** A markdown notebook beside the board, plus dictation on every field. Whisper runs in the page, so audio never leaves your machine.
@@ -15,9 +15,31 @@ the code that is there, not the intent someone claims for it.
15
15
 
16
16
  You will be given a run directory path. The plan's **File manifest** names the paths
17
17
  this run touches — start from it rather than re-searching the material, and widen only
18
- for the blast-radius check. Read `01-plan.md` (what was approved) and
19
- `03-impl.md` (what the builder claims it did), then examine the work itself. Treat
20
- the builder's report as a claim to verify, not as fact.
18
+ for the blast-radius check. Read `00-request.md` first (what was asked, verbatim),
19
+ then `01-plan.md` (what was approved) and `03-impl.md` (what the builder claims it
20
+ did), then examine the work itself. Treat the builder's report as a claim to verify,
21
+ not as fact.
22
+
23
+ ## Criteria come from the request
24
+
25
+ Before you open the plan, write down what the request and its *done* and *wrong*
26
+ lines require, one checkable criterion each. Then map them onto the plan's gate: a
27
+ criterion a `G-nn` item covers takes that id; one the gate missed becomes `R-01`,
28
+ `R-02`, … If you take your criteria from the plan you check the planner's reading of
29
+ the request and inherit its blind spot. The `R-nn` items are where you catch it.
30
+
31
+ Answer every criterion by trying to break it: name the concrete check that would fail
32
+ if it did not hold, and run it. `PASS` means the attempt came back clean, not that the
33
+ builder's evidence reads well. Each criterion gets exactly one of:
34
+
35
+ - `PASS: <the check you ran> — <what came back>`
36
+ - `FAIL: see finding <n>`
37
+ - `CANNOT VERIFY: <what you tried>; <why it does not settle it>. Human: <the exact check to make>.`
38
+
39
+ `CANNOT VERIFY` is for what needs something you do not have — taste, a live account or
40
+ device, a real reader, production data, a person's decision. A check that is only slow
41
+ is not unverifiable: run it. A `block`-tier item left `CANNOT VERIFY` means the run is
42
+ not clean.
21
43
 
22
44
  **You never edit the work.** Your only writes are `04-review.md` (or an iteration
23
45
  recheck file) and, when enabled, an append to `.kaizen/memory.md`.
@@ -80,7 +102,8 @@ The plan's Verification section says what was promised. Check the promise was ke
80
102
 
81
103
  For every candidate finding, construct the concrete failure: specific inputs and the
82
104
  wrong output that follows, the sentence that contradicts the earlier one, the reader
83
- who follows step four and gets stuck. If you cannot construct one, drop the finding.
105
+ who follows step four and gets stuck. If you cannot construct one, drop the finding. That drops suspicions, never criteria:
106
+ a criterion you cannot settle is `CANNOT VERIFY`, not silence.
84
107
  Do not soften an unverified suspicion into a hedged note — an unverified finding
85
108
  costs the user more time than it saves.
86
109
 
@@ -106,8 +129,14 @@ code does, no style nits that do not change meaning. If nothing survives
106
129
  verification, write exactly that — a clean review is a real result, and inventing
107
130
  findings to look thorough is worse than none.
108
131
 
109
- End the file with a one-line verdict: `PASS` (nothing at or above medium) or
110
- `FINDINGS: <n> critical, <n> high, <n> medium, <n> low`.
132
+ After the findings, an `## Acceptance` section: one line per criterion,
133
+ `G-01 PASS: …`, `R-01 CANNOT VERIFY: …`. Never number these lines — numbered lines are
134
+ read as findings to fix.
135
+
136
+ End the file with a one-line verdict: `PASS` (nothing at or above medium and no
137
+ `CANNOT VERIFY`) or `FINDINGS: <n> critical, <n> high, <n> medium, <n> low`, followed
138
+ by `; <n> cannot verify` when any criterion was — even when every count is 0, so an
139
+ open human check never reads as a clean pass.
111
140
 
112
141
  ## Memory
113
142
 
@@ -123,5 +152,5 @@ memory file that only grows stops being read.
123
152
 
124
153
  ## Report back
125
154
 
126
- Return the verdict line and the critical and high findings only. The full list is on
127
- disk.
155
+ Return the verdict line, the critical and high findings, and every `CANNOT VERIFY`
156
+ line. The full list is on disk.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaizen-agent",
3
- "version": "1.13.2",
3
+ "version": "1.14.0",
4
4
  "description": "Staged workflow for AI agents — code, writing, research, operations: plan, human approval, build, independent review, bounded fix loop.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,7 +22,7 @@ request -> PLAN -> [approval] -> IMPLEMENT -> REVIEW -> [fix loop] -> [approval]
22
22
 
23
23
  Three separate subagents do the work. They never share a context window, which is
24
24
  the point: a reviewer that watched the code being written will rationalize it, a
25
- reviewer that sees only the diff and the plan will not.
25
+ reviewer that sees only the request, the plan and the diff will not.
26
26
 
27
27
  The stage contract is split so no reader loads a stage it is not running:
28
28
  [`spec.md`](spec.md) is the core (track, intake, resume) and every reader takes it,
@@ -6,13 +6,14 @@ the final approval. No subagent reads this file.
6
6
  ---
7
7
  ## Backlog
8
8
 
9
- Every run produces work it deliberately does not do. Three sources, all already
9
+ Every run produces work it deliberately does not do. Four sources, all already
10
10
  written down by the time a run ends:
11
11
 
12
12
  1. Out of scope suggestions the planner listed and the user did not fold into the
13
13
  approved scope.
14
14
  2. Findings below `auto_fix.min_severity`, and findings the fix loop could not close.
15
15
  3. Debts deferred at an approval because they fell outside the approved scope.
16
+ 4. Criteria the reviewer answered `CANNOT VERIFY` that the user did not settle.
16
17
 
17
18
  Without capture these survive only in the conversation that produced them.
18
19
 
@@ -88,7 +89,8 @@ Controlled by `approvals.review`, skipped in `auto`. A direct-path run always st
88
89
  whatever `approvals.review` says: the user's check is its only review.
89
90
 
90
91
  Report: what was built, verification results, findings fixed, findings still open,
91
- and anything the builder noted as out of scope. Where the run used `runner: lite`, say
92
+ every criterion the reviewer answered `CANNOT VERIFY` with the check it says a human
93
+ must make, and anything the builder noted as out of scope. Where the run used `runner: lite`, say
92
94
  so in that report — the reviewer saw the work, and nobody should read a same-session
93
95
  review as an independent one because the output looked the same. Where the run took
94
96
  the direct path, say there was no plan and no review: the user's check is the review.
@@ -101,9 +103,9 @@ touched, and goes to the backlog as `open` like any other deferred item. This is
101
103
  same granularity the fix loop already works at; the only change is that the user
102
104
  picks the subset instead of accepting or declining the whole review.
103
105
 
104
- Before setting `stage: "done"`, append the same three categories just reported —
105
- findings still open, findings below the fix threshold, and the builder's out-of-scope
106
- notes from `03-impl.md` — to `runs/<id>/06-backlog.md`, each as `open`, in the format
106
+ Before setting `stage: "done"`, append the same categories just reported — findings
107
+ still open, findings below the fix threshold, `CANNOT VERIFY` criteria the user did
108
+ not settle, and the builder's out-of-scope notes from `03-impl.md` — to `runs/<id>/06-backlog.md`, each as `open`, in the format
107
109
  given in *Backlog* above. Every input is already assembled at this moment; the only
108
110
  change is that it is written down rather than spoken and discarded.
109
111
 
@@ -7,13 +7,22 @@ reviewer's contract. The planner and builder do not read it.
7
7
  ## Stage 3 — Review
8
8
 
9
9
  **Agent:** reviewer, with a context that has never seen the builder's reasoning.
10
- **Input:** `01-plan.md` (its File manifest names what to read), `03-impl.md`, the
11
- track, and the work produced.
10
+ **Input:** `00-request.md` first, then `01-plan.md` (its File manifest names what to
11
+ read), `03-impl.md`, and the work produced.
12
12
  **Output:** `04-review.md`.
13
13
 
14
14
  The track's third answer — *what would make it wrong* — is the reviewer's primary
15
15
  brief. It reads that first and hunts for it specifically.
16
16
 
17
+ **Acceptance criteria come from the request, not the plan.** Before opening the plan,
18
+ the reviewer writes down what the verbatim request and its *done* and *wrong* lines
19
+ require, one checkable criterion each. Then it maps them onto the plan's gate: a
20
+ criterion a `G-nn` item already covers takes that id, and one the gate missed becomes
21
+ `R-01`, `R-02`, … A reviewer that takes its criteria from the plan checks the plan's
22
+ reading of the request, and inherits whatever the planner misread; an `R-nn` item is
23
+ where that misreading shows up. Plan conformance (check 2) still compares the work to
24
+ the plan; this compares it to what was asked.
25
+
17
26
  Five checks are universal, in every track:
18
27
 
19
28
  1. **Correctness** — is it true, and does it hold up? For code: logic errors,
@@ -34,12 +43,13 @@ Five checks are universal, in every track:
34
43
  now is a `high` finding at minimum, whatever else the work achieved. If the builder
35
44
  recorded no baseline, that absence is itself the finding.
36
45
 
37
- 5. **The plan's gate** — every `G-nn` item from the plan's Verification section,
38
- re-answered against the work rather than against `03-impl.md`. A gate item the
39
- builder marked `PASS` with no evidence behind it, or with evidence that only
40
- restates the item, is treated as unproven and re-checked here; if it does not hold,
41
- that is the finding. A `reason`-tier item fails when the technique is present and
42
- the written reason is not.
46
+ 5. **Acceptance** — every criterion, `G-nn` and `R-nn`, answered against the work
47
+ rather than against `03-impl.md`, by trying to falsify it: name the concrete check
48
+ that would fail if the criterion did not hold — an input, a command, a sentence to
49
+ compare, a step to walk — and run it. `PASS` means that attempt came back clean, not
50
+ that the builder's evidence reads well. A `reason`-tier item fails when the
51
+ technique is present and the written reason is not. An `R-nn` item that fails takes
52
+ its severity on its own merits, like any finding outside the gate.
43
53
 
44
54
  Then the track's own checks. For software work: security, reuse and simplification,
45
55
  test coverage. For a document: completeness against its own structure, accuracy of
@@ -76,9 +86,33 @@ it is not a judgment the reviewer re-litigates: the tier was set at the plan, wh
76
86
  the user approved. A finding outside the gate carries no id and is graded on its own
77
87
  merits.
78
88
 
89
+ **Each criterion gets one of three answers**, in an `## Acceptance` section of its
90
+ own, after the findings — one unnumbered line per criterion, so nothing reads it as a
91
+ finding to fix:
92
+
93
+ ```
94
+ G-01 PASS: ran `bun test` with the cache dir unwritable — 0 failed, error shown
95
+ G-02 FAIL: see finding 3
96
+ R-01 CANNOT VERIFY: needs a live Stripe account; the test-mode fixture skips webhooks. Human: refund one real charge and confirm the ledger row.
97
+ ```
98
+
99
+ `CANNOT VERIFY` is for a check that needs something the reviewer does not have —
100
+ taste, a live account or device, a real reader, production data, a person's decision.
101
+ It states what was tried, why that does not settle it, and exactly what a human must
102
+ check. A check that is only slow or tedious is not unverifiable: run it. A `block`-tier
103
+ item left `CANNOT VERIFY` means the run is not clean, whatever the findings say.
104
+
79
105
  The reviewer verifies before reporting: a finding it cannot construct a concrete
80
- failing input or scenario for is dropped, not softened into a maybe. No praise, no
81
- summary of what the code does, no style nits that do not change meaning.
106
+ failing input or scenario for is dropped, not softened into a maybe. That drops
107
+ suspicions, never criteria: a criterion that cannot be settled is `CANNOT VERIFY`,
108
+ not silence. No praise, no summary of what the code does, no style nits that do not
109
+ change meaning.
110
+
111
+ The file ends with one verdict line: `PASS` when no finding is at or above medium
112
+ and no criterion is `CANNOT VERIFY`; otherwise
113
+ `FINDINGS: <n> critical, <n> high, <n> medium, <n> low`, followed by
114
+ `; <n> cannot verify` when any criterion was — even when every count is 0, so an open
115
+ human check never reads as a clean pass.
82
116
 
83
117
  The reviewer also appends any durable lesson about this material to `memory.md` —
84
118
  a recurring bug pattern, a non-obvious constraint, a convention worth keeping. Not
@@ -103,7 +137,7 @@ A finding the loop could not close is escalated to the user with the reviewer's
103
137
  description intact — never quietly downgraded to make the run look clean.
104
138
 
105
139
  **A recheck is not a second review.** Re-answer the findings it was meant to close,
106
- the gate items the change could plausibly touch, and the regression check. Nothing
140
+ the criteria (`G-nn` and `R-nn`) the change could plausibly touch, and the regression check. Nothing
107
141
  else. State which items were skipped and why, in one line, so the reader can disagree
108
142
  with the judgement — a skipped item is a claim that the change could not have reached
109
143
  it, and that claim is checkable.