triad-plus 1.8.0 → 1.10.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 (61) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +21 -12
  3. package/adapters/antigravity/.agents/agents/triad-developer/agent.md +7 -3
  4. package/adapters/antigravity/.agents/agents/triad-orchestrator/agent.md +5 -0
  5. package/adapters/antigravity/.agents/agents/triad-reviewer/agent.md +7 -2
  6. package/adapters/antigravity/.agents/skills/triad/SKILL.md +22 -0
  7. package/adapters/antigravity/README.md +1 -1
  8. package/adapters/antigravity/install.sh +1 -1
  9. package/adapters/claude-code/.claude/agents/triad-developer.md +9 -4
  10. package/adapters/claude-code/.claude/agents/triad-reviewer.md +10 -5
  11. package/adapters/claude-code/.claude/commands/triad.md +22 -0
  12. package/adapters/claude-code/README.md +12 -4
  13. package/adapters/claude-code/install.sh +1 -1
  14. package/adapters/codex/README.md +1 -1
  15. package/adapters/codex/install.sh +3 -3
  16. package/adapters/codex/prompts/triad.md +28 -0
  17. package/adapters/copilot/.github/agents/triad-developer.agent.md +12 -6
  18. package/adapters/copilot/.github/agents/triad-evaluator.agent.md +2 -1
  19. package/adapters/copilot/.github/agents/triad-orchestrator.agent.md +15 -1
  20. package/adapters/copilot/.github/agents/triad-reviewer.agent.md +11 -5
  21. package/adapters/copilot/.github/skills/triad/SKILL.md +23 -0
  22. package/adapters/hermes/install.sh +1 -1
  23. package/adapters/hermes/skills/triad/SKILL.md +18 -0
  24. package/adapters/opencode/.opencode/agents/triad-developer.md +23 -4
  25. package/adapters/opencode/.opencode/agents/triad-orchestrator.md +16 -0
  26. package/adapters/opencode/.opencode/agents/triad-reviewer.md +25 -3
  27. package/adapters/opencode/.opencode/commands/triad.md +21 -0
  28. package/adapters/opencode/README.md +29 -5
  29. package/adapters/opencode/install.sh +1 -1
  30. package/adapters/registry.mjs +23 -1
  31. package/bin/triad-plus.js +210 -38
  32. package/docs/architecture.md +8 -0
  33. package/docs/assignment-packets.md +35 -0
  34. package/docs/bmad-integration.md +187 -82
  35. package/docs/configuration.md +29 -0
  36. package/docs/npx-installation.md +20 -0
  37. package/docs/opencode-replication.md +8 -0
  38. package/docs/operating-guide.it.md +8 -0
  39. package/docs/operating-guide.md +7 -0
  40. package/docs/runtimes.md +1 -1
  41. package/docs/verification.md +20 -0
  42. package/integrations/bmad/README.md +17 -9
  43. package/integrations/bmad/epics-parser.mjs +697 -0
  44. package/integrations/bmad/story-importer.mjs +143 -5
  45. package/package.json +2 -2
  46. package/runtime/lib/assignment-packet.mjs +553 -0
  47. package/runtime/lib/model-config.mjs +165 -0
  48. package/runtime/lib/repository-context.mjs +192 -0
  49. package/runtime/lib/terminal.mjs +86 -0
  50. package/runtime/triad-assignment-packet.mjs +62 -0
  51. package/runtime/triad-bmad-intake.mjs +150 -0
  52. package/runtime/triad-runtime-context.mjs +88 -0
  53. package/runtime/triad-verify.mjs +41 -21
  54. package/schemas/verification-evidence.schema.json +8 -0
  55. package/skills/triad-loop-bootstrap/SKILL.md +39 -4
  56. package/skills/triad-loop-bootstrap/assets/loop-template/runtime/assignments/assignment.template.json +14 -1
  57. package/skills/triad-loop-developer/SKILL.md +33 -8
  58. package/skills/triad-loop-orchestrator/SKILL.md +96 -11
  59. package/skills/triad-loop-reviewer/SKILL.md +31 -5
  60. package/skills/triad-model-configuration/SKILL.md +98 -0
  61. package/skills/triad-model-configuration/agents/openai.yaml +4 -0
@@ -0,0 +1,35 @@
1
+ # Assignment packets
2
+
3
+ Before a delegated role starts, the Orchestrator creates one immutable
4
+ Assignment Packet for that assignment:
5
+
6
+ ```bash
7
+ node .triad-runtime/triad-assignment-packet.mjs \
8
+ --project /absolute/path/to/control-workspace \
9
+ --assignment .loop/runtime/assignments/<assignment-file>.json
10
+ ```
11
+
12
+ The command binds `assignment_packet_path` and
13
+ `assignment_packet_sha256` in the active assignment and returns a JSON dispatch
14
+ context. The host launches the Developer with `dispatch.cwd` set to the
15
+ declared product worktree. The Reviewer receives the same packet and uses that
16
+ worktree when direct candidate inspection is needed. The control workspace
17
+ remains the source for policy, cards, state, and evidence.
18
+
19
+ Packets contain bounded assignment context: card outcome and acceptance
20
+ criteria, relevant PRD/ADR excerpts supplied by the Orchestrator, verification
21
+ mapping, expected paths, constraints, risks, mandatory skill paths/hashes, and
22
+ prior evidence references. They are not a second PRD and do not copy skill
23
+ contents. The Developer and Reviewer still read every real mandatory skill and
24
+ the verifier remains authoritative for skill hashes and gate evidence.
25
+
26
+ The packet and card are the normal startup contract. A full PRD or ADR is a
27
+ fallback only when a detail is missing, contradictory, or explicitly required.
28
+ Native `read`, `grep`, `glob`, and `list` operations should be preferred for
29
+ simple discovery; shell commands remain appropriate for builds, tests, git,
30
+ scripts, and system operations.
31
+
32
+ Projects and assignments without packet fields keep the legacy behavior. A
33
+ bound packet is validated before `triad-verify` runs skills, scope checks, or
34
+ quality gates; a missing, changed, or mismatched packet fails closed as
35
+ `assignment_packet_invalid` without consuming retry budget.
@@ -1,110 +1,215 @@
1
- # Optional BMAD Story integration
1
+ # BMAD native intake
2
+
3
+ Triad+ treats BMAD as the planning authority and takes over at the natural
4
+ planning handoff: the read-only `_bmad-output/planning-artifacts/epics.md`
5
+ artifact.
6
+
7
+ ```text
8
+ BMAD planning
9
+ -> epics.md
10
+ -> deterministic Triad intake
11
+ -> normal Cards
12
+ -> Developer -> verifier -> Reviewer -> delivery
13
+ ```
2
14
 
3
- Triad+ can consume one already-produced BMAD Story and turn it into a normal
4
- Triad feature Card. This is an integration boundary, not a BMAD execution
5
- adapter: BMAD remains the planning authority and Triad remains responsible for
6
- implementation, verification, review, and delivery.
15
+ The owner does not need to split `epics.md` into Triad-shaped Story files or
16
+ run one import command per Story. A normal host entry point such as
17
+ `/triad /path/to/_bmad-output/planning-artifacts/epics.md` lets the Orchestrator
18
+ detect the native artifact, ingest it, and continue with the initialized
19
+ project-control workspace. Passing the BMAD output directory is also supported
20
+ when it contains the conventional `planning-artifacts/epics.md` path.
7
21
 
8
- ## Contract
22
+ ## Responsibilities
9
23
 
10
- The source is a read-only Markdown Story. It must contain:
24
+ BMAD owns planning:
11
25
 
12
- - a unique Story `id` and `title` (frontmatter, metadata labels, or a Story
13
- heading);
14
- - `status: ready-for-dev` (frontmatter or a `Status` field);
15
- - a target repository (or an explicit `--target-repository` importer option);
16
- - an intent/outcome; and
17
- - acceptance criteria.
26
+ - Epic and Story boundaries;
27
+ - intent and user outcome;
28
+ - acceptance criteria;
29
+ - planning context, constraints, and references.
18
30
 
19
- The importer also carries through the Story's `Tasks & Acceptance`, Code Map,
20
- Design Notes/constraints, verification expectations, and source references
21
- when they are present. It does not interpret prose with an LLM, re-decompose a
22
- Story, or invoke BMAD Build, Build Auto, or `bmad-loop`.
31
+ Triad owns execution:
23
32
 
24
- ## CLI
33
+ - project and repository resolution;
34
+ - worktree and branch selection;
35
+ - trusted quality gates and required-gate selection;
36
+ - Card creation, assignment, Developer, verifier, Reviewer, retry, and delivery
37
+ semantics.
25
38
 
26
- ```bash
27
- npx triad-plus import-bmad-story \
28
- --source /absolute/path/to/story.md \
29
- --output /absolute/path/to/control/features/JFR-001.md \
30
- --target-repository webup \
31
- --required-gate cypress-jfr \
32
- --depends-on JFR-000
33
- ```
39
+ Triad never invokes `bmad-loop`, Build, Build Auto, or another BMAD workflow.
40
+ It does not modify `epics.md` or add execution metadata to the BMAD source.
41
+
42
+ ## Bootstrap boundary
43
+
44
+ When native BMAD planning has produced `epics.md`, that artifact is the sole
45
+ authority for Epic/Story boundaries and acceptance criteria. Bootstrap consumes
46
+ the canonical Stories and materializes one normal Triad Card per Story; it does
47
+ not independently re-decompose the PRD, create a second semantic plan, or use
48
+ an LLM to decide Story boundaries. This prevents parallel Cards A/B and keeps
49
+ the handoff deterministic: BMAD plans, Triad executes.
50
+
51
+ ## Deterministic parser and API
52
+
53
+ The integration is implemented in
54
+ `integrations/bmad/epics-parser.mjs`. It recognizes native headings such as:
55
+
56
+ ```md
57
+ ### Epic 1: JsonForm integration
58
+
59
+ ### Story 1.1: Route the provider document
34
60
 
35
- `--required-gate` and `--depends-on` may be repeated. They are explicit caller
36
- options: gate IDs are additive to the repository's globally required gates,
37
- and dependencies are never inferred from `stories.yaml` order. Omit both when
38
- the Card should use the repository's normal/baseline behavior.
61
+ **Intent / outcome:** ...
39
62
 
40
- The command writes the Card and a sidecar provenance record (by default
41
- `<card>.bmad-provenance.json`). The provenance records `source_kind:
42
- bmad-story`, the resolved source path, source SHA-256, BMAD Story ID, target
43
- repository, Card SHA-256, and the explicit options used for the import.
63
+ **Acceptance Criteria:**
64
+ **Given** ...
65
+ **When** ...
66
+ **Then** ...
67
+ ```
44
68
 
45
- The same operation is available to Node consumers:
69
+ Story detection, Epic association, ID/title extraction, acceptance extraction,
70
+ splitting, and provenance are deterministic code. No LLM is used for intake.
71
+ The source is read twice and must remain byte-stable during the operation.
72
+
73
+ Read-only ingestion returns canonical Stories without assigning a repository:
46
74
 
47
75
  ```js
48
- import { importBmadStory, writeImportedCard } from
49
- 'triad-plus/integrations/bmad/story-importer.mjs';
76
+ import { ingestBmadEpics } from 'triad-plus/integrations/bmad/epics-parser.mjs';
50
77
 
51
- const result = await importBmadStory({
52
- sourcePath: '/absolute/path/to/story.md',
53
- targetRepository: 'webup',
54
- requiredGates: ['cypress-jfr']
78
+ const result = await ingestBmadEpics({
79
+ sourcePath: '/project/_bmad-output/planning-artifacts/epics.md'
55
80
  });
56
81
 
57
- await writeImportedCard({
58
- sourcePath: '/absolute/path/to/story.md',
59
- outputPath: '/absolute/path/to/control/features/JFR-001.md',
60
- targetRepository: 'webup',
61
- requiredGates: ['cypress-jfr']
62
- });
82
+ // result.stories: canonical BMAD Stories
83
+ // result.cards: [] — no execution assumptions were made
63
84
  ```
64
85
 
65
- ## Example mapping
86
+ The integration-side runtime primitive can materialize normal Cards when an
87
+ initialized Triad project context is supplied:
66
88
 
67
- Input (abridged):
89
+ ```bash
90
+ node .triad-runtime/triad-bmad-intake.mjs \
91
+ --source /project/_bmad-output/planning-artifacts/epics.md \
92
+ --project /project/triad-control \
93
+ --output /project/triad-control/features \
94
+ --repository webup \
95
+ --required-gate 1.4=cypress-jfr
96
+ ```
68
97
 
69
- ```md
70
- ---
71
- id: JFR-001
72
- title: Route the provider document
73
- status: ready-for-dev
74
- target_repository: webup
75
- ---
98
+ `--source` may also be the BMAD output directory; the conventional
99
+ `_bmad-output/planning-artifacts/epics.md` file is selected deterministically.
100
+
101
+ This is an automation/API primitive for the Orchestrator, not the primary user
102
+ workflow. The primary workflow remains the host's `/triad` entry point with the
103
+ BMAD artifact path.
104
+
105
+ ## Ingestion readiness versus execution readiness
76
106
 
77
- # Story JFR-001: Route the provider document
107
+ An `epics.md` Story is ingestible when it has:
78
108
 
79
- ## Intent
109
+ - a unique Story ID;
110
+ - a title;
111
+ - an intent, outcome, or user story;
112
+ - acceptance criteria;
113
+ - an unambiguous Epic parent.
80
114
 
81
- Webup renders the provider-owned document at the existing boundary.
115
+ `status: ready-for-dev` is not required for ingestion because native
116
+ `epics.md` commonly does not contain that field. Ingestion does not dispatch a
117
+ Developer and does not claim that a Card is executable.
82
118
 
83
- ## Acceptance Criteria
119
+ Before Card materialization, Triad resolves execution readiness:
84
120
 
85
- - Given a valid document, when the route is requested, then it renders.
121
+ - project configuration is present;
122
+ - the target repository is explicit, configured as the project default, or is
123
+ the only configured repository;
124
+ - multiple repositories without a deterministic mapping fail closed;
125
+ - the selected repository has a usable path/worktree;
126
+ - the trusted gate catalog exists and contains no placeholders;
127
+ - explicit per-Story required gates and dependencies validate as caller input.
86
128
 
87
- ## Code Map
129
+ An explicit non-ready BMAD status such as `draft`, `in-progress`, `done`, or
130
+ `blocked` remains ingestible but is rejected at execution readiness. Triad never
131
+ silently promotes it to `ready-for-dev` in the source.
88
132
 
89
- - `src/components/jfr/`
133
+ ## Repository and gate binding
134
+
135
+ `target_repository` is optional in native BMAD. Resolution is deterministic:
136
+
137
+ ```text
138
+ per-Story caller override / Story repository declaration
139
+ -> explicit caller default repository
140
+ -> project default repository
141
+ -> single configured repository
142
+ -> otherwise fail closed as ambiguous
90
143
  ```
91
144
 
92
- The generated Card keeps that intent, acceptance criterion, Code Map, and the
93
- target repository, then adds the normal Triad sections and the integration
94
- boundary note. The caller-supplied `cypress-jfr` (if any) is recorded as an
95
- additive required gate; it is not inferred from the word "render" or from a
96
- file extension.
97
-
98
- ## Fail-closed behavior
99
-
100
- No executable Card is produced for a missing source, missing/non-`ready-for-dev`
101
- status, malformed or ambiguous ID/title, missing indispensable Card fields,
102
- conflicting target repository, invalid caller options, or a source that changes
103
- while it is being read. The API exposes integration-level error codes such as
104
- `bmad_story_not_ready`, `bmad_story_ambiguous`, `bmad_story_unmappable`, and
105
- `bmad_story_source_mutated` so a planning gap can return upstream rather than
106
- become a Developer decision.
107
-
108
- After import, the generated Card goes through the existing assignment and
109
- `triad-verify` path. No Core schema, lifecycle, Reviewer, retry, or gate
110
- execution semantics are changed by this integration.
145
+ Conflicting explicit mappings fail closed rather than being silently chosen;
146
+ unknown repositories fail closed. Quality gates are not inferred from
147
+ acceptance prose or Story ordering. If a caller selects an additional gate, it
148
+ is supplied explicitly and uses the existing additive `required_gates`
149
+ semantics. Dependencies are preserved only when explicitly supplied; position
150
+ in `epics.md` never becomes `depends_on` automatically.
151
+
152
+ ## Card and provenance output
153
+
154
+ The parser reuses the existing Card builder. It does not create intermediate
155
+ BMAD Story files. When Cards are materialized, each normal Card is accompanied
156
+ by an integration-side provenance record containing at least:
157
+
158
+ ```json
159
+ {
160
+ "source_kind": "bmad-epics",
161
+ "source_path": "_bmad-output/planning-artifacts/epics.md",
162
+ "source_sha256": "...",
163
+ "epic_id": "1",
164
+ "story_id": "1.1",
165
+ "source_heading": "Story 1.1: ...",
166
+ "source_range": { "start_line": 10, "end_line": 38 },
167
+ "card_sha256": "..."
168
+ }
169
+ ```
170
+
171
+ The source SHA, Story identity, source heading/range, and generated Card SHA
172
+ form the audit binding. Line ranges are supporting evidence, not the sole
173
+ identity. The BMAD source remains read-only.
174
+
175
+ ## Fail-closed conditions
176
+
177
+ The native intake rejects malformed or unsafe input rather than inventing a
178
+ planning decision. Examples include:
179
+
180
+ - missing or malformed Epic/Story headings;
181
+ - duplicate Epic or Story IDs;
182
+ - a Story outside an Epic;
183
+ - missing title, intent/outcome, or acceptance criteria;
184
+ - source mutation during the read;
185
+ - ambiguous or unknown repository resolution;
186
+ - missing project/worktree/gate readiness;
187
+ - an explicit non-ready Story status at execution time.
188
+
189
+ No partial Card set is written when parsing or execution readiness fails.
190
+
191
+ ## Low-level single-Story compatibility path
192
+
193
+ `import-bmad-story` remains available as a low-level API, debugging tool, test
194
+ utility, and compatibility path for a standalone Story that already carries
195
+ `status: ready-for-dev` and a repository (or an explicit caller override):
196
+
197
+ ```bash
198
+ npx triad-plus import-bmad-story \
199
+ --source /absolute/path/to/story.md \
200
+ --output /absolute/path/to/control/features/STORY-001.md
201
+ ```
202
+
203
+ It is no longer the primary BMAD workflow. It remains read-only and fail-closed,
204
+ preserves explicit gates/dependencies, and uses the same Card contract.
205
+
206
+ ## Non-goals
207
+
208
+ This integration does not add:
209
+
210
+ - BMAD execution, Build Auto, or `bmad-loop`;
211
+ - an Epic scheduler or batch execution engine;
212
+ - dependency inference from `stories.yaml` or document order;
213
+ - an LLM Story interpreter;
214
+ - NotebookLM, SMEUP-specific policy, or Quality Baseline Core changes;
215
+ - parallel writers, worktree orchestration, or a new plugin framework.
@@ -31,6 +31,35 @@ adapter writes those into host-native profiles only where the selected host
31
31
  supports that facility. A blank model means the host default. Never put tokens,
32
32
  API keys, or private deployment data in this file.
33
33
 
34
+ ## Configure models through the agent
35
+
36
+ The installed `triad-model-configuration` skill lets an owner ask the selected
37
+ agent to show or change role models without editing host-specific files. The
38
+ agent reads `.triad-runtime/adapter.json`, validates `.triad-plus/team.json`,
39
+ changes only the explicitly requested `model` or `reasoning_effort` fields, and
40
+ uses the existing managed binding path to materialize supported values. It
41
+ reports whether each request was applied host-natively, recorded only in the
42
+ team file, left at the host default, or unsupported. It never invents model IDs
43
+ and never puts credentials in the configuration.
44
+
45
+ The skill follows the adapter metadata: `global-profiles` writes native
46
+ user-level profiles, `project-frontmatter` writes only the declared native
47
+ fields (OpenCode supports model plus its native `variant`, Copilot supports
48
+ model plus `reasoningEffort`, and Claude Code currently supports model only),
49
+ and `team-record` records intent without fabricating a host binding. A null or
50
+ blank value deliberately means host default. Reasoning levels are host-specific
51
+ and are never translated between providers.
52
+
53
+ For project-frontmatter adapters, `.triad-plus/team.json` remains the canonical
54
+ source of truth. Managed installation and `upgrade --apply` re-materialize each
55
+ configured role's supported fields after refreshing agent assets. OpenCode maps
56
+ `model` to `model` and `reasoning_effort` to its native `variant` field; Copilot
57
+ maps the same canonical fields to `model` and `reasoningEffort`; Claude Code
58
+ currently maps `model` only. Null or blank values are omitted so the host uses
59
+ its session default. Other adapters may expose different controls; Triad+ only
60
+ materializes fields supported by the selected host. A host/session default is
61
+ distinct from a role-agent binding.
62
+
34
63
  ## Retry and scope policy
35
64
 
36
65
  New control workspaces use separate finite budgets for environment recovery and
@@ -10,6 +10,10 @@ npx triad-plus
10
10
  The interactive setup selects a host, optional user-level command, language,
11
11
  owner address, role display names/personas, models, and whether the optional
12
12
  Evaluator+ is enabled. It changes files only after `install` is typed.
13
+ Before confirmation it prints a compact summary of the host, control workspace,
14
+ interaction settings, Evaluator+, and each role's model/binding. Colors are
15
+ used only for an interactive terminal and are disabled by `NO_COLOR` or when
16
+ output is not a TTY.
13
17
 
14
18
  For repeatable setup:
15
19
 
@@ -46,6 +50,18 @@ personas, models, and supported effort/options. Existing schema-version-1 team
46
50
  files remain valid. Core roles are always enabled; Evaluator+ is enabled only
47
51
  when `roles.evaluator.enabled` is `true`.
48
52
 
53
+ The shared `triad-model-configuration` skill is installed with the selected
54
+ adapter. Ask the host agent to inspect or change a role model; it keeps
55
+ `.triad-plus/team.json` as the source of truth and re-materializes only fields
56
+ the adapter declares as host-native. Unsupported fields are reported rather
57
+ than silently substituted.
58
+
59
+ For OpenCode, the canonical `reasoning_effort` value is materialized as the
60
+ native per-agent `variant` field. Copilot uses its own native
61
+ `reasoningEffort` field; these host contracts are intentionally not inferred
62
+ from one another. The active host/session default remains separate from a
63
+ materialized role profile.
64
+
49
65
  | Role | Responsibility |
50
66
  | --- | --- |
51
67
  | Orchestrator | Maintains goal/context and decides the next step. |
@@ -58,3 +74,7 @@ PRD path. The Orchestrator presents feature cards before implementation, then
58
74
  delegates normal development and review. When `roles.evaluator.enabled` is true,
59
75
  the Orchestrator invokes Evaluator+ automatically after Triad is approved. Users never create
60
76
  evaluation packets, report paths, or evidence directories manually.
77
+
78
+ During a run the Orchestrator creates any Assignment Packet internally and
79
+ passes its explicit product-worktree dispatch context to the delegated roles;
80
+ there is no user-facing packet path to configure.
@@ -7,3 +7,11 @@ command assets carry the configured role models where OpenCode supports them.
7
7
  Verification uses explicit Orchestrator dispatch. A configured Evaluator+ is
8
8
  automatically invoked only after a Reviewer-approved result; it cannot reopen
9
9
  that run.
10
+
11
+ `.triad-plus/team.json` is the desired source of truth for OpenCode role
12
+ configuration. Triad+ materializes each supported role's `model` and native
13
+ `variant` (from `reasoning_effort`) in `.opencode/agents/*.md` during init and
14
+ after `upgrade --apply`. A null value leaves that field absent so OpenCode uses
15
+ its host/session default. The OpenCode session default is independent of these
16
+ per-agent bindings; use `opencode models` to inspect available IDs and
17
+ variants.
@@ -18,6 +18,14 @@ Prima del lavoro l’Orchestrator congela il PRD, dichiara card misurabili,
18
18
  repository/worktree/branch e quality gate deterministici. Mostra il piano al
19
19
  proprietario, poi delega normalmente sviluppo e review.
20
20
 
21
+ Per ogni assignment attivo può creare un Assignment Packet immutabile. Il
22
+ packet contiene il contesto delimitato della card e gli estratti pertinenti; il
23
+ host avvia il Developer con `cwd`/`workdir` uguale al product worktree
24
+ dichiarato, mantenendo espliciti i path del control workspace. Il Reviewer
25
+ riceve lo stesso packet più candidato/evidence. La rilettura completa di
26
+ PRD/ADR è solo fallback e le skill obbligatorie continuano a essere lette e
27
+ verificate tramite i loro path reali.
28
+
21
29
  Dopo il completamento del Developer avviene la verifica: tramite hook validato
22
30
  quando disponibile, altrimenti con dispatch esplicito dell’Orchestrator. Il
23
31
  verifier esegue solo comandi `control-plane` dichiarati. L’evidence atomica lega
@@ -19,6 +19,13 @@ Before work, the Orchestrator snapshots the PRD, declares measurable feature
19
19
  cards, target repositories/worktrees/branches, and deterministic quality gates.
20
20
  It shows the plan to the owner, then delegates ordinary development and review.
21
21
 
22
+ For each active assignment it may create an immutable Assignment Packet. The
23
+ packet carries the bounded card context and relevant excerpts; the host launches
24
+ the Developer with `cwd`/`workdir` equal to the declared product worktree, while
25
+ control-workspace paths remain explicit. The Reviewer receives the same packet
26
+ plus candidate/evidence. Full PRD/ADR reads are fallback-only, and mandatory
27
+ repository skills are still read and hash-verified from their real paths.
28
+
22
29
  After Developer completion, verification happens through a validated host hook
23
30
  when available, or explicit Orchestrator dispatch. The verifier executes only
24
31
  declared `control-plane` commands. Atomic evidence binds assignment ID/hash, run,
package/docs/runtimes.md CHANGED
@@ -49,6 +49,6 @@ validated independently as well.
49
49
  ## OpenCode
50
50
 
51
51
  Use the interactive OpenCode TUI for complete multi-step Triad runs. OpenCode
52
- 1.18.0 validated the full Orchestrator → Developer → verifier → Reviewer →
52
+ 1.18.x validated the full Orchestrator → Developer → verifier → Reviewer →
53
53
  configured Evaluator+ lifecycle in the TUI. `opencode run` is useful for
54
54
  one-shot work but does not retain that multi-step parent/subagent lifecycle.
@@ -46,6 +46,26 @@ it does not itself approve, rework, or transition a run.
46
46
  Evidence files and logs are diagnostics. Users normally need only the
47
47
  Orchestrator's summary and the Reviewer verdict.
48
48
 
49
+ ## Assignment packets and dispatch context
50
+
51
+ The Orchestrator can create one immutable packet per active assignment with:
52
+
53
+ ```bash
54
+ node .triad-runtime/triad-assignment-packet.mjs \
55
+ --project /absolute/path/to/control-workspace \
56
+ --assignment .loop/runtime/assignments/<assignment-file>.json
57
+ ```
58
+
59
+ The command binds a packet path and SHA-256 to the assignment and returns the
60
+ explicit product-worktree `dispatch.cwd`. The packet contains the bounded card
61
+ contract, relevant excerpts, verification mapping, expected paths, risks,
62
+ constraints, mandatory skill references, and prior evidence references. It is
63
+ the primary Developer/Reviewer context; full PRD/ADR reads are fallback-only.
64
+ It never replaces real skill reads or verifier hash checks. A bound packet is
65
+ validated before `triad-verify` executes scope or gates, and a changed or
66
+ missing packet fails closed as `assignment_packet_invalid`. Assignments without
67
+ packet fields retain legacy behavior.
68
+
49
69
  ## Card-declared required gates
50
70
 
51
71
  The work queue may carry a machine-readable `required_gates` list for an
@@ -1,12 +1,20 @@
1
- # BMAD Story importer
1
+ # BMAD integration
2
2
 
3
- This optional integration converts one BMAD Markdown Story with
4
- `status: ready-for-dev` into a normal Triad feature Card. It is intentionally
5
- small and deterministic: the source is read-only, caller options are explicit,
6
- and BMAD workflows are never invoked.
3
+ The primary BMAD handoff is the native planning artifact
4
+ `_bmad-output/planning-artifacts/epics.md`. Use the deterministic parser in
5
+ `epics-parser.mjs` to detect Epic/Story boundaries, ingest canonical Stories,
6
+ resolve Triad execution readiness, and materialize normal Cards with strong
7
+ source provenance.
7
8
 
8
- See [the public BMAD integration guide](../../docs/bmad-integration.md) for the
9
- mapping contract, CLI/API examples, provenance sidecar, and fail-closed rules.
9
+ The parser is read-only and does not invoke BMAD workflows or mutate
10
+ `epics.md`. It reuses the Card builder from `story-importer.mjs`; no
11
+ intermediate BMAD Story files are required.
10
12
 
11
- The implementation is in `story-importer.mjs`. It does not add BMAD-specific
12
- branches to the Triad Core or infer gates/dependencies from planning order.
13
+ `story-importer.mjs` remains the low-level compatibility API for a standalone
14
+ Story that already has `status: ready-for-dev`. It is retained for debugging,
15
+ tests, automation, and existing callers, but it is not the primary BMAD user
16
+ workflow.
17
+
18
+ See [the native BMAD integration guide](../../docs/bmad-integration.md) for the
19
+ handoff contract, repository resolution, execution readiness, provenance, and
20
+ fail-closed behavior.