Skip to content

speccheck 1.25.0

Choose a tag to compare

@rioffe rioffe released this 06 Nov 02:08
· 19 commits to main since this release

speccheck checks a spec-driven build mechanically: it maps every spec ID to the code and tests that cite it. This release ships with the spec-writing, spec-review, spec-plan, spec-model, spec-proof, spec-build and spec-proposal skills, spec2pdf.sh, and install.sh. The code is MIT-licensed and the documents are CC BY 4.0.

This release implements all of SPEC.md v1.25: 334 spec IDs, 213 tests, and both checker phases conforming.

speccheck (mock): CONFORMING - 334/334 passing (100.0%), 0 failing, 0 skipped, 0 weak, 0 unverified, 0 untested, 0 uncited; 0 dangling, 0 stale; judge=mock
speccheck (llm):  CONFORMING - 334/334 passing (100.0%), 0 failing, 0 skipped, 0 weak, 0 unverified, 0 untested, 0 uncited; 0 dangling, 0 stale; judge=llm

Phase B ran with openai/gpt-6-luna-pro via OpenRouter (--judge-concurrency 16) and judged 1,110 edges:

  • judge_strength: 1.0 (324/324).
  • unknown_rate: 0.0117 (13/1,110).
  • No ID was downgraded.

The first probe returned HTTP 401 because no valid key was in the environment, so the full run waited until one was. Details are in SPEC_BUILD_REPORT.md §0p.

v1.25 is the first step of docs/plans/ISO13485_READINESS_PLAN.md. It adds two things a team building medical-device software needs from a conformance report filed as a quality record:

  • the report can be tied to the exact bytes it was computed from;
  • each hazard can be traced to the tests that verify its risk controls.

The design is in docs/proposals/PROPOSAL_v1.25_provenance_manifest_and_risk_controls.md (decisions D-61..D-65).

What is new in 1.25.0 (SPEC.md v1.24 → v1.25)

The provenance manifest: check --manifest (R-106, C-25, I-020)

The two reports are byte-identical for identical inputs, and they carry no version or timestamp. So a line added to a source file after the test run left both reports unchanged. A report filed under ISO 13485 4.2.5 could not say which code it had verified.

check --manifest writes a third file, speccheck.manifest.json, in the same all-or-nothing write as the two reports. It records:

  • the tool version and the options;
  • the SHA-256 and length of every file the run read, by role (spec, src, tests, proof, results, citation_map, proof_results, risk_file);
  • one tree_sha256 over those files, in the shasum -a 256 line format;
  • the hashes of both reports.

Like the reports, the manifest is deterministic: it records no clock, host, or absolute path. Set SOURCE_DATE_EPOCH to record a generated_at time.

speccheck verify (R-107, C-26)

uv run speccheck check --spec SPEC.md --src src --tests tests --results junit.xml --judge mock --manifest --out build/rec
uv run speccheck verify --manifest build/rec/speccheck.manifest.json
# verify: ok - 74 files match, tree 3be076240f44          exit 0 (this repository at v1.25)
# after an edit to src/speccheck/report.py:
# verify: mismatch src/speccheck/report.py
# verify: FAILED - 1 of 74 files differ                    exit 1

verify only re-hashes files. It never re-runs check, writes nothing, and opens no socket. Exit codes:

  • 0: every file matches.
  • 1: a file differs or is missing.
  • 2: --manifest is missing or outside --root.
  • 3: the manifest is malformed or names a path outside --root. This exits before any file is read.

Hazard traceability: the *(controls: …)* marker and --risk-file (R-108, R-109, C-27, C-28)

A requirement that serves as a risk control for an ISO 14971 hazard says so on its own row:

| **R-12** *(controls: HAZ-003, HAZ-007)* | The viewer MUST NOT display a measurement whose sign check fails. |

Each hazard rolls up to one status:

  • VERIFIED: every control is PASSING.
  • NOT_VERIFIED: at least one control is not PASSING.
  • UNCONTROLLED: nothing controls the hazard.

The roll-up appears in four places:

  • controls on each marked ID, plus a top-level hazards list, in speccheck.json;
  • a ## 10. Hazards table in the Markdown report;
  • a controls: line in explain;
  • ; hazards: <V>/<H> verified at the end of the summary line.

--risk-file FILE (check only) lists the hazards whose control is allocated to this software. A listed hazard that no row controls is UNCONTROLLED. It fails --strict (R-15 amended), and a run without --strict prints UNPROVEN. A marker naming a hazard the file does not list gets a Note, never a failure.

VERIFIED means the software controls passed their tests. It does not mean the risk is acceptable; that judgment stays in the risk file.

Unchanged unless used (I-021)

A run that uses neither new flag and has no marker in its spec is byte-identical to 1.24.0. Both fixture goldens are unchanged.

A fix found during the build

The spec's C-27 said each marker Note appears at most once per run, but E-78 and E-80 emit one Note per marked ID. Separately, the marker Notes were reaching impact.json, although impact ignores the marker. Both the spec text and the code are fixed (F-801).

Not yet

  • Signatures and the identity of whoever ran the check: the manifest proves which bytes a report came from, not who produced it or whether the results file came from that tree. Both belong to your quality system or CI.
  • Risk management itself: speccheck does not estimate, evaluate, or accept risk.
  • The rest of docs/plans/ISO13485_READINESS_PLAN.md: the tool validation pack (§3.1), a policy for the LLM judge in regulated use (§3.4), our own development process (§3.5) and procedure templates (§3.6). IEC 62304 safety classes are not modelled.

Upgrading

git pull and re-run ./install.sh. A run that uses none of the new features produces the same reports as 1.24.0. A log parser matching the summary line may see the new ; hazards: … suffix, but only on runs whose spec has a marker or that pass --risk-file.