Skip to content

Commit 6c5c4a2

Browse files
committed
feat: v0.7.0 — JSON schemas for review artifacts + zero-dep validator
Codifies the .reviews/{handoff,response}.json shapes the wizard has been hand-writing across review rounds so downstream consumers (cross-model-review skill, ditto, CI) can fail fast on malformed artifacts instead of producing confused reviews. - templates/schemas/handoff.schema.json — draft-07 schema for the handoff artifact (review_id / status enum / round / mission / success / failure / review_instructions + optional verification_state) - templates/schemas/response.schema.json — draft-07 schema for the response artifact with conditional validation (FIXED requires fix_summary + fix_locations; REJECTED requires rejection_reason) and patternProperty support for recheck_instructions_for_round_N - scripts/validate-review-artifact.{sh,js} — zero-dep validator (pure node, no npm install). Implements the draft-07 subset the schemas use including \$ref + allOf if/then + const. Exit codes: 0 valid / 1 invalid (jsonpath + reason on stderr) / 2 usage|missing|bad-json - install.sh ships schemas at .opencode/schemas/ + validator at .opencode/scripts/ - cross-model-review SKILL.md Step 1.5 validates before sending the reviewer prompt; setup-wizard mentions schemas in Step 4 - bundle-drift extended: scripts/*.js + templates/schemas/* coverage - 28 tests in test-review-schemas.sh: schemas valid + draft-07 + live artifacts validate + negative cases (missing required, bad enum, wrong type, FIXED-without-fix-fields, REJECTED-without-reason, P3 severity pattern fail, parenthetical-context P0 allowed, recheck_instructions_for_round_N pattern keys, install bundle test) - 270 tests across 11 suites total
1 parent 0f5f956 commit 6c5c4a2

13 files changed

Lines changed: 1096 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,106 @@
22

33
All notable changes to opencode-sdlc-wizard.
44

5+
## [0.7.0] - 2026-05-05
6+
7+
### Added — JSON Schemas for review artifacts + zero-dep validator
8+
9+
Codifies the structures the wizard has been hand-writing across review
10+
rounds. The `.reviews/handoff.json` and `.reviews/response.json` shapes
11+
were previously implicit — every reviewer + every consumer had to infer
12+
them. v0.7.0 makes both shapes explicit + machine-checkable.
13+
14+
**`templates/schemas/handoff.schema.json`** — JSON Schema (draft-07) for
15+
the handoff artifact: `review_id`, `status` (PENDING_REVIEW / IN_REVIEW
16+
/ CERTIFIED / NOT_CERTIFIED), `round`, `mission`, `success`, `failure`,
17+
`review_instructions`, plus optional `files_changed`, `verification_state`
18+
with `tests_green` + `test_counts`, `preflight_path`, `response_path`,
19+
`artifact_path`. Permissive `additionalProperties: true` for forward
20+
compat — extra fields don't break validation.
21+
22+
**`templates/schemas/response.schema.json`** — Schema for the response
23+
artifact: top-level `responses[]` array with per-finding shape
24+
(`finding_id`, `severity` matching `^P[0-2]( \(.*\))?$` to allow
25+
parenthetical context, `title`, `claim`, `status`). Conditional
26+
validation enforces: `FIXED` requires `fix_summary` + `fix_locations`;
27+
`REJECTED` / `WONT_FIX` requires `rejection_reason`. Pattern-key
28+
support for `recheck_instructions_for_round_N`.
29+
30+
**`scripts/validate-review-artifact.sh`** + companion `.js` — zero-dep
31+
validator (pure node, no `npm install`). Implements the draft-07 subset
32+
the schemas use: `type`, `required`, `properties`, `enum`, `pattern`,
33+
`minLength`, `minimum`, `items`, `$ref` (#/definitions/*),
34+
`patternProperties`, `allOf` with `if`/`then`, `const`, `definitions`.
35+
Exit codes: `0` valid / `1` invalid (errors with jsonpath + reason on
36+
stderr) / `2` usage / missing-file / unparseable JSON.
37+
38+
Both schemas + validator install to `.opencode/schemas/` and
39+
`.opencode/scripts/` respectively. Live `.reviews/handoff.json` and
40+
`.reviews/response.json` (round-2 artifacts from v0.2.0) validate
41+
against the schemas — the schemas were derived from these artifacts so
42+
they're guaranteed compatible with prior rounds.
43+
44+
### Updated — skills consume the schemas
45+
46+
**`cross-model-review` SKILL.md** — new Step 1.5 validates handoff +
47+
response against the schemas before sending the prompt to the reviewer.
48+
A malformed handoff wastes reviewer tokens and produces a confused
49+
review; validation is fast (zero deps, sub-100ms) and fails fast with
50+
specific jsonpath + reason for every error.
51+
52+
**`setup-wizard` SKILL.md** — Step 4 (Generate) now mentions the
53+
schemas as the canonical shape for review artifacts. No setup work
54+
required (schemas auto-install); the skill points consumers at them
55+
when they create their first review artifact.
56+
57+
### Drift-test extension
58+
59+
`tests/test-bundle-drift.sh` extended to:
60+
- Include `scripts/*.js` companions in the "every script ships in
61+
install.sh" check (T7) — without this, a `.js` file added to scripts/
62+
but forgotten in install.sh would silently never reach consumers.
63+
- New T12: every `templates/schemas/*.schema.json` must be shipped by
64+
install.sh — same drift-class for the schemas dir.
65+
66+
### Tests
67+
68+
- `tests/test-review-schemas.sh` — 28 tests covering: schemas exist +
69+
parse + declare draft-07; validator script exists + executable +
70+
prints usage on `--help` + handles missing-file/bad-JSON gracefully;
71+
live `.reviews/*.json` artifacts validate; negative cases for missing
72+
required fields, bad enum, wrong type, FIXED-status missing
73+
`fix_summary`/`fix_locations`, REJECTED-status missing
74+
`rejection_reason`, P3 severity (pattern violation), parenthetical
75+
P0 severity (allowed), `recheck_instructions_for_round_N` pattern
76+
keys; bundle-test that install lands schemas + validator at the
77+
expected paths and the installed pair validates the live handoff
78+
end-to-end.
79+
80+
**Total: 270 tests across 11 suites** (73 + 11 + 13 + 21 + 10 + 10 +
81+
26 + 51 + 10 + 17 + 28). bundle-drift grew from 48 → 51 (`.js`
82+
inclusion + 2 schema-shipped checks).
83+
84+
### Changed
85+
86+
- `install.sh` REQUIRED_SOURCES + declare_target add the validator
87+
pair (`.sh` + `.js`) and both schemas.
88+
- `package.json` `description` mentions JSON Schemas; `test` script
89+
adds the new suite. `files[]` already includes `scripts/` and
90+
`templates/`, so the new files publish without further changes.
91+
92+
### Why this matters
93+
94+
The handoff/response artifacts have been the load-bearing
95+
hand-shake between the implementing agent and the reviewer all
96+
session. Locking the shape down means: (1) `cross-model-review` skill
97+
fails fast on bad handoffs instead of producing confused reviews,
98+
(2) the `ditto` cross-host migrator (when it lands at v0.1.0) can
99+
parse + transform these artifacts safely, (3) any future CI tooling
100+
gating release on a CERTIFIED status can validate the artifact
101+
shape with zero `npm install`. Forward-compat is preserved — extra
102+
keys are allowed, so older artifacts validate against the new schema
103+
without retrofit.
104+
5105
## [0.6.0] - 2026-05-05
6106

7107
### Added — `SDLC.md` and `ARCHITECTURE.md` templates

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# OpenCode SDLC Wizard
22

3-
> **Status: v0.6.0 (full template set + check subcommand + drift
4-
> detection + OSS-tier reviewer + backend picker) — 2026-05-05.**
5-
> Install with `npx opencode-sdlc-wizard init`, check upstream with
6-
> `npx opencode-sdlc-wizard check`. Full SDLC loop is any-backend on
7-
> both coder AND reviewer (zero Anthropic+OpenAI lock-in possible);
8-
> setup-wizard ships SDLC.md + ARCHITECTURE.md + 4 domain-specific
9-
> TESTING.md templates so consumers don't reinvent.
10-
> Phase B (backend matrix proof) and Phase C (hardware scout) deferred to
11-
> follow-up releases. See [`HANDOFF.md`](HANDOFF.md) for architecture
12-
> decisions, [`PRIVACY.md`](PRIVACY.md) for the tier model, and
3+
> **Status: v0.7.0 (schemas + validator + full template set + check
4+
> subcommand + drift detection + OSS-tier reviewer + backend picker) —
5+
> 2026-05-05.** Install with `npx opencode-sdlc-wizard init`, check
6+
> upstream with `npx opencode-sdlc-wizard check`. Full SDLC loop is
7+
> any-backend on both coder AND reviewer (zero Anthropic+OpenAI lock-in
8+
> possible); setup-wizard ships SDLC.md + ARCHITECTURE.md + 4
9+
> domain-specific TESTING.md templates so consumers don't reinvent.
10+
> Review artifacts (`.reviews/handoff.json` + `.reviews/response.json`)
11+
> have machine-checkable JSON Schemas + a zero-dep validator so
12+
> downstream consumers (cross-model-review, ditto, CI) can fail fast on
13+
> malformed handoffs. Phase B (backend matrix proof) and Phase C
14+
> (hardware scout) deferred to follow-up releases. See
15+
> [`HANDOFF.md`](HANDOFF.md) for architecture decisions,
16+
> [`PRIVACY.md`](PRIVACY.md) for the tier model, and
1317
> [`CHANGELOG.md`](CHANGELOG.md) for release notes.
1418
1519
SDLC enforcement for [`sst/opencode`](https://github.com/sst/opencode) — the
@@ -129,9 +133,15 @@ bash tests/test-plugin-shim.sh # plugin ESM + bash hook validity
129133
bash tests/test-install.sh # installer non-destructive behavior
130134
bash tests/test-backend-picker.sh # detect/configure-backend behavior
131135
bash tests/test-cli.sh # npx CLI wrapper
136+
bash tests/test-cross-model-review.sh # OSS-tier reviewer skill + script
137+
bash tests/test-domain-templates.sh # TESTING.md domain templates
138+
bash tests/test-bundle-drift.sh # bundle drift / mirror guards
139+
bash tests/test-check-cli.sh # check subcommand + staleness
140+
bash tests/test-doc-templates.sh # SDLC.md + ARCHITECTURE.md templates
141+
bash tests/test-review-schemas.sh # JSON Schemas + validator
132142
```
133143

134-
Or `npm test` runs all five.
144+
Or `npm test` runs all eleven (270 tests).
135145

136146
## Known limitations
137147

ROADMAP.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,27 @@ the script logic; live E2E proves the wiring against a real reviewer.
6464
- ✅ setup-wizard skill references both templates
6565
- ✅ 17 tests in `test-doc-templates.sh` (238 total across 10 suites)
6666

67-
## v0.7.0+ candidates (unprioritized)
67+
## v0.7.0 — JSON schemas for review artifacts + zero-dep validator — shipped 2026-05-05
68+
69+
-`templates/schemas/handoff.schema.json` — draft-07 schema for the
70+
handoff artifact (review_id / status / round / mission / success /
71+
failure / review_instructions + optional fields)
72+
-`templates/schemas/response.schema.json` — draft-07 schema for the
73+
response artifact, including conditional validation (FIXED requires
74+
fix_summary+fix_locations; REJECTED requires rejection_reason) and
75+
patternProperty support for `recheck_instructions_for_round_N`
76+
-`scripts/validate-review-artifact.sh` + `.js` — zero-dep node
77+
validator (no `npm install` to consumers); handles draft-07 subset
78+
the schemas use including $ref + allOf if/then + const
79+
- ✅ install lands schemas at `.opencode/schemas/` + validator at
80+
`.opencode/scripts/`
81+
-`cross-model-review` skill new Step 1.5 — validate before sending
82+
the prompt; `setup-wizard` skill mentions schemas in Step 4
83+
- ✅ Drift-test extension: scripts/*.js + templates/schemas/* coverage
84+
- ✅ 28 tests in `test-review-schemas.sh` (270 total across 11 suites)
85+
86+
## v0.8.0+ candidates (unprioritized)
6887

69-
- **JSON schemas for `.reviews/handoff.json` + `response.json`**: codify
70-
the structures we've been hand-writing all session. Lets ditto v0.1.0
71-
+ cross-model-review consume them safely. Tests assert any new review
72-
artifact validates against the schema.
7388
- **Mixed-mode skill**: setup-wizard could pin a coder model + a
7489
reviewer model in one config (today they're picked separately).
7590
- **Auto-nudge integration**: `instructions-loaded-check.sh` hook
@@ -78,6 +93,9 @@ the script logic; live E2E proves the wiring against a real reviewer.
7893
- **OPENCODE_SDLC_WIZARD.md master doc**: equivalent of parent's
7994
4506-line CLAUDE_CODE_SDLC_WIZARD.md. Heavier lift; defer until
8095
consumer feedback says it's needed.
96+
- **Schema versioning + migration**: when v0.7.0 schemas need a
97+
breaking change, add `$schema_version` field + a migrator the
98+
validator runs through. Defer until first breaking change is needed.
8199

82100
## Phase B — backend matrix proof
83101

install.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ REQUIRED_SOURCES=(
6969
"scripts/configure-backend.sh"
7070
"scripts/cross-model-review.sh"
7171
"scripts/check-updates.sh"
72+
"scripts/validate-review-artifact.sh"
73+
"scripts/validate-review-artifact.js"
7274
"skills/sdlc/SKILL.md"
7375
"skills/setup-wizard/SKILL.md"
7476
"skills/update-wizard/SKILL.md"
@@ -80,6 +82,8 @@ REQUIRED_SOURCES=(
8082
"templates/testing/web.md"
8183
"templates/sdlc.md"
8284
"templates/architecture.md"
85+
"templates/schemas/handoff.schema.json"
86+
"templates/schemas/response.schema.json"
8387
)
8488

8589
for f in "${REQUIRED_SOURCES[@]}"; do
@@ -102,6 +106,8 @@ declare_target() {
102106
"scripts/configure-backend.sh") echo ".opencode/scripts/configure-backend.sh" ;;
103107
"scripts/cross-model-review.sh") echo ".opencode/scripts/cross-model-review.sh" ;;
104108
"scripts/check-updates.sh") echo ".opencode/scripts/check-updates.sh" ;;
109+
"scripts/validate-review-artifact.sh") echo ".opencode/scripts/validate-review-artifact.sh" ;;
110+
"scripts/validate-review-artifact.js") echo ".opencode/scripts/validate-review-artifact.js" ;;
105111
"skills/sdlc/SKILL.md") echo ".opencode/skills/sdlc/SKILL.md" ;;
106112
"skills/setup-wizard/SKILL.md") echo ".opencode/skills/setup-wizard/SKILL.md" ;;
107113
"skills/update-wizard/SKILL.md") echo ".opencode/skills/update-wizard/SKILL.md" ;;
@@ -113,6 +119,8 @@ declare_target() {
113119
"templates/testing/web.md") echo ".opencode/templates/testing/web.md" ;;
114120
"templates/sdlc.md") echo ".opencode/templates/sdlc.md" ;;
115121
"templates/architecture.md") echo ".opencode/templates/architecture.md" ;;
122+
"templates/schemas/handoff.schema.json") echo ".opencode/schemas/handoff.schema.json" ;;
123+
"templates/schemas/response.schema.json") echo ".opencode/schemas/response.schema.json" ;;
116124
*) echo "$1" ;;
117125
esac
118126
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "opencode-sdlc-wizard",
3-
"version": "0.6.0",
4-
"description": "SDLC enforcement for OpenCode CLI — privacy-first, any-backend portability with a four-tier backend picker plus an OSS-tier cross-model-review skill so the full SDLC loop can run with zero Anthropic+OpenAI lock-in. Install with `npx opencode-sdlc-wizard init`. Sibling of agentic-sdlc-wizard and codex-sdlc-wizard.",
3+
"version": "0.7.0",
4+
"description": "SDLC enforcement for OpenCode CLI — privacy-first, any-backend portability with a four-tier backend picker plus an OSS-tier cross-model-review skill so the full SDLC loop can run with zero Anthropic+OpenAI lock-in. Ships JSON Schemas for review artifacts so any consumer (cross-model-review, ditto, CI) can validate. Install with `npx opencode-sdlc-wizard init`. Sibling of agentic-sdlc-wizard and codex-sdlc-wizard.",
55
"bin": {
66
"opencode-sdlc-wizard": "cli/bin/opencode-sdlc-wizard.js"
77
},
@@ -20,7 +20,7 @@
2020
"templates/"
2121
],
2222
"scripts": {
23-
"test": "bash tests/test-bundle-integrity.sh && bash tests/test-plugin-shim.sh && bash tests/test-install.sh && bash tests/test-backend-picker.sh && bash tests/test-cli.sh && bash tests/test-cross-model-review.sh && bash tests/test-domain-templates.sh && bash tests/test-bundle-drift.sh && bash tests/test-check-cli.sh && bash tests/test-doc-templates.sh"
23+
"test": "bash tests/test-bundle-integrity.sh && bash tests/test-plugin-shim.sh && bash tests/test-install.sh && bash tests/test-backend-picker.sh && bash tests/test-cli.sh && bash tests/test-cross-model-review.sh && bash tests/test-domain-templates.sh && bash tests/test-bundle-drift.sh && bash tests/test-check-cli.sh && bash tests/test-doc-templates.sh && bash tests/test-review-schemas.sh"
2424
},
2525
"keywords": [
2626
"opencode",

0 commit comments

Comments
 (0)