triad-plus 1.7.0 → 1.9.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.
- package/CHANGELOG.md +32 -0
- package/README.md +23 -12
- package/adapters/antigravity/.agents/agents/triad-developer/agent.md +7 -3
- package/adapters/antigravity/.agents/agents/triad-evaluator/agent.md +5 -0
- package/adapters/antigravity/.agents/agents/triad-orchestrator/agent.md +5 -0
- package/adapters/antigravity/.agents/agents/triad-reviewer/agent.md +7 -2
- package/adapters/antigravity/.agents/skills/triad/SKILL.md +22 -0
- package/adapters/claude-code/.claude/agents/triad-developer.md +9 -4
- package/adapters/claude-code/.claude/agents/triad-evaluator.md +5 -0
- package/adapters/claude-code/.claude/agents/triad-reviewer.md +10 -5
- package/adapters/claude-code/.claude/commands/triad.md +22 -0
- package/adapters/claude-code/README.md +11 -3
- package/adapters/codex/prompts/triad.md +28 -0
- package/adapters/copilot/.github/agents/triad-developer.agent.md +12 -6
- package/adapters/copilot/.github/agents/triad-evaluator.agent.md +7 -1
- package/adapters/copilot/.github/agents/triad-orchestrator.agent.md +15 -1
- package/adapters/copilot/.github/agents/triad-reviewer.agent.md +11 -5
- package/adapters/copilot/.github/skills/triad/SKILL.md +23 -0
- package/adapters/hermes/skills/triad/SKILL.md +23 -0
- package/adapters/opencode/.opencode/agents/triad-developer.md +9 -4
- package/adapters/opencode/.opencode/agents/triad-evaluator.md +6 -0
- package/adapters/opencode/.opencode/agents/triad-orchestrator.md +15 -0
- package/adapters/opencode/.opencode/agents/triad-reviewer.md +10 -3
- package/adapters/opencode/.opencode/commands/triad.md +21 -0
- package/adapters/opencode/README.md +19 -4
- package/adapters/registry.mjs +2 -0
- package/bin/triad-plus.js +8 -2
- package/docs/architecture.md +15 -0
- package/docs/assignment-packets.md +35 -0
- package/docs/bmad-integration.md +187 -82
- package/docs/configuration.md +28 -0
- package/docs/evaluator-plus.md +9 -0
- package/docs/npx-installation.md +4 -0
- package/docs/operating-guide.it.md +18 -0
- package/docs/operating-guide.md +17 -0
- package/docs/quality-contract.md +119 -0
- package/docs/verification.md +37 -0
- package/integrations/bmad/README.md +17 -9
- package/integrations/bmad/epics-parser.mjs +697 -0
- package/integrations/bmad/story-importer.mjs +143 -5
- package/package.json +2 -2
- package/runtime/lib/assignment-packet.mjs +516 -0
- package/runtime/lib/quality-baseline.mjs +205 -0
- package/runtime/triad-assignment-packet.mjs +62 -0
- package/runtime/triad-bmad-intake.mjs +150 -0
- package/runtime/triad-evaluator-validate.mjs +261 -0
- package/runtime/triad-verify.mjs +33 -7
- package/schemas/evaluator-plus-result.schema.json +16 -0
- package/schemas/quality-baseline.schema.json +42 -0
- package/schemas/verification-evidence.schema.json +9 -1
- package/skills/triad-loop-bootstrap/SKILL.md +47 -4
- package/skills/triad-loop-bootstrap/assets/loop-template/handoff-report.template.md +13 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/quality-baseline.json +15 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/run-state.yaml +7 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/runtime/assignments/assignment.template.json +16 -1
- package/skills/triad-loop-bootstrap/assets/project.yaml +5 -0
- package/skills/triad-loop-developer/SKILL.md +19 -8
- package/skills/triad-loop-evaluator/SKILL.md +12 -2
- package/skills/triad-loop-orchestrator/SKILL.md +134 -11
- package/skills/triad-loop-reviewer/SKILL.md +15 -5
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Immutable Quality Contract
|
|
2
|
+
|
|
3
|
+
Triad+ 1.8 optionally binds a run to an owner-approved, machine-readable
|
|
4
|
+
Quality Baseline. It is an additional target record, not a second control
|
|
5
|
+
plane and not a replacement for the PRD, card baseline, or candidate
|
|
6
|
+
fingerprint.
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
Quality Baseline fingerprint = what the run was meant to satisfy
|
|
10
|
+
Repository/card baseline = where implementation started
|
|
11
|
+
Candidate fingerprint = what implementation produced
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Manifest
|
|
15
|
+
|
|
16
|
+
The manifest is JSON and is normally stored at
|
|
17
|
+
`artifacts/quality-baseline.json`:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"schema_version": 1,
|
|
22
|
+
"id": "my-project-quality-baseline",
|
|
23
|
+
"revision": 1,
|
|
24
|
+
"sources": [
|
|
25
|
+
{
|
|
26
|
+
"id": "prd",
|
|
27
|
+
"role": "intent",
|
|
28
|
+
"path": "artifacts/prd.md",
|
|
29
|
+
"sha256": "<64-hex-digest>"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"criteria": [
|
|
33
|
+
{ "id": "QB-001", "scope": "product_quality", "requirement": "..." },
|
|
34
|
+
{ "id": "QB-010", "scope": "delivery_closure", "requirement": "..." }
|
|
35
|
+
],
|
|
36
|
+
"fingerprint": "<sha256-of-canonical-manifest-without-fingerprint>"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The manifest requires a positive revision, at least one source, unique source
|
|
41
|
+
and criterion IDs, project-relative source paths, SHA-256 for every source, and
|
|
42
|
+
non-empty requirements. Version 1 has exactly two criterion scopes:
|
|
43
|
+
`product_quality` and `delivery_closure`.
|
|
44
|
+
|
|
45
|
+
The fingerprint is SHA-256 over canonical JSON with object keys sorted
|
|
46
|
+
recursively, array order preserved, and the `fingerprint` field excluded from
|
|
47
|
+
the payload. Whitespace and object formatting therefore do not change it.
|
|
48
|
+
|
|
49
|
+
## Binding and drift
|
|
50
|
+
|
|
51
|
+
When `project.quality_contract` is present, the Orchestrator binds both the
|
|
52
|
+
manifest path and its fingerprint in every active Developer assignment:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"quality_baseline_path": "artifacts/quality-baseline.json",
|
|
57
|
+
"expected_quality_baseline_fingerprint": "<sha256>"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`triad-verify` validates the manifest and all source hashes before expensive
|
|
62
|
+
gates. A malformed manifest or fingerprint mismatch is
|
|
63
|
+
`quality_baseline_invalid`; a valid manifest whose declared sources or
|
|
64
|
+
assignment fingerprint no longer match is `quality_baseline_drift`. Both are
|
|
65
|
+
`invalid_context`: no Developer dispatch, expensive gates, or retry budget.
|
|
66
|
+
|
|
67
|
+
Projects without `quality_contract` retain the legacy PRD-only path. A
|
|
68
|
+
rebaseline is never an in-place edit: create a new revision/fingerprint and
|
|
69
|
+
record an explicit lineage event. Historical evidence is not silently
|
|
70
|
+
reinterpreted.
|
|
71
|
+
|
|
72
|
+
## Phase ownership
|
|
73
|
+
|
|
74
|
+
`product_quality` criteria are included in the fresh, blind Evaluator+ packet.
|
|
75
|
+
The packet carries the baseline fingerprint, final candidate fingerprint,
|
|
76
|
+
criteria, approved source material, and bounded verifier evidence. It never
|
|
77
|
+
includes delivery criteria, queue state, handoff state, or attempt history.
|
|
78
|
+
|
|
79
|
+
Evaluator+ returns one result per product criterion. The control plane validates
|
|
80
|
+
coverage, uniqueness, scope, candidate/baseline fingerprints, and the overall
|
|
81
|
+
verdict. Aggregation is deterministic:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
any FAIL -> FAIL
|
|
85
|
+
else any INDETERMINATE -> INDETERMINATE
|
|
86
|
+
else -> PASS
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`delivery_closure` criteria are evaluated separately during delivery closure
|
|
90
|
+
and recorded with criterion ID, verdict, and evidence references. A run is not
|
|
91
|
+
`delivered` when any configured delivery criterion is `FAIL` or
|
|
92
|
+
`INDETERMINATE`. Quality Bar evaluation is not a required-gate replacement,
|
|
93
|
+
and an Evaluator+ failure never repairs or reopens Triad automatically.
|
|
94
|
+
|
|
95
|
+
## Explicit control-plane validation
|
|
96
|
+
|
|
97
|
+
The installed runtime exposes deterministic commands for the two phase
|
|
98
|
+
boundaries. Run the baseline preflight before dispatch, then run the phase
|
|
99
|
+
validators from the control workspace so the baseline is reloaded from disk:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
node .triad-runtime/triad-evaluator-validate.mjs --mode baseline \
|
|
103
|
+
--project /absolute/path/to/control \
|
|
104
|
+
--baseline artifacts/quality-baseline.json
|
|
105
|
+
|
|
106
|
+
node .triad-runtime/triad-evaluator-validate.mjs --mode evaluator \
|
|
107
|
+
--project /absolute/path/to/control \
|
|
108
|
+
--baseline artifacts/quality-baseline.json \
|
|
109
|
+
--result artifacts/evaluator-plus/evaluation.json \
|
|
110
|
+
--expected-candidate-fingerprint <final-candidate-fingerprint>
|
|
111
|
+
|
|
112
|
+
node .triad-runtime/triad-evaluator-validate.mjs --mode delivery \
|
|
113
|
+
--project /absolute/path/to/control \
|
|
114
|
+
--baseline artifacts/quality-baseline.json \
|
|
115
|
+
--result artifacts/delivery-closure.json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Each command emits one machine-readable JSON result and exits non-zero for an
|
|
119
|
+
invalid contract, source drift, stale candidate binding, or invalid result.
|
package/docs/verification.md
CHANGED
|
@@ -17,6 +17,23 @@ An agent-reported claim is not the same as verification evidence. A Developer ca
|
|
|
17
17
|
report the commands it ran; `triad-verify` independently observes declared
|
|
18
18
|
required `control-plane` gates and writes atomic evidence.
|
|
19
19
|
|
|
20
|
+
## Immutable Quality Contract
|
|
21
|
+
|
|
22
|
+
Projects may opt into `project.quality_contract` with a project-relative JSON
|
|
23
|
+
manifest and its expected SHA-256 fingerprint. The shared
|
|
24
|
+
`runtime/lib/quality-baseline.mjs` loader canonicalizes the manifest (excluding
|
|
25
|
+
its self-declared `fingerprint`), validates source paths, IDs, scopes, and hashes,
|
|
26
|
+
then verifies every bound source before any expensive gate runs. A malformed,
|
|
27
|
+
missing, or mismatched contract is `invalid_context`; a valid manifest whose
|
|
28
|
+
bound source content has changed is `quality_baseline_drift`. Both fail closed:
|
|
29
|
+
no Developer dispatch, gate execution, or retry budget consumption is allowed.
|
|
30
|
+
|
|
31
|
+
The verifier records `baseline.quality_baseline_fingerprint` when configured and
|
|
32
|
+
records `null` for legacy projects. The Quality Contract is distinct from the
|
|
33
|
+
repository/card baseline and the candidate fingerprint: it says what the run is
|
|
34
|
+
trying to satisfy, not which Git commit was checked out or what the candidate
|
|
35
|
+
changed.
|
|
36
|
+
|
|
20
37
|
Before gates run, the verifier validates the active assignment, PRD/card/gate
|
|
21
38
|
hashes, worktree, expected branch, and candidate fingerprint. It records the
|
|
22
39
|
assignment ID/hash and run ID, executes deterministic commands with a bounded
|
|
@@ -29,6 +46,26 @@ it does not itself approve, rework, or transition a run.
|
|
|
29
46
|
Evidence files and logs are diagnostics. Users normally need only the
|
|
30
47
|
Orchestrator's summary and the Reviewer verdict.
|
|
31
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
|
+
|
|
32
69
|
## Card-declared required gates
|
|
33
70
|
|
|
34
71
|
The work queue may carry a machine-readable `required_gates` list for an
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
# BMAD
|
|
1
|
+
# BMAD integration
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`
|
|
5
|
-
|
|
6
|
-
and
|
|
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
|
-
|
|
9
|
-
|
|
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
|
-
|
|
12
|
-
|
|
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.
|