@pazmo/ai-workflow-kit 3.0.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 +19 -0
- package/.claude-plugin/plugin.json +12 -0
- package/.codex-plugin/plugin.json +6 -0
- package/LICENSE +21 -0
- package/README.md +183 -0
- package/assets/check.mjs +301 -0
- package/bin/ai-workflow-kit.mjs +152 -0
- package/examples/payment/README.md +9 -0
- package/package.json +44 -0
- package/skills/workflow/SKILL.md +24 -0
- package/skills/workflow/agents/openai.yaml +3 -0
- package/skills/workflow/assets/STORY.md +30 -0
- package/skills/workflow/assets/TASK.md +22 -0
- package/skills/workflow/references/domain-risks.md +29 -0
- package/skills/workflow/references/execution.md +22 -0
- package/skills/workflow/references/intake.md +40 -0
- package/skills/workflow/references/understanding-gate.md +19 -0
- package/src/install.mjs +333 -0
- package/src/managed-block.mjs +70 -0
- package/src/paths.mjs +25 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { access, readFile } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { checkArtifact, checkGate } from '../assets/check.mjs';
|
|
6
|
+
import { installWorkflow, removeWorkflow } from '../src/install.mjs';
|
|
7
|
+
import { END_MARKER, START_MARKER } from '../src/managed-block.mjs';
|
|
8
|
+
import { HOSTS } from '../src/paths.mjs';
|
|
9
|
+
|
|
10
|
+
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
11
|
+
|
|
12
|
+
function help() {
|
|
13
|
+
console.log(`ai-workflow-kit
|
|
14
|
+
|
|
15
|
+
Usage:
|
|
16
|
+
ai-workflow-kit init [--root <dir>] [--host all|codex|claude]
|
|
17
|
+
ai-workflow-kit doctor [--root <dir>]
|
|
18
|
+
ai-workflow-kit check story|task <file> [--root <dir>]
|
|
19
|
+
ai-workflow-kit check gate G1|G4 <story-file> [--root <dir>]
|
|
20
|
+
ai-workflow-kit remove [--root <dir>]
|
|
21
|
+
ai-workflow-kit --version`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function parse(argv) {
|
|
25
|
+
const positional = [];
|
|
26
|
+
let root = process.cwd();
|
|
27
|
+
const hosts = [];
|
|
28
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
29
|
+
const value = argv[index];
|
|
30
|
+
if (value === '--root') {
|
|
31
|
+
if (!argv[index + 1]) throw new Error('--root requires a directory.');
|
|
32
|
+
root = path.resolve(argv[++index]);
|
|
33
|
+
} else if (value === '--host') {
|
|
34
|
+
if (!argv[index + 1]) throw new Error('--host requires all, codex, or claude.');
|
|
35
|
+
const host = argv[++index].toLowerCase();
|
|
36
|
+
if (host === 'all' || host === 'both') hosts.push('codex', 'claude');
|
|
37
|
+
else hosts.push(host);
|
|
38
|
+
} else {
|
|
39
|
+
positional.push(value);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { root, hosts: hosts.length ? [...new Set(hosts)] : ['codex', 'claude'], positional };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async function exists(file) {
|
|
46
|
+
try { await access(file); return true; } catch { return false; }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function doctor(root) {
|
|
50
|
+
const configFile = path.join(root, '.ai-workflow/config.json');
|
|
51
|
+
if (!await exists(configFile)) {
|
|
52
|
+
console.log('MISS workflow config: .ai-workflow/config.json');
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let config;
|
|
57
|
+
try {
|
|
58
|
+
config = JSON.parse(await readFile(configFile, 'utf8'));
|
|
59
|
+
} catch {
|
|
60
|
+
console.log('MISS valid workflow config: .ai-workflow/config.json');
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const hosts = Array.isArray(config.hosts) ? config.hosts : [];
|
|
65
|
+
if (hosts.length === 0 || hosts.some((host) => !HOSTS[host])) {
|
|
66
|
+
console.log('MISS configured hosts');
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const checks = [];
|
|
71
|
+
for (const host of hosts) {
|
|
72
|
+
const hostConfig = HOSTS[host];
|
|
73
|
+
checks.push([`${host === 'codex' ? 'Codex' : 'Claude'} skill`, hostConfig.skillDir]);
|
|
74
|
+
checks.push([`${hostConfig.instructionFile} routing block`, hostConfig.instructionFile, true]);
|
|
75
|
+
}
|
|
76
|
+
checks.push(
|
|
77
|
+
['Story template', 'templates/ai-workflow/STORY.md'],
|
|
78
|
+
['Task template', 'templates/ai-workflow/TASK.md'],
|
|
79
|
+
['Checker', '.ai-workflow/bin/check.mjs'],
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
let ok = true;
|
|
83
|
+
for (const [label, relative, routing] of checks) {
|
|
84
|
+
const file = path.join(root, relative);
|
|
85
|
+
let present = await exists(file);
|
|
86
|
+
if (present && routing) {
|
|
87
|
+
const content = await readFile(file, 'utf8');
|
|
88
|
+
present = content.includes(START_MARKER) && content.includes(END_MARKER);
|
|
89
|
+
}
|
|
90
|
+
console.log(`${present ? 'PASS' : 'MISS'} ${label}: ${relative}`);
|
|
91
|
+
ok &&= present;
|
|
92
|
+
}
|
|
93
|
+
return ok;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function main(argv) {
|
|
97
|
+
if (argv.length === 0 || argv.includes('--help') || argv.includes('-h')) {
|
|
98
|
+
help();
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
if (argv[0] === '--version' || argv[0] === '-v') {
|
|
102
|
+
const pkg = JSON.parse(await readFile(path.join(packageRoot, 'package.json'), 'utf8'));
|
|
103
|
+
console.log(pkg.version);
|
|
104
|
+
return 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const command = argv[0];
|
|
108
|
+
const { root, hosts, positional } = parse(argv.slice(1));
|
|
109
|
+
|
|
110
|
+
if (command === 'init') {
|
|
111
|
+
const result = await installWorkflow({ root, packageRoot, hosts });
|
|
112
|
+
console.log(result.changed ? 'Installed/updated AI Workflow Kit.' : 'AI Workflow Kit is already up to date.');
|
|
113
|
+
console.log(`Hosts: ${result.hosts.join(', ')}`);
|
|
114
|
+
if (result.preserved.length) console.log(`Preserved modified files: ${result.preserved.join(', ')}`);
|
|
115
|
+
if (result.hosts.includes('claude')) console.log('Next (Claude Code): /workflow <request>');
|
|
116
|
+
if (result.hosts.includes('codex')) console.log('Next (Codex): $workflow <request>');
|
|
117
|
+
return 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (command === 'remove') {
|
|
121
|
+
const result = await removeWorkflow({ root });
|
|
122
|
+
console.log(result.changed ? 'Removed managed workflow files.' : 'Nothing managed was found.');
|
|
123
|
+
if (result.preserved.length) console.log(`Preserved modified files: ${result.preserved.join(', ')}`);
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (command === 'doctor') return await doctor(root) ? 0 : 1;
|
|
128
|
+
|
|
129
|
+
if (command === 'check') {
|
|
130
|
+
let result;
|
|
131
|
+
if (positional[0] === 'gate') {
|
|
132
|
+
result = await checkGate({ root, gate: positional[1], file: positional[2] });
|
|
133
|
+
} else {
|
|
134
|
+
result = await checkArtifact({ root, kind: positional[0], file: positional[1] });
|
|
135
|
+
}
|
|
136
|
+
if (result.ok) {
|
|
137
|
+
console.log('PASS');
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
for (const error of result.errors) console.error(`- ${error}`);
|
|
141
|
+
return 1;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
throw new Error(`Unknown command: ${command}`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
try {
|
|
148
|
+
process.exitCode = await main(process.argv.slice(2));
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error(error.message);
|
|
151
|
+
process.exitCode = 1;
|
|
152
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Example: “결제 시스템 만들고 싶어”
|
|
2
|
+
|
|
3
|
+
The workflow does not choose infrastructure. It first asks behavior questions such as:
|
|
4
|
+
|
|
5
|
+
1. What is being paid for, and when does the user consider payment complete?
|
|
6
|
+
2. Does an external payment gateway perform authorization, capture, or both?
|
|
7
|
+
3. What must happen after timeout or the same request is retried?
|
|
8
|
+
|
|
9
|
+
After answers, it creates one concise Story with payment invariants, MUST/SHOULD/OUT, and success/failure verification. Only after G1 approval does repository-grounded planning begin.
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pazmo/ai-workflow-kit",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Portable DDD-inspired AI engineering workflow with concise contracts and a human understanding gate.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ai-workflow-kit": "bin/ai-workflow-kit.mjs",
|
|
8
|
+
"ai-workflow": "bin/ai-workflow-kit.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/",
|
|
12
|
+
"src/",
|
|
13
|
+
"assets/",
|
|
14
|
+
"skills/",
|
|
15
|
+
"examples/",
|
|
16
|
+
".claude-plugin/",
|
|
17
|
+
".codex-plugin/",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "node --test test/*.test.mjs",
|
|
23
|
+
"check:package": "npm pack --dry-run",
|
|
24
|
+
"verify": "npm test && npm run check:package",
|
|
25
|
+
"prepack": "npm test"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=20"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"agent-skills",
|
|
33
|
+
"ai-workflow",
|
|
34
|
+
"codex",
|
|
35
|
+
"claude-code",
|
|
36
|
+
"compound-engineering",
|
|
37
|
+
"ddd"
|
|
38
|
+
],
|
|
39
|
+
"author": "JongKun Kim",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow
|
|
3
|
+
description: Use when a user requests a product or engineering change, especially from a vague feature idea, before planning, coding, or declaring delivery complete.
|
|
4
|
+
argument-hint: "[request | status | finish]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Workflow
|
|
8
|
+
|
|
9
|
+
Turn `$ARGUMENTS` into an approved, reviewable change without creating documentation debt.
|
|
10
|
+
|
|
11
|
+
## Non-negotiable gates
|
|
12
|
+
|
|
13
|
+
- Do not plan implementation or edit production code before the Story is `Approved` and G1 is recorded.
|
|
14
|
+
- Do not declare delivery complete or merge a non-trivial change before G4 passes.
|
|
15
|
+
- Requirements have one source of truth. AI context may be richer; copied requirements may not diverge.
|
|
16
|
+
|
|
17
|
+
## Route by current state
|
|
18
|
+
|
|
19
|
+
1. **No approved Story:** read `references/intake.md`. Use `assets/STORY.md`; ask only missing behavior questions and obtain G1.
|
|
20
|
+
2. **Approved, not implemented:** read `references/execution.md`. Read `references/domain-risks.md` only for relevant risk domains. Create a Task from `assets/TASK.md` only when one PR is not reviewable.
|
|
21
|
+
3. **Implemented or `finish`:** read `references/understanding-gate.md`; run G4 before completion.
|
|
22
|
+
4. **`status`:** report stage, blocking decision, evidence present, and the single next action.
|
|
23
|
+
|
|
24
|
+
Use the user's language. Keep each response focused on one decision. Surface assumptions and evidence boundaries. Never say “AI decided”; name the human-owned decision or mark it open.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Story: <observable outcome>
|
|
2
|
+
Status: Draft
|
|
3
|
+
Owner: <human owner>
|
|
4
|
+
Understanding gate (G1): <pending>
|
|
5
|
+
Understanding gate (G4): <pending>
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
<Actor can achieve observable outcome because...>
|
|
9
|
+
|
|
10
|
+
## Domain
|
|
11
|
+
- Terms: <term = meaning>
|
|
12
|
+
- Invariant: <must always / never happen>
|
|
13
|
+
|
|
14
|
+
## MUST
|
|
15
|
+
- M1. <observable success behavior>
|
|
16
|
+
- M2. <observable failure/negative behavior>
|
|
17
|
+
|
|
18
|
+
## SHOULD
|
|
19
|
+
- S1. <useful, non-blocking behavior>
|
|
20
|
+
|
|
21
|
+
## OUT
|
|
22
|
+
- O1. <explicit exclusion>
|
|
23
|
+
|
|
24
|
+
## Decisions
|
|
25
|
+
- D1. <human decision or ASSUMED: safe default>
|
|
26
|
+
- OPEN BLOCKING: <remove before approval, or omit>
|
|
27
|
+
|
|
28
|
+
## Verify
|
|
29
|
+
- V1 [M1]. <input/action → observable result>
|
|
30
|
+
- V2 [M2]. <failure/retry → state remains valid>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Task: <one reviewable outcome>
|
|
2
|
+
Readiness: Draft
|
|
3
|
+
Story: <link or ID>
|
|
4
|
+
Plan source: <ce-plan path | approved plan path | N/A — small and reversible>
|
|
5
|
+
|
|
6
|
+
## Outcome
|
|
7
|
+
<One independently reviewable result>
|
|
8
|
+
|
|
9
|
+
## Covers — Story M/V IDs
|
|
10
|
+
- M1, M2 / V1, V2
|
|
11
|
+
|
|
12
|
+
## Scope
|
|
13
|
+
- IN: <included change boundary>
|
|
14
|
+
|
|
15
|
+
## Constraints
|
|
16
|
+
- <relevant invariant or explicit exclusion>
|
|
17
|
+
|
|
18
|
+
## Verify
|
|
19
|
+
- <focused evidence command or scenario>
|
|
20
|
+
|
|
21
|
+
## Risk / Dependency
|
|
22
|
+
- <only when material; otherwise omit this section>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Domain Risk Lenses
|
|
2
|
+
|
|
3
|
+
Use only the matching lens. These are missing-behavior prompts, not architecture prescriptions.
|
|
4
|
+
|
|
5
|
+
## Payment / money
|
|
6
|
+
|
|
7
|
+
Check: charge timing; authorization vs capture; duplicate request/idempotency; timeout with unknown external result; cancellation/refund boundary; amount/currency ownership; reconciliation and operator recovery. Do not infer Redis, Kafka, Outbox, or locks.
|
|
8
|
+
|
|
9
|
+
## Inventory / concurrency
|
|
10
|
+
|
|
11
|
+
Check: stock meaning; reservation boundary; non-negative invariant; competing requests; atomic success/failure; release/expiry; retry semantics; evidence under the actual datastore/runtime.
|
|
12
|
+
|
|
13
|
+
## Authentication / authorization
|
|
14
|
+
|
|
15
|
+
Check: identity source; protected action; permission owner; token/session expiry and revocation; replay; auditability; failure information disclosure.
|
|
16
|
+
|
|
17
|
+
## External integration
|
|
18
|
+
|
|
19
|
+
Check: source of truth; timeout; retry/backoff; duplicate side effects; callback ordering; partial success; reconciliation; manual recovery.
|
|
20
|
+
|
|
21
|
+
## Data migration / deletion
|
|
22
|
+
|
|
23
|
+
Check: compatibility window; backfill owner; rollback; partial progress; irreversible loss; verification before cleanup; observability and stop conditions.
|
|
24
|
+
|
|
25
|
+
## Sensitive data
|
|
26
|
+
|
|
27
|
+
Check: collection purpose; minimization; access boundary; storage/transit; retention/deletion; logs; incident and audit needs.
|
|
28
|
+
|
|
29
|
+
Ask only a lens item that changes this Story's behavior. Keep the rest out of scope.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Delivery and Execution
|
|
2
|
+
|
|
3
|
+
## Size first
|
|
4
|
+
|
|
5
|
+
- **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 → ce-work → ce-code-review` when Compound Engineering is available. Otherwise perform equivalent repository-grounded plan, work, and review stages.
|
|
7
|
+
- **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
|
+
|
|
9
|
+
High-risk signals: money/payment, authentication/authorization, concurrency, destructive migration, sensitive data, data loss, and irreversible external side effects.
|
|
10
|
+
|
|
11
|
+
## Task rule
|
|
12
|
+
|
|
13
|
+
Create Tasks only when the approved Story cannot be reviewed as one PR. Each Task has one independent outcome, references Story M/V IDs, stays within 30 non-empty lines, and contains no speculative implementation choreography. **HOW belongs to the repository-grounded plan.**
|
|
14
|
+
|
|
15
|
+
## Execute
|
|
16
|
+
|
|
17
|
+
1. Read the approved Story, relevant code, tests, repository instructions, and prior learnings.
|
|
18
|
+
2. Make a plan that maps every M/V ID to code and evidence. Do not create a second requirement source.
|
|
19
|
+
3. For new behavior or a bug fix, demonstrate RED before production code, GREEN after the minimum change, then refactor while green.
|
|
20
|
+
4. Review the actual diff against the Story, including failure paths and what tests do not prove. Use `ce-code-review` for deep review when available.
|
|
21
|
+
5. Resolve or explicitly record material findings.
|
|
22
|
+
6. Continue to `understanding-gate.md`; passing tests alone are not completion.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Intake and Contract
|
|
2
|
+
|
|
3
|
+
## Internal Domain Frame
|
|
4
|
+
|
|
5
|
+
Derive before asking: actor, desired outcome, terms/entities, state change, invariant/forbidden outcome, failure, external side effect, and observable evidence.
|
|
6
|
+
|
|
7
|
+
## Question policy
|
|
8
|
+
|
|
9
|
+
- Ask **only blocking** unknowns that change behavior, ownership, or failure semantics.
|
|
10
|
+
- Ask one decision per turn by default; **at most three** independent, closely related questions.
|
|
11
|
+
- Stop after **two question rounds**. Draft with safe defaults labeled `ASSUMED`; keep unsafe gaps as `OPEN BLOCKING`.
|
|
12
|
+
- Never ask implementation or **HOW** questions before the contract is clear. Database, queue, lock, and file choices belong to planning.
|
|
13
|
+
- Offer a concrete default rather than an open questionnaire when a conventional safe choice exists.
|
|
14
|
+
|
|
15
|
+
## Output recipe
|
|
16
|
+
|
|
17
|
+
Create one Story from `../assets/STORY.md`:
|
|
18
|
+
|
|
19
|
+
1. Goal: actor + observable outcome.
|
|
20
|
+
2. Domain: terms and business invariants only.
|
|
21
|
+
3. MUST: numbered positive and negative behavior.
|
|
22
|
+
4. SHOULD: useful but non-blocking behavior.
|
|
23
|
+
5. OUT: explicit exclusions that prevent scope expansion.
|
|
24
|
+
6. Decisions: human choices, `ASSUMED`, and material open items.
|
|
25
|
+
7. Verify: V# cases mapped to M#; include success and failure.
|
|
26
|
+
|
|
27
|
+
Keep it one-screen by default. Do not copy it into an “AI spec.”
|
|
28
|
+
|
|
29
|
+
## G1 approval
|
|
30
|
+
|
|
31
|
+
Show the full concise draft and ask: “이 내용이 이번 구현의 범위와 완료 조건으로 맞나요?” End the turn. On explicit approval, save the approved snapshot and decision to `docs/understanding/<slug>-contract.md`, set `Status: Approved`, and record:
|
|
32
|
+
|
|
33
|
+
`Understanding gate (G1): <artifact> · <date> · Check-in: accepted`
|
|
34
|
+
|
|
35
|
+
Then verify instead of assuming: run `node .ai-workflow/bin/check.mjs story <story-file>`
|
|
36
|
+
and report the exit code. Exit 0 means the contract is well formed and G1 is valid; any
|
|
37
|
+
other exit names what is wrong. Do not start implementation on a non-zero exit, and never
|
|
38
|
+
claim the gate passed without that output.
|
|
39
|
+
|
|
40
|
+
No approval means no implementation.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# G4 Human Understanding Gate
|
|
2
|
+
|
|
3
|
+
This gate checks ownership of the actual implementation. It is not a generated summary ceremony.
|
|
4
|
+
|
|
5
|
+
## Predict before reveal
|
|
6
|
+
|
|
7
|
+
1. Gather the approved Story, test results, review findings, and the **raw diff** or mechanical diff/stat. Show only that evidence; do not explain the solution yet.
|
|
8
|
+
2. Ask in the user's language: “이 변경이 사용자나 시스템의 어떤 behavior를 바꾸나요? 핵심 invariant 또는 failure path는 무엇이고, 어떤 테스트가 이를 증명하며 아직 unproven인 evidence boundary는 무엇인가요?” **END THE TURN.**
|
|
9
|
+
3. Only after the human answers, **compare** the answer with the Story, diff, runtime flow, and tests.
|
|
10
|
+
4. Return three short sections: correct, missed, incorrect/risky. Never reward confident guessing.
|
|
11
|
+
5. If a core gap remains, teach only that gap and require a one- or two-sentence **restatement**. Repeat until the owner can explain behavior, one invariant/failure path, and the evidence boundary.
|
|
12
|
+
|
|
13
|
+
## Record
|
|
14
|
+
|
|
15
|
+
Save the raw evidence, human answer, and evaluation to `docs/understanding/<slug>-diff.md`. Then record:
|
|
16
|
+
|
|
17
|
+
`Understanding gate (G4): <artifact> · <date> · Check-in: accepted`
|
|
18
|
+
|
|
19
|
+
Also append `G4: PASS — <what the human correctly restated>`. Set `Status: Delivered` only after both records exist and `node .ai-workflow/bin/check.mjs story <story-file>` exits 0. Run it and report the exit code; never claim the gate passed without that output. Use `G4: N/A — <specific reason>` only when no implementation behavior changed; never use it to bypass uncertainty.
|