Repository navigation
Conversation
|
🔱 Poseidon started reviewing this PR — central run. |
There was a problem hiding this comment.
🔱 Poseidon Review
Summary — Adds ajv schema validation to the report renderer (gated on schemas that declare $schema, i.e. shop and aeo) so a non-matching report is refused on every render path; low risk, and the change is unusually well covered by tests. No issues found on this pass.
I verified the parts most likely to break: the date-time validator correctly rejects Feb 30, non-leap Feb 29, and hour 24 while accepting leap-year and offset forms; the uri validator rejects surrounding whitespace and relative paths; the top-level return (rather than process.exit) on validation failure lets a long refusal drain to a pipe; provenance is modeled in the shop schema so stamping-before-validation doesn't itself fail the check; and the set -e wrapper exits on a refused report with the ajv errors already flushed to stderr.
ℹ️ Review info
- Commit: 88d6dc7
- Files reviewed: .github/workflows/ci.yml, CLAUDE.md, README.md, docs/getting-started.md, hooks/hooks.json, schemas/qa-report-aeo-schema.json, scripts/generate-report.js, scripts/run-qa-report.sh, scripts/validate-report.js, tests/generate-report.test.js, tests/validate-report.test.js
- Files skipped: package.json, package-lock.json (dependency manifest / lockfile — ajv ^8.20.0 only)
- Model: claude-opus-4-8
what
package.json,package-lock.json— new root manifest;ajvis the only dependencyscripts/validate-report.jsvalidate()checks a report againstschemas/qa-report-<type>-schema.jsonin ajv strict mode, but only when that file declares$schema: shop and aeo today. functional, performance and accessibility are still example documents and pass through with a notetypesFor()is the flagged types plus whatever the content shows (mode: "aeo", ashopblock), so a missing or wrong flag can't skip the checkcheckReport()prints one line per mismatch, thenFix these fields in <file>, then re-run.andNothing was rendered.scripts/generate-report.jsprocess.exitCodeand returns--skip-validationrenders without the check, for archived reports whose shape predates their schemamode" error no longer says "pass --aeo to force", which hit the same errorscripts/run-qa-report.shwebsiteNameandtimestampwithJSON.parseinstead of splitting raw text, so a missing field or compact JSON no longer crashes itmode: "aeo"resolves to--aeo, so the stamp and the filename label get it tooschemas/qa-report-aeo-schema.json—"type": "object"on the eightcriterionSignalPairingbranches so the schema compiles in strict mode. no change to what it acceptstests/validate-report.test.js,tests/generate-report.test.js— strict-mode compile of each schema, format edge cases, refuse and pass through both the wrapper and the renderer, the no-ajv and broken-schema paths, shop and aeo detected from content, the 64 KB cut-off, the--aeomessage.github/workflows/ci.yml—npm cibeforenode --testwhy
the skills lean on long "did I…?" checklists to get the report JSON right, and nothing enforces them. the files in
schemas/described the shape, but nothing ever read them: shop and aeo were real JSON Schema that no run had ever been checked against, and an opus 5 performance run invented a top-levelsummarykey that the renderer silently ignored.now a report has to match its schema to render. when it doesn't, the model gets the exact field:
and fixes the JSON. that's the feedback loop the checklists were pretending to be, and it's the first step of the skills refactor: once the schema is the gate, the rewrites can drop the checklists.
the check lives in the renderer, not the wrapper, because every render goes through
generate-report.js:run-qa-report.sh, the merge, and a direct call. the first version only validated inrun-qa-report.sh, whileCLAUDE.md(loaded in every kosh session) documents the renderer-only command, so a refused model had a documented way around it. skipping the check is now an explicit, named flag.npm cirather thannpm install, becausenpm installcan rewrite the committed lockfile (under a different npm version, say), and a modifiedpackage-lock.jsonblocks the user's nextgit pull.notes
run-qa-report.shandmerge-qa-reports.shstill paste file paths into single-quoted JS strings (18 places, 17 of them pre-existing), so a path containing'fails. it fails on trunk too, as a misleading "Invalid JSON". a follow-up fixes all of them together with the merge script's matchingsplit()parsingco-authored by claude opus 5.5 🛂