intentdna 1.8.7 → 1.9.0-rc.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.
Files changed (69) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/dist/cli/commands/candidate-promotion.d.ts +15 -0
  4. package/dist/cli/commands/candidate-promotion.js +197 -0
  5. package/dist/cli/commands/run-lifecycle.js +1 -0
  6. package/dist/cli/commands/run.js +76 -42
  7. package/dist/cli/commands/setup.d.ts +10 -0
  8. package/dist/cli/commands/setup.js +129 -36
  9. package/dist/cli/commands/source-assets.d.ts +32 -0
  10. package/dist/cli/commands/source-assets.js +154 -0
  11. package/dist/cli/commands/sync.js +52 -12
  12. package/dist/cli/commands/templates.js +59 -37
  13. package/dist/cli/index.js +161 -5
  14. package/dist/compiler/cascade.js +1 -1
  15. package/dist/hooks/cli.d.ts +6 -0
  16. package/dist/hooks/cli.js +118 -10
  17. package/dist/hooks/enforcement-boundary.d.ts +1 -1
  18. package/dist/hooks/protocol.d.ts +1 -1
  19. package/dist/hooks/state.d.ts +5 -0
  20. package/dist/hooks/state.js +21 -6
  21. package/dist/mcp/tools-state.js +251 -15
  22. package/dist/runtime/claude-sync-target.d.ts +2 -0
  23. package/dist/runtime/claude-sync-target.js +1 -1
  24. package/dist/runtime/evaluator.d.ts +13 -0
  25. package/dist/runtime/evaluator.js +46 -0
  26. package/dist/runtime/index.d.ts +8 -4
  27. package/dist/runtime/index.js +4 -2
  28. package/dist/runtime/plugin-adapter.d.ts +14 -1
  29. package/dist/runtime/plugin-adapter.js +23 -9
  30. package/dist/runtime/run-contracts.d.ts +5 -3
  31. package/dist/runtime/run-contracts.js +11 -1
  32. package/dist/runtime/run-controller.d.ts +15 -1
  33. package/dist/runtime/run-controller.js +235 -94
  34. package/dist/runtime/skill-adapter.js +24 -53
  35. package/dist/runtime/verifier.js +101 -2
  36. package/dist/runtime/workflow-plan-adapter.d.ts +2 -1
  37. package/dist/runtime/workflow-plan-adapter.js +78 -11
  38. package/dist/runtime/workflow-runtime-manifest.d.ts +48 -0
  39. package/dist/runtime/workflow-runtime-manifest.js +196 -0
  40. package/dist/runtime/workflow-variable-scopes.d.ts +12 -0
  41. package/dist/runtime/workflow-variable-scopes.js +55 -0
  42. package/dist/schema/types.d.ts +9 -0
  43. package/dist/schema/validate.js +29 -1
  44. package/dist/sources/authoring-packet.d.ts +8 -0
  45. package/dist/sources/authoring-packet.js +85 -0
  46. package/dist/sources/discovery.d.ts +7 -0
  47. package/dist/sources/discovery.js +150 -0
  48. package/dist/sources/license.d.ts +5 -0
  49. package/dist/sources/license.js +94 -0
  50. package/dist/sources/manifest.d.ts +11 -0
  51. package/dist/sources/manifest.js +84 -0
  52. package/dist/sources/skill-markdown.d.ts +6 -0
  53. package/dist/sources/skill-markdown.js +174 -0
  54. package/dist/sources/types.d.ts +125 -0
  55. package/dist/sources/types.js +1 -0
  56. package/dist/templates/asset-refinery.dna.yaml +192 -0
  57. package/dist/templates/flutter-behavior-lock.dna.yaml +17 -0
  58. package/dist/templates/flutter-refactoring-rescue.dna.yaml +11 -0
  59. package/dist/templates/flutter-rewrite.dna.yaml +154 -28
  60. package/dist/templates/metadata.js +2 -0
  61. package/dist/templates/multi-agent-handoff-coordination.dna.yaml +102 -37
  62. package/dist/templates/persistent-executor.dna.yaml +61 -3
  63. package/dist/templates/research-improvement.dna.yaml +295 -0
  64. package/dist/templates/subagent-parallel.dna.yaml +90 -17
  65. package/dist/templates/workflow-evidence-review.dna.yaml +8 -0
  66. package/dist/workflow/candidate-projection.d.ts +33 -0
  67. package/dist/workflow/candidate-projection.js +70 -0
  68. package/package.json +3 -1
  69. package/scripts/sync-release-plugin.cjs +87 -0
@@ -155,6 +155,8 @@ export const TEMPLATE_MATCH_METADATA = [
155
155
  { name: "migration-safety", keywords: ["migration", "migrate", "upgrade", "database migration", "dependency upgrade", "迁移"] },
156
156
  { name: "incident-response", keywords: ["incident", "production issue", "hotfix", "outage", "postmortem", "事故"] },
157
157
  { name: "performance-audit", keywords: ["performance", "profiling", "benchmark", "optimize", "latency", "性能"] },
158
+ { name: "asset-refinery", keywords: ["asset refinery", "source packet", "skill import", "candidate authoring", "workflow import", "资产精炼", "技能导入"] },
159
+ { name: "research-improvement", keywords: ["research improvement", "evaluator", "evidence driven", "candidate evaluation", "bounded research", "研究改进", "评估器"] },
158
160
  { name: "ui-visual-regression-qa", keywords: ["ui qa", "visual regression", "screenshot qa", "responsive", "overflow", "视觉回归", "界面验收"] },
159
161
  { name: "release-evidence-gate", keywords: ["release evidence", "deploy gate", "vercel verification", "deployed url", "release gate", "发布证据", "部署门禁"] },
160
162
  { name: "multi-agent-handoff-coordination", keywords: ["multi-agent", "handoff", "parallel lanes", "worktree coordination", "lane isolation", "多智能体", "交接"] },
@@ -1,7 +1,7 @@
1
1
  version: "0.1.0"
2
2
  id: template_multi_agent_handoff_coordination
3
3
  name: Multi-Agent Handoff Coordination
4
- purpose: Coordinate parallel agent lanes through isolated scopes, machine-checkable handoffs, and an explicit integration review.
4
+ purpose: Coordinate exactly two isolated implementation lanes through a structured plan, machine-checkable lane results, and an explicit integration review.
5
5
  maturity: reviewed
6
6
  fit:
7
7
  - Large tasks that need multiple agents working on disjoint write scopes.
@@ -15,8 +15,8 @@ inputs:
15
15
  - per-lane handoff artifacts
16
16
  outputs:
17
17
  - coordination artifact directory
18
- - lane handoff evidence
19
- - final integration plan
18
+ - two structured lane results with commit evidence
19
+ - structured GO/NO-GO integration plan
20
20
  lineage:
21
21
  source: Codex/OMX multi-agent handoff pattern
22
22
  reference: docs/archive/2026H1/references/branch-consolidation-handoff-20260709.md
@@ -27,17 +27,6 @@ cascade:
27
27
  inherits: ["species:default"]
28
28
  priority: 100
29
29
 
30
- variables:
31
- task_scope:
32
- description: "Feature, bug, or productization scope to split"
33
- default: "$ARGUMENTS"
34
- handoff_dir:
35
- description: "Coordination and handoff artifact directory"
36
- default: ".dna/handoffs/$ARGUMENTS"
37
- integration_plan_path:
38
- description: "Final integration plan artifact"
39
- default: ".dna/handoffs/$ARGUMENTS.integration.json"
40
-
41
30
  evidence:
42
31
  - label: Parallel productization boundary
43
32
  kind: doc
@@ -86,7 +75,7 @@ contexts: {}
86
75
 
87
76
  roles:
88
77
  coordinator:
89
- description: Splits work into independent lanes and owns integration review.
78
+ description: Splits work into exactly two independent lanes.
90
79
  tool_permissions:
91
80
  allow: [Read, Write, Grep, Glob, Bash]
92
81
  deny: [Edit, NotebookEdit]
@@ -95,9 +84,9 @@ roles:
95
84
  write: [".dna/handoffs/**"]
96
85
  instructions:
97
86
  - Read the route-lock docs before assigning lanes.
98
- - Define each lane with owner, write scope, acceptance tests, verification commands, and boundary risks.
87
+ - Define exactly Lane A and Lane B with owner, exclusive write scope, acceptance tests, verification commands, and boundary risks.
99
88
  - Reject lanes with overlapping write scopes unless sequenced explicitly.
100
- - Write coordination artifacts under {{handoff_dir}}.
89
+ - Return the complete structured lane manifest; workers receive it through a declared Controller handoff.
101
90
 
102
91
  lane_executor:
103
92
  description: Executes one assigned lane inside its write scope.
@@ -107,9 +96,10 @@ roles:
107
96
  read: ["**/*"]
108
97
  write: ["src/**", "apps/**", "test/**", "docs/**", ".dna/handoffs/**"]
109
98
  instructions:
110
- - Execute only the assigned lane and stay within the declared write scope.
99
+ - Execute only the named lane from the structured manifest and stay within its exclusive write scope.
111
100
  - Do not revert unrelated edits or incidental local state.
112
- - Run lane verification and write a handoff with changed files, tests, boundary checks, and residual risks.
101
+ - Commit the completed lane before returning its structured result.
102
+ - Report the commit, changed files, verification exit statuses, boundary checks, conflicts, and residual risks.
113
103
  - Escalate scope conflicts to the coordinator instead of editing shared files silently.
114
104
 
115
105
  integration_reviewer:
@@ -121,36 +111,111 @@ roles:
121
111
  read: ["**/*", ".dna/handoffs/**"]
122
112
  write: [".dna/handoffs/**"]
123
113
  instructions:
124
- - Read all lane handoffs before integration.
125
- - Verify each lane has separate commits or a clean staged diff.
114
+ - Read both declared lane results before making an integration decision.
115
+ - Verify each lane has a separate commit and stayed within its declared write scope.
126
116
  - Check local runtime truth, marketplace, online projection, hidden transport, and external-reference boundaries.
127
- - Write {{integration_plan_path}} with merge order, blockers, verification commands, and final audit checklist.
117
+ - Write .dna/handoffs/{{task_id}}/integration.json with GO or NO-GO, integration order, blockers, verification commands, and final audit checklist.
118
+ - Do not merge, cherry-pick, rebase, or promote either lane.
128
119
 
129
120
  workflows:
130
121
  coordinate-handoffs:
131
122
  name: Multi-Agent Handoff Coordination
132
- description: Split independent lanes, execute scoped work, and review handoffs before integration.
123
+ description: Split exactly two independent lanes, execute both in isolated worktrees, and review committed results before integration.
133
124
  steps:
134
125
  - id: split-lanes
135
126
  role: coordinator
136
- description: Define independent lanes and handoff requirements.
127
+ description: Define exactly two independent lanes and their handoff requirements.
137
128
  prompt: |
138
- Split {{task_scope}} into independent lanes.
139
- For each lane, define owner, write scope, acceptance tests, verification commands, and product-boundary risks.
140
- Write lane specs under {{handoff_dir}}.
141
- - id: execute-lane
129
+ Split {{task_id}} into exactly Lane A and Lane B.
130
+ Return one structured manifest containing, for each lane:
131
+ - lane id and owner;
132
+ - a standalone bounded task;
133
+ - an exclusive write scope with no overlap;
134
+ - acceptance criteria and verification commands;
135
+ - product-boundary risks and conflict escalation conditions.
136
+ If the scopes cannot be made disjoint, return a blocked manifest and do
137
+ not authorize implementation.
138
+ handoff:
139
+ produces:
140
+ - type: state
141
+ name: lane_manifest
142
+ description: Exact two-lane manifest with disjoint ownership, bounded tasks, acceptance criteria, verification commands, and risks
143
+
144
+ - id: execute-lane-a
142
145
  role: lane_executor
143
146
  depends_on: [split-lanes]
144
- description: Execute an assigned lane and write its handoff.
147
+ isolation: worktree
148
+ max_attempts: 2
149
+ description: Execute only Lane A in its isolated worktree.
145
150
  prompt: |
146
- Execute only your assigned lane for {{task_scope}}.
147
- Stay within the declared write scope.
148
- Write a handoff under {{handoff_dir}} with changed files, tests, boundary checks, and residual risks.
151
+ Read the declared lane manifest and execute only Lane A for
152
+ {{task_id}}. Stay inside Lane A's exclusive write scope. If the
153
+ manifest is blocked, ownership overlaps, or a shared-file change is
154
+ required, make no out-of-scope edit and report the conflict.
155
+ Run Lane A's declared verification, commit the completed lane, and
156
+ return a structured result containing status, commit, changed files,
157
+ verification commands and exit statuses, boundary checks, conflicts,
158
+ and residual risks. Stop after this lane.
159
+ handoff:
160
+ consumes:
161
+ - type: state
162
+ from: split-lanes
163
+ name: lane_manifest
164
+ description: Exact two-lane manifest and exclusive ownership contract
165
+ produces:
166
+ - type: state
167
+ name: lane_a_result
168
+ description: Machine-checkable Lane A status, commit, changed files, verification evidence, conflicts, and residual risks
169
+
170
+ - id: execute-lane-b
171
+ role: lane_executor
172
+ depends_on: [split-lanes]
173
+ isolation: worktree
174
+ max_attempts: 2
175
+ description: Execute only Lane B in its isolated worktree.
176
+ prompt: |
177
+ Read the declared lane manifest and execute only Lane B for
178
+ {{task_id}}. Stay inside Lane B's exclusive write scope. If the
179
+ manifest is blocked, ownership overlaps, or a shared-file change is
180
+ required, make no out-of-scope edit and report the conflict.
181
+ Run Lane B's declared verification, commit the completed lane, and
182
+ return a structured result containing status, commit, changed files,
183
+ verification commands and exit statuses, boundary checks, conflicts,
184
+ and residual risks. Stop after this lane.
185
+ handoff:
186
+ consumes:
187
+ - type: state
188
+ from: split-lanes
189
+ name: lane_manifest
190
+ description: Exact two-lane manifest and exclusive ownership contract
191
+ produces:
192
+ - type: state
193
+ name: lane_b_result
194
+ description: Machine-checkable Lane B status, commit, changed files, verification evidence, conflicts, and residual risks
195
+
149
196
  - id: review-integration
150
197
  role: integration_reviewer
151
- depends_on: [execute-lane]
152
- description: Review handoffs and write the final integration plan.
198
+ depends_on: [execute-lane-a, execute-lane-b]
199
+ description: Review both committed lane results and write the final integration plan.
153
200
  prompt: |
154
- Review all handoffs under {{handoff_dir}}.
155
- Verify lane isolation, boundary compliance, and required tests.
156
- Write {{integration_plan_path}} with integration order and final audit checklist.
201
+ Review the declared Lane A and Lane B results only after both have
202
+ committed. Verify result completeness, lane isolation, ownership
203
+ compliance, commit identity, boundary checks, and verification exit
204
+ statuses. Write .dna/handoffs/{{task_id}}/integration.json and return the same decision
205
+ as a structured GO/NO-GO integration verdict with rationale, merge
206
+ order, blockers, verification commands, and final audit checklist.
207
+ Do not merge, cherry-pick, rebase, or promote either lane.
208
+ handoff:
209
+ consumes:
210
+ - type: state
211
+ from: execute-lane-a
212
+ name: lane_a_result
213
+ description: Machine-checkable Lane A result and commit evidence
214
+ - type: state
215
+ from: execute-lane-b
216
+ name: lane_b_result
217
+ description: Machine-checkable Lane B result and commit evidence
218
+ produces:
219
+ - type: state
220
+ name: integration_verdict
221
+ description: Structured GO/NO-GO integration plan with rationale, order, blockers, verification commands, and audit checklist
@@ -14,9 +14,9 @@ inputs:
14
14
  - acceptance criteria
15
15
  - verification commands
16
16
  outputs:
17
- - implemented story diff
18
- - verifier evidence
19
- - completion or remaining-work report
17
+ - implemented story commit
18
+ - machine-readable verifier verdict and feedback artifact
19
+ - completion report
20
20
  lineage:
21
21
  source: PRD-driven persistent execution workflow
22
22
  reference: src/templates/persistent-executor.dna.yaml
@@ -104,6 +104,7 @@ roles:
104
104
  - "Mark each: VERIFIED / PARTIAL / MISSING"
105
105
  - "Verdict: PASS (all verified) or FAIL (list what's missing)"
106
106
  - On FAIL the executor must fix before proceeding
107
+ - Write the exact verdict and bounded feedback to .dna/reviews/{{task_id}}.json
107
108
 
108
109
  workflows:
109
110
  persistent-execution:
@@ -119,6 +120,12 @@ workflows:
119
120
  Confirm: acceptance criteria are clear and testable.
120
121
  If criteria are vague, ask for clarification before starting.
121
122
  Output: story ID, title, acceptance criteria.
123
+ run_if: "round == 1"
124
+ handoff:
125
+ produces:
126
+ - type: summary
127
+ name: story_contract
128
+ description: Exact selected story and acceptance criteria
122
129
 
123
130
  - id: implement
124
131
  role: executor
@@ -133,6 +140,22 @@ workflows:
133
140
  - If stuck for 3 attempts on the same issue: STOP and report blocker
134
141
  - Commit when story implementation is complete
135
142
  - Do not start the next story
143
+ - If .dna/reviews/{{task_id}}.json exists, address only its declared feedback
144
+ handoff:
145
+ consumes:
146
+ - type: summary
147
+ from: pick_story
148
+ name: story_contract
149
+ description: Exact selected story and acceptance criteria
150
+ - type: file
151
+ path: ".dna/reviews/{{task_id}}.json"
152
+ name: review_feedback
153
+ required: false
154
+ description: Explicit verifier feedback from the prior round, when present
155
+ produces:
156
+ - type: git_commit
157
+ name: implementation_commit
158
+ description: Commit containing the bounded story implementation
136
159
 
137
160
  - id: verify
138
161
  role: verifier
@@ -147,6 +170,23 @@ workflows:
147
170
 
148
171
  PASS: All criteria verified → story complete, ready for next
149
172
  FAIL: List what's missing → executor must fix
173
+ Write .dna/reviews/{{task_id}}.json with:
174
+ {"clean":true|false,"verdict":"PASS|FAIL","feedback":["bounded item"]}
175
+ Return the same data as the declared structured output.
176
+ handoff:
177
+ consumes:
178
+ - type: git_commit
179
+ from: implement
180
+ name: implementation_commit
181
+ description: Implementation commit under independent verification
182
+ produces:
183
+ - type: state
184
+ name: verification_verdict
185
+ description: Structured PASS/FAIL verdict and bounded feedback
186
+ completion:
187
+ - file_contains:
188
+ path: ".dna/reviews/{{task_id}}.json"
189
+ pattern: '"clean"\s*:\s*true'
150
190
 
151
191
  - id: report
152
192
  role: verifier
@@ -161,3 +201,21 @@ workflows:
161
201
 
162
202
  If COMPLETE: "Story done. Pick next story to continue."
163
203
  If NEEDS_FIX: "Story incomplete. Issues: [list]. Fix before proceeding."
204
+ handoff:
205
+ consumes:
206
+ - type: state
207
+ from: verify
208
+ name: verification_verdict
209
+ description: Clean independent verification verdict
210
+ produces:
211
+ - type: summary
212
+ name: completion_report
213
+ description: Final verified completion report
214
+ transitions:
215
+ - from: verify
216
+ to: implement
217
+ condition: fail
218
+ retry_policy:
219
+ max_retries: 3
220
+ retry_from: implement
221
+ backoff: none
@@ -0,0 +1,295 @@
1
+ version: "0.1.0"
2
+ id: template_research_improvement
3
+ name: Research and Evaluator-Driven Improvement
4
+ purpose: Use two independent evidence lanes to author a staged candidate, gate it with strict evaluator JSON, and revise only the candidate segment until pass or bounded exhaustion.
5
+ maturity: reviewed
6
+ fit:
7
+ - Research deliverables that need independent evidence and an objective acceptance gate.
8
+ - Staged artifact improvement where failed evaluation should produce bounded revision feedback.
9
+ not_for:
10
+ - Production code promotion, automatic merge, deployment, or policy adoption.
11
+ - Work without a declared evaluator or a bounded retry limit.
12
+ inputs:
13
+ - research mission and source constraints
14
+ - evaluator procedure and objective pass criteria
15
+ - safe task identifier
16
+ outputs:
17
+ - two structured research briefs
18
+ - staged candidate artifact
19
+ - strict evaluator result artifact
20
+ - human-reviewable improvement report
21
+ lineage:
22
+ source: OMX autoresearch and OMC self-improve behavior contracts
23
+ reference: docs/upstream/workflow-reuse-ledger.json
24
+ type: project
25
+ namespace: ri
26
+
27
+ cascade:
28
+ inherits: ["species:default"]
29
+ priority: 100
30
+
31
+ genes:
32
+ evidence_before_candidate:
33
+ description: Candidate changes must be grounded in independent research evidence
34
+ codons:
35
+ - type: attract
36
+ target: two_independent_research_lanes
37
+ - type: attract
38
+ target: source_attribution
39
+ - type: repel
40
+ target: unsupported_candidate_change
41
+
42
+ strict_evaluator_gate:
43
+ description: Completion depends on strict evaluator JSON rather than a natural-language done claim
44
+ codons:
45
+ - type: attract
46
+ target: evaluator_json_artifact
47
+ - type: repel
48
+ target: regex_verdict_parsing
49
+ - type: threshold
50
+ condition: "evaluator_pass == true"
51
+ action: block
52
+
53
+ bounded_revision:
54
+ description: Failed evaluation revises only the staged candidate segment
55
+ codons:
56
+ - type: attract
57
+ target: evaluator_feedback_revision
58
+ - type: repel
59
+ target: repeat_completed_research
60
+ - type: threshold
61
+ condition: "revision_rounds <= 3"
62
+ action: block
63
+
64
+ human_promotion_boundary:
65
+ description: A passing candidate remains staged until a human chooses a later promotion workflow
66
+ codons:
67
+ - type: repel
68
+ target: automatic_merge
69
+ - type: repel
70
+ target: automatic_publish
71
+ - type: repel
72
+ target: automatic_deploy
73
+
74
+ contexts: {}
75
+
76
+ roles:
77
+ mission_lead:
78
+ description: Defines one bounded research mission and its objective evaluator contract.
79
+ tool_permissions:
80
+ allow: [Read, Grep, Glob]
81
+ deny: [Edit, Write, Bash, NotebookEdit]
82
+ scope:
83
+ read: ["**/*"]
84
+ write: []
85
+ instructions:
86
+ - Define the question, source constraints, evaluator procedure, pass meaning, score meaning, and bounded stop rule.
87
+ - Separate the research mission from any later promotion decision.
88
+ - Return one structured mission contract.
89
+
90
+ researcher:
91
+ description: Investigates one hypothesis independently and returns attributed evidence.
92
+ tool_permissions:
93
+ allow: [Read, Grep, Glob, Bash]
94
+ deny: [Edit, Write, NotebookEdit]
95
+ scope:
96
+ read: ["**/*"]
97
+ write: []
98
+ instructions:
99
+ - Investigate only the assigned hypothesis.
100
+ - Separate facts, inferences, contradictions, and uncertainties.
101
+ - Include exact source references and confidence for every conclusion.
102
+ - Return one structured research brief and stop.
103
+
104
+ candidate_author:
105
+ description: Authors one staged research candidate from declared evidence and evaluator feedback.
106
+ tool_permissions:
107
+ allow: [Read, Edit, Write, Grep, Glob]
108
+ deny: [Bash, NotebookEdit]
109
+ scope:
110
+ read: ["**/*", ".dna/research/**"]
111
+ write: [".dna/research/**"]
112
+ instructions:
113
+ - Write only .dna/research/{{task_id}}/candidate.md.
114
+ - Use both declared research briefs and preserve source attribution.
115
+ - On a later round, read .dna/research/{{task_id}}/evaluation.json and address only its bounded feedback.
116
+ - Do not modify production source, publish, promote, or deploy the candidate.
117
+
118
+ evaluator:
119
+ description: Independently evaluates the staged candidate and writes strict JSON evidence.
120
+ tool_permissions:
121
+ allow: [Read, Write, Grep, Glob, Bash]
122
+ deny: [Edit, NotebookEdit]
123
+ scope:
124
+ read: ["**/*", ".dna/research/**"]
125
+ write: [".dna/research/**"]
126
+ instructions:
127
+ - Evaluate the exact declared candidate against the mission's objective procedure.
128
+ - Run the declared evaluator command or rubric independently.
129
+ - Write .dna/research/{{task_id}}/evaluation.json as one JSON object with boolean pass, finite numeric score, summary, evidence references, and bounded feedback.
130
+ - Do not alter the candidate or convert evaluator failure into success.
131
+
132
+ reporter:
133
+ description: Reports the passing candidate and evaluator evidence without promoting it.
134
+ tool_permissions:
135
+ allow: [Read, Grep, Glob]
136
+ deny: [Edit, Write, Bash, NotebookEdit]
137
+ scope:
138
+ read: ["**/*", ".dna/research/**"]
139
+ write: []
140
+ instructions:
141
+ - Read the validated candidate and strict evaluator result.
142
+ - Report score, evidence, residual uncertainty, and human review needs.
143
+ - Do not promote, merge, publish, or deploy the candidate.
144
+
145
+ workflows:
146
+ research-improvement:
147
+ name: Research and Evaluator-Driven Improvement
148
+ description: Define one mission, gather two independent evidence briefs, revise a staged candidate under strict evaluation, and stop at pass or bounded exhaustion.
149
+ steps:
150
+ - id: define-mission
151
+ role: mission_lead
152
+ description: Define the research question, evaluator, and stop contract.
153
+ prompt: |
154
+ Define a bounded research and improvement mission for {{task_id}}.
155
+ Return a structured contract containing the question, two distinct
156
+ hypotheses, allowed sources, evaluator procedure, pass semantics,
157
+ numeric score semantics, and stop rule: evaluator pass or retry
158
+ exhaustion. Do not begin research or author a candidate.
159
+ handoff:
160
+ produces:
161
+ - type: state
162
+ name: mission_contract
163
+ description: Structured question, hypotheses, sources, evaluator procedure, pass/score semantics, and stop rule
164
+
165
+ - id: investigate-a
166
+ role: researcher
167
+ depends_on: [define-mission]
168
+ description: Independently investigate the first declared hypothesis.
169
+ prompt: |
170
+ Investigate only Hypothesis A from the mission contract.
171
+ Return structured facts, inferences, contradictions, uncertainties,
172
+ exact source references, and confidence. Do not inspect or rely on
173
+ another research worker's conversation or output.
174
+ handoff:
175
+ consumes:
176
+ - type: state
177
+ from: define-mission
178
+ name: mission_contract
179
+ description: Exact bounded research and evaluator contract
180
+ produces:
181
+ - type: state
182
+ name: research_a
183
+ description: Structured Hypothesis A evidence, source references, contradictions, uncertainty, and confidence
184
+
185
+ - id: investigate-b
186
+ role: researcher
187
+ depends_on: [define-mission]
188
+ description: Independently investigate the second declared hypothesis.
189
+ prompt: |
190
+ Investigate only Hypothesis B from the mission contract.
191
+ Return structured facts, inferences, contradictions, uncertainties,
192
+ exact source references, and confidence. Do not inspect or rely on
193
+ another research worker's conversation or output.
194
+ handoff:
195
+ consumes:
196
+ - type: state
197
+ from: define-mission
198
+ name: mission_contract
199
+ description: Exact bounded research and evaluator contract
200
+ produces:
201
+ - type: state
202
+ name: research_b
203
+ description: Structured Hypothesis B evidence, source references, contradictions, uncertainty, and confidence
204
+
205
+ - id: author-candidate
206
+ role: candidate_author
207
+ depends_on: [investigate-a, investigate-b]
208
+ description: Author or revise one staged candidate from declared evidence.
209
+ prompt: |
210
+ Author .dna/research/{{task_id}}/candidate.md from both declared
211
+ research briefs. Preserve facts, inferences, source references,
212
+ contradictions, and uncertainty. Include the objective evaluator
213
+ contract needed by the next Step.
214
+ If .dna/research/{{task_id}}/evaluation.json exists from a prior round,
215
+ address only its bounded feedback and retain still-valid evidence.
216
+ Do not modify production files or promote the candidate.
217
+ handoff:
218
+ consumes:
219
+ - type: state
220
+ from: investigate-a
221
+ name: research_a
222
+ description: Independent Hypothesis A evidence brief
223
+ - type: state
224
+ from: investigate-b
225
+ name: research_b
226
+ description: Independent Hypothesis B evidence brief
227
+ - type: file
228
+ path: ".dna/research/{{task_id}}/evaluation.json"
229
+ name: prior_evaluation
230
+ required: false
231
+ description: Strict evaluator feedback from the prior round, when present
232
+ produces:
233
+ - type: file
234
+ path: ".dna/research/{{task_id}}/candidate.md"
235
+ name: candidate_artifact
236
+ description: Staged candidate grounded in both research briefs
237
+
238
+ - id: evaluate-candidate
239
+ role: evaluator
240
+ depends_on: [author-candidate]
241
+ description: Independently evaluate the staged candidate and fail closed.
242
+ prompt: |
243
+ Evaluate the exact declared candidate for {{task_id}} using its stated
244
+ objective procedure. Write
245
+ .dna/research/{{task_id}}/evaluation.json with:
246
+ {"pass":true|false,"score":number,"summary":"...","evidence":["reference"],"feedback":["bounded item"]}
247
+ The JSON file is the authoritative result. Return its file reference.
248
+ Never report pass when the procedure fails, errors, or is inconclusive.
249
+ handoff:
250
+ consumes:
251
+ - type: file
252
+ from: author-candidate
253
+ name: candidate_artifact
254
+ description: Exact staged candidate to evaluate
255
+ produces:
256
+ - type: file
257
+ path: ".dna/research/{{task_id}}/evaluation.json"
258
+ name: evaluation_artifact
259
+ description: Strict evaluator JSON with boolean pass, finite numeric score, evidence, and feedback
260
+ completion:
261
+ - evaluator_result:
262
+ path: ".dna/research/{{task_id}}/evaluation.json"
263
+ require_score: true
264
+
265
+ - id: report
266
+ role: reporter
267
+ depends_on: [evaluate-candidate]
268
+ description: Report the passing staged candidate without promotion.
269
+ prompt: |
270
+ Read the declared candidate and validated evaluator result for
271
+ {{task_id}}. Report the score, supporting evidence, remaining
272
+ uncertainty, and exact human review needed before any later adoption.
273
+ Do not promote, merge, publish, or deploy the candidate.
274
+ handoff:
275
+ consumes:
276
+ - type: file
277
+ from: author-candidate
278
+ name: candidate_artifact
279
+ description: Latest staged candidate that reached evaluator pass
280
+ - type: file
281
+ from: evaluate-candidate
282
+ name: evaluation_artifact
283
+ description: Strict passing evaluator result artifact
284
+ produces:
285
+ - type: summary
286
+ name: improvement_report
287
+ description: Human-reviewable passing score, evidence, uncertainty, and promotion boundary
288
+ transitions:
289
+ - from: evaluate-candidate
290
+ to: author-candidate
291
+ condition: fail
292
+ retry_policy:
293
+ max_retries: 2
294
+ retry_from: author-candidate
295
+ backoff: none