Checkwright v0.39.0

2026-11-26

Checkwright catches reproducible classes of unsupported claims in coding-agent delivery before merge, and this release keys the verdict store before dispatch and adds gate-sdk content checks, from deny terms in path names and build outputs to script, migration and execute-bit rules. It also splits exit 3, a tool error, from exit 2, and gives every SARIF result a rule class and a stable fingerprint.

In brief

Section Entries Who acts
New and tightened gates 10 everyone: these may red on upgrade
Knob changes 19 if you set knobs
Gate-authoring changes 0 if you write or shadow gates
Platforms 0 if you install on a listed platform
Behavior changes 10 if you depend on a listed behavior
  • The verdict-store fix ships in this release together with the content checks, as one cut. A store keyed before dispatch keeps no verdict for a tree that moved while its members ran, so GATE_SDK_VERDICT_STORE is safe to turn on from this version.
  • check-binary-strings, check-path-names, check-pipefail-readers, check-script-preflight, check-site-count, check-migration-guard and check-exec-write are new and disarmed until you configure each. check-tree-terms now prints a rule id in place of the matched line.
  • Exit 3 now means the tool could not do the work, and exit 2 means a usage error or a refusal. A script that read 2 as could-not-run should read 2 or 3.
  • You must act on one red if you vendor gate-sdk: check-gate-substrate-parity names each of the seven new gates until your gates.list registers it or declares it unregistered.

New and tightened gates

  • check-tree-terms — reads the deny-term lists GATE_SDK_DENY_TERMS names beside its pattern files, a literal term hitting a line where it stands as a whole word, ASCII case folded; a # rule: <ID> line in a term list or pattern file names the id of the entries after it, and a malformed one refuses at exit 2. Its record is now <path>:<line>: [<ID>], one per matching line per distinct id, TEXT-DENIED where no rule line names one, and never the matched line; a binary’s is <path>: [<ID>]. A consumer binding no term list is unchanged in verdict; a script grepping the old path:line:text record reads the id instead.
  • check-binary-strings — new, on-surface, disarmed until GATE_SDK_STRINGS_FILES names a build output: each named output’s printable strings (runs of 4 or more bytes, and in an ELF64 little-endian file only its non-executable sections) against the deny terms, a whole token equal to a term, and the ERE shapes GATE_SDK_STRINGS_SHAPES names. Its record is <path>@<offset>: [<ID>] term|shape <position>, never the string. A named output that is absent refuses at 2, and an unparseable ELF64 header is exit 3. Copy templates/strings-shapes.list into your gates dir to start from home-path, cargo-registry and URL shapes.
  • check-path-names — new, on-surface, disarmed until a deny-term list holds a live term: no tracked path has a file or directory name equal to a term or opening with it followed by -, _ or ., ASCII case folded. Its record is <path>: [<ID>] at the shortest hitting prefix, NAMES-DENIED where no rule line names an id, and never the term. It takes no valve: rename the component.
  • check-pipefail-readers — new, on-surface, disarmed until GATE_SDK_PIPEFAIL_PATHS names a shell file or directory: no early-exit reader (grep -q/-m/-l, head, read, sed … q, awk … exit, a while read loop that breaks) is fed under pipefail beyond the file’s count in an optional GATE_SDK_PIPEFAIL_BASELINE. Its record is <path>:<line>: [PIPEFAIL-EARLY-EXIT] <reader>, ending in [auto-fix] where the new --emit pipefail-fix [<path>…] arm rewrites the site in place; waive a site with # pipefail-ok: <reason> on a line of its pipeline. A shell span the reader cannot parse is [LINT-PARSE] at exit 3.
  • check-script-preflight — new, on-surface, disarmed until GATE_SDK_SCRIPT_FILES selects tracked scripts or a script is named as an operand: no script breaks a rule in your GATE_SDK_SCRIPT_RULES file, whose blocks are of four kinds — command (an invocation refused unless an allow or before ERE matches), forbidden-token, early-exit and id-grammar (each listed flag’s value against an ERE). Its record is <path>:<line>: [<ID>] <what>, never a value from the script; waive a site with # <token>: <reason> on a line of its logical line, the reason at least waiver-min characters. An absent operand or rules file, or a malformed rules file, refuses at 2; a script the reader cannot parse is [LINT-PARSE] at exit 3. Copy templates/script-rules.list into your gates dir to start from one commented example per kind.
  • check-site-count — new, on-surface, disarmed until your GATE_SDK_SITE_RULES file holds a rule <ID> site-count block: each tracked file’s count of the block’s site EREs, binary files and test code skipped, equals its row in the block’s baseline, a count baseline of <count><TAB><path> rows. The comparison is exact, a file with no row counting 0, so a new site, a removed one and a stale row each red <path>: [<ID>] <found>/<reviewed>. A malformed rules file or an absent baseline refuses at 2; an unparseable baseline is exit 3.
  • check-migration-guard — new, on-surface, taking [--base <ref> | --base-dir <dir>], disarmed until GATE_SDK_MIGRATION_DIR names your migration directory: since the merge base with HEAD, uncommitted edits included, the branch only appends migrations, in order. Every file there is named NNNN_<name>.sql; an edited, deleted or renamed one reds <path>: [MIGRATION-EDITED], an added one numbered at or under the base’s highest <path>: [MIGRATION-ORDER] <added> <= <highest>, and an added statement matching an ERE in your destructive list <path>:<line>: [MIGRATION-DESTRUCTIVE] unless a -- migration-ok: <reason> comment on one of its lines declares it. --base-dir <dir> compares against a directory standing in for the base’s migrations. Any other file there is exit 3; an unresolved base or a malformed list refuses at 2. Copy templates/migration-destructive.list into your gates dir to start from the DROP and ALTER TABLE … DROP|RENAME floor.
  • check-exec-write — new, on-surface, disarmed until GATE_SDK_EXEC_WRITE_PATHS selects tracked Rust files: no file but a helper GATE_SDK_EXEC_WRITE_HELPERS names writes a file with an execute bit. Read in a code view with comments and literals blanked, it reds <path>:<line>: [EXEC-WRITE] <call> at a from_mode, mode, set_mode, low-level chmod-family, open or creat call whose mode is not an integer literal free of 0o111, a set_permissions taking a copied set, any fs::copy, a Command::new("chmod") or ("install"), and an execute-mode constant. It takes no waiver. A helper absolute, holding .. or naming no file refuses at 2; an unterminated literal or an unbalanced call is [LINT-PARSE] at exit 3.
  • check-pipe-membership — now reads through the shared shell reader, its predicate unchanged: a file holding an unterminated quote, an unclosed here-doc or an unbalanced (, ) or $( is <path>:<line>: [LINT-PARSE] unparseable span at exit 3, where it was judged on a best-effort split. Action owed only by a tree with such a file: fix the span.
  • check-gate-substrate-parity — reds after upgrading through assertion I, which holds every gate the binary carries for a kit you vendor to be registered in your gates.list or declared # unregistered: there. If you vendor gate-sdk, the new check-binary-strings, check-path-names, check-pipefail-readers, check-script-preflight, check-site-count, check-migration-guard and check-exec-write are such gates: register each, since its battery run is a clean skip until you name a build output, a deny term, a shell path, a script, a site rule, a migration directory or a Rust path, or declare # unregistered: <gate> — <reason>.

Knob changes

  • GATE_SDK_DENY_TERMS — new: space-separated literal-term lists, default <gates-dir>/deny-terms.local.list, each optional; an absent list contributes nothing and one that is no readable regular file is exit 3. The kit ships no starter list. Read by check-tree-terms, check-path-names and check-binary-strings; a tracked list is self-exempt from the first two.
  • GATE_SDK_STRINGS_FILES — new: space-separated build-output paths check-binary-strings scans, each named exactly; default empty, which leaves the gate disarmed.
  • GATE_SDK_STRINGS_SHAPES — new: space-separated ERE shape lists for check-binary-strings, default <gates-dir>/strings-shapes.list, each optional; the kit ships a starter at gate-sdk/templates/strings-shapes.list, which init does not seed.
  • GATE_SDK_PIPEFAIL_PATHS — new: space-separated shell files and directories check-pipefail-readers and --emit pipefail-fix read, a directory searched for *.sh under the prune dirs; default empty, which leaves the gate disarmed.
  • GATE_SDK_PIPEFAIL_LIBRARIES — new: basename globs of files linted with pipefail on from their first line, default *lib.sh *-lib*; empty names none.
  • GATE_SDK_PIPEFAIL_ALL — new: 1 lints every file in that corpus from its first line, default 0; any other value is refused at exit 2.
  • GATE_SDK_PIPEFAIL_BASELINE — new: a count baseline of <count><TAB><path> rows holding each file’s early-exit sites to a ceiling, default empty (every file at 0). A row above its file’s count reds [BASELINE-STALE] <found>/<count>; a malformed row or a repeated path is exit 3.
  • GATE_SDK_SCRIPT_FILES — new: space-separated pathspecs over the tracked tree check-script-preflight reads, the prune dirs applied; default empty, which leaves the gate disarmed.
  • GATE_SDK_SCRIPT_RULES — new: check-script-preflight’s rules file, default <gates-dir>/script-rules.list, required while a corpus is configured; the kit ships a starter at gate-sdk/templates/script-rules.list, which init does not seed.
  • GATE_SDK_SITE_RULES — new: check-site-count’s rules file, default <gates-dir>/site-rules.list, optional; absent, or holding no block, it leaves the gate disarmed.
  • GATE_SDK_TEST_GLOBS — new: space-separated globs naming test code, default tests/ fixtures/ tests.rs *_tests.rs tests_*.rs test_* *_test.*; a glob ending in / matches a directory component and any other the basename, and in a .rs file the lines from its first #[cfg(test)] on are test code too. Empty names none. Read by check-site-count and --emit stale-literals.
  • GATE_SDK_BASE_REF — new: the ref a since-base reader takes its merge base with HEAD from when no --base is given, default main. A ref naming no commit, or sharing no merge base with HEAD, refuses at exit 2. Read by --emit stale-literals and check-migration-guard; bind it where your base branch is named otherwise.
  • GATE_SDK_MIGRATION_DIR — new: the directory check-migration-guard reads, relative to where the gate runs; default empty, which leaves the gate disarmed.
  • GATE_SDK_MIGRATION_DESTRUCTIVE — new: check-migration-guard’s destructive-statement list, one ERE per line, default <gates-dir>/migration-destructive.list, optional; absent, it turns the destructive check off and the clean line says so. The kit ships a starter at gate-sdk/templates/migration-destructive.list, which init does not seed.
  • GATE_SDK_EXEC_WRITE_PATHS — new: space-separated pathspecs over the tracked tree whose .rs files check-exec-write reads, the prune dirs applied; default empty, which leaves the gate disarmed.
  • GATE_SDK_EXEC_WRITE_HELPERS — new: space-separated helper files check-exec-write exempts for their own content, relative to where the gate runs; default empty.
  • GATE_SDK_VERDICT_STORE — new: an absolute directory --run keeps a judged verdict in, environment-only; default unset, which keeps nothing. A registry run on a clean worktree whose verdict is pass or fail, by a stamped binary, writes one record under a key digesting treeId, tool.version and gateSet, and keeps nothing where that key moved while its members ran. A relative path is refused at exit 2 before the first member runs, and a store that cannot be written is exit 3.
  • GATE_SDK_PAYLOAD_WITHHOLD — default SPEC.md smoke → SPEC.md SPEC-*.md smoke: the payload --pack-installer builds no longer carries a kit root’s open SPEC-<slug>.md amendment, and the install-size figure stops counting one. A member carrying *, ? or [ is now a glob whose wildcards never cross a /, so a same-named file deeper in a kit root still ships, and check-packed-links reds a packed README linking a member it matches. Action owed only by a publisher setting the knob: add SPEC-*.md to withhold amendments too.
  • DELEGATION_KIT_TIER_CLASSES and LIFECYCLE_KIT_CONSULT_CLASS — a class spelled as a lone - is now refused by each validator, since a foreign session’s record reads class=- as no class and a resume under it failed. Action owed only by a table naming - as a class: rename it.

Gate-authoring changes

None.

Platforms

None.

Behavior changes

  • The verdict contract (--run’s SARIF log) and the gate-run predicate — both move to 1.1.0: the provenance block gains treeId, the tree object a clean worktree’s HEAD names, and gateSet, a digest of the selected gates as resolved (written by --run alone), and each fail result gains fingerprints["checkwright/v1"], an identity that survives a rerun and a line move. --verify-gate-run now reds a Statement whose provenance.treeId is not its subject’s tree. Nothing to do: a reader ignoring unknown fields reads both unchanged, and a 1.0.0 Statement carries no treeId and judges as before.
  • Exit 3 is a tool error, split from exit 2 — the binary, both front ends and the gates now exit 2 only for a usage error or a refusal (argv, a malformed knob, a request declined, an operand naming nothing) and exit 3 where the tool could not do the work (a file it cannot read or parse, a failed write or spawn, git failing, an absent or unrunnable gate binary). --run exits 0, 1 or 3 for pass, fail or error, a run that also fails reading fail, and the dispatch tail reads (dispatch harness error, exit 3). Under --json, an arm that refuses or fails prints the error document {"contract":…,"error":"<usage|refused|input|tool>"}; --verify-gate-run’s contract moves to 1.1.0 with an error.json golden. Kept at 2: the hook block, the verdict-word members’ words (STALE, UNKNOWN, FAILED, OFF, FAIL(env), “no comparison made”, “nothing written”), and a relay’s passed-through child status; the installer keeps 1 for an adopter-actionable refusal. Action owed: a script or CI step that branches on exit 2 to mean “could not run” now misses 3 — read “2 or 3”, or any non-zero, as could-not-run.
  • The verdict contract moves to 1.2.0 — a placed result whose finding text opens a rule class token [<CLASS>] (upper-case, as check-prose-tells’ and check-prose-bounds’ findings already print) carries it as properties.ruleClass, and two new finding shapes are placed: <path>: [<CLASS>] on a file or directory with no region, and <path>@<offset>: [<CLASS>] at a region carrying byteOffset alone, its offset outside the fingerprint. Every line a 1.1.0 member printed keeps its placement and fingerprint. Nothing to do: a reader ignoring unknown fields reads the log unchanged; test a reader keying on the class against the goldens at /contracts/verdict/v1/.
  • A configured file now splits on whether it is there — a file the caller names or configures (an operand, a knob, a registry, a queue file, a ceiling or declaration file) that is absent, a directory or a dangling link is now refused at exit 2, where many gates and arms exited 3; one that is present but cannot be read or decoded is now exit 3, where the queue gates, check-brevity and --emit port-blockers exited 2. An optional file is still its default when nothing is there, and anything else there that cannot be read is exit 3. A failing command knob’s command (check-prose-enum, check-unmarked-claim and the other claim gates) and an unrunnable registry member now exit 3, and --emit gate-argv exits 2 only for an absent declaration or an unset host knob. Unreadable files that read as clean or empty before (check-gate-binary-fresh’s registry, check-gate-fixture-coverage’s declarations, the provenance-seam and PSScriptAnalyzer registry reads) now exit 3. Action owed only by a script branching on 2 versus 3 for these: read “2 or 3” as could-not-run.
  • --verdict-lookup <tree> <kit-ver> <digest> — new arm: answers a key from GATE_SDK_VERDICT_STORE with one JSON object, contract 1.0.0, its verdict the stored pass or fail at exit 0, or absent at exit 0 where no run stored the key. A malformed operand or an unset or relative store is exit 2, and a record that cannot be read or does not answer for its key is exit 3, each with the error document. It reads no repository, so a caller can ask before checking a tree out; through the front end it still runs inside one. Test a reader against the goldens at /contracts/verdict-lookup/v1/.
  • --emit stale-literals [--base <ref>] [--tools <dir>] — new arm: lists the test lines that may assert a string your branch removed, comparing the merge base with the working tree, uncommitted edits included. A string is a literal fragment of 8 or more characters holding 4 ASCII letters, removed from a non-test line and held by no non-test line still in the tree; a test line unchanged since the merge base whose literal overlaps one prints LITERAL <test>:<line> (was <src>:<line>), an assertion’s message never. --tools <dir> adds a test suite outside the repository. It judges nothing: exit 0 whatever it lists, 2 for an unresolved base or a malformed argv, 3 for a git failure.
  • --run --json — new option, leading any selector: prints the run’s verdict as one JSON object on stdout, contract 1.0.0, with verdict, scope, the provenance block, each member’s name, kind (pass, notApplicable, fail or error), exit and an error member’s error (refused or tool), in gate-set order, and the declared omissions with their reason. It is written last, after the SARIF log and the verdict store; the transcript and summary move to stderr, and the exit status is unchanged. A refused or failed invocation prints the error document instead. Without the option the output is byte-identical. Test a reader against the goldens at /contracts/run/v1/, pinned by version and digest.
  • The foreign run’s confinement record — a lone - is no longer a policy: --foreign-run --sandbox - is a shape refusal at exit 2, and the DELEGATION_KIT_FOREIGN_SANDBOX validator refuses an <adapter>/-=<word> element, so every delegation-kit knob reader refuses on such a table. A --foreign-resume whose DELEGATION_KIT_FOREIGN_RESUME form carries no @SANDBOX@ under a session that recorded a policy now fails before the spawn as FAILED (sandbox: …), where it ran a literal its line’s sandbox= did not name. Action owed only by a table binding - as a policy: rename the policy.
  • --enter-stage --open-lead-journal’s session-role marker — the id is now the lead’s own: LIFECYCLE_KIT_SESSION_ID where set, else CLAUDE_CODE_SESSION_ID whatever the child-session flag says, else the stamp’s derivation. A lead the harness flags as a child no longer writes its newest stage session’s id, which had lost it the executor-facing suppression. Nothing to do.
  • check-provenance-seam and a slug named for an arm — a live queue slug equal to a non-gate arm’s name, less its leading --emit- or --, is now exempt like a kit or gate name, so a kit SPEC may spell that arm’s contract path. Nothing to do.

Upgrading

Replace the vendored kit directories wholesale at v0.39.0, or run checkwright update. Regenerate your generated artifacts; each freshness gate that reds prints its own regen command. Then run the full battery.

The allowed reds. Every gate under New and tightened gates above may red, and its bullet names what clears it. On a tree that vendors gate-sdk, expect check-gate-substrate-parity’s assertion I naming check-binary-strings, check-path-names, check-pipefail-readers, check-script-preflight, check-site-count, check-migration-guard and check-exec-write: add each to your gates.list, where its battery run is a clean skip until you configure it, or declare it # unregistered: <gate> — <reason>. check-pipe-membership reds only a shell file with an unparseable span; fix the span. check-tree-terms changes its record and keeps its verdict.

The behavior changes above are declared for reading, not a mechanical scan. If a gate reds that this note does not name, the upgrade smoke was supposed to catch it first — open an issue, because that is a defect in the release rather than work for you.