intentdna 1.6.0 → 1.6.2

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.
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "intentdna",
11
11
  "description": "Declarative policy layer for AI agent behavior with plugin-managed hook runtime for Claude Code.",
12
- "version": "1.6.0",
12
+ "version": "1.6.2",
13
13
  "author": {
14
14
  "name": "Samuel"
15
15
  },
@@ -25,5 +25,5 @@
25
25
  ]
26
26
  }
27
27
  ],
28
- "version": "1.6.0"
28
+ "version": "1.6.2"
29
29
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intentdna",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Declarative policy layer for AI agent behavior",
5
5
  "author": {
6
6
  "name": "Samuel"
@@ -134,6 +134,7 @@ context_files:
134
134
  - ".dna/specs/diagnosis-{{ARGUMENTS}}.md"
135
135
  surgeon:
136
136
  - ".dna/specs/diagnosis-{{ARGUMENTS}}.md"
137
+ - ".dna/specs/diagnosis-{{ARGUMENTS}}.review.json"
137
138
  fix_reviewer:
138
139
  - "docs/behavior/{{ARGUMENTS}}.md"
139
140
  - ".dna/specs/diagnosis-{{ARGUMENTS}}.md"
@@ -465,13 +466,20 @@ workflows:
465
466
  prompt: |
466
467
  This invocation is one fix round.
467
468
 
468
- Before editing, check whether .dna/fix-progress/$ARGUMENTS.md exists.
469
- - If it exists, read it before the diagnosis spec and continue from its Next Round Focus.
470
- - If it records REQUEST_CHANGES or BLOCKED_BY_REVIEW, address those review issues before starting unrelated diagnosis items.
471
- - Use Failed approaches / Do not repeat to avoid repeating unsuccessful fixes.
472
- - If it does not exist, treat this as round 1.
469
+ Before editing, read .dna/specs/diagnosis-$ARGUMENTS.review.json.
470
+ - If it is missing, invalid, or verdict is not APPROVE, stop immediately; do not edit.
471
+ - Manual fix invocations must obey this same gate.
472
+ - If verdict is REQUEST_REANALYSIS, run diagnosis reanalysis first instead of fixing.
473
473
 
474
- Read context + diagnosis spec first.
474
+ Read context + diagnosis spec only after the diagnosis review gate passes.
475
+
476
+ Progress artifacts:
477
+ - .dna/fix-progress/$ARGUMENTS.json is the machine-readable source of truth for controller scheduling.
478
+ - If JSON exists and provenance matches this module, use its next_round_focus/verdict for the current round.
479
+ - .dna/fix-progress/$ARGUMENTS.md is human-readable legacy/manual context only; read it for Failed approaches / Do not repeat and evidence, but never use it as the controller verdict or source of truth.
480
+ - If .md exists without .json, treat it as legacy context only; do not infer PASS/CONTINUE/BLOCKED from it.
481
+ - If progress records REQUEST_CHANGES or BLOCKED_BY_REVIEW, address those review issues before starting unrelated diagnosis items.
482
+ - If neither progress artifact exists, treat this as round 1.
475
483
 
476
484
  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.
477
485
 
@@ -493,6 +501,9 @@ workflows:
493
501
  - type: file
494
502
  path: ".dna/specs/diagnosis-$ARGUMENTS.md"
495
503
  description: "Diagnosis spec"
504
+ - type: file
505
+ path: ".dna/specs/diagnosis-$ARGUMENTS.review.json"
506
+ description: "Approved diagnosis review gate"
496
507
  produces:
497
508
  - type: git_commit
498
509
  description: "Fix commit"
@@ -518,6 +529,9 @@ workflows:
518
529
  "module": "$ARGUMENTS",
519
530
  "round": 1,
520
531
  "run_id": "controller run id or manual-run",
532
+ "actionability": "none | actionable | needs_human | unsafe | unclear",
533
+ "scope": "none | in_diagnosis | outside_diagnosis | unclear",
534
+ "risk": "none | low | medium | high",
521
535
  "issues": ["specific issue with evidence path; empty when approved"],
522
536
  "evidence_paths": ["paths that justify the verdict"],
523
537
  "failure_reason": "why changes need another round; empty when approved",
@@ -533,9 +547,11 @@ workflows:
533
547
  - module is required and must equal $ARGUMENTS.
534
548
  - round is required and must be the provided current_round, or 1 for manual fix invocation.
535
549
  - run_id is required and must equal the provided controller_run_id, or "manual-run" for manual fix invocation.
536
- - updated_at is a required ISO timestamp string.
537
-
538
- REQUEST_CHANGES include failure_reason and concrete next_round_focus for the next fix invocation. The next_round_focus must name the priority/classification and specific test file or evidence path to address first.
550
+ - actionability, scope, risk, and updated_at are required.
551
+ - APPROVE → actionability/scope/risk should be none, issues empty, failure_reason empty, next_round_focus empty.
552
+ - REQUEST_CHANGES can continue automatically only when actionability is actionable, scope is in_diagnosis, risk is low or medium, and next_round_focus is concrete.
553
+ - REQUEST_CHANGES must stop when actionability is needs_human/unsafe/unclear, scope is outside_diagnosis/unclear, risk is high, or next_round_focus is empty.
554
+ - REQUEST_CHANGES → include failure_reason and concrete next_round_focus for the next fix invocation. The next_round_focus must name the priority/classification and specific test file or evidence path to address first.
539
555
  handoff:
540
556
  consumes:
541
557
  - type: git_commit
@@ -559,7 +575,9 @@ workflows:
559
575
  prompt: |
560
576
  Read the review verdict and diagnosis spec first.
561
577
 
562
- If the review verdict is REQUEST_CHANGES, set Verdict: BLOCKED, set Failure reason: BLOCKED_BY_REVIEW plus reviewer details, and do not claim verification.
578
+ If the review verdict is REQUEST_CHANGES:
579
+ - If actionability is actionable, scope is in_diagnosis, risk is low or medium, and next_round_focus is concrete, set Verdict: CONTINUE and do not run tests; copy reviewer next_round_focus into Next Round Focus.
580
+ - Otherwise set Verdict: BLOCKED, set Failure reason: BLOCKED_BY_REVIEW plus reviewer details, and do not run tests.
563
581
 
564
582
  If the review verdict is APPROVE:
565
583
  - Run full module test suite for $ARGUMENTS.
@@ -576,7 +594,8 @@ workflows:
576
594
  - Before writing Module complete: yes, read diagnosis classification summary, read current test summary, compare skipped tests against remaining UNIMPLEMENTED diagnosis items, and if any UNIMPLEMENTED skipped remains, Module complete must be no.
577
595
 
578
596
  Verdict mapping:
579
- - review REQUEST_CHANGES -> Verdict: BLOCKED, Failure reason: BLOCKED_BY_REVIEW.
597
+ - review REQUEST_CHANGES + actionable + in_diagnosis + risk low/medium + concrete next_round_focus -> Verdict: CONTINUE, Module complete: no, Next Round Focus: reviewer next_round_focus.
598
+ - review REQUEST_CHANGES without safe actionable scope -> Verdict: BLOCKED, Failure reason: BLOCKED_BY_REVIEW.
580
599
  - 0 failed + remaining UNIMPLEMENTED skipped > 0 -> Verdict: CONTINUE, Module complete: no, Next Round Focus: next diagnosis-backed UNIMPLEMENTED test/evidence path.
581
600
  - progress contradicts diagnosis/test evidence -> Verdict: BLOCKED, Failure reason: PROGRESS_DIAGNOSIS_CONFLICT.
582
601
  - new red caused by current round -> Verdict: REQUEST_CHANGES.
@@ -612,6 +631,9 @@ workflows:
612
631
  "module": "$ARGUMENTS",
613
632
  "round": 1,
614
633
  "run_id": "controller run id or manual-run",
634
+ "actionability": "none | actionable | needs_human | unsafe | unclear",
635
+ "scope": "none | in_diagnosis | outside_diagnosis | unclear",
636
+ "risk": "none | low | medium | high",
615
637
  "diagnosis_artifact": ".dna/specs/diagnosis-$ARGUMENTS.md",
616
638
  "review_artifact": ".dna/reviews/$ARGUMENTS-review.json",
617
639
  "git_head": null,
@@ -638,10 +660,11 @@ workflows:
638
660
  - git_head is the current git HEAD after verification if available, otherwise null.
639
661
  - verdict is required and must be PASS, CONTINUE, REQUEST_CHANGES, or BLOCKED.
640
662
  - review is required and must be APPROVE or REQUEST_CHANGES.
663
+ - actionability, scope, and risk are required and must mirror the review verdict when review is REQUEST_CHANGES; use none/none/none when review is APPROVE.
641
664
  - module_complete is a required boolean and must match the Markdown Module complete value.
642
665
  - fixed_count, new_red_count, blocked_count, remaining_count, and remaining_unimplemented_skipped_count are required non-negative integers.
643
666
  - next_round_focus is required and non-empty when verdict is CONTINUE or REQUEST_CHANGES; empty string is allowed when verdict is PASS.
644
- - failure_reason is required and non-empty when verdict is BLOCKED or REQUEST_CHANGES; empty string is allowed when verdict is PASS or CONTINUE.
667
+ - failure_reason is required and non-empty when verdict is BLOCKED or REQUEST_CHANGES; empty string is allowed when verdict is PASS or CONTINUE. When review REQUEST_CHANGES is normalized to verdict CONTINUE, keep reviewer failure details in Review Issues To Address First instead of failure_reason.
645
668
  - last_fix_commit is the commit hash string if available, otherwise null.
646
669
  - evidence_paths is a required array of command/test/diagnosis/review evidence paths.
647
670
  - updated_at is a required ISO timestamp string.
@@ -650,9 +673,9 @@ workflows:
650
673
 
651
674
  Verdict meanings:
652
675
  - PASS: all actionable BUG / UNIMPLEMENTED items are fixed, with no diagnosis-backed UNIMPLEMENTED skipped tests remaining; only TEST_BUG / INFRA / REMOVED / explicitly user-approved blocked items may remain
653
- - CONTINUE: this round made progress and remaining approved items should continue in the next fix invocation
676
+ - CONTINUE: this round made progress or review found safe, actionable, in-diagnosis issues that should continue in the next fix invocation
654
677
  - REQUEST_CHANGES: verification found issues in this round's changes
655
- - BLOCKED: review blocks verification, user confirmation is needed, evidence conflicts, or repeated no-progress prevents safe continuation
678
+ - BLOCKED: review blocks verification, user confirmation is needed, evidence conflicts, unsafe/out-of-scope changes, or repeated no-progress prevents safe continuation
656
679
  handoff:
657
680
  consumes:
658
681
  - type: file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intentdna",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Intent DNA — Declarative policy layer for AI agent behavior",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",