jcp: C26 — the one-writer requirement gets a conformance clause with teeth #352
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/c25-single-writer-conformance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#346 added §5's one-writer requirement and deliberately added no conformance clause, on the grounds that numbering one the pack cannot test would claim coverage that does not exist. This is that follow-up.
The clause
C26 one writer per record: a second holder is refusedasserts three things on the referenceFileJournal:§9 gains the clause and the harness header gains its class, so the spec's list and the pack agree. This fits the pack's own stated contract — "Every check is real — it exercises the reference library and asserts a property the standard requires."
Proving it has teeth took two attempts, and the first was wrong
I first mutated the check: made it accept a second holder, made it accept any error kind. The suite stayed green, and for a moment that read as a surviving defect.
It isn't. Weakening a check makes it vacuous, and a vacuous check passes. Mutating the assertion tests nothing about whether the clause can detect a violation. The meaningful direction for a conformance clause is to break the implementation and require the clause to catch it:
All three caught with C26 named in the failure — which also settles the question I went in with, namely whether the clause is actually executed by
all_checks_passor merely listed. It runs.This is the second time in two days that my first mutation set tested the wrong thing (the other being a pair of semantic no-ops). The guard is the same: a mutation must change behaviour the test is supposed to notice, and "SURVIVED" is only meaningful once the mutation is known to be real.
Verification
cargo check --workspace --all-targets --locked(jcp-rs) — exit 0cargo test --workspace --locked— exit 0, 64 test binaries green, no failurescargo clippy -p jcp-conformance --all-targets --no-deps --locked -- -D warnings— cleancheck-spec-refs1675 citations / 16 standards ·check-tests-in-ciclean ·check-lockfiles42 current ·check-comparative-prosecleanNoted, not touched
While counting clause ids I found two pre-existing asymmetries between the spec's list and the harness: §9 declares a
C25 — flowthe harness does not implement, and the harness has aC19(injection resistance) that §9 does not list. Both predate this change and neither is in its path, so they are reported rather than folded in — the first is a claim of coverage, so it is the more interesting of the two.🤖 Generated with Claude Code