intentdna 1.7.5 → 1.8.1

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 (154) 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 +8 -1
  38. package/dist/cli/commands/run.js +129 -57
  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 +703 -36
  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 +9 -0
  53. package/dist/hooks/cli.js +170 -411
  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 +164 -39
  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/runtime/verifier.d.ts +51 -0
  83. package/dist/runtime/verifier.js +462 -0
  84. package/dist/schema/controller-registry.d.ts +8 -1
  85. package/dist/schema/controller-registry.js +8 -0
  86. package/dist/schema/types.d.ts +35 -23
  87. package/dist/schema/types.js +10 -1
  88. package/dist/schema/validate.js +22 -22
  89. package/dist/schema/validators/controllers.js +38 -20
  90. package/dist/schema/workflow-authoring-contract.d.ts +29 -0
  91. package/dist/schema/workflow-authoring-contract.js +109 -0
  92. package/dist/schema/yaml-parser.js +18 -0
  93. package/dist/templates/api-backend.dna.yaml +19 -0
  94. package/dist/templates/brainstorming-first.dna.yaml +19 -0
  95. package/dist/templates/code-cleanup.dna.yaml +19 -0
  96. package/dist/templates/code-review-pipeline.dna.yaml +18 -0
  97. package/dist/templates/documentation-writer.dna.yaml +19 -0
  98. package/dist/templates/flutter-behavior-lock.dna.yaml +19 -0
  99. package/dist/templates/flutter-refactoring-rescue.dna.yaml +19 -0
  100. package/dist/templates/flutter-rewrite-diagnosis-review.dna.yaml +210 -0
  101. package/dist/templates/flutter-rewrite-fix-review-loop.dna.yaml +260 -0
  102. package/dist/templates/flutter-rewrite-new.dna.yaml +506 -0
  103. package/dist/templates/flutter-rewrite.dna.yaml +100 -4
  104. package/dist/templates/frontend-quality.dna.yaml +19 -0
  105. package/dist/templates/full-pipeline.dna.yaml +20 -0
  106. package/dist/templates/marketplace.d.ts +92 -0
  107. package/dist/templates/marketplace.js +502 -0
  108. package/dist/templates/metadata.d.ts +25 -0
  109. package/dist/templates/metadata.js +136 -3
  110. package/dist/templates/mobile-dev.dna.yaml +19 -0
  111. package/dist/templates/multi-agent-handoff-coordination.dna.yaml +156 -0
  112. package/dist/templates/multi-perspective-review.dna.yaml +19 -0
  113. package/dist/templates/persistent-executor.dna.yaml +19 -0
  114. package/dist/templates/qa-loop.dna.yaml +18 -0
  115. package/dist/templates/release-evidence-gate.dna.yaml +131 -0
  116. package/dist/templates/requirements-gate.dna.yaml +19 -0
  117. package/dist/templates/research-orchestration.dna.yaml +19 -0
  118. package/dist/templates/root-cause-analysis.dna.yaml +19 -0
  119. package/dist/templates/safe-refactoring.dna.yaml +321 -0
  120. package/dist/templates/secure-dev.dna.yaml +19 -0
  121. package/dist/templates/subagent-parallel.dna.yaml +19 -0
  122. package/dist/templates/systematic-debugging.dna.yaml +19 -0
  123. package/dist/templates/tdd-strict.dna.yaml +19 -0
  124. package/dist/templates/ui-visual-regression-qa.dna.yaml +133 -0
  125. package/dist/templates/workflow-author.dna.yaml +302 -0
  126. package/dist/templates/workflow-blocked-scope-triage.dna.yaml +242 -0
  127. package/dist/templates/workflow-completion-audit.dna.yaml +254 -0
  128. package/dist/templates/workflow-cross-boundary-resource-approval.dna.yaml +249 -0
  129. package/dist/templates/workflow-evidence-review.dna.yaml +198 -0
  130. package/dist/templates/workflow-module-inventory.dna.yaml +257 -0
  131. package/dist/templates/workflow-runtime-smoke-review.dna.yaml +252 -0
  132. package/dist/templates/workflow-verification-command-routing.dna.yaml +278 -0
  133. package/dist/workflow/authoring-packet.d.ts +67 -0
  134. package/dist/workflow/authoring-packet.js +218 -0
  135. package/dist/workflow/draft.d.ts +159 -0
  136. package/dist/workflow/draft.js +800 -0
  137. package/dist/workflow/index.d.ts +3 -0
  138. package/dist/workflow/index.js +3 -0
  139. package/dist/workflow/suggestion-review.d.ts +65 -0
  140. package/dist/workflow/suggestion-review.js +245 -0
  141. package/package.json +1 -1
  142. package/spec/README.md +15 -48
  143. package/spec/codex-adapter-contract.md +176 -0
  144. package/spec/sync-target-plan.md +158 -0
  145. package/spec/workflow-capability-ir.md +153 -0
  146. package/spec/agent-dispatch-fix.md +0 -116
  147. package/spec/control-plane-convergence-handoff-2026-04-24.md +0 -432
  148. package/spec/flutter-rewrite-template-optimization.md +0 -301
  149. package/spec/foundation-hardening.md +0 -178
  150. package/spec/hooks-infra-harness-hardening.md +0 -741
  151. package/spec/multi-config.md +0 -172
  152. package/spec/parallel-isolation.md +0 -268
  153. package/spec/template-version-namespace-fix.md +0 -653
  154. package/spec/workflow-pipeline.md +0 -101
@@ -109,15 +109,10 @@ function prefixRecordKeys(record, ns) {
109
109
  function prefixController(controller, ns) {
110
110
  return {
111
111
  ...controller,
112
- diagnosis_workflow: `${ns}_${controller.diagnosis_workflow}`,
113
- fix_workflow: `${ns}_${controller.fix_workflow}`,
114
- roles: {
115
- analyzer: `${ns}_${controller.roles.analyzer}`,
116
- analysis_reviewer: `${ns}_${controller.roles.analysis_reviewer}`,
117
- surgeon: `${ns}_${controller.roles.surgeon}`,
118
- fix_reviewer: `${ns}_${controller.roles.fix_reviewer}`,
119
- test_runner: `${ns}_${controller.roles.test_runner}`,
120
- },
112
+ workflow: controller.workflow ? `${ns}_${controller.workflow}` : undefined,
113
+ diagnosis_workflow: controller.diagnosis_workflow ? `${ns}_${controller.diagnosis_workflow}` : undefined,
114
+ fix_workflow: controller.fix_workflow ? `${ns}_${controller.fix_workflow}` : undefined,
115
+ roles: Object.fromEntries(Object.entries(controller.roles).map(([roleKey, roleName]) => [roleKey, `${ns}_${roleName}`])),
121
116
  };
122
117
  }
123
118
  function prefixLegibilityAssets(map, ns) {
@@ -384,6 +384,7 @@ export function compileDNA(activated, cascaded) {
384
384
  workflowsIR.push({
385
385
  workflow_name: wfKey,
386
386
  namespace,
387
+ step_ids: (wf.steps ?? []).map((step) => step.id),
387
388
  step_checkpoints: wfStepCheckpoints,
388
389
  active_roles: activeRoles,
389
390
  handoff_chain: handoffChain,
@@ -0,0 +1,12 @@
1
+ import type { ConstraintIR } from "../schema/types.js";
2
+ export interface EvidenceCaptureAttributionHint {
3
+ workflowAsset?: string;
4
+ workflowId?: string;
5
+ stepId?: string;
6
+ }
7
+ export interface TrustedEvidenceCaptureAttribution {
8
+ workflowAsset: string;
9
+ workflowId: string;
10
+ stepId: string;
11
+ }
12
+ export declare function trustedEvidenceCaptureAttribution(ir: ConstraintIR, hint: EvidenceCaptureAttributionHint): TrustedEvidenceCaptureAttribution;
@@ -0,0 +1,46 @@
1
+ const UNKNOWN_ATTRIBUTION = "unknown";
2
+ function canonicalWorkflowAsset(ir) {
3
+ const sourceIds = [...new Set(ir.source_dna_ids)]
4
+ .filter((sourceId) => sourceId.length > 0)
5
+ .filter((sourceId) => !sourceId.startsWith("species:"))
6
+ .filter((sourceId) => !sourceId.startsWith("enterprise:"));
7
+ return sourceIds.length === 1 ? sourceIds[0] : undefined;
8
+ }
9
+ function attributedWorkflow(ir, workflowId) {
10
+ if (workflowId) {
11
+ return ir.workflows_ir?.find((workflow) => workflow.workflow_name === workflowId);
12
+ }
13
+ return ir.workflows_ir?.length === 1 ? ir.workflows_ir[0] : undefined;
14
+ }
15
+ function workflowStepIds(ir, workflow) {
16
+ return new Set([
17
+ ...(workflow.step_ids ?? []),
18
+ ...workflow.step_checkpoints.map((checkpoint) => checkpoint.step_id),
19
+ ...workflow.handoff_chain.map((handoff) => handoff.step_id),
20
+ ...(workflow.step_enforce_rules ?? []).map((rule) => rule.step_id),
21
+ ...(ir.verifier_specs ?? [])
22
+ .filter((spec) => spec.workflow_name === workflow.workflow_name)
23
+ .map((spec) => spec.step_id)
24
+ .filter((stepId) => typeof stepId === "string"),
25
+ ]);
26
+ }
27
+ export function trustedEvidenceCaptureAttribution(ir, hint) {
28
+ const workflow = attributedWorkflow(ir, hint.workflowId);
29
+ const invalidExplicitWorkflow = Boolean(hint.workflowId && !workflow);
30
+ if (invalidExplicitWorkflow) {
31
+ return {
32
+ workflowAsset: UNKNOWN_ATTRIBUTION,
33
+ workflowId: UNKNOWN_ATTRIBUTION,
34
+ stepId: UNKNOWN_ATTRIBUTION,
35
+ };
36
+ }
37
+ const canonicalAsset = canonicalWorkflowAsset(ir);
38
+ const workflowAsset = canonicalAsset
39
+ ? hint.workflowAsset === canonicalAsset ? hint.workflowAsset : canonicalAsset
40
+ : UNKNOWN_ATTRIBUTION;
41
+ const workflowId = workflow?.workflow_name ?? UNKNOWN_ATTRIBUTION;
42
+ const stepId = workflow && hint.stepId && workflowStepIds(ir, workflow).has(hint.stepId)
43
+ ? hint.stepId
44
+ : UNKNOWN_ATTRIBUTION;
45
+ return { workflowAsset, workflowId, stepId };
46
+ }
@@ -5,4 +5,6 @@
5
5
  */
6
6
  export type { AuditReport, RemoteDNAPolicy, PolicyContent, PolicyScope, PolicyUpdate, GovernanceConfig, GovernanceClient, GovernanceResponse, GovernanceSubscription, } from "./types.js";
7
7
  export { CASCADE_LAYER_NAMES, RUNTIME_DECISION_EVENT_SCHEMA_VERSION, validateRuntimeDecisionEvent, } from "./runtime-decision-event.js";
8
+ export { trustedEvidenceCaptureAttribution } from "./evidence-capture-attribution.js";
9
+ export type { EvidenceCaptureAttributionHint, TrustedEvidenceCaptureAttribution, } from "./evidence-capture-attribution.js";
8
10
  export type { CascadeDecisionTrace, CascadeLayerFingerprint, CascadeLayerName, CascadeLayers, EnforcementPoint, ExplicitPlaceholder, HarnessRuntimeContext, PolicyBundle, RuntimeDecision, RuntimeDecisionEvent, RuntimeDecisionEventValidationResult, RuntimeEvidenceRef, WinningConstraint, } from "./runtime-decision-event.js";
@@ -4,3 +4,4 @@
4
4
  * Exports the v1.7.1 enterprise evidence contract plus reserved remote governance interfaces.
5
5
  */
6
6
  export { CASCADE_LAYER_NAMES, RUNTIME_DECISION_EVENT_SCHEMA_VERSION, validateRuntimeDecisionEvent, } from "./runtime-decision-event.js";
7
+ export { trustedEvidenceCaptureAttribution } from "./evidence-capture-attribution.js";
@@ -49,6 +49,9 @@ export interface RunHookEventOptions {
49
49
  }
50
50
  export declare function normalizeHookOutputForEvent(output: HookOutput, event: HookEvent): HookOutput;
51
51
  export declare function runHookEvent(options: RunHookEventOptions): Promise<HookOutput>;
52
+ export declare function codexHookEventForInput(rawInput: Record<string, unknown>, args: string[]): unknown;
53
+ declare function inferWorkflowAssetFromIr(ir: ConstraintIR, workflowId?: string): string | undefined;
54
+ declare function runCodexHookWithLoadedIr(rawInput: Record<string, unknown>, projectDir: string, args: string[], ir: ConstraintIR): Promise<import("../runtime/codex-adapter.js").CodexHookRunnerResult>;
52
55
  declare function recordProducedArtifacts(projectDir: string, ir: ConstraintIR, wfState: {
53
56
  workflow: string;
54
57
  current_step: string;
@@ -87,6 +90,8 @@ declare function finalizeAndResolveArtifactsForHook(projectDir: string, ir: Cons
87
90
  export declare const recordProducedArtifactsForTest: typeof recordProducedArtifacts;
88
91
  export declare const resolveWorkflowArtifactFactsForTest: typeof resolveWorkflowArtifactFacts;
89
92
  export declare const readWorkflowStateForHookTest: typeof readWorkflowStateForHook;
93
+ export declare const runCodexHookWithLoadedIrForTest: typeof runCodexHookWithLoadedIr;
94
+ export declare const inferWorkflowAssetFromIrForTest: typeof inferWorkflowAssetFromIr;
90
95
  export declare const resolveWorkflowArtifactFactsForHookTest: typeof resolveWorkflowArtifactFactsForHook;
91
96
  export declare const finalizeAndResolveArtifactsForHookTest: typeof finalizeAndResolveArtifactsForHook;
92
97
  export declare function appendStopVerifierWarnings(output: HookOutput, verifierResults: VerifierResultEntry[], currentStep?: string): HookOutput;
@@ -94,6 +99,8 @@ export declare function runVerifiersForTest(projectDir: string, ir: ConstraintIR
94
99
  workflow: string;
95
100
  current_step: string;
96
101
  current_role: string;
102
+ inputs?: Record<string, string>;
103
+ resolved_variables?: Record<string, string>;
97
104
  }, when: VerifierSpec["when"], sessionId?: string, options?: {
98
105
  commandTimeoutMs?: number;
99
106
  }): Promise<VerifierResultEntry[]>;
@@ -101,6 +108,8 @@ export declare function runStopVerifiersForTest(projectDir: string, ir: Constrai
101
108
  workflow: string;
102
109
  current_step: string;
103
110
  current_role: string;
111
+ inputs?: Record<string, string>;
112
+ resolved_variables?: Record<string, string>;
104
113
  }, sessionId?: string, options?: {
105
114
  commandTimeoutMs?: number;
106
115
  }): Promise<VerifierResultEntry[]>;