@pazmo/ai-workflow-kit 3.0.3 → 3.0.4
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
|
@@ -147,8 +147,14 @@ G4: PASS — 환불은 결제수단으로만 돌아간다는 규칙을 담당자
|
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
149
|
node .ai-workflow/bin/check.mjs story docs/STORY.md
|
|
150
|
+
node .ai-workflow/bin/check.mjs gate G1 docs/STORY.md
|
|
150
151
|
```
|
|
151
152
|
|
|
153
|
+
`story`는 합의서의 **모양**을, `gate`는 **사람이 실제로 확인했는지**를 봅니다. 아직 `Draft`인
|
|
154
|
+
파일에 `story`를 돌리면 모양만 맞아도 통과합니다 — 그건 승인이 아니고, 통과 메시지가 어느
|
|
155
|
+
게이트를 건너뛰었는지 `NOTE`로 알려줍니다. 승인을 확인하려면 `gate G1`을, 이해 게이트를
|
|
156
|
+
확인하려면 `gate G4`를 함께 돌리세요.
|
|
157
|
+
|
|
152
158
|
이 검사기가 잡는 것:
|
|
153
159
|
|
|
154
160
|
| 검사 | 막는 상황 |
|
package/assets/check.mjs
CHANGED
|
@@ -205,7 +205,7 @@ function checkStoryShape(text) {
|
|
|
205
205
|
const errors = [];
|
|
206
206
|
requireOrderedHeadings(text, REQUIRED_STORY_HEADINGS, errors, 'Story');
|
|
207
207
|
|
|
208
|
-
if (!/^#\s+Story:\s
|
|
208
|
+
if (!/^#\s+Story:\s*(?!<|pending\b)\S.+$/imu.test(text)) errors.push('Story needs a descriptive “# Story:” title.');
|
|
209
209
|
if (!/^Status:\s*(Draft|Approved|Delivered)\s*$/imu.test(text)) {
|
|
210
210
|
errors.push('Status must be Draft, Approved, or Delivered.');
|
|
211
211
|
}
|
|
@@ -266,15 +266,30 @@ export async function checkArtifact({ root = process.cwd(), file, kind = 'story'
|
|
|
266
266
|
if (kind !== 'story') return { ok: false, errors: [`Unsupported artifact kind: ${kind}`] };
|
|
267
267
|
|
|
268
268
|
const errors = checkStoryShape(text);
|
|
269
|
-
|
|
269
|
+
|
|
270
|
+
// Status decides which gates are due. A Story that has not reached a gate cannot
|
|
271
|
+
// fail it — but then exit 0 only means the shape is right, and a caller who was
|
|
272
|
+
// told "exit 0 is the only pass" will read it as approval. Say which gate went
|
|
273
|
+
// unchecked, so a pass can never be quoted as one that was.
|
|
274
|
+
const notes = [];
|
|
275
|
+
const approved = /^Status:\s*(Approved|Delivered)\s*$/imu.test(text);
|
|
276
|
+
const delivered = /^Status:\s*Delivered\s*$/imu.test(text);
|
|
277
|
+
|
|
278
|
+
if (approved) {
|
|
270
279
|
const g1 = await checkGate({ root, file: artifactFile, gate: 'G1' });
|
|
271
280
|
errors.push(...g1.errors);
|
|
281
|
+
} else {
|
|
282
|
+
notes.push('Status is not Approved, so the G1 approval gate was not checked. Exit 0 means the Story is well formed, not that a human approved it.');
|
|
272
283
|
}
|
|
273
|
-
|
|
284
|
+
|
|
285
|
+
if (delivered) {
|
|
274
286
|
const g4 = await checkGate({ root, file: artifactFile, gate: 'G4' });
|
|
275
287
|
errors.push(...g4.errors);
|
|
288
|
+
} else {
|
|
289
|
+
notes.push('Status is not Delivered, so the G4 understanding gate was not checked.');
|
|
276
290
|
}
|
|
277
|
-
|
|
291
|
+
|
|
292
|
+
return { ok: errors.length === 0, errors, notes };
|
|
278
293
|
}
|
|
279
294
|
|
|
280
295
|
async function runCli(argv) {
|
|
@@ -291,6 +306,7 @@ async function runCli(argv) {
|
|
|
291
306
|
|
|
292
307
|
if (result.ok) {
|
|
293
308
|
console.log('PASS');
|
|
309
|
+
for (const note of result.notes ?? []) console.log(`NOTE ${note}`);
|
|
294
310
|
return 0;
|
|
295
311
|
}
|
|
296
312
|
for (const error of result.errors) console.error(`- ${error}`);
|
package/bin/ai-workflow-kit.mjs
CHANGED
package/package.json
CHANGED
|
@@ -32,9 +32,17 @@ Show the full concise draft and ask: “이 내용이 이번 구현의 범위와
|
|
|
32
32
|
|
|
33
33
|
`Understanding gate (G1): <artifact> · <date> · Check-in: accepted`
|
|
34
34
|
|
|
35
|
-
Then verify instead of assuming
|
|
36
|
-
and report
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
Then verify instead of assuming. Write `Status: Approved` and the G1 record first, then run
|
|
36
|
+
both checks and report both exit codes:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
node .ai-workflow/bin/check.mjs story <story-file>
|
|
40
|
+
node .ai-workflow/bin/check.mjs gate G1 <story-file>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`story` checks that the contract is well formed. `gate G1` checks that a human actually
|
|
44
|
+
approved it. Run `story` while the file still says `Draft` and it exits 0 on shape alone —
|
|
45
|
+
that is not approval, and the output says which gate it skipped. Do not start implementation
|
|
46
|
+
unless both exit 0, and never claim the gate passed without that output.
|
|
39
47
|
|
|
40
48
|
No approval means no implementation.
|
|
@@ -16,4 +16,11 @@ Save the raw evidence, human answer, and evaluation to `docs/understanding/<slug
|
|
|
16
16
|
|
|
17
17
|
`Understanding gate (G4): <artifact> · <date> · Check-in: accepted`
|
|
18
18
|
|
|
19
|
-
Also append `G4: PASS — <what the human correctly restated>`. Set `Status: Delivered` only after both records exist and
|
|
19
|
+
Also append `G4: PASS — <what the human correctly restated>`. Set `Status: Delivered` only after both records exist and both of these exit 0:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
node .ai-workflow/bin/check.mjs story <story-file>
|
|
23
|
+
node .ai-workflow/bin/check.mjs gate G4 <story-file>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Run them and report both exit codes; never claim the gate passed without that output. A `story` run on a Story that is not yet `Delivered` does not check G4 at all, and says so. Use `G4: N/A — <specific reason>` only when no implementation behavior changed; never use it to bypass uncertainty.
|
package/src/install.mjs
CHANGED
|
@@ -263,7 +263,9 @@ async function removeEmptyParents(file, stopAt) {
|
|
|
263
263
|
while (current.startsWith(stopAt) && current !== stopAt) {
|
|
264
264
|
try {
|
|
265
265
|
if ((await readdir(current)).length > 0) break;
|
|
266
|
-
|
|
266
|
+
// fs.rm refuses a directory without `recursive`, and the catch below would
|
|
267
|
+
// swallow the EISDIR — leaving every emptied parent on disk, silently.
|
|
268
|
+
await rm(current, { recursive: true });
|
|
267
269
|
current = path.dirname(current);
|
|
268
270
|
} catch {
|
|
269
271
|
break;
|