intentdna 1.7.4 → 1.8.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.
Files changed (152) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/LICENSE +201 -0
  4. package/README.md +143 -194
  5. package/dist/assets/candidates.d.ts +124 -0
  6. package/dist/assets/candidates.js +1249 -0
  7. package/dist/assets/catalog.d.ts +101 -0
  8. package/dist/assets/catalog.js +311 -0
  9. package/dist/assets/evidence.d.ts +93 -0
  10. package/dist/assets/evidence.js +391 -0
  11. package/dist/assets/index.d.ts +4 -0
  12. package/dist/assets/index.js +4 -0
  13. package/dist/assets/metadata.d.ts +19 -0
  14. package/dist/assets/metadata.js +227 -0
  15. package/dist/cli/commands/assets.d.ts +65 -0
  16. package/dist/cli/commands/assets.js +2871 -0
  17. package/dist/cli/commands/auth.d.ts +322 -0
  18. package/dist/cli/commands/auth.js +1592 -0
  19. package/dist/cli/commands/cloud-auth-guidance.d.ts +2 -0
  20. package/dist/cli/commands/cloud-auth-guidance.js +4 -0
  21. package/dist/cli/commands/cloud.d.ts +1359 -0
  22. package/dist/cli/commands/cloud.js +8364 -0
  23. package/dist/cli/commands/evolve.js +18 -2
  24. package/dist/cli/commands/generate.js +25 -2
  25. package/dist/cli/commands/guard.d.ts +1 -1
  26. package/dist/cli/commands/guard.js +1 -1
  27. package/dist/cli/commands/guide.d.ts +15 -0
  28. package/dist/cli/commands/guide.js +1747 -0
  29. package/dist/cli/commands/init.d.ts +12 -0
  30. package/dist/cli/commands/init.js +95 -60
  31. package/dist/cli/commands/org.d.ts +16 -0
  32. package/dist/cli/commands/org.js +2393 -0
  33. package/dist/cli/commands/release.d.ts +59 -0
  34. package/dist/cli/commands/release.js +716 -0
  35. package/dist/cli/commands/report.d.ts +82 -0
  36. package/dist/cli/commands/report.js +1516 -0
  37. package/dist/cli/commands/run.d.ts +6 -1
  38. package/dist/cli/commands/run.js +95 -26
  39. package/dist/cli/commands/sync.d.ts +8 -1
  40. package/dist/cli/commands/sync.js +436 -141
  41. package/dist/cli/commands/templates.d.ts +64 -0
  42. package/dist/cli/commands/templates.js +2151 -1
  43. package/dist/cli/commands/workflow.d.ts +26 -0
  44. package/dist/cli/commands/workflow.js +3053 -0
  45. package/dist/cli/index.js +719 -42
  46. package/dist/compiler/cascade.js +4 -9
  47. package/dist/compiler/compile.js +1 -0
  48. package/dist/governance/evidence-capture-attribution.d.ts +12 -0
  49. package/dist/governance/evidence-capture-attribution.js +46 -0
  50. package/dist/governance/index.d.ts +2 -0
  51. package/dist/governance/index.js +1 -0
  52. package/dist/hooks/cli.d.ts +6 -0
  53. package/dist/hooks/cli.js +168 -12
  54. package/dist/hooks/enforce.d.ts +1 -0
  55. package/dist/hooks/protocol.d.ts +1 -1
  56. package/dist/hooks/protocol.js +1 -1
  57. package/dist/hooks/state.d.ts +41 -0
  58. package/dist/hooks/state.js +126 -2
  59. package/dist/index.d.ts +3 -0
  60. package/dist/index.js +3 -0
  61. package/dist/mcp/tools-state.js +2 -0
  62. package/dist/organization/index.d.ts +121 -0
  63. package/dist/organization/index.js +413 -0
  64. package/dist/runtime/claude-sync-target.d.ts +49 -0
  65. package/dist/runtime/claude-sync-target.js +280 -0
  66. package/dist/runtime/codex-adapter.d.ts +254 -0
  67. package/dist/runtime/codex-adapter.js +1204 -0
  68. package/dist/runtime/codex-sync-target.d.ts +33 -0
  69. package/dist/runtime/codex-sync-target.js +241 -0
  70. package/dist/runtime/index.d.ts +8 -0
  71. package/dist/runtime/index.js +4 -0
  72. package/dist/runtime/output-artifact-registry.d.ts +1 -1
  73. package/dist/runtime/output-artifact-registry.js +2 -0
  74. package/dist/runtime/settings-adapter.d.ts +1 -1
  75. package/dist/runtime/settings-adapter.js +1 -1
  76. package/dist/runtime/skill-adapter.d.ts +5 -1
  77. package/dist/runtime/skill-adapter.js +120 -34
  78. package/dist/runtime/sync-artifact-registry.d.ts +99 -0
  79. package/dist/runtime/sync-artifact-registry.js +194 -0
  80. package/dist/runtime/sync-target-plan.d.ts +45 -0
  81. package/dist/runtime/sync-target-plan.js +19 -0
  82. package/dist/schema/controller-registry.d.ts +8 -1
  83. package/dist/schema/controller-registry.js +8 -0
  84. package/dist/schema/types.d.ts +35 -23
  85. package/dist/schema/types.js +10 -1
  86. package/dist/schema/validate.js +22 -22
  87. package/dist/schema/validators/controllers.js +38 -20
  88. package/dist/schema/workflow-authoring-contract.d.ts +29 -0
  89. package/dist/schema/workflow-authoring-contract.js +109 -0
  90. package/dist/schema/yaml-parser.js +18 -0
  91. package/dist/templates/api-backend.dna.yaml +19 -0
  92. package/dist/templates/brainstorming-first.dna.yaml +19 -0
  93. package/dist/templates/code-cleanup.dna.yaml +19 -0
  94. package/dist/templates/code-review-pipeline.dna.yaml +18 -0
  95. package/dist/templates/documentation-writer.dna.yaml +19 -0
  96. package/dist/templates/flutter-behavior-lock.dna.yaml +19 -0
  97. package/dist/templates/flutter-refactoring-rescue.dna.yaml +19 -0
  98. package/dist/templates/flutter-rewrite-diagnosis-review.dna.yaml +210 -0
  99. package/dist/templates/flutter-rewrite-fix-review-loop.dna.yaml +260 -0
  100. package/dist/templates/flutter-rewrite-new.dna.yaml +506 -0
  101. package/dist/templates/flutter-rewrite.dna.yaml +20 -0
  102. package/dist/templates/frontend-quality.dna.yaml +19 -0
  103. package/dist/templates/full-pipeline.dna.yaml +20 -0
  104. package/dist/templates/marketplace.d.ts +92 -0
  105. package/dist/templates/marketplace.js +502 -0
  106. package/dist/templates/metadata.d.ts +25 -0
  107. package/dist/templates/metadata.js +136 -3
  108. package/dist/templates/mobile-dev.dna.yaml +19 -0
  109. package/dist/templates/multi-agent-handoff-coordination.dna.yaml +156 -0
  110. package/dist/templates/multi-perspective-review.dna.yaml +19 -0
  111. package/dist/templates/persistent-executor.dna.yaml +19 -0
  112. package/dist/templates/qa-loop.dna.yaml +18 -0
  113. package/dist/templates/release-evidence-gate.dna.yaml +131 -0
  114. package/dist/templates/requirements-gate.dna.yaml +19 -0
  115. package/dist/templates/research-orchestration.dna.yaml +19 -0
  116. package/dist/templates/root-cause-analysis.dna.yaml +19 -0
  117. package/dist/templates/safe-refactoring.dna.yaml +321 -0
  118. package/dist/templates/secure-dev.dna.yaml +19 -0
  119. package/dist/templates/subagent-parallel.dna.yaml +19 -0
  120. package/dist/templates/systematic-debugging.dna.yaml +19 -0
  121. package/dist/templates/tdd-strict.dna.yaml +19 -0
  122. package/dist/templates/ui-visual-regression-qa.dna.yaml +133 -0
  123. package/dist/templates/workflow-author.dna.yaml +302 -0
  124. package/dist/templates/workflow-blocked-scope-triage.dna.yaml +242 -0
  125. package/dist/templates/workflow-completion-audit.dna.yaml +254 -0
  126. package/dist/templates/workflow-cross-boundary-resource-approval.dna.yaml +249 -0
  127. package/dist/templates/workflow-evidence-review.dna.yaml +198 -0
  128. package/dist/templates/workflow-module-inventory.dna.yaml +257 -0
  129. package/dist/templates/workflow-runtime-smoke-review.dna.yaml +252 -0
  130. package/dist/templates/workflow-verification-command-routing.dna.yaml +278 -0
  131. package/dist/workflow/authoring-packet.d.ts +67 -0
  132. package/dist/workflow/authoring-packet.js +218 -0
  133. package/dist/workflow/draft.d.ts +159 -0
  134. package/dist/workflow/draft.js +800 -0
  135. package/dist/workflow/index.d.ts +3 -0
  136. package/dist/workflow/index.js +3 -0
  137. package/dist/workflow/suggestion-review.d.ts +65 -0
  138. package/dist/workflow/suggestion-review.js +245 -0
  139. package/package.json +1 -1
  140. package/spec/README.md +15 -48
  141. package/spec/codex-adapter-contract.md +176 -0
  142. package/spec/sync-target-plan.md +158 -0
  143. package/spec/workflow-capability-ir.md +153 -0
  144. package/spec/agent-dispatch-fix.md +0 -116
  145. package/spec/control-plane-convergence-handoff-2026-04-24.md +0 -432
  146. package/spec/flutter-rewrite-template-optimization.md +0 -301
  147. package/spec/foundation-hardening.md +0 -178
  148. package/spec/hooks-infra-harness-hardening.md +0 -741
  149. package/spec/multi-config.md +0 -172
  150. package/spec/parallel-isolation.md +0 -268
  151. package/spec/template-version-namespace-fix.md +0 -653
  152. package/spec/workflow-pipeline.md +0 -101
@@ -65,6 +65,23 @@ function printChanges(changes) {
65
65
  }
66
66
  }
67
67
  }
68
+ function printEmptyPreviewRoute(dnaId, storeDir) {
69
+ process.stderr.write("No marker changes to generate (no outcomes recorded)\n");
70
+ process.stderr.write("Self-evolution packet:\n");
71
+ process.stderr.write(" - evidence input: recorded outcomes from real workflow/runtime use\n");
72
+ process.stderr.write(" - preview output: marker changes proposed from repeated helped/hindered feedback\n");
73
+ process.stderr.write(" - review gate: humans review the preview before any marker mutation\n");
74
+ process.stderr.write(" - mutation path: dna sync --evolve only after review\n");
75
+ process.stderr.write(" - product meaning: workflow assets improve from evidence; dna core stays the governance source of truth\n");
76
+ process.stderr.write("Evolution route:\n");
77
+ process.stderr.write(` 1. Record outcomes: dna epigenetic record ${dnaId} --action <action> --genes <gene[,gene]> --feedback '[{\"gene\":\"quality\",\"effect\":\"helped\"}]'\n`);
78
+ process.stderr.write(` 2. Inspect outcomes: dna epigenetic summary ${dnaId}\n`);
79
+ process.stderr.write(` 3. Preview marker changes: dna evolve ${dnaId}\n`);
80
+ process.stderr.write(" 4. Mutate only after review: dna sync --evolve\n");
81
+ process.stderr.write(`Store: ${storeDir}\n`);
82
+ process.stderr.write("Boundary: no outcomes means there is no evidence to evolve; no markers, policy, sync artifacts, dashboard state, or Obsidian/wiki notes were changed.\n");
83
+ process.stderr.write("Preview only: no outcomes or markers were persisted.\n");
84
+ }
68
85
  export async function runEvolve(opts) {
69
86
  if (!opts.dnaId) {
70
87
  process.stderr.write("Error: dna-id is required\n");
@@ -82,8 +99,7 @@ export async function runEvolve(opts) {
82
99
  const existingMarkers = await readMarkersReadOnly(storeDir, safeDnaId);
83
100
  const changes = describeMarkerChanges(outcomes, existingMarkers);
84
101
  if (changes.length === 0) {
85
- process.stderr.write("No marker changes to generate (no outcomes recorded)\n");
86
- process.stderr.write("Preview only: no outcomes or markers were persisted.\n");
102
+ printEmptyPreviewRoute(safeDnaId, storeDir);
87
103
  return 0;
88
104
  }
89
105
  printChanges(changes);
@@ -12,9 +12,11 @@ import { readFile, writeFile } from "node:fs/promises";
12
12
  import { resolve, dirname } from "node:path";
13
13
  import { fileURLToPath } from "node:url";
14
14
  import { TEMPLATE_MATCH_METADATA } from "../../templates/metadata.js";
15
+ import { findWorkflowAsset } from "../../assets/index.js";
16
+ import { getWorkflowAssetMetadata } from "../../assets/metadata.js";
15
17
  const SPEC_PATH = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "..", "spec", "schema-spec.md");
16
18
  const TEMPLATES_DIR = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "templates");
17
- function scoreTemplates(description) {
19
+ async function scoreTemplates(description) {
18
20
  const lower = description.toLowerCase();
19
21
  const scores = [];
20
22
  for (const template of TEMPLATE_MATCH_METADATA) {
@@ -25,11 +27,21 @@ function scoreTemplates(description) {
25
27
  }
26
28
  }
27
29
  if (matched.length > 0) {
30
+ const asset = await findWorkflowAsset(template.name);
31
+ const metadata = getWorkflowAssetMetadata(template.name);
28
32
  scores.push({
29
33
  name: template.name,
30
34
  displayName: template.name.replace(/-/g, " "),
31
35
  score: matched.length,
32
36
  matchedKeywords: matched,
37
+ asset: asset ? {
38
+ status: asset.status.managementStatus,
39
+ evidence: asset.status.evidencePosture,
40
+ cascade: asset.status.cascadePosture,
41
+ evolution: asset.status.evolutionPosture,
42
+ positioning: metadata?.positioning,
43
+ dogfood: metadata?.dogfood !== undefined,
44
+ } : undefined,
33
45
  });
34
46
  }
35
47
  }
@@ -74,7 +86,7 @@ export async function runGenerate(opts) {
74
86
  }
75
87
  // Match mode: score templates and recommend
76
88
  if (opts.match) {
77
- const scores = scoreTemplates(description);
89
+ const scores = await scoreTemplates(description);
78
90
  if (scores.length === 0) {
79
91
  process.stderr.write("No matching templates found.\n");
80
92
  process.stderr.write("Use without --match to generate a custom config prompt.\n");
@@ -86,9 +98,20 @@ export async function runGenerate(opts) {
86
98
  const stars = "*".repeat(Math.min(s.score, 5));
87
99
  process.stderr.write(` ${stars.padEnd(5)} ${s.name}\n`);
88
100
  process.stderr.write(` matched: ${s.matchedKeywords.join(", ")}\n`);
101
+ if (s.asset) {
102
+ process.stderr.write(` asset: ${s.asset.status}, evidence=${s.asset.evidence}, cascade=${s.asset.cascade}, evolution=${s.asset.evolution}${s.asset.dogfood ? ", dogfood" : ""}\n`);
103
+ if (s.asset.positioning)
104
+ process.stderr.write(` why: ${s.asset.positioning}\n`);
105
+ }
89
106
  }
90
107
  const best = scores[0];
91
108
  process.stderr.write(`\nRecommended: dna init --template ${best.name}\n`);
109
+ if (best.asset) {
110
+ process.stderr.write("Asset review path:\n");
111
+ process.stderr.write(` - dna assets inspect ${best.name} --evidence\n`);
112
+ process.stderr.write(` - dna assets governance ${best.name}\n`);
113
+ process.stderr.write(` - dna assets adoption ${best.name}\n`);
114
+ }
92
115
  return 0;
93
116
  }
94
117
  // Default mode: generate prompt with spec
@@ -10,7 +10,7 @@
10
10
  * yolo — Maximum autonomy + safety net (hard limits on destructive ops)
11
11
  * strict — All of standard + strict tool restrictions
12
12
  *
13
- * Reference: docs/references/harness-ecosystem-2026.md §6 (debate consensus #9)
13
+ * Reference: docs/archive/2026H1/references/harness-ecosystem-2026.md §6 (debate consensus #9)
14
14
  */
15
15
  export type GuardLevel = "standard" | "yolo" | "strict";
16
16
  export interface GuardOptions {
@@ -10,7 +10,7 @@
10
10
  * yolo — Maximum autonomy + safety net (hard limits on destructive ops)
11
11
  * strict — All of standard + strict tool restrictions
12
12
  *
13
- * Reference: docs/references/harness-ecosystem-2026.md §6 (debate consensus #9)
13
+ * Reference: docs/archive/2026H1/references/harness-ecosystem-2026.md §6 (debate consensus #9)
14
14
  */
15
15
  import { join } from "node:path";
16
16
  import { readFile, writeFile, stat, readdir, rm } from "node:fs/promises";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * dna guide - product route navigator for workflow governance.
3
+ */
4
+ export interface GuideOptions {
5
+ asset?: string;
6
+ name?: string;
7
+ project?: string;
8
+ goal?: string;
9
+ syncTarget?: string;
10
+ projectDir?: string;
11
+ json?: boolean;
12
+ brief?: boolean;
13
+ quickstart?: boolean;
14
+ }
15
+ export declare function runGuide(opts: GuideOptions): Promise<number>;