intentdna 1.5.16 → 1.5.18
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 +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +72 -92
- package/dist/audit/index.d.ts +12 -3
- package/dist/cli/commands/feedback.d.ts +3 -0
- package/dist/cli/commands/feedback.js +33 -11
- package/dist/cli/commands/run.js +1 -1
- package/dist/cli/commands/sync.js +5 -5
- package/dist/compiler/cascade.d.ts +3 -1
- package/dist/compiler/cascade.js +86 -2
- package/dist/compiler/compile.js +93 -3
- package/dist/compiler/workflow.d.ts +1 -0
- package/dist/compiler/workflow.js +1 -0
- package/dist/evolution/trace-bridge.d.ts +4 -5
- package/dist/evolution/trace-bridge.js +31 -55
- package/dist/hooks/cli.d.ts +18 -1
- package/dist/hooks/cli.js +624 -24
- package/dist/hooks/enforce.js +3 -2
- package/dist/hooks/state.d.ts +20 -1
- package/dist/hooks/state.js +55 -0
- package/dist/runtime/markdown.d.ts +1 -1
- package/dist/runtime/markdown.js +149 -0
- package/dist/runtime/settings-adapter.d.ts +3 -2
- package/dist/runtime/settings-adapter.js +26 -4
- package/dist/runtime/skill-adapter.js +49 -23
- package/dist/schema/types.d.ts +39 -0
- package/dist/schema/validate.js +143 -0
- package/dist/signals/index.d.ts +45 -0
- package/dist/signals/index.js +117 -0
- package/dist/templates/code-review-pipeline.dna.yaml +4 -0
- package/dist/templates/flutter-rewrite.dna.yaml +139 -212
- package/dist/templates/full-pipeline.dna.yaml +4 -0
- package/dist/templates/mobile-dev.dna.yaml +5 -0
- package/hooks/hooks.json +1 -1
- package/package.json +1 -1
- package/spec/control-plane-convergence-handoff-2026-04-24.md +432 -0
|
@@ -134,25 +134,33 @@ context_files:
|
|
|
134
134
|
- ".dna/specs/diagnosis-{{ARGUMENTS}}.md"
|
|
135
135
|
surgeon:
|
|
136
136
|
- ".dna/specs/diagnosis-{{ARGUMENTS}}.md"
|
|
137
|
+
fix_reviewer:
|
|
138
|
+
- "docs/behavior/{{ARGUMENTS}}.md"
|
|
139
|
+
- ".dna/specs/diagnosis-{{ARGUMENTS}}.md"
|
|
137
140
|
test_runner:
|
|
138
141
|
- "docs/behavior/{{ARGUMENTS}}.md"
|
|
142
|
+
- ".dna/specs/diagnosis-{{ARGUMENTS}}.md"
|
|
139
143
|
|
|
144
|
+
verifier_policy:
|
|
145
|
+
allow_builtin_asserts:
|
|
146
|
+
- clean_working_tree
|
|
140
147
|
|
|
141
148
|
roles:
|
|
142
149
|
# ── Phase 0/3: behavior-lock 角色 ──
|
|
143
150
|
scanner:
|
|
144
|
-
description: Scans v1 source code
|
|
151
|
+
description: Scans v1 source code and writes the behavior document artifact.
|
|
145
152
|
tool_permissions:
|
|
146
|
-
allow: [Read, Grep, Glob,
|
|
147
|
-
deny: [
|
|
153
|
+
allow: [Read, Grep, Glob, Write, Edit]
|
|
154
|
+
deny: [Bash, NotebookEdit]
|
|
148
155
|
scope:
|
|
149
156
|
read: ["**/*"]
|
|
150
|
-
write: []
|
|
157
|
+
write: ["docs/behavior/**"]
|
|
151
158
|
instructions:
|
|
152
159
|
- Scan ONE module only
|
|
153
160
|
- "For each page, list user-visible actions: 动作 → 函数调用 → 返回值"
|
|
154
|
-
-
|
|
161
|
+
- Write the behavior document artifact under docs/behavior/
|
|
155
162
|
- Do NOT read v2 code — only v1
|
|
163
|
+
- Do NOT write tests or app code
|
|
156
164
|
|
|
157
165
|
test_writer:
|
|
158
166
|
description: Reads behavior document, writes tests for all layers (logic + widget).
|
|
@@ -170,29 +178,7 @@ roles:
|
|
|
170
178
|
- Run tests after writing — record baseline
|
|
171
179
|
- Red tests are expected (implementation doesn't exist yet)
|
|
172
180
|
|
|
173
|
-
# ── Phase 4:
|
|
174
|
-
investigator:
|
|
175
|
-
description: Traces broken chain in v1 and v2, identifies breakpoint. Read-only.
|
|
176
|
-
tool_permissions:
|
|
177
|
-
allow: [Read, Grep, Glob, Bash]
|
|
178
|
-
deny: [Edit, Write, NotebookEdit]
|
|
179
|
-
scope:
|
|
180
|
-
read: ["**/*"]
|
|
181
|
-
write: []
|
|
182
|
-
instructions:
|
|
183
|
-
- Trace the call chain in v1 for the target feature
|
|
184
|
-
- Find where v2 diverges
|
|
185
|
-
- Report with exact file paths and line numbers
|
|
186
|
-
- Never suggest code changes
|
|
187
|
-
- "If round > 1: review previous round's git diff first, judge if direction is correct"
|
|
188
|
-
- "If previous fix produced 0 red→green transitions: warn 'no progress'"
|
|
189
|
-
- "Categorize by severity and type:"
|
|
190
|
-
- " CRITICAL: compile errors, import failures — blocks everything"
|
|
191
|
-
- " HIGH-INFRA: mock incomplete causing test hang — blocks behavior verification, fix mock infrastructure first"
|
|
192
|
-
- " HIGH-LOGIC: logic test failures (state/notifier) — behavior inconsistency"
|
|
193
|
-
- " MEDIUM: widget test failures (rendering/navigation)"
|
|
194
|
-
- "hung tests ≠ failed tests. hung = mock infrastructure problem (needs mock fix), failed = behavior inconsistency (needs v2 code fix)"
|
|
195
|
-
|
|
181
|
+
# ── Phase 4: fix 角色 ──
|
|
196
182
|
surgeon:
|
|
197
183
|
description: Fixes breakpoints and builds missing layers by understanding v1 intent and rewriting in v2 style.
|
|
198
184
|
tool_permissions:
|
|
@@ -244,10 +230,13 @@ roles:
|
|
|
244
230
|
write: [".dna/specs/**"]
|
|
245
231
|
instructions:
|
|
246
232
|
- "REQUIRED FIRST: Read all context files listed in SKILL.md"
|
|
233
|
+
- "Treat docs/behavior/blocked_items.md as historical context only, never as the current run verdict"
|
|
247
234
|
- "For each failing, skipped, and hung test: read test code + v1 impl + v2 impl"
|
|
248
235
|
- "Classify each as BUG / UNIMPLEMENTED / INFRA / REMOVED / TEST_BUG (skipped tests are usually UNIMPLEMENTED)"
|
|
249
|
-
- "Output diagnosis spec with v1 code snippets + v2 current state"
|
|
250
|
-
- "
|
|
236
|
+
- "Output diagnosis spec with v1 code snippets + v2 current state + evidence paths"
|
|
237
|
+
- "If reanalyzing after REQUEST_REANALYSIS, update every reviewer sections_to_fix item and report sections_updated"
|
|
238
|
+
- "DO NOT include fix prescriptions, implementation order, call-site instructions, or Notes for Surgeon"
|
|
239
|
+
- "DO NOT run tests. DO NOT edit app code. Analysis only."
|
|
251
240
|
|
|
252
241
|
analysis_reviewer:
|
|
253
242
|
description: "Reviews analyzer output quality. Read-only."
|
|
@@ -261,7 +250,23 @@ roles:
|
|
|
261
250
|
- "REQUIRED FIRST: Read all context files listed in SKILL.md"
|
|
262
251
|
- "Verify analyzer spec: v1 references exist? Classifications sound?"
|
|
263
252
|
- "Check missing: any failing test not covered?"
|
|
264
|
-
- "
|
|
253
|
+
- "Verify diagnosis remains evidence-only: no fix prescriptions, implementation order, call-site instructions, or Notes for Surgeon"
|
|
254
|
+
- "Output a structured verdict block with verdict, artifact_reviewed, sections_to_fix, evidence_paths, confidence, and summary"
|
|
255
|
+
|
|
256
|
+
fix_reviewer:
|
|
257
|
+
description: "Reviews surgeon changes against approved diagnosis, v1 evidence, and v2 architecture. Read-only."
|
|
258
|
+
tool_permissions:
|
|
259
|
+
allow: [Read, Grep, Glob, Bash]
|
|
260
|
+
deny: [Edit, Write, NotebookEdit]
|
|
261
|
+
scope:
|
|
262
|
+
read: ["**/*"]
|
|
263
|
+
write: []
|
|
264
|
+
instructions:
|
|
265
|
+
- "Read diagnosis spec, behavior doc, and git diff before judging"
|
|
266
|
+
- "Verify changes are minimal and limited to the approved diagnosis classifications"
|
|
267
|
+
- "Verify v1 evidence was preserved and v2 patterns are followed"
|
|
268
|
+
- "Reject fake mocks, unrelated refactors, scope creep, or unapproved REMOVED handling"
|
|
269
|
+
- "Output structured verdict: APPROVE or REQUEST_CHANGES with issues and evidence paths"
|
|
265
270
|
|
|
266
271
|
test_runner:
|
|
267
272
|
description: "Runs tests and reports progress delta."
|
|
@@ -340,159 +345,6 @@ workflows:
|
|
|
340
345
|
- type: git_commit
|
|
341
346
|
description: "Behavior lock commit"
|
|
342
347
|
|
|
343
|
-
rescue:
|
|
344
|
-
name: Rescue
|
|
345
|
-
description: "Fix v2 module $ARGUMENTS — investigate, fix, review, verify, report. Max 10 rounds with convergence protection."
|
|
346
|
-
max_rounds: 10
|
|
347
|
-
convergence_rule: "2 consecutive rounds with 0 test progress (green count not increasing) → STOP. Output blocked items + analysis."
|
|
348
|
-
round_budget: "Max 5 files per round. Each round must produce at least 1 test transition (red/skip/hung → green), otherwise counted as no progress."
|
|
349
|
-
priority_order: |
|
|
350
|
-
Phase 1: Fix CRITICAL (compile errors) — unblocks everything
|
|
351
|
-
Phase 2: Fix HIGH-INFRA (mock infrastructure, make hung tests runnable) — unblocks behavior verification
|
|
352
|
-
Phase 3: Fix HIGH-LOGIC (logic tests, red → green) — behavior alignment
|
|
353
|
-
Phase 4: Fix MEDIUM (widget tests, red → green) — UI alignment
|
|
354
|
-
Complete each phase before moving to the next.
|
|
355
|
-
steps:
|
|
356
|
-
- id: investigate
|
|
357
|
-
role: investigator
|
|
358
|
-
description: "Run tests, assess current state, pick next targets by severity."
|
|
359
|
-
prompt: |
|
|
360
|
-
Round context:
|
|
361
|
-
- If round > 1: review previous round's git diff first
|
|
362
|
-
- If previous round had 0 test progress (no red→green or skip→green): warn "no progress" and consider changing approach
|
|
363
|
-
|
|
364
|
-
Run tests in {{test_path}}/$ARGUMENTS/ --timeout 30s. Categorize all non-passing tests by severity:
|
|
365
|
-
CRITICAL: compile errors, import failures — blocks everything, fix first
|
|
366
|
-
HIGH-INFRA: mock incomplete causing test hang (timed out) — blocks behavior verification, fix mock infrastructure
|
|
367
|
-
HIGH-LOGIC: logic test failures (state/notifier/service) — behavior inconsistency, fix after infra
|
|
368
|
-
MEDIUM: widget test failures (rendering/navigation) — fix after logic
|
|
369
|
-
|
|
370
|
-
IMPORTANT: hung ≠ failed. A test that times out (hung) = mock infrastructure problem, NOT a v2 behavior issue. Classify separately.
|
|
371
|
-
|
|
372
|
-
Pick highest severity batch. Trace: what does v1 do vs what does v2 do? Find the breakpoints.
|
|
373
|
-
Report findings and the plan for this round.
|
|
374
|
-
handoff:
|
|
375
|
-
produces:
|
|
376
|
-
- type: summary
|
|
377
|
-
description: "Investigation findings and breakpoint analysis"
|
|
378
|
-
- type: test_result
|
|
379
|
-
path: "{{test_path}}/$ARGUMENTS/"
|
|
380
|
-
description: "Current test state assessment"
|
|
381
|
-
- id: fix
|
|
382
|
-
role: surgeon
|
|
383
|
-
depends_on: [investigate]
|
|
384
|
-
description: "Fix identified issues. Max 5 files per round."
|
|
385
|
-
max_attempts: 3
|
|
386
|
-
on_fail: handoff
|
|
387
|
-
handoff_to: investigate
|
|
388
|
-
max_handoffs: 3
|
|
389
|
-
on_handoff_exhausted: skip
|
|
390
|
-
blocked_items_path: "docs/behavior/blocked_items.md"
|
|
391
|
-
checkpoints:
|
|
392
|
-
- assert: clean_working_tree
|
|
393
|
-
message: "Commit all changes before proceeding"
|
|
394
|
-
prompt: |
|
|
395
|
-
Fix the identified breakpoints. Rules:
|
|
396
|
-
- Read v1 intent in {{v1_path}}/, rewrite in v2 style in {{v2_path}}/ (not copy v1 verbatim)
|
|
397
|
-
- Maximum 5 files per round — if more needed, split the scope
|
|
398
|
-
- Run `flutter analyze` after each file change
|
|
399
|
-
- Same issue failed 3 times → STOP, report as blocked, do not retry
|
|
400
|
-
- Logic tests: implement notifier/state/service code
|
|
401
|
-
- Widget tests: copy widget from v1, change bindings (Obx→Consumer, Get.to→context.go), set up infra (ProviderScope, mock providers, GoRouter) if needed
|
|
402
|
-
- Run tests after each fix. Red→green or Skip→green = progress. Still failing = revert and re-analyze
|
|
403
|
-
- Commit: "rescue($ARGUMENTS): round N — what changed, why, which tests targeted"
|
|
404
|
-
handoff:
|
|
405
|
-
consumes:
|
|
406
|
-
- type: summary
|
|
407
|
-
from: investigate
|
|
408
|
-
description: "Investigation findings from investigate step"
|
|
409
|
-
produces:
|
|
410
|
-
- type: git_commit
|
|
411
|
-
description: "Rescue round commit"
|
|
412
|
-
- id: progress_check
|
|
413
|
-
role: investigator
|
|
414
|
-
depends_on: [fix]
|
|
415
|
-
description: "Check test progress after surgeon's fix."
|
|
416
|
-
prompt: |
|
|
417
|
-
Run tests. Compare green count with previous round.
|
|
418
|
-
If green count increased: PROGRESS — proceed to review.
|
|
419
|
-
If green count unchanged or decreased: NO_PROGRESS — record what surgeon tried
|
|
420
|
-
and why it didn't work, for the experience chain.
|
|
421
|
-
handoff:
|
|
422
|
-
consumes:
|
|
423
|
-
- type: git_commit
|
|
424
|
-
from: fix
|
|
425
|
-
description: "Fix commit from surgeon"
|
|
426
|
-
produces:
|
|
427
|
-
- type: summary
|
|
428
|
-
description: "Progress check result (PROGRESS or NO_PROGRESS)"
|
|
429
|
-
- id: review
|
|
430
|
-
role: investigator
|
|
431
|
-
depends_on: [progress_check]
|
|
432
|
-
description: "Read-only review of surgeon's changes."
|
|
433
|
-
prompt: |
|
|
434
|
-
Review surgeon's git diff (read-only, do NOT modify any files):
|
|
435
|
-
1. Are changes minimal? No unnecessary files touched?
|
|
436
|
-
2. Does the code match v2 patterns (Riverpod, GoRouter)?
|
|
437
|
-
3. Are mocks correct (not faked just to make tests pass)?
|
|
438
|
-
4. Any new issues introduced?
|
|
439
|
-
|
|
440
|
-
Verdict: APPROVE → proceed to verify
|
|
441
|
-
Verdict: REQUEST_CHANGES → describe specific problems. Next round's investigate step will include this feedback.
|
|
442
|
-
handoff:
|
|
443
|
-
consumes:
|
|
444
|
-
- type: summary
|
|
445
|
-
from: progress_check
|
|
446
|
-
description: "Progress check result"
|
|
447
|
-
- type: git_commit
|
|
448
|
-
from: fix
|
|
449
|
-
description: "Committed fix from surgeon"
|
|
450
|
-
produces:
|
|
451
|
-
- type: summary
|
|
452
|
-
description: "Review verdict (APPROVE or REQUEST_CHANGES)"
|
|
453
|
-
- id: verify
|
|
454
|
-
role: investigator
|
|
455
|
-
depends_on: [review]
|
|
456
|
-
description: "Independent test verification + regression check."
|
|
457
|
-
prompt: |
|
|
458
|
-
Run tests independently (do not trust surgeon's reported results):
|
|
459
|
-
1. `flutter test {{test_path}}/$ARGUMENTS/ --timeout 30s` (per-test safety net; hung = mock infra issue)
|
|
460
|
-
2. `flutter analyze` (compilation check)
|
|
461
|
-
3. Check for regressions in core module tests if applicable
|
|
462
|
-
|
|
463
|
-
Record test delta vs previous round.
|
|
464
|
-
Each acceptance criterion: VERIFIED / PARTIAL / MISSING
|
|
465
|
-
Verdict: PASS or FAIL
|
|
466
|
-
handoff:
|
|
467
|
-
consumes:
|
|
468
|
-
- type: summary
|
|
469
|
-
from: review
|
|
470
|
-
description: "Review verdict"
|
|
471
|
-
produces:
|
|
472
|
-
- type: test_result
|
|
473
|
-
path: "{{test_path}}/$ARGUMENTS/"
|
|
474
|
-
description: "Verified test results"
|
|
475
|
-
- id: report
|
|
476
|
-
role: investigator
|
|
477
|
-
depends_on: [verify]
|
|
478
|
-
description: "Round summary with convergence judgment."
|
|
479
|
-
prompt: |
|
|
480
|
-
Summary:
|
|
481
|
-
1. Test delta: +N green, -M red, ±K skipped vs last round
|
|
482
|
-
2. Remaining tests by category (logic vs widget vs platform)
|
|
483
|
-
3. Convergence check:
|
|
484
|
-
- If 2 consecutive rounds with no test progress → STOP, output blocked items + analysis
|
|
485
|
-
- If all green → "Module $ARGUMENTS rescue complete"
|
|
486
|
-
- Otherwise → "Run /rescue $ARGUMENTS to continue (round N+1 of max 10)"
|
|
487
|
-
4. If review verdict was REQUEST_CHANGES: include the specific feedback for next round
|
|
488
|
-
handoff:
|
|
489
|
-
consumes:
|
|
490
|
-
- type: test_result
|
|
491
|
-
from: verify
|
|
492
|
-
description: "Verified test results from verify step"
|
|
493
|
-
produces:
|
|
494
|
-
- type: summary
|
|
495
|
-
description: "Round summary with test delta and convergence status"
|
|
496
348
|
|
|
497
349
|
core-align:
|
|
498
350
|
name: Core Align
|
|
@@ -517,16 +369,19 @@ workflows:
|
|
|
517
369
|
|
|
518
370
|
For module $ARGUMENTS, analyze failing tests in baseline:
|
|
519
371
|
1. Read behavior doc: docs/behavior/$ARGUMENTS.md
|
|
520
|
-
2. Read test results from last behavior-lock run
|
|
521
|
-
3.
|
|
372
|
+
2. Read test results from last behavior-lock run. If no structured baseline artifact exists, state exactly which file(s) you used as the baseline source.
|
|
373
|
+
3. Treat docs/behavior/blocked_items.md as historical context only. It must never be used as the current run verdict.
|
|
374
|
+
4. For each failing, skipped, and hung test:
|
|
522
375
|
a. Read test code (what behavior does it expect?)
|
|
523
376
|
b. Read v1 implementation (how did v1 do this?)
|
|
524
377
|
c. Read v2 current state (what's missing/wrong?)
|
|
525
378
|
d. Classify: BUG / UNIMPLEMENTED / INFRA / REMOVED / TEST_BUG
|
|
526
|
-
|
|
379
|
+
5. Write .dna/specs/diagnosis-$ARGUMENTS.md with:
|
|
527
380
|
- For each failure: v1 code snippet + v2 current state + classification
|
|
528
|
-
-
|
|
381
|
+
- Evidence paths for every classification
|
|
382
|
+
- NO fix prescriptions, implementation order, call-site instructions, or "Notes for Surgeon"
|
|
529
383
|
- NO running tests (analysis only)
|
|
384
|
+
6. If this is a reanalysis after REQUEST_REANALYSIS, read the reviewer verdict first, update every section listed in sections_to_fix plus the summary table, and report sections_updated in your final response. Reanalysis is not successful unless the spec artifact is rewritten.
|
|
530
385
|
handoff:
|
|
531
386
|
produces:
|
|
532
387
|
- type: file
|
|
@@ -545,10 +400,23 @@ workflows:
|
|
|
545
400
|
1. All failing tests from baseline covered?
|
|
546
401
|
2. v1 code references actually exist at claimed locations?
|
|
547
402
|
3. Classifications reasonable? (INFRA not mistaken for BUG)
|
|
548
|
-
4. Enough detail for surgeon to act?
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
403
|
+
4. Enough evidence detail for surgeon to act without adding fix prescriptions?
|
|
404
|
+
5. Diagnosis remains evidence-only: no implementation order, call-site instructions, or "Notes for Surgeon"?
|
|
405
|
+
|
|
406
|
+
Output exactly one structured verdict block:
|
|
407
|
+
```json
|
|
408
|
+
{
|
|
409
|
+
"verdict": "APPROVE" | "REQUEST_REANALYSIS",
|
|
410
|
+
"artifact_reviewed": ".dna/specs/diagnosis-$ARGUMENTS.md",
|
|
411
|
+
"sections_to_fix": ["section ids or titles; empty when approved"],
|
|
412
|
+
"evidence_paths": ["paths that justify the verdict"],
|
|
413
|
+
"confidence": "high" | "medium" | "low",
|
|
414
|
+
"summary": "brief reason"
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
APPROVE → diagnosis complete.
|
|
419
|
+
REQUEST_REANALYSIS → sections_to_fix must be passed back to analyze. docs/behavior/blocked_items.md is historical context only and must not be treated as the current run verdict.
|
|
552
420
|
handoff:
|
|
553
421
|
consumes:
|
|
554
422
|
- type: file
|
|
@@ -560,36 +428,32 @@ workflows:
|
|
|
560
428
|
|
|
561
429
|
fix:
|
|
562
430
|
name: Fix
|
|
563
|
-
description: "Read diagnosis spec and fix v2 code for module $ARGUMENTS with
|
|
431
|
+
description: "Read diagnosis spec and fix v2 code for module $ARGUMENTS with review and verification gates"
|
|
564
432
|
steps:
|
|
565
433
|
- id: fix_bugs
|
|
566
434
|
role: surgeon
|
|
567
|
-
max_attempts: 3
|
|
568
|
-
on_fail: handoff
|
|
569
|
-
handoff_to: fix_bugs
|
|
570
|
-
max_handoffs: 3
|
|
571
|
-
on_handoff_exhausted: skip
|
|
572
435
|
blocked_items_path: "docs/behavior/blocked_items.md"
|
|
573
436
|
description: "Fix issues according to diagnosis spec classifications"
|
|
574
437
|
prompt: |
|
|
575
|
-
|
|
438
|
+
This invocation is one fix round. If prior verify_report or experience_chain context is provided, read it first and do not repeat failed approaches.
|
|
576
439
|
|
|
577
440
|
Read context + diagnosis spec first.
|
|
578
441
|
|
|
579
|
-
|
|
580
|
-
|
|
442
|
+
Count diagnosis classifications before editing. If UNIMPLEMENTED count is greater than 100, this round is implementation-first: fix UNIMPLEMENTED items by priority only, and leave TEST_BUG / BUG / INFRA / REMOVED for later rounds unless they block implementation.
|
|
443
|
+
|
|
444
|
+
Otherwise process issues in priority order: INFRA → BUG → TEST_BUG → UNIMPLEMENTED.
|
|
445
|
+
REMOVED is always skipped unless the user explicitly approved handling it.
|
|
581
446
|
|
|
582
447
|
For each issue:
|
|
583
448
|
- BUG: read v1 file, edit v2 (use Riverpod per refactoring-workflow-v2.md)
|
|
584
|
-
- UNIMPLEMENTED: read v1 impl, implement in v2 style, remove skip marker from test
|
|
585
|
-
- INFRA: edit test_helpers only, do NOT touch v2/lib
|
|
586
449
|
- TEST_BUG: re-read v1, edit test to match v1 behavior
|
|
450
|
+
- INFRA: edit test_helpers only, do NOT touch v2/lib
|
|
451
|
+
- UNIMPLEMENTED: read v1 impl, implement in v2 style, remove skip marker from test
|
|
587
452
|
|
|
588
|
-
|
|
453
|
+
Continue within the round while changes are coherent and reviewable. If the remaining work is large, stop at a natural boundary and leave the rest for the next fix round.
|
|
589
454
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
- Read them, use a DIFFERENT approach
|
|
455
|
+
After each fix: run tests ONCE for that specific file.
|
|
456
|
+
Commit only the round's coherent changes, with message including what changed, why, and which tests were targeted.
|
|
593
457
|
handoff:
|
|
594
458
|
consumes:
|
|
595
459
|
- type: file
|
|
@@ -599,24 +463,87 @@ workflows:
|
|
|
599
463
|
- type: git_commit
|
|
600
464
|
description: "Fix commit"
|
|
601
465
|
|
|
602
|
-
- id:
|
|
603
|
-
role:
|
|
466
|
+
- id: review_changes
|
|
467
|
+
role: fix_reviewer
|
|
604
468
|
depends_on: [fix_bugs]
|
|
469
|
+
description: "Review surgeon changes before verification"
|
|
470
|
+
prompt: |
|
|
471
|
+
Read diagnosis spec, behavior doc, and git diff.
|
|
472
|
+
|
|
473
|
+
Review only the surgeon's changes:
|
|
474
|
+
1. Are changes limited to BUG / UNIMPLEMENTED / INFRA / TEST_BUG items in the approved diagnosis?
|
|
475
|
+
2. Is REMOVED handling absent unless explicitly approved by user?
|
|
476
|
+
3. Does implementation preserve v1 behavior and follow v2 architecture?
|
|
477
|
+
4. Are test infra changes honest, not fake mocks?
|
|
478
|
+
5. Is there unrelated refactor or scope creep?
|
|
479
|
+
|
|
480
|
+
Output exactly one structured verdict block:
|
|
481
|
+
```json
|
|
482
|
+
{
|
|
483
|
+
"verdict": "APPROVE" | "REQUEST_CHANGES",
|
|
484
|
+
"issues": ["specific issue with evidence path; empty when approved"],
|
|
485
|
+
"evidence_paths": ["paths that justify the verdict"],
|
|
486
|
+
"failure_reason": "why changes need another round; empty when approved",
|
|
487
|
+
"next_round_focus": "specific priority/classification/test file for the next fix invocation; empty when approved",
|
|
488
|
+
"summary": "brief reason"
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
REQUEST_CHANGES → include failure_reason and concrete next_round_focus for the next fix invocation.
|
|
493
|
+
handoff:
|
|
494
|
+
consumes:
|
|
495
|
+
- type: git_commit
|
|
496
|
+
from: fix_bugs
|
|
497
|
+
description: "Fix commit from surgeon"
|
|
498
|
+
- type: file
|
|
499
|
+
path: ".dna/specs/diagnosis-$ARGUMENTS.md"
|
|
500
|
+
description: "Diagnosis spec"
|
|
501
|
+
- type: file
|
|
502
|
+
path: "docs/behavior/$ARGUMENTS.md"
|
|
503
|
+
description: "Behavior document"
|
|
504
|
+
produces:
|
|
505
|
+
- type: summary
|
|
506
|
+
description: "Review verdict (APPROVE or REQUEST_CHANGES)"
|
|
507
|
+
|
|
508
|
+
- id: verify_report
|
|
509
|
+
role: test_runner
|
|
510
|
+
depends_on: [review_changes]
|
|
605
511
|
description: "Verify progress and output report"
|
|
606
512
|
prompt: |
|
|
607
|
-
|
|
608
|
-
|
|
513
|
+
Read the review verdict and diagnosis spec first.
|
|
514
|
+
|
|
515
|
+
If the review verdict is REQUEST_CHANGES, set Verdict: BLOCKED, set Failure reason: BLOCKED_BY_REVIEW plus reviewer details, and do not claim verification.
|
|
516
|
+
|
|
517
|
+
If the review verdict is APPROVE:
|
|
518
|
+
- Run full module test suite for $ARGUMENTS.
|
|
519
|
+
- Compare with diagnosis spec baseline.
|
|
609
520
|
|
|
610
521
|
Output report:
|
|
522
|
+
- Verdict: PASS / CONTINUE / REQUEST_CHANGES / BLOCKED
|
|
523
|
+
- Review: APPROVE / REQUEST_CHANGES
|
|
611
524
|
- Fixed: N tests now green
|
|
612
525
|
- New red: M tests that regressed
|
|
613
526
|
- Blocked: K tests skipped (see blocked_items.md)
|
|
614
527
|
- Remaining: R tests still failing
|
|
528
|
+
- Failure reason: why progress stopped, if any
|
|
529
|
+
- Next round focus: the priority/classification/test file to continue with, if verdict is CONTINUE or REQUEST_CHANGES
|
|
530
|
+
|
|
531
|
+
Verdict meanings:
|
|
532
|
+
- PASS: all approved diagnosis items are fixed or intentionally skipped
|
|
533
|
+
- CONTINUE: this round made progress and remaining approved items should continue in the next fix invocation
|
|
534
|
+
- REQUEST_CHANGES: review or verification found issues in this round's changes
|
|
535
|
+
- BLOCKED: user confirmation is needed or repeated no-progress prevents safe continuation
|
|
615
536
|
handoff:
|
|
616
537
|
consumes:
|
|
538
|
+
- type: summary
|
|
539
|
+
from: review_changes
|
|
540
|
+
description: "Review verdict from fix_reviewer"
|
|
617
541
|
- type: git_commit
|
|
618
542
|
from: fix_bugs
|
|
619
543
|
description: "Fix commit from surgeon"
|
|
544
|
+
- type: file
|
|
545
|
+
path: ".dna/specs/diagnosis-$ARGUMENTS.md"
|
|
546
|
+
description: "Diagnosis spec"
|
|
620
547
|
produces:
|
|
621
548
|
- type: summary
|
|
622
|
-
description: "
|
|
549
|
+
description: "Verification report with test delta"
|
package/hooks/hooks.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"SubagentStop": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook SubagentStop", "timeout": 3 }] }],
|
|
7
7
|
"PreCompact": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook PreCompact", "timeout": 3 }] }],
|
|
8
8
|
"Notification": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook Notification", "timeout": 3 }] }],
|
|
9
|
-
"Stop": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook Stop", "timeout":
|
|
9
|
+
"Stop": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook Stop", "timeout": 45 }] }],
|
|
10
10
|
"SessionStart": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook SessionStart", "timeout": 5 }] }]
|
|
11
11
|
}
|
|
12
12
|
}
|