thoth-agents 0.2.2 → 0.2.3
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/README.md +1 -1
- package/dist/{chunk-3NOVCFN7.js → chunk-37QKOSBR.js} +65 -19
- package/dist/{chunk-3SQ4ZQ57.js → chunk-7KLRUFZ4.js} +26 -5
- package/dist/{chunk-FRZZ25ND.js → chunk-FHEYA3VV.js} +1 -1
- package/dist/cli/index.js +3 -3
- package/dist/cli/tui/index.js +2 -2
- package/dist/harness/core/sdd.d.ts +32 -12
- package/dist/harness/core/skills.d.ts +14 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/skills/_shared/openspec-convention.md +221 -11
- package/src/skills/executing-plans/SKILL.md +37 -2
- package/src/skills/plan-reviewer/SKILL.md +81 -1
- package/src/skills/requirements-interview/SKILL.md +10 -3
- package/src/skills/sdd-archive/SKILL.md +7 -2
- package/src/skills/sdd-clarify/SKILL.md +105 -0
- package/src/skills/sdd-constitution/SKILL.md +107 -0
- package/src/skills/sdd-design/SKILL.md +54 -1
- package/src/skills/sdd-init/SKILL.md +123 -38
- package/src/skills/sdd-spec/SKILL.md +44 -1
- package/src/skills/sdd-tasks/SKILL.md +63 -3
- package/src/skills/sdd-verify/SKILL.md +33 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdd-constitution
|
|
3
|
+
description: Guide a semver constitution amendment and Sync-Impact Report entry.
|
|
4
|
+
metadata:
|
|
5
|
+
author: thoth-agents
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# SDD Constitution Skill
|
|
10
|
+
|
|
11
|
+
Perform a guided, human-confirmed amendment of `openspec/memory/constitution.md`
|
|
12
|
+
ONLY — a semver version bump, an updated `Last-Amended` date, and one prepended
|
|
13
|
+
`## Sync-Impact Report` entry. This skill closes the constitution lifecycle by
|
|
14
|
+
adding its AMENDMENT side; it never edits any other bundled asset.
|
|
15
|
+
|
|
16
|
+
## Shared Conventions
|
|
17
|
+
|
|
18
|
+
- [../_shared/openspec-convention.md](../_shared/openspec-convention.md)
|
|
19
|
+
- [../_shared/persistence-contract.md](../_shared/persistence-contract.md)
|
|
20
|
+
- [../_shared/thoth-mem-convention.md](../_shared/thoth-mem-convention.md)
|
|
21
|
+
|
|
22
|
+
## Persistence Mode
|
|
23
|
+
|
|
24
|
+
The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
25
|
+
`hybrid`). Follow the persistence contract for read/write rules per mode.
|
|
26
|
+
|
|
27
|
+
- `thoth-mem`: record the amendment as a governance observation only — do NOT
|
|
28
|
+
create or modify `openspec/` files.
|
|
29
|
+
- `openspec`: write `openspec/memory/constitution.md` only — do NOT call
|
|
30
|
+
thoth-mem save tools.
|
|
31
|
+
- `hybrid`: do both — write the file AND record the governance observation
|
|
32
|
+
(default).
|
|
33
|
+
|
|
34
|
+
## When to Use
|
|
35
|
+
|
|
36
|
+
- A native principle must be added, redefined, removed, or its guidance
|
|
37
|
+
materially expanded or clarified, and the constitution must record it.
|
|
38
|
+
- A report-only suggestion from `sdd-verify` or `sdd-archive` flagged a
|
|
39
|
+
completed change as governance-touching and a human chooses to record an
|
|
40
|
+
amendment.
|
|
41
|
+
|
|
42
|
+
## Prerequisites
|
|
43
|
+
|
|
44
|
+
- An existing `openspec/memory/constitution.md` (bootstrapped by `sdd-init`).
|
|
45
|
+
- A human-described principle change (what changed and why).
|
|
46
|
+
- `change-name` — OPTIONAL context only; the skill may run standalone and is not
|
|
47
|
+
a per-change pipeline phase.
|
|
48
|
+
- Selected persistence mode (default: `hybrid`).
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
1. Read the shared conventions, especially `openspec-convention.md` >
|
|
53
|
+
Constitution Governance (amendment doctrine, read-only-asset rules, and the
|
|
54
|
+
Sync-Impact Report entry format).
|
|
55
|
+
2. Load `openspec/memory/constitution.md` and read its `Version:`, `Ratified:`,
|
|
56
|
+
`Last-Amended:` header fields and the existing `## Sync-Impact Report`
|
|
57
|
+
section. If the file is absent, instruct the user to run `sdd-init` first;
|
|
58
|
+
do NOT create the constitution here.
|
|
59
|
+
3. Determine the principle change from the human description. If no principle
|
|
60
|
+
change is warranted, report a no-op and stop — write nothing.
|
|
61
|
+
4. Classify the bump per policy: MAJOR = a principle is removed or redefined;
|
|
62
|
+
MINOR = a principle is added or guidance materially expanded; PATCH =
|
|
63
|
+
clarification or wording with no behavioral change. Present the
|
|
64
|
+
classification for confirmation via the harness blocking-input surface
|
|
65
|
+
(AskUserQuestion-equivalent). Do NOT write any version bump before the user
|
|
66
|
+
confirms, and NEVER use a runtime parser to auto-select the bump.
|
|
67
|
+
5. Apply the amendment to `openspec/memory/constitution.md` ONLY: bump the
|
|
68
|
+
`Version:` field, set `Last-Amended:` to the current date, and PREPEND
|
|
69
|
+
exactly one entry to the top of the `## Sync-Impact Report` section in the
|
|
70
|
+
canonical format
|
|
71
|
+
`- X.Y.Z | change type | principles touched | downstream gates/artifacts affected`.
|
|
72
|
+
Preserve all existing content and ALL prior Sync-Impact Report entries.
|
|
73
|
+
6. Emit REPORT-ONLY impact: name the live-read consuming gates (`sdd-design`,
|
|
74
|
+
`plan-reviewer`) in the Sync-Impact entry, and FLAG any in-flight change
|
|
75
|
+
`openspec/changes/{name}/design.md` or `tasks.md` that reference now-changed
|
|
76
|
+
principles for HUMAN re-review. Do NOT edit those artifacts or any other
|
|
77
|
+
bundled asset.
|
|
78
|
+
7. Persist per the selected mode: in modes that include OpenSpec write the
|
|
79
|
+
constitution file; in modes that include thoth-mem record a governance
|
|
80
|
+
observation per the persistence contract.
|
|
81
|
+
|
|
82
|
+
## Output Format
|
|
83
|
+
|
|
84
|
+
Return:
|
|
85
|
+
|
|
86
|
+
- `Constitution Version`: old `X.Y.Z` -> new `X.Y.Z` (or unchanged on no-op)
|
|
87
|
+
- `Bump`: MAJOR, MINOR, PATCH, or no-op
|
|
88
|
+
- `Sync-Impact Entry`: the single prepended line (or none on no-op)
|
|
89
|
+
- `Consuming Gates`: live-read gates that consume the changed principles
|
|
90
|
+
(e.g. `sdd-design`, `plan-reviewer`)
|
|
91
|
+
- `In-Flight Artifacts Flagged`: change `design.md` / `tasks.md` flagged for
|
|
92
|
+
human re-review, or none
|
|
93
|
+
- `Files Written`: `openspec/memory/constitution.md` only, or none
|
|
94
|
+
- `Status`: amended or no-op
|
|
95
|
+
|
|
96
|
+
## Rules
|
|
97
|
+
|
|
98
|
+
- NEVER edit, create, or delete any other `SKILL.md`, any file under `src/`, or
|
|
99
|
+
any bundled/template asset — the ONLY writable target is
|
|
100
|
+
`openspec/memory/constitution.md`.
|
|
101
|
+
- NEVER auto-bump: there is no runtime parser, and no `Version:` change is
|
|
102
|
+
written without explicit human confirmation via the blocking-input surface.
|
|
103
|
+
- No-op when no principle change is warranted: report it and write nothing.
|
|
104
|
+
- Preserve all existing constitution content and ALL prior `## Sync-Impact
|
|
105
|
+
Report` entries; only PREPEND the new entry and update the version/date.
|
|
106
|
+
- Propagation is report-only: document the consuming gates and flag in-flight
|
|
107
|
+
change artifacts for human re-review; NEVER auto-fix them.
|
|
@@ -78,7 +78,60 @@ technical write-capable role such as `deep`.
|
|
|
78
78
|
and required metadata fields: `title`, `topic_key`, `type`, `project`,
|
|
79
79
|
`scope`, and `content`.
|
|
80
80
|
|
|
81
|
-
##
|
|
81
|
+
## Optional Sub-Artifacts
|
|
82
|
+
|
|
83
|
+
Beyond the always-present `design.md`, `sdd-design` MAY produce optional plan
|
|
84
|
+
sub-artifacts. They are gated by BOTH conditions, config as the hard floor and
|
|
85
|
+
author judgment within the gate:
|
|
86
|
+
|
|
87
|
+
- **Hard gate (config)**: `rules.design.sub_artifacts` MUST be `true`. When
|
|
88
|
+
`false` or absent, NO sub-artifacts are ever produced (back-compat default).
|
|
89
|
+
- **Complexity gate (config threshold, author-evaluated)**: when enabled, the
|
|
90
|
+
change MUST meet `rules.design.complexity_threshold` (e.g. `affected_domains`,
|
|
91
|
+
`affected_files`, `external_research` — eligible when ANY trigger is met). The
|
|
92
|
+
threshold is the reviewable hard floor; the author still selects which (if any)
|
|
93
|
+
sub-artifacts add value within the gate. An eligible change MAY still produce
|
|
94
|
+
zero sub-artifacts.
|
|
95
|
+
|
|
96
|
+
`design.md` is ALWAYS produced regardless of the gate. The optional types are:
|
|
97
|
+
|
|
98
|
+
- `research.md` — only when there is genuine unknown investigation.
|
|
99
|
+
- `data-model.md` — only when there is a non-trivial data shape.
|
|
100
|
+
- `contracts/` (subdir) — only when there are interfaces to pin; follow the
|
|
101
|
+
`checklists/` subdir as the precedent for change-dir subdirectory layout.
|
|
102
|
+
- `quickstart.md` — only when a runnable smoke path helps.
|
|
103
|
+
|
|
104
|
+
Note: the `clarify` phase now precedes design (`spec -> clarify -> design`), so
|
|
105
|
+
design consumes the already-clarified spec.
|
|
106
|
+
|
|
107
|
+
## Constitution Check and Handoff Hints
|
|
108
|
+
|
|
109
|
+
### Consume upstream handoffHints
|
|
110
|
+
|
|
111
|
+
At design start, surface the spec phase's `handoffHints` (recorded
|
|
112
|
+
`## Assumptions` and `[NEEDS CLARIFICATION]` resolutions) and treat them as
|
|
113
|
+
constraints the design must preserve. When the spec declared no hints, surface
|
|
114
|
+
nothing. Surfacing is gated by `rules.handoffs.surface_hints`.
|
|
115
|
+
|
|
116
|
+
### Constitution Check self-review
|
|
117
|
+
|
|
118
|
+
Before finalizing the design, run a Constitution Check self-review: evaluate the
|
|
119
|
+
emerging design against EACH principle in `openspec/memory/constitution.md` —
|
|
120
|
+
delegate-first coordination, read-only role boundaries, governed persistence,
|
|
121
|
+
multi-harness parity, and evidence-led verification. Report any principle the
|
|
122
|
+
design would violate.
|
|
123
|
+
|
|
124
|
+
- On a detected violation, BLOCK finalization and surface the violated
|
|
125
|
+
principle through the harness blocking-input surface (the
|
|
126
|
+
AskUserQuestion-equivalent primitive). An explicit user override MUST be
|
|
127
|
+
logged with the violated principle before proceeding. Gated by
|
|
128
|
+
`rules.constitution.enforce_check`; when disabled, note the skip and do not
|
|
129
|
+
block.
|
|
130
|
+
- This self-review does not replace `plan-reviewer`'s independent Constitution
|
|
131
|
+
Check; both run. See `_shared/openspec-convention.md` (Constitution
|
|
132
|
+
Governance, Handoff Hints) for the canonical, harness-agnostic semantics.
|
|
133
|
+
|
|
134
|
+
## Output Format
|
|
82
135
|
|
|
83
136
|
Return:
|
|
84
137
|
|
|
@@ -31,6 +31,11 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
31
31
|
## When to Use
|
|
32
32
|
|
|
33
33
|
- SDD is needed but `openspec/` is not initialized
|
|
34
|
+
- `openspec/` exists but is stale: missing `config.yaml` mechanism sections
|
|
35
|
+
(`constitution` / `consistency` / `requirements_quality` / `clarification` /
|
|
36
|
+
`handoffs`), missing `tasks.traceability` / `tasks.parallel_markers` /
|
|
37
|
+
`design.sub_artifacts` / `design.complexity_threshold` / `verify` toggles, or a
|
|
38
|
+
missing `openspec/memory/constitution.md`
|
|
34
39
|
- A new project needs initial OpenSpec conventions
|
|
35
40
|
- The team wants detected stack/context captured before `sdd-propose`
|
|
36
41
|
|
|
@@ -63,9 +68,38 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
63
68
|
- `openspec/config.yaml`
|
|
64
69
|
- `openspec/specs/`
|
|
65
70
|
- `openspec/changes/`
|
|
66
|
-
5. If
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
5. If the required OpenSpec paths already exist, do not dead-end. Compute
|
|
72
|
+
whether the project is fully aligned or stale, then realign additively:
|
|
73
|
+
- **Fully aligned** (all paths present AND `config.yaml` already carries
|
|
74
|
+
every mechanism section / toggle AND `openspec/memory/constitution.md`
|
|
75
|
+
exists) -> report a no-op and return. Never overwrite by default.
|
|
76
|
+
- **Stale / partial** (any piece below is absent) -> proceed to the
|
|
77
|
+
additive backfill in steps 5a-5c. Never overwrite a value that is
|
|
78
|
+
already present.
|
|
79
|
+
|
|
80
|
+
5a. Compute the per-piece *absent set* (detect each independently; treat a
|
|
81
|
+
partially-present `openspec/` per-piece, not all-or-nothing):
|
|
82
|
+
- missing `openspec/specs/`
|
|
83
|
+
- missing `openspec/changes/` (and `changes/archive/`)
|
|
84
|
+
- missing `config.yaml` mechanism sections: `constitution`,
|
|
85
|
+
`consistency`, `requirements_quality`, `clarification`, `handoffs`
|
|
86
|
+
- missing `config.yaml` toggles: `rules.tasks.traceability`,
|
|
87
|
+
`rules.tasks.parallel_markers`, `rules.design.sub_artifacts`,
|
|
88
|
+
`rules.design.complexity_threshold`,
|
|
89
|
+
`rules.verify` (`test_command` / `build_command` /
|
|
90
|
+
`coverage_threshold`)
|
|
91
|
+
- missing `openspec/memory/constitution.md`
|
|
92
|
+
|
|
93
|
+
5b. For each absent piece, additively create or merge ONLY that piece using
|
|
94
|
+
the canonical shapes defined in step 7 (`config.yaml`) and step 7a
|
|
95
|
+
(`constitution.md`). Merge missing `config.yaml` sections into the
|
|
96
|
+
existing file, preserving every present key and value verbatim. Never
|
|
97
|
+
rewrite a value that is already present. Never renumber or recreate an
|
|
98
|
+
existing `constitution.md` (see step 7a idempotency).
|
|
99
|
+
|
|
100
|
+
5c. Report exactly what was added (list each created path and each merged
|
|
101
|
+
`config.yaml` section / toggle). If the absent set was empty, report a
|
|
102
|
+
no-op instead.
|
|
69
103
|
6. If any required OpenSpec path is missing and mode includes OpenSpec, create
|
|
70
104
|
only the minimum structure:
|
|
71
105
|
|
|
@@ -79,40 +113,87 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
79
113
|
|
|
80
114
|
7. Generate `openspec/config.yaml` dynamically with this shape:
|
|
81
115
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
```yaml
|
|
117
|
+
schema: spec-driven
|
|
118
|
+
|
|
119
|
+
context: |
|
|
120
|
+
Tech stack: {detected}
|
|
121
|
+
Architecture: {detected}
|
|
122
|
+
Testing: {detected}
|
|
123
|
+
Style: {detected}
|
|
124
|
+
|
|
125
|
+
rules:
|
|
126
|
+
proposal:
|
|
127
|
+
- Include rollback plan for risky changes
|
|
128
|
+
- Identify affected modules/packages
|
|
129
|
+
spec:
|
|
130
|
+
- Use RFC 2119 keywords (MUST, SHALL, SHOULD, MAY)
|
|
131
|
+
- Use Given/When/Then scenarios
|
|
132
|
+
design:
|
|
133
|
+
guidance:
|
|
134
|
+
- Document architecture decisions with rationale
|
|
135
|
+
- Require a File Changes section
|
|
136
|
+
sub_artifacts: false # optional design sub-artifacts (default off)
|
|
137
|
+
complexity_threshold: # author-evaluated eligibility triggers (OR)
|
|
138
|
+
affected_domains: 3
|
|
139
|
+
affected_files: 12
|
|
140
|
+
external_research: true
|
|
141
|
+
tasks:
|
|
142
|
+
guidance:
|
|
143
|
+
- Group tasks by phase with hierarchical numbering
|
|
144
|
+
- Keep tasks small enough to complete in one session
|
|
145
|
+
tdd: false # TDD ordering flag (sdd-tasks-format)
|
|
146
|
+
traceability: true # require [USN] + Spec: tag + Independent Test per task
|
|
147
|
+
parallel_markers: false # [P] emission + executing-plans consumption (default off)
|
|
148
|
+
apply:
|
|
149
|
+
guidance:
|
|
150
|
+
- Follow existing code patterns and conventions
|
|
151
|
+
test_command: ''
|
|
152
|
+
verify:
|
|
153
|
+
test_command: ''
|
|
154
|
+
build_command: ''
|
|
155
|
+
coverage_threshold: 0
|
|
156
|
+
archive:
|
|
157
|
+
- Warn before merging destructive deltas
|
|
158
|
+
|
|
159
|
+
# --- mechanism sections (spec-kit-rigor) ---
|
|
160
|
+
constitution:
|
|
161
|
+
path: openspec/memory/constitution.md
|
|
162
|
+
enforce_check: true # Constitution Check gate blocks on violation
|
|
163
|
+
version_policy: semver # MAJOR=remove/redefine, MINOR=add, PATCH=clarify
|
|
164
|
+
consistency:
|
|
165
|
+
enforce_block: true # CRITICAL findings block plan-review
|
|
166
|
+
require_coverage_percentage: true
|
|
167
|
+
requirements_quality:
|
|
168
|
+
enforce_block: true # incomplete checklist blocks tasks phase
|
|
169
|
+
dimensions: [completeness, clarity, measurability, testability]
|
|
170
|
+
clarification:
|
|
171
|
+
max_markers_per_spec: 3 # [NEEDS CLARIFICATION] cap enforced by plan-reviewer
|
|
172
|
+
handoffs:
|
|
173
|
+
surface_hints: true # surface SddPhaseContract.handoffHints at transitions
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Mixing bare `- item` list entries with `key: value` scalars under one key is
|
|
177
|
+
invalid YAML; when a phase carries scalar toggles (`tasks`, `apply`,
|
|
178
|
+
`verify`), put its guidance strings under a `guidance:` subkey.
|
|
179
|
+
|
|
180
|
+
7a. Bootstrap the project constitution at `openspec/memory/constitution.md`
|
|
181
|
+
(mode includes OpenSpec):
|
|
182
|
+
- **Absent** -> create it at `Version: 1.0.0` with `Ratified`/`Last-Amended`
|
|
183
|
+
dates, the five native principles (delegate-first coordination, read-only
|
|
184
|
+
role boundaries, governed persistence, multi-harness parity, evidence-led
|
|
185
|
+
verification) each with Statement/Rationale/Gate Implications, and an empty
|
|
186
|
+
`## Sync-Impact Report` section.
|
|
187
|
+
- **Present** -> preserve the existing content AND its existing version
|
|
188
|
+
unchanged; do NOT recreate or renumber it. This step is idempotent: a
|
|
189
|
+
second `sdd-init` run on a repo whose `constitution.md` is at `2.1.0`
|
|
190
|
+
leaves it at `2.1.0`.
|
|
191
|
+
- **Semver bump policy** (manual, by whoever edits the constitution): MAJOR
|
|
192
|
+
= a principle removed or redefined; MINOR = a principle added or guidance
|
|
193
|
+
materially expanded; PATCH = clarification/wording. Each edit also appends
|
|
194
|
+
a `## Sync-Impact Report` entry. No tooled auto-bump exists.
|
|
195
|
+
- See `_shared/openspec-convention.md` (Constitution Governance) for the
|
|
196
|
+
canonical artifact and gate semantics.
|
|
116
197
|
|
|
117
198
|
8. Never create placeholder SDD artifacts (`proposal.md`, `design.md`,
|
|
118
199
|
`tasks.md`, or spec files) during initialization.
|
|
@@ -141,7 +222,11 @@ Return:
|
|
|
141
222
|
|
|
142
223
|
## Rules
|
|
143
224
|
|
|
144
|
-
-
|
|
225
|
+
- Realignment is strictly additive: when `openspec/` already exists, backfill
|
|
226
|
+
only the absent pieces and NEVER overwrite a value that is already present.
|
|
227
|
+
- An existing `constitution.md` is never renumbered or recreated; create it
|
|
228
|
+
only when absent and otherwise preserve its content and version unchanged.
|
|
229
|
+
- A re-run on a fully-aligned project is a reported no-op (no writes).
|
|
145
230
|
- In `thoth-mem` mode, never create `openspec/` directories or files.
|
|
146
231
|
- Keep `config.yaml` context concise (max 10 lines).
|
|
147
232
|
- Detect and include CI, test, and style conventions in the context summary.
|
|
@@ -28,6 +28,10 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
28
28
|
- A proposal is approved and must be converted into testable requirements
|
|
29
29
|
- Existing change specs need to be expanded or corrected
|
|
30
30
|
|
|
31
|
+
> Boundary: residual ambiguity that surfaces after spec authoring is resolved by
|
|
32
|
+
> the `sdd-clarify` phase (between `spec` and `design`), not here — spec
|
|
33
|
+
> authoring behavior itself is unchanged.
|
|
34
|
+
|
|
31
35
|
## Prerequisites
|
|
32
36
|
|
|
33
37
|
- `change-name`
|
|
@@ -73,12 +77,51 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
73
77
|
and required metadata fields: `title`, `topic_key`, `type`, `project`,
|
|
74
78
|
`scope`, and `content`.
|
|
75
79
|
|
|
76
|
-
##
|
|
80
|
+
## Clarification Discipline and Requirements-Quality Checklist
|
|
81
|
+
|
|
82
|
+
Follow these mechanisms (canonical definitions in
|
|
83
|
+
`_shared/openspec-convention.md` — Clarification Discipline and
|
|
84
|
+
Requirements-Quality Checklist). All are gated by their `config.yaml rules:`
|
|
85
|
+
sections.
|
|
86
|
+
|
|
87
|
+
### `[NEEDS CLARIFICATION]` markers and Assumptions
|
|
88
|
+
|
|
89
|
+
- Use `[NEEDS CLARIFICATION: <concrete question>]` ONLY for a genuine decision
|
|
90
|
+
fork where no single default is defensible. The marker text MUST name the
|
|
91
|
+
specific unresolved decision, not a vague placeholder.
|
|
92
|
+
- Cap markers at `rules.clarification.max_markers_per_spec` (default 3) per spec
|
|
93
|
+
file.
|
|
94
|
+
- Informed-guess-first: when an ambiguity has a defensible default, APPLY the
|
|
95
|
+
default and record it in an `## Assumptions` section of the spec rather than
|
|
96
|
+
emitting a marker. Do not silently default a genuine fork.
|
|
97
|
+
|
|
98
|
+
### Generate `checklists/requirements.md`
|
|
99
|
+
|
|
100
|
+
At or after authoring the delta specs, generate
|
|
101
|
+
`openspec/changes/{change-name}/checklists/requirements.md` ("unit tests for
|
|
102
|
+
English"):
|
|
103
|
+
|
|
104
|
+
- One `## Domain: {domain}` section per authored delta domain.
|
|
105
|
+
- Each domain section carries checkbox items across the four dimensions:
|
|
106
|
+
completeness, clarity, measurability, testability.
|
|
107
|
+
- Items use the task checkbox states (`- [ ]` / `- [x]` / `- [-] waived:
|
|
108
|
+
reason`).
|
|
109
|
+
- The spec->tasks transition is gated on every item being `- [x]` or explicitly
|
|
110
|
+
waived (gated by `rules.requirements_quality.enforce_block`).
|
|
111
|
+
|
|
112
|
+
### Declare handoffHints
|
|
113
|
+
|
|
114
|
+
Declare `handoffHints` for the design phase: the recorded `## Assumptions` and
|
|
115
|
+
any unresolved `[NEEDS CLARIFICATION]` resolutions the design phase must
|
|
116
|
+
preserve. Surfacing is gated by `rules.handoffs.surface_hints`.
|
|
117
|
+
|
|
118
|
+
## Output Format
|
|
77
119
|
|
|
78
120
|
Return:
|
|
79
121
|
|
|
80
122
|
- `Change`
|
|
81
123
|
- `Artifacts`: list of domain spec paths written
|
|
124
|
+
- `Checklist`: `openspec/changes/{change-name}/checklists/requirements.md`
|
|
82
125
|
- `Topic Key`: `sdd/{change-name}/spec`
|
|
83
126
|
- `Coverage Summary`: requirements and scenarios added or modified
|
|
84
127
|
- `Next Step`: usually `sdd-design`
|
|
@@ -66,18 +66,34 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
66
66
|
|
|
67
67
|
## Phase 1: Foundation
|
|
68
68
|
- [ ] 1.1 Set up project structure — `src/config/`
|
|
69
|
+
**[USN-1]** | Priority: P1
|
|
70
|
+
**Spec:** `config-domain/Project Structure`
|
|
71
|
+
**Independent Test:** Inspect `src/config/` exists and typechecks in isolation.
|
|
69
72
|
**Verification**:
|
|
70
73
|
- Run: `pnpm run typecheck`
|
|
71
74
|
- Expected: No TypeScript errors in config files
|
|
72
75
|
|
|
73
76
|
## Phase 2: Core Implementation
|
|
74
|
-
- [ ] 2.1
|
|
77
|
+
- [ ] 2.1 Author core-logic tests — `src/core/handler.test.ts`
|
|
78
|
+
**[USN-2]** | Priority: P1
|
|
79
|
+
**Spec:** `core-domain/Core Logic`
|
|
80
|
+
**Independent Test:** Run the new handler test file; it is red before 2.2.
|
|
81
|
+
**Verification**:
|
|
82
|
+
- Run: `pnpm test -- -t "core handler"`
|
|
83
|
+
- Expected: New tests run (red before 2.2)
|
|
84
|
+
- [ ] 2.2 Implement core logic — `src/core/handler.ts`
|
|
85
|
+
**[USN-2]** | Priority: P1
|
|
86
|
+
**Spec:** `core-domain/Core Logic`
|
|
87
|
+
**Independent Test:** Run the handler tests; they pass against the impl.
|
|
75
88
|
**Verification**:
|
|
76
89
|
- Run: `pnpm test -- -t "core handler"`
|
|
77
90
|
- Expected: All handler tests pass
|
|
78
91
|
|
|
79
92
|
## Phase 3: Integration
|
|
80
|
-
- [ ] 3.1 Integrate with API — `src/api/client.ts`
|
|
93
|
+
- [ ] 3.1 [P] Integrate with API — `src/api/client.ts`
|
|
94
|
+
**[USN-3]** | Priority: P2
|
|
95
|
+
**Spec:** `api-domain/Client Integration`
|
|
96
|
+
**Independent Test:** Run the API client lint in isolation.
|
|
81
97
|
**Verification**:
|
|
82
98
|
- Run: `pnpm run lint src/api/`
|
|
83
99
|
- Expected: No linting errors in API module
|
|
@@ -113,7 +129,51 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
113
129
|
11. The orchestrator handles the `[OKAY]` / `[REJECT]` review loop and any
|
|
114
130
|
necessary fixes before proceeding to execution.
|
|
115
131
|
|
|
116
|
-
##
|
|
132
|
+
## Traceability, TDD Ordering, and Handoff Hints
|
|
133
|
+
|
|
134
|
+
Canonical definitions live in `_shared/openspec-convention.md`. These fields are
|
|
135
|
+
ADDITIVE to the existing `Verification` block, not a replacement, and they are
|
|
136
|
+
optional for back-compat (legacy `tasks.md` without them still executes).
|
|
137
|
+
|
|
138
|
+
- **`[USN-<n>]`** — a user-story-number grouping label (a coarse story/epic
|
|
139
|
+
bucket). It is NOT the requirement linkage.
|
|
140
|
+
- **Priority** — one of `P1`, `P2`, `P3`.
|
|
141
|
+
- **`Spec:` trace tag** — names the exact requirement the task implements, in
|
|
142
|
+
`{domain}/{Requirement Name}` format (optionally `#{Scenario Name}`). This is
|
|
143
|
+
the requirement linkage `plan-reviewer` counts for coverage %; keep it
|
|
144
|
+
greppable and one requirement per tag.
|
|
145
|
+
- **`Independent Test`** — how the task's outcome is verified in isolation,
|
|
146
|
+
without depending on other tasks being complete.
|
|
147
|
+
|
|
148
|
+
### `tasks.tdd` ordering
|
|
149
|
+
|
|
150
|
+
When `rules.tasks.tdd` is enabled in `config.yaml`, sequence test-authoring
|
|
151
|
+
tasks BEFORE their corresponding implementation tasks within the same phase (see
|
|
152
|
+
the Phase 2 example: 2.1 authors tests, 2.2 implements). When `tasks.tdd` is
|
|
153
|
+
disabled, impose no test-first ordering constraint. `plan-reviewer` enforces
|
|
154
|
+
this ordering when the flag is enabled.
|
|
155
|
+
|
|
156
|
+
### `[P]` parallel markers
|
|
157
|
+
|
|
158
|
+
When `rules.tasks.parallel_markers` is enabled in `config.yaml`, an optional
|
|
159
|
+
`[P]` marker MAY be placed AFTER the `N.M` number (`- [ ] 2.1 [P] Title`),
|
|
160
|
+
never before it (`[P] 2.1` would break the task-numbering validator). Emit
|
|
161
|
+
`[P]` ONLY on tasks that are intra-phase, dependency-free of every other task
|
|
162
|
+
in the same phase, and assigned to the SAME execution agent — never across
|
|
163
|
+
phases and never on tasks with intra-phase dependencies. `[P]` is
|
|
164
|
+
back-compatible: when `parallel_markers` is disabled or the marker is absent,
|
|
165
|
+
the plan executes exactly as it does today (absence = today's behavior). It
|
|
166
|
+
annotates an explicit parallel batch; it does not change `N.M`, `[USN]`, the
|
|
167
|
+
`Spec:` tag, or introduce flat `T001` ids.
|
|
168
|
+
|
|
169
|
+
### Consume upstream handoffHints
|
|
170
|
+
|
|
171
|
+
At task-generation start, surface the spec/design phases' `handoffHints` and
|
|
172
|
+
treat them as preservation constraints (coverage decisions, architecture
|
|
173
|
+
constraints, recorded Assumptions). When no hints were declared, surface
|
|
174
|
+
nothing. Surfacing is gated by `rules.handoffs.surface_hints`.
|
|
175
|
+
|
|
176
|
+
## Output Format
|
|
117
177
|
|
|
118
178
|
Return:
|
|
119
179
|
|
|
@@ -38,6 +38,7 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
38
38
|
- Design artifact (full pipeline only)
|
|
39
39
|
- Proposal artifact (accelerated pipeline — used as the verification reference)
|
|
40
40
|
- Ability to run the relevant checks or tests
|
|
41
|
+
- Expected `round N` from the dispatch envelope (the verify-loop round counter; defaults to round 1 for the first verify after apply)
|
|
41
42
|
|
|
42
43
|
## Workflow
|
|
43
44
|
|
|
@@ -59,13 +60,31 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
59
60
|
```md
|
|
60
61
|
# Verification Report: {Change Title}
|
|
61
62
|
|
|
63
|
+
## Round
|
|
64
|
+
round N <!-- stamped from the dispatch envelope's expected round; source of truth for the loop counter -->
|
|
65
|
+
|
|
62
66
|
## Completeness
|
|
63
67
|
## Build and Test Evidence
|
|
64
68
|
## Compliance Matrix
|
|
65
69
|
<!-- Full pipeline: map Given/When/Then scenarios from spec -->
|
|
66
70
|
<!-- Accelerated pipeline: map success criteria from proposal -->
|
|
67
71
|
## Design Coherence (full pipeline only)
|
|
72
|
+
|
|
68
73
|
## Issues Found
|
|
74
|
+
|
|
75
|
+
### Critical
|
|
76
|
+
- **[C1]** {one-line problem statement}
|
|
77
|
+
- file: `path/to/file.ts:LINE` (or `path/to/file.ts` when line is N/A)
|
|
78
|
+
- scenario: `{Requirement title} › {Scenario name}` (full pipeline) OR
|
|
79
|
+
criterion: `{proposal success-criterion id/text}` (accelerated pipeline)
|
|
80
|
+
- fix: {imperative remediation instruction}
|
|
81
|
+
|
|
82
|
+
### Warnings
|
|
83
|
+
- **[W1]** {one-line problem statement}
|
|
84
|
+
- file: `path/to/file.ts:LINE`
|
|
85
|
+
- scenario / criterion: {anchor}
|
|
86
|
+
- fix: {imperative remediation instruction}
|
|
87
|
+
|
|
69
88
|
## Verdict
|
|
70
89
|
```
|
|
71
90
|
|
|
@@ -77,6 +96,15 @@ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
|
|
|
77
96
|
Use the memory tool binding for `mem_save` with the canonical SDD topic key
|
|
78
97
|
and required metadata fields: `title`, `topic_key`, `type`, `project`,
|
|
79
98
|
`scope`, and `content`.
|
|
99
|
+
8. Stamp the expected `round N` from the dispatch envelope into the report's
|
|
100
|
+
`## Round` field and the `Round` return field. The orchestrator treats this
|
|
101
|
+
`round N` marker as the source of truth for the verify-loop round counter
|
|
102
|
+
when enforcing the round bound across iterations.
|
|
103
|
+
9. Apply the governance-touched heuristic from
|
|
104
|
+
`_shared/openspec-convention.md` > Constitution Governance > Amendment
|
|
105
|
+
Auto-Suggest. When it matches, surface the shared report-only
|
|
106
|
+
`sdd-constitution` suggestion. This is advisory and MUST NOT change the
|
|
107
|
+
verdict or block verification.
|
|
80
108
|
|
|
81
109
|
## Output Format
|
|
82
110
|
|
|
@@ -85,9 +113,11 @@ Return:
|
|
|
85
113
|
- `Change`
|
|
86
114
|
- `Artifact`: `openspec/changes/{change-name}/verify-report.md`
|
|
87
115
|
- `Topic Key`: `sdd/{change-name}/verify-report`
|
|
116
|
+
- `Round`: `round N` (mirrors the report's `## Round` marker)
|
|
88
117
|
- `Verdict`: pass, pass with warnings, or fail
|
|
89
118
|
- `Compliance Summary`: compliant vs total scenarios
|
|
90
|
-
- `Critical Issues`:
|
|
119
|
+
- `Critical Issues`: anchored compact lines (`id — file:line — scenario/criterion — fix`), one per issue, or `None`
|
|
120
|
+
- `Constitution Suggestion`: surfaced or none
|
|
91
121
|
|
|
92
122
|
## Rules
|
|
93
123
|
|
|
@@ -96,4 +126,6 @@ Return:
|
|
|
96
126
|
scenarios in full pipeline, proposal success criteria in accelerated pipeline.
|
|
97
127
|
- Distinguish blockers from warnings clearly.
|
|
98
128
|
- Do not fix issues inside this phase; report them.
|
|
129
|
+
- Every Critical Issue MUST carry at least one remediation anchor (file: and/or scenario:/criterion:); prose-only Critical Issues are invalid output.
|
|
130
|
+
- Stamp the `round N` marker from the dispatch envelope into `## Round`.
|
|
99
131
|
- Recover full artifacts with the protocol in the persistence contract.
|