intentdna 1.6.3 → 1.6.5

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.
@@ -289,7 +289,7 @@ controllers:
289
289
  fix-loop:
290
290
  name: Fix Loop
291
291
  description: "Run diagnosis once if needed, then loop fix/review/verify until PASS or stop condition"
292
- kind: flutter_rewrite_fix_loop
292
+ kind: fix_loop
293
293
  max_rounds: 10
294
294
  progress_artifact_path: ".dna/fix-progress/$ARGUMENTS.json"
295
295
  diagnosis_workflow: diagnosis
@@ -303,7 +303,47 @@ controllers:
303
303
  surgeon: surgeon
304
304
  fix_reviewer: fix_reviewer
305
305
  test_runner: test_runner
306
- stop_format: zh_three_part
306
+ stop_format: configured_stop_report
307
+ policy:
308
+ diagnosis_reuse_criteria:
309
+ - "$diagnosis_artifact_path exists"
310
+ - "$diagnosis_review_artifact_path exists and verdict is APPROVE"
311
+ - "behavior doc is not newer than diagnosis spec"
312
+ - "baseline artifact is not newer than diagnosis spec"
313
+ - "user did not explicitly pass reanalyze or scope changed"
314
+ - "progress JSON does not say diagnosis_invalid"
315
+ progress_provenance_checks:
316
+ - "module equals the safe module argument"
317
+ - "round equals the provided current_round"
318
+ - "run_id equals the provided controller_run_id"
319
+ - "diagnosis_artifact equals $diagnosis_artifact_path"
320
+ - "review_artifact equals $review_artifact_path"
321
+ - "git_head or last_fix_commit references the current round's fix commit when available"
322
+ - "updated_at is not earlier than the current round start time"
323
+ progress_provenance_failure: "if provenance is missing, stale, or mismatched, stop with Verdict BLOCKED and failure_reason PROGRESS_PROVENANCE_MISMATCH"
324
+ verdict_branches:
325
+ - "PASS -> success stop"
326
+ - "CONTINUE -> next fresh context fix round"
327
+ - "REQUEST_CHANGES -> stop with the configured stop report"
328
+ - "BLOCKED -> stop with the configured stop report"
329
+ verdict_mapping:
330
+ - "PASS / CONTINUE / REQUEST_CHANGES / BLOCKED mapping:"
331
+ - "- PASS: success stop"
332
+ - "- CONTINUE: start the next fresh context round"
333
+ - "- REQUEST_CHANGES: stop, report reviewer/verifier requested changes"
334
+ - "- BLOCKED: stop, report blocker"
335
+ - "- MAX_ROUNDS: stop, report max rounds reached and next focus"
336
+ stop_report:
337
+ - "On REQUEST_CHANGES, BLOCKED, or MAX_ROUNDS, output exactly these Chinese sections:"
338
+ - "结论:state the direct stop trigger, current round, and current commit if one exists."
339
+ - "为什么停止:explain the workflow principle in plain language; if this is a current-round new red, explain that continuing would build on a bad baseline."
340
+ - "是否回滚:say whether rollback/revert is recommended. If the commit direction looks wrong or the blast radius is unclear, recommend revert; if the failure is narrow and fixable, recommend fix-forward."
341
+ - "下一步:give one concrete next action. If recommending fix-forward, include a copy-paste single-fix prompt with current commit, exact failure, allowed scope, forbidden actions, verification command, commit expectation, and stop conditions."
342
+ constraints:
343
+ - "Do not infer module completion from raw test output."
344
+ - "The controller must schedule only from $progress_artifact_path."
345
+ - "Manual /dna-frw-diagnosis and /dna-frw-fix flows remain separate and available."
346
+ - "Do not use the generic workflow policy block; branch only from the progress JSON verdict."
307
347
 
308
348
  workflows:
309
349
  behavior-lock:
@@ -494,7 +534,11 @@ workflows:
494
534
 
495
535
  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.
496
536
 
497
- After each fix: run tests ONCE for that specific file.
537
+ Shared boundary rule:
538
+ - If this round changes an interface, abstract class, provider, initializer, repository contract, constructor, public model/DTO, fake/mock, or test helper, search for affected fake/mock/helper implementations and update them in the same round.
539
+ - In that case, run the targeted test plus the affected module behavior suite once when practical; do not wait for final verification to discover compile/load failures caused by stale test fakes.
540
+
541
+ After each fix: run tests ONCE for that specific file unless the shared boundary rule requires the affected module behavior suite.
498
542
  Commit only the round's coherent changes, with message including what changed, why, and which tests were targeted.
499
543
  handoff:
500
544
  consumes:
@@ -520,7 +564,8 @@ workflows:
520
564
  2. Is REMOVED handling absent unless explicitly approved by user?
521
565
  3. Does implementation preserve v1 behavior and follow v2 architecture?
522
566
  4. Are test infra changes honest, not fake mocks?
523
- 5. Is there unrelated refactor or scope creep?
567
+ 5. If shared interfaces/providers/initializers/contracts/constructors/models or test helpers changed, were affected fake/mock/helper implementations searched and synchronized?
568
+ 6. Is there unrelated refactor or scope creep?
524
569
 
525
570
  Output exactly one structured verdict block:
526
571
  ```json
@@ -614,6 +659,8 @@ workflows:
614
659
  - Remaining UNIMPLEMENTED skipped: U diagnosis-backed skipped tests still remaining
615
660
  - Failure reason: why progress stopped, if any
616
661
  - Next round focus: the priority/classification/test file to continue with, if verdict is CONTINUE or REQUEST_CHANGES
662
+ - Rollback decision: say whether the current round commit should be reverted or fixed forward, with one plain-language reason
663
+ - Single-fix prompt: required when rollback decision recommends fix-forward; include current commit, exact failure, allowed scope, forbidden actions, verification command, commit expectation, and stop conditions
617
664
 
618
665
  Always write or update .dna/fix-progress/$ARGUMENTS.md before finishing, even when review blocks verification. Include these sections:
619
666
  - Current verdict: Verdict, Review, Module complete, Last fix commit, Updated at
@@ -622,6 +669,8 @@ workflows:
622
669
  - Review Issues To Address First: reviewer issues when Review is REQUEST_CHANGES
623
670
  - Failed approaches / Do not repeat: approaches that failed or caused regressions
624
671
  - Evidence: commands run and relevant paths
672
+ - Rollback Decision: required when Verdict is REQUEST_CHANGES or BLOCKED after a current-round commit exists; say revert or fix-forward with one reason
673
+ - Single-Fix Prompt: required when Rollback Decision recommends fix-forward; make it copy-pasteable and narrow
625
674
 
626
675
  Always write or update .dna/fix-progress/$ARGUMENTS.json before finishing, even when review blocks verification. The JSON must match this contract exactly:
627
676
  ```json
@@ -0,0 +1,6 @@
1
+ export interface TemplateMatchMetadata {
2
+ name: string;
3
+ keywords: readonly string[];
4
+ }
5
+ export declare const TEMPLATE_MATCH_METADATA: readonly TemplateMatchMetadata[];
6
+ export declare function getTemplateMatchMetadata(name: string): TemplateMatchMetadata | undefined;
@@ -0,0 +1,32 @@
1
+ export const TEMPLATE_MATCH_METADATA = [
2
+ { name: "code-review-pipeline", keywords: ["review", "code review", "pr review", "pull request", "审查"] },
3
+ { name: "safe-refactoring", keywords: ["refactor", "refactoring", "restructure", "rewrite safely", "重构"] },
4
+ { name: "tdd-strict", keywords: ["tdd", "test driven", "test first", "red green", "测试驱动"] },
5
+ { name: "full-pipeline", keywords: ["pipeline", "plan implement test", "full workflow", "完整流水线"] },
6
+ { name: "systematic-debugging", keywords: ["debug", "debugging", "bug fix", "troubleshoot", "调试"] },
7
+ { name: "verification-loop", keywords: ["verify", "verification", "validate", "check", "验证"] },
8
+ { name: "secure-dev", keywords: ["security", "secure", "owasp", "vulnerability", "安全"] },
9
+ { name: "enterprise-baseline", keywords: ["enterprise", "organization", "company", "corporate", "企业"] },
10
+ { name: "frontend-quality", keywords: ["frontend", "react", "vue", "css", "ui", "前端"] },
11
+ { name: "api-backend", keywords: ["api", "backend", "rest", "graphql", "server", "后端"] },
12
+ { name: "mobile-dev", keywords: ["mobile", "ios", "android", "react native", "移动"] },
13
+ { name: "documentation-writer", keywords: ["doc", "documentation", "readme", "wiki", "文档"] },
14
+ { name: "devops-cicd", keywords: ["devops", "ci", "cd", "deploy", "pipeline", "运维"] },
15
+ { name: "monorepo-governance", keywords: ["monorepo", "workspace", "packages", "governance"] },
16
+ { name: "flutter-behavior-lock", keywords: ["flutter", "behavior lock", "behavior spec", "行为锁定"] },
17
+ { name: "flutter-rewrite", keywords: ["flutter", "rewrite", "migration", "flutter rewrite"] },
18
+ { name: "flutter-refactoring-rescue", keywords: ["flutter", "rescue", "refactoring rescue"] },
19
+ { name: "multi-perspective-review", keywords: ["multi perspective", "multiple reviewer", "多角度"] },
20
+ { name: "subagent-parallel", keywords: ["parallel", "subagent", "concurrent", "并行"] },
21
+ { name: "yolo-with-guardrails", keywords: ["yolo", "fast", "guardrails", "move fast"] },
22
+ { name: "brainstorming-first", keywords: ["brainstorm", "explore", "ideation", "探索"] },
23
+ { name: "branch-finishing", keywords: ["branch", "finish", "cleanup", "pr prep"] },
24
+ { name: "pr-submitter", keywords: ["pr", "pull request", "submit"] },
25
+ { name: "migration-safety", keywords: ["migration", "migrate", "upgrade", "database migration", "dependency upgrade", "迁移"] },
26
+ { name: "incident-response", keywords: ["incident", "production issue", "hotfix", "outage", "postmortem", "事故"] },
27
+ { name: "performance-audit", keywords: ["performance", "profiling", "benchmark", "optimize", "latency", "性能"] },
28
+ ];
29
+ const TEMPLATE_MATCH_METADATA_BY_NAME = new Map(TEMPLATE_MATCH_METADATA.map((entry) => [entry.name, entry]));
30
+ export function getTemplateMatchMetadata(name) {
31
+ return TEMPLATE_MATCH_METADATA_BY_NAME.get(name);
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intentdna",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "description": "Intent DNA — Declarative policy layer for AI agent behavior",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",