checkwright 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +3 -3
  2. package/package.json +2 -2
  3. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  4. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  5. package/payload/canon-kit/README.md +2 -0
  6. package/payload/canon-kit/SPEC.md +329 -15
  7. package/payload/canon-kit/checks/check-amendment-update-target.gate +3 -0
  8. package/payload/canon-kit/checks/check-unmarked-claim.gate +3 -0
  9. package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/SPEC-thing.md +26 -0
  10. package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/expect.txt +8 -0
  11. package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +47 -0
  12. package/payload/canon-kit/gate-tests/check-amendment-update-target/good/expect.txt +1 -0
  13. package/payload/canon-kit/gate-tests/check-amendment-update-target.test.sh +82 -0
  14. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/SPEC.md +11 -0
  15. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/expect.txt +3 -0
  16. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/scripts/canon-config.sh +6 -0
  17. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/SPEC.md +18 -0
  18. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/expect.txt +1 -0
  19. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/scripts/canon-config.sh +6 -0
  20. package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +85 -0
  21. package/payload/canon-kit/lib/spec.sh +16 -0
  22. package/payload/canon-kit/smoke/install.sh +2 -0
  23. package/payload/canon-kit/templates/SPEC-amendment.md +17 -2
  24. package/payload/context-kit/SPEC.md +16 -5
  25. package/payload/delegation-kit/README.md +11 -1
  26. package/payload/delegation-kit/SPEC.md +392 -26
  27. package/payload/delegation-kit/bin/wait-probe.sh +184 -0
  28. package/payload/delegation-kit/gate-tests/subagent-stop-liveness.test.sh +99 -0
  29. package/payload/delegation-kit/smoke/install.sh +20 -0
  30. package/payload/delegation-kit/templates/agent-execution.md +26 -9
  31. package/payload/delegation-kit/templates/subagent-stop-liveness.sh +56 -0
  32. package/payload/gate-sdk/README.md +7 -2
  33. package/payload/gate-sdk/SPEC.md +800 -66
  34. package/payload/gate-sdk/bin/build-native.sh +66 -1
  35. package/payload/gate-sdk/bin/run-gates.sh +136 -34
  36. package/payload/gate-sdk/checks/check-action-run-shell.sh +1 -1
  37. package/payload/gate-sdk/checks/check-gate-assertions.gate +3 -0
  38. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +55 -2
  39. package/payload/gate-sdk/checks/check-tree-terms.gate +3 -0
  40. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/expect.txt +5 -1
  41. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +22 -0
  42. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-count.sh +11 -0
  43. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-extra.sh +14 -0
  44. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-zero.sh +7 -0
  45. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  46. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +27 -0
  47. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-qux.sh +13 -0
  48. package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +117 -0
  49. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +2 -0
  50. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kit-spec.md +6 -0
  51. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-nospec.sh +4 -0
  52. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-ungrounded.sh +5 -0
  53. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +2 -0
  54. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +1 -1
  55. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kit-spec.md +12 -0
  56. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-held.sh +1 -0
  57. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +5 -0
  58. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/multi.txt +4 -0
  59. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/second-leak.txt +2 -0
  60. package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -1
  61. package/payload/gate-sdk/gate-tests/check-tree-terms/good/patterns.list +3 -0
  62. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/anchored.txt +4 -0
  63. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +2 -0
  64. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +3 -0
  65. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/worktrees/vendored-note.txt +3 -0
  66. package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +94 -0
  67. package/payload/gate-sdk/smoke/install.sh +23 -0
  68. package/payload/guard-kit/README.md +4 -3
  69. package/payload/guard-kit/SPEC.md +409 -57
  70. package/payload/guard-kit/bin/compare-settings-allow.sh +36 -12
  71. package/payload/guard-kit/bin/run-guard-tests.sh +22 -4
  72. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +46 -1
  73. package/payload/guard-kit/guard-tests/background-cases.tsv +14 -0
  74. package/payload/guard-kit/guard-tests/cases.tsv +41 -11
  75. package/payload/guard-kit/lib/guard.sh +213 -34
  76. package/payload/guard-kit/templates/bash-guard.sh +2 -0
  77. package/payload/guard-kit/templates/close-triage.md +10 -3
  78. package/payload/guard-kit/templates/guard-config.sh +3 -0
  79. package/payload/lifecycle-kit/SPEC.md +2 -2
  80. package/payload/lifecycle-kit/templates/lead.md +8 -0
  81. package/payload/queue-kit/SPEC.md +78 -0
  82. package/payload/site-kit/SPEC.md +12 -0
  83. package/payload/gate-sdk/checks/check-gate-assertions.sh +0 -149
  84. package/payload/gate-sdk/checks/check-tree-terms.sh +0 -67
package/README.md CHANGED
@@ -24,9 +24,9 @@ vendored keeps working — it needs nothing from a package registry again.
24
24
  ## Implementation
25
25
 
26
26
  Bash. npm is the delivery vehicle, never the implementation: the `bin` entry is
27
- a bash script, so a reader reviewing what they are about to run reads the one
28
- language the rest of the tree is written in, and the linter that governs every
29
- other script in the repository governs these too.
27
+ a bash script, so a reader reviewing what they are about to run reads source
28
+ rather than a build product, and the linter that governs every other script in
29
+ the repository governs these too.
30
30
 
31
31
  ## Requirements
32
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "checkwright",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Vendors pinned Checkwright kit source into your repository and commits it — a coding-agent-assisted delivery methodology (gate SDK, evidence-stamped lifecycle, agent context economics).",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -19,6 +19,6 @@
19
19
  "README.md"
20
20
  ],
21
21
  "checkwright": {
22
- "commit": "fa830b8840f1544f0382a4c3028d9149885e14eb"
22
+ "commit": "b5629b333379de6d4ca7d5d0cdaee7c187a58a23"
23
23
  }
24
24
  }
@@ -1 +1 @@
1
- 34ebcda0547246cf48fcf511776138e1ecff68077da92df4a51dbbe92feca801 checkwright-gates
1
+ ce155e6bb76a8365cdbded00d65a428e52aa848d17722fc8fe01df4b1de57889 checkwright-gates
@@ -26,6 +26,7 @@ reads the tag syntax [queue-kit](../queue-kit/) defines.
26
26
  <!-- gate-roster:begin -->
27
27
  ```
28
28
  check-amendment-queue # needs a task queue
29
+ check-amendment-update-target # every update target cites a delta the amendment defines
29
30
  check-spec-dod-singleton # needs canonical specs
30
31
  check-spec-derivable-section # needs canonical specs
31
32
  check-spec-embedded-source # needs canonical specs + tracked source
@@ -38,6 +39,7 @@ reads the tag syntax [queue-kit](../queue-kit/) defines.
38
39
  check-knob-default-coupling # source knob defaults agree with the owning SPEC
39
40
  check-manifest-count # no bare cardinal over a governed collection
40
41
  check-measured-claim # needs a measured-claim oracle (marked claims re-measured)
42
+ check-unmarked-claim # needs a claim-class roster (a declared class carries a marker)
41
43
  check-manifest-temporal # no temporal narration in manifest prose
42
44
  check-tracking-claim # a path's tracking status in prose agrees with git
43
45
  check-prose-enum # partial enumeration of a governed set
@@ -79,6 +79,38 @@ design *ruling* is design work — it goes to the deferred section
79
79
  `[design-pending]` until scope rules on it. Enforced by
80
80
  `check-amendment-queue`.
81
81
 
82
+ **The delta-ID grammar.** An amendment's `## What changes` is a sequence of
83
+ **deltas**, and both a delta and a citation to one have a pinned form. Pinned
84
+ because the next section requires each update target to name the delta that
85
+ owns it, and a name no surface specifies is unmechanizable: a gate cannot match
86
+ a grammar the template never states.
87
+
88
+ A **delta** is a `###` heading under `## What changes` of the form
89
+ `### (<N>) <title>`, where `<N>` is a positive decimal integer written without a
90
+ leading zero and `<title>` is non-empty. Delta numbers begin at one and are
91
+ **sequential and unique** within the amendment — a gap or a repeat means a delta
92
+ was split or dropped without its citations moving, which is the drift this
93
+ grammar exists to make visible.
94
+
95
+ A **citation** is the token `delta <N>` or `deltas <N>` (case-insensitive),
96
+ optionally continuing into further integers separated by commas and/or the word
97
+ `and`; a trailing possessive (`delta 3's`) is the same citation. The literal
98
+ `all deltas` cites **every** delta the amendment defines — the form a
99
+ whole-amendment update target already uses in practice (a generated mirror is
100
+ stale the moment any delta lands), admitted rather than forced into an
101
+ enumeration that would itself drift as deltas are added.
102
+
103
+ A heading rather than a bold lead-in token, because a heading gives a delta an
104
+ anchor a reader can link to and a scanner can find in one pass, and it survives
105
+ reordering under a diff more legibly than a token buried in a paragraph. The
106
+ **work-class tag** an amendment may carry (`{mechanical}` / `{design-bearing}`)
107
+ is deliberately **outside** this grammar: its owner is the roster's
108
+ authoring-stage template and its reader is the iteration lead at batch-cut, so
109
+ carrying it inside the delta token would tie two independent conventions to one
110
+ string and stop either changing without the other. Stated as a non-target so a
111
+ later reader does not read the silence as an omission. Enforced by
112
+ `check-amendment-update-target`.
113
+
82
114
  An amendment file is **outside the governed manifest**: `CANON_KIT_MANIFEST_FILES`
83
115
  globs `*/SPEC.md`, which `SPEC-<name>.md` does not match, so the prose and knob
84
116
  gates never scan one. Their obligations attach at the merge rather than at the
@@ -204,7 +236,13 @@ own instance); the kit's rules are the topology itself:
204
236
  turns a transcribed number into a generated, freshness-gated copy and is the
205
237
  second remedy this bullet offers beside citing the owner. Prefer citing the
206
238
  owner where the number need not be stated; mark it where a reader is served by
207
- reading it. A **user-facing** claim takes the same treatment when a reader
239
+ reading it. **What makes marking happen at all is a third mechanism**, because
240
+ the two above both wait for an author to act: `check-unmarked-claim` lets a
241
+ consumer declare a *class* of claim that may not go unoracled, so the sentences
242
+ most worth binding are pressured into a marker rather than left to authorial
243
+ memory — and the class reaches a claim carrying no number, which is where this
244
+ bullet's own rules stop.
245
+ A **user-facing** claim takes the same treatment when a reader
208
246
  acts on it: `check-install-claim` gives the primary-install-path claim one
209
247
  declared owner and holds every governed install section to it, so the topology
210
248
  reaches beyond the internal facts the rules above are stated over.
@@ -376,7 +414,22 @@ unset, and the loader exits 2 on a malformed config. Knobs:
376
414
  so no key ships as a kit literal (the provenance seam). This repo sets
377
415
  `bash scripts/measured-claims.sh` and the `CANON_KIT_MANIFEST_FILES` globs plus
378
416
  `.claude/commands/*.md` — the shims the manifest set omits and the prose surface
379
- excludes on a copy-shape ownership this rule is not covered by.
417
+ excludes on a copy-shape ownership this rule is not covered by. The surface knob
418
+ has a **second reader**, `check-unmarked-claim`, which shares it rather than
419
+ forking a knob of its own: the pair composes over one corpus
420
+ (§check-unmarked-claim), and the recorded cost is that a consumer cannot scan
421
+ claim classes over a different surface than its measured claims.
422
+ - `CANON_KIT_CLAIM_CLASSES_CMD` — a consumer command emitting the claim classes
423
+ `check-unmarked-claim` holds, one `<class-id>`⇥`<ERE>` line per class, default
424
+ empty ⇒ clean skip (no declared class, so no sentence falls in one). A class is
425
+ a spelling of what one project claims about itself, so it is consumer config for
426
+ the same provenance-seam reason the vocabularies above are, and for one more:
427
+ this kit's own SPEC is governed prose, so a kit literal here would match its own
428
+ class while describing it. This repo sets `bash scripts/claim-classes.sh`. The
429
+ gate reads `CANON_KIT_MEASURED_SURFACE_GLOBS` above for its corpus and adds no
430
+ surface knob. `CANON_KIT_CLAIM_CLASS_IDS` / `CANON_KIT_CLAIM_CLASS_PATTERNS` —
431
+ that command's parsed output in the same bridged, index-aligned shape as the
432
+ transport and payload pairs above, default empty arrays.
380
433
  - `CANON_KIT_COMMENT_MACHINE` / `CANON_KIT_COMMENT_REASON` — arrays, default
381
434
  empty: extra directive prefixes appended to the built-in kit-mechanism
382
435
  roster (a consumer's product vocabulary). `CANON_KIT_COMMENT_SURFACE` —
@@ -435,12 +488,14 @@ each degrading to "no icebox" rather than to a wrong section when left unset. Va
435
488
  Each gate below owns its own section — the assertion, its fixture pair, and the
436
489
  reason for any bespoke unit test beside it. The bespoke unit tests are named
437
490
  together here, because a roster spread across per-gate sections is one no reader
438
- and no oracle sees whole: `check-comment-tier.test.sh`,
491
+ and no oracle sees whole: `check-amendment-update-target.test.sh`,
492
+ `check-comment-tier.test.sh`,
439
493
  `check-deprecation-task.test.sh`, `check-docs-link-convention.test.sh`,
440
494
  `check-knob-citation.test.sh`, `check-knob-default-coupling.test.sh`,
441
495
  `check-manifest-count.test.sh`, `check-md-refs.test.sh`,
442
496
  `check-measured-claim.test.sh`, `check-prose-enum.test.sh`,
443
- `check-spec-dod-singleton.test.sh` and `check-tracking-claim.test.sh`.
497
+ `check-spec-dod-singleton.test.sh`, `check-tracking-claim.test.sh` and
498
+ `check-unmarked-claim.test.sh`.
444
499
 
445
500
  ### lib/spec.sh
446
501
 
@@ -547,9 +602,10 @@ same shapes:
547
602
  element, so a `<name>`⇥`<member>` line cannot cross as a single string. The
548
603
  resolution is gated on `GATE_SDK_RESOLVING_KNOB` (gate-sdk/SPEC.md
549
604
  §lib/gate.sh), because it costs a subprocess and this library is sourced once
550
- per declared knob per gate. Three vocabularies ride that shape, one pair each:
551
- the enum sets, `CANON_KIT_INSTALL_TRANSPORT_IDS` / `..._PATTERNS`, and
552
- `CANON_KIT_PAYLOAD_CLAIM_IDS` / `..._PATTERNS` (§Layout and configuration). The
605
+ per declared knob per gate. Four vocabularies ride that shape, one pair each:
606
+ the enum sets, `CANON_KIT_INSTALL_TRANSPORT_IDS` / `..._PATTERNS`,
607
+ `CANON_KIT_PAYLOAD_CLAIM_IDS` / `..._PATTERNS`, and
608
+ `CANON_KIT_CLAIM_CLASS_IDS` / `..._PATTERNS` (§Layout and configuration). The
553
609
  emitting **command** knob is bridged beside each pair, because it is what tells
554
610
  *none configured* from *configured, and it declared nothing* — the two clean
555
611
  skips a claim gate reports apart. The tab a POSIX ERE may legitimately carry
@@ -558,7 +614,14 @@ same shapes:
558
614
  - **The count adapter** the restated-total gates share, so a consumer's
559
615
  `CANON_KIT_COUNT_COLLECTIONS` vocabulary enters once and every such gate
560
616
  matches the same total shapes — including a total whose cardinal and noun
561
- straddle a prose wrap, reported at the cardinal's physical line. The boundary
617
+ straddle a prose wrap, reported at the cardinal's physical line. **That
618
+ wrap-straddling normalization now has a second reader**: `check-unmarked-claim`
619
+ matches a class ERE against the same normalized paragraph and maps the match's
620
+ span back to the physical line it starts on (`FlatPara`,
621
+ `native/src/spec.rs`), so both cross a prose wrap by one rule rather than by a
622
+ copy each. What the count adapter owns is the *total* grammar; what the flatten
623
+ adapter owns is the *subject* a pattern is matched against, and separating them
624
+ is why a second reader cost a call rather than a fork. The boundary
562
625
  rule and the mechanical exemptions live in one shared fragment, so no sibling
563
626
  drifts from another in what it counts as a total (§check-manifest-count). That
564
627
  boundary guards a prose **noun** against gluing to a following word ("gate"
@@ -573,7 +636,10 @@ same shapes:
573
636
  `spec_claim_vocabulary <command> <label>` — one loader for every
574
637
  `<id>`⇥`<ERE>` vocabulary a claim gate reads, taking the command as an
575
638
  argument rather than from one named knob so a second claim axis costs a caller
576
- and not a second copy. It carries the
639
+ and not a second copy. **That argument is attested rather than anticipated:**
640
+ `check-unmarked-claim` is the fourth caller and it arrived as a caller and
641
+ nothing else — no fork of the loader, no second copy of the shape checks. It
642
+ carries the
577
643
  same fail-closed contract its enum-set sibling does — a command error, an
578
644
  unparsable line, an id that is not slug-shaped, or a repeated id is exit 2 —
579
645
  and the `<label>` it is given names the failing vocabulary in every message,
@@ -583,10 +649,14 @@ same shapes:
583
649
  callers are `spec_install_transports`, over
584
650
  `CANON_KIT_INSTALL_TRANSPORTS_CMD` (§check-install-claim);
585
651
  `check-payload-claim` directly, over `CANON_KIT_PAYLOAD_CLAIMS_CMD`
586
- (§check-payload-claim); and `spec_measured_claims`, over
652
+ (§check-payload-claim); `spec_measured_claims`, over
587
653
  `CANON_KIT_MEASURED_CLAIMS_CMD` (§check-measured-claim) — whose second field is
588
654
  a measured value rather than an ERE, which the loader neither interprets nor
589
- needs to, since every check it makes is on the line's shape.
655
+ needs to, since every check it makes is on the line's shape; and
656
+ `check-unmarked-claim` directly, over `CANON_KIT_CLAIM_CLASSES_CMD`
657
+ (§check-unmarked-claim). The two-field shape is what makes that last caller
658
+ coverage-only: a class cannot carry a required key beside its ERE without a
659
+ third field this loader refuses, and the refusal is kept rather than relaxed.
590
660
  - **The comment-surface adapters:** the comment gates read *different* surfaces,
591
661
  which is the one thing the primitive's parameter decides.
592
662
  `check-spec-pointer` scans the template-pruned surface — a template's `spec:`
@@ -603,6 +673,17 @@ same shapes:
603
673
  (gate-sdk/SPEC.md §The port-candidate criteria, criterion 2) reaches
604
674
  **undocumented** surface only, and this bullet documents it. The live holder is
605
675
  `native/src/spec.rs`.
676
+ Its consumers are `check-amendment-queue` and
677
+ `check-amendment-update-target`, and they **differ in fail-closed posture on
678
+ purpose** — so the crate holds two spellings of one walk, `amendments` and
679
+ `amendments_strict`, rather than one that reads as drift. The best-effort form
680
+ swallows an unwalkable scan root and yields no amendments, which the queue gate
681
+ can afford because an empty amendment set cannot hide a violation there (every
682
+ `[spec:]` ref then dangles and the run reds). The update-target gate has no
683
+ second surface to contradict an empty set, so for it an empty set hides every
684
+ violation silently and the walk refuses instead. Each section states its own
685
+ half; the difference is a reasoned divergence, never an inconsistency to
686
+ reconcile.
606
687
  - **The default-statement grammar** both knob gates share, so the rule for
607
688
  what reads as a stated default has one home. `sk_literal_at` recognizes the
608
689
  value literal opening a window (a backticked non-knob string, a quoted string,
@@ -645,7 +726,11 @@ carrying the tag reds nowhere, and queue-kit's lead-line gate misses it too
645
726
  grammar is a bare slug line, so the tag is dropped by that grammar rather
646
727
  than by a gate. The guard is total over the *promotion* moves it exists to
647
728
  catch — design-pending → an active section — and silent on the disposition
648
- move.
729
+ move. This is a limit on *this* gate's axis only: the amendment artifact is
730
+ held on a second axis by `check-amendment-update-target`
731
+ (§check-amendment-update-target), whose corpus is the same amendment set and
732
+ whose subject is what the file says about itself rather than how it pairs with
733
+ the queue.
649
734
 
650
735
  **The amendment finder is best-effort, and the port had to reproduce that
651
736
  rather than harden it.** `spec_amendments` ends `2>/dev/null … || true`, so an
@@ -660,6 +745,101 @@ because the natural port instinct is to add the refusal, and the sibling
660
745
  instinct look precedented. That member's shell form carried the `-d` guard;
661
746
  this one never has.
662
747
 
748
+ ### check-amendment-update-target
749
+
750
+ Invariant: in every amendment on disk, each entry under
751
+ `## Existing sections updated` cites at least one delta, and every cited delta is
752
+ defined under `## What changes` in the same amendment. The grammar it reads —
753
+ what a delta is, what a citation looks like — is contract, stated at
754
+ §The amendment lifecycle and shown to the author in
755
+ `templates/SPEC-amendment.md`.
756
+
757
+ The failure it closes is attested: an update target no delta claims **reaches
758
+ build as an orphan a batch adopts on its own authority**, which is the
759
+ template's own words for it. That is not hypothetical — one iteration dropped a
760
+ tightened-gates declaration across all three of its build batches, and a fourth
761
+ batch repaired it at validate.
762
+
763
+ **Three arms and a valve.**
764
+
765
+ - **A — the grammar.** Red (exit 1) when a `###` heading under `## What changes`
766
+ does not match `### (<N>) <title>`, or when the delta numbers, read in
767
+ document order, are not `1..n` unique and ascending. This is the arm that makes
768
+ B and C possible at all. Only the **first** ordering breach in a file is
769
+ reported: inserting one delta shifts every number after it, so reporting each
770
+ would bury the single edit that caused them.
771
+ - **B — the uncited target.** Red when a top-level `-` bullet under
772
+ `## Existing sections updated` carries no citation. The bullet's entry is the
773
+ bullet line plus its indented continuation, so a citation that wrapped across a
774
+ newline is still one subject — the same wrap-straddling boundary
775
+ §check-unmarked-claim crosses, for the same reason.
776
+ - **C — the dangling citation.** Red when a citation names an `<N>` no
777
+ `### (<N>)` heading defines, `all deltas` in an amendment that defines none
778
+ included. Without C, arms A and B both pass on an amendment whose targets cite
779
+ deltas that were renumbered out from under them.
780
+ - **Valve** — `<!-- update-target-exempt: <reason> -->` on the bullet's first
781
+ line or the one above, riding the shared exempt-window (§lib/spec.sh — the line
782
+ or the one above), and the reason is mandatory (the `comment-tier-exempt:`
783
+ convention). An exempt bullet leaves the target count as well as the finding.
784
+
785
+ A fenced block is skipped whole, on the ground §The amendment lifecycle already
786
+ gives the fence its exemption for: an amendment may embed a wire-contract delta
787
+ until merge, and a heading or a bullet inside one is grammar being shown rather
788
+ than a delta being defined.
789
+
790
+ **Fail-closed (exit 2):** a scan root that is not a directory; an amendment
791
+ carrying `## Existing sections updated` but no `## What changes`, where no entry
792
+ *can* be owned and no arm could say which to blame; a file the finder returns and
793
+ the reader cannot read; and **an unwalkable scan root**, where
794
+ §check-amendment-queue's best-effort finder returns empty instead. That last
795
+ divergence is deliberate and is the one to read carefully: the queue gate can
796
+ afford an empty amendment set because its other direction contradicts it, while
797
+ here an empty set hides every violation silently. The two spellings of the walk
798
+ live at §lib/spec.sh, which owns the asymmetry.
799
+
800
+ **No new knob, and the reason is not laziness.** The corpus is `spec_amendments`
801
+ (§lib/spec.sh) — the same finder §check-amendment-queue uses, already applying
802
+ the `templates/` exclusion that keeps a shipped `SPEC-amendment.md` skeleton from
803
+ being read as a live amendment, so the skeleton's illustrative headings cannot
804
+ red the gate that governs its copies. The two heading names are **kit constants,
805
+ not config**: they are canon-kit's own template's headings, and a consumer
806
+ editing them has edited canon-kit's artifact rather than configured it. The
807
+ contrast with §check-spec-dod-singleton's configurable Definition-of-Done heading
808
+ is real, and the line is where the surface is authored — that heading appears in
809
+ **consumer-authored canonical specs**, these appear in **copies of a kit-shipped
810
+ skeleton**. A knob is available later behind an attested consumer rename; adding
811
+ one now would be a knob whose only reader is §check-knob-citation.
812
+
813
+ **Deliberately not asserted: roster completeness.** The gate cannot check that
814
+ the update-target roster names every surface the change obliges a write to —
815
+ that is a claim about the world, not about the file, and no scanner reaches it.
816
+ It asserts the decidable half (every listed target is owned) and the align stage
817
+ keeps the other half, whose duty is unchanged: arm B catches a target that was
818
+ *listed and unowned*, never one that was never listed at all. Two stronger arms
819
+ were weighed and refused. Requiring **every delta to be cited by some target** is
820
+ false — a delta adding a wholly new section legitimately touches no existing one.
821
+ Requiring **every path or `§` reference in a delta body to appear in the roster**
822
+ would be high-false-positive, because a delta body names many surfaces for
823
+ context, and a gate that cries wolf trains its readers to bypass it (gate-sdk/SPEC.md
824
+ §When a gate earns its place).
825
+
826
+ **Criterion 4** (gate-sdk/SPEC.md §The port-candidate criteria) **clears**: the
827
+ corpus is `spec_amendments`, which reaches no gate declaration path. **Born
828
+ native**, no shell form authored — a crate-carrying tree births a gate native by
829
+ default and none of the three exception classes applies. Its `good/`+`bad/` pair
830
+ is its oracle: the `bad/` case carries a malformed heading, a non-sequential
831
+ delta number, an uncited target and a dangling citation together, so each arm has
832
+ an executable statement, while the `good/` case exercises the wrapped citation,
833
+ the list and possessive forms, `all deltas`, the fenced decoy and the valve.
834
+ `check-amendment-update-target.test.sh` holds the fail-closed exits and the
835
+ empty-corpus clean, which a one-pair harness cannot spell.
836
+
837
+ Producer of nothing but a verdict; its consumer is the committing session through
838
+ the output contract, on the generated pre-commit hook, `run-gates.sh` and CI, and
839
+ `run-gate-tests.sh` through the fixture pair. Its input is `spec_amendments`'
840
+ output — an existing producer with an existing enabling path, so nothing new must
841
+ be configured for the gate to see a live corpus. `precommit` tier.
842
+
663
843
  ### check-spec-dod-singleton
664
844
 
665
845
  Invariant: no canonical spec carries the configured Definition-of-Done
@@ -925,11 +1105,22 @@ the emitter recomputes: a corpus size, a sorted membership list, a digest over
925
1105
  the swept set. This is the axis no scanner reaches and it costs nothing extra —
926
1106
  the same arms, with a set-valued rather than integer-valued oracle. Because the
927
1107
  config bridge refuses an element containing a tab and tab is this protocol's own
928
- field separator, a set-valued oracle joins its members with something else.
1108
+ field separator, a set-valued oracle joins its members with something else. This
1109
+ repo's first such inhabitant is `gate-substrates`, the live substrate set the
1110
+ enforcement core runs on, its members joined with `+`; it is the shape that makes
1111
+ a **definitional or qualitative** sentence self-correcting, since such a sentence
1112
+ carries no cardinal for arm C to check and would otherwise be marked with nothing
1113
+ an emitter could recompute.
929
1114
 
930
1115
  **The known limit, stated rather than hidden: a claim nobody marks is uncaught
931
- here.** What narrows it is §check-manifest-count's discharge, which makes marking
932
- pressured rather than voluntary wherever the ban already bites.
1116
+ here.** It is narrowed from both sides, along different axes.
1117
+ §check-manifest-count's discharge makes marking pressured rather than voluntary
1118
+ wherever the ban already bites — a narrowing by **shape**, reaching whatever
1119
+ carries a bare cardinal over a governed collection. §check-unmarked-claim narrows
1120
+ by **subject**, reaching a claim a consumer has declared must not go unoracled
1121
+ whether or not it carries a number. Neither closes the limit; between them the
1122
+ uncaught remainder is a claim that is both unnumbered and undeclared, which is a
1123
+ smaller set than either alone leaves.
933
1124
 
934
1125
  The scanned surface is its own glob knob, `CANON_KIT_MEASURED_SURFACE_GLOBS`,
935
1126
  **not** the manifest set. The motivating class ranges over SPEC sections and
@@ -981,6 +1172,129 @@ under one of three stated classes (gate-sdk/SPEC.md §The port-candidate
981
1172
  criteria). The refusal above is unaffected in its own terms: what settles the
982
1173
  second gate is the ruling, never this section.
983
1174
 
1175
+ ### check-unmarked-claim
1176
+
1177
+ Invariant: on the scanned prose surface, a paragraph matching a
1178
+ consumer-declared **claim-class** pattern carries a `measured:` marker. The class
1179
+ this closes is the axis §check-measured-claim names as its own known limit: the
1180
+ marker is voluntary, so the claims that most need an oracle are exactly the ones
1181
+ an author never thought to mark. This gate makes marking **pressured inside a
1182
+ declared class**, the same narrowing §check-manifest-count already performs for
1183
+ the bare-cardinal shape — there by *shape*, here by *subject*.
1184
+
1185
+ **It declares a class; it does not ban a phrase, and the difference is the whole
1186
+ design.** A ban is discharged forever the moment the banned phrase is deleted, and
1187
+ it can only ever face one direction. A class assertion fires again on the next
1188
+ author who states the same thing in new words, and it covers a claim that
1189
+ overstates in *either* direction, because what puts a sentence in the class is
1190
+ what it asserts rather than which words it reaches for. The two properties are
1191
+ one property: the class is written over the claim, never over a canonical
1192
+ phrasing.
1193
+
1194
+ **Two arms and a valve.**
1195
+
1196
+ - **A — an unmarked claim.** Red (exit 1) when a paragraph matches a declared
1197
+ class ERE and no `measured:` marker binds it. The finding names the class id,
1198
+ the file, and the physical line where the match starts, and its `help:` line
1199
+ states the three remedies below. A paragraph yields at most one finding, at the
1200
+ first class in roster order that matches it.
1201
+ - **B — the vocabulary fails to load.** Exit 2 on a command error, an unparsable
1202
+ line, a non-slug id, or a repeated id — inherited unchanged from
1203
+ `spec_claim_vocabulary` (§lib/spec.sh), which already names the failing
1204
+ vocabulary by its `<label>` in every message — and on a declared ERE that does
1205
+ not compile, which is the same unreadable-roster failure one step later.
1206
+ - **Valve** — `<!-- unmarked-claim-exempt: <reason> -->` on the flagged line or
1207
+ directly above it, riding the shared exempt-window (§lib/spec.sh — the line or
1208
+ the one above), and the reason is mandatory (the `comment-tier-exempt:`
1209
+ convention — a deliberate keep carries its cause in-line, a reasonless valve is
1210
+ red).
1211
+
1212
+ **The three remedies, and the gate is indifferent between them.** Rewrite the
1213
+ sentence out of the class (the doctrine's preference — a claim not made cannot go
1214
+ stale); attach a `measured:` marker binding it to an oracle; or land a reasoned
1215
+ valve. Naming all three on the finding is what keeps the gate from reading as a
1216
+ ban, which it deliberately is not.
1217
+
1218
+ **Matching is whitespace-normalized across lines, and this is load-bearing rather
1219
+ than a nicety.** A claim spans a prose wrap as readily as it fits on one line, so
1220
+ a line-keyed predicate is blind by construction on whatever fraction of its corpus
1221
+ happens to wrap — a fraction no author controls and no reviewer can see. The ERE
1222
+ is matched against the paragraph with every run of whitespace, the newline at a
1223
+ wrap included, collapsed to one space; the finding is reported at the physical
1224
+ line the match starts on. This is not a new mechanism: it is the boundary
1225
+ §check-manifest-count already crosses for a total whose cardinal and noun straddle
1226
+ a wrap, reported at the cardinal's physical line, and the shared adapter
1227
+ (§lib/spec.sh) is where that normalization already lives. The subject is
1228
+ **ASCII-lowercased** before matching and a class pattern is authored in lower
1229
+ case, so a sentence's opening capital is not a way past the class.
1230
+
1231
+ **A paragraph is the unit, and it is §check-measured-claim's paragraph**, so the
1232
+ both gates agree on what a marker binds: the block ending at a blank line, a fence,
1233
+ or the end of file, with the marker line riding inside the block it heads — which
1234
+ is what makes carrying a marker a property of the paragraph rather than of a line.
1235
+ Fenced blocks are skipped for the reason that section gives: a fence is grammar
1236
+ being shown, not a claim being made.
1237
+
1238
+ **Coverage-only, and the reason is a constraint rather than a preference.** The
1239
+ gate asserts that a matched claim carries *a* marker; it does not assert *which*
1240
+ key. `spec_claim_vocabulary` is a two-field loader that **rejects a line carrying
1241
+ an extra tab**, so a class cannot declare a required key beside its ERE without a
1242
+ third field the loader refuses. Adding one would fork the loader every claim gate
1243
+ shares — the cost §lib/spec.sh explicitly took the shared-loader shape to avoid.
1244
+ The key is checked by `check-measured-claim` on the very next arm (its arm B fails
1245
+ closed on a key nobody emits, its arm A on a value the oracle now contradicts),
1246
+ so the composition covers it and neither gate duplicates the other.
1247
+
1248
+ The scanned surface is `CANON_KIT_MEASURED_SURFACE_GLOBS` — **shared with
1249
+ `check-measured-claim`, not forked**, because they compose: a claim this
1250
+ one pressures into a marker is a claim that one then re-measures, and holding them
1251
+ over one corpus is what makes that handoff total. The cost of sharing is stated
1252
+ rather than hidden: a consumer wanting claim classes over a *different* surface
1253
+ than its measured claims cannot express that, and the split is available later
1254
+ behind an attested need.
1255
+
1256
+ **The roster is consumer config and the seam here is sharper than its siblings'.**
1257
+ Every class id and every pattern arrives through `CANON_KIT_CLAIM_CLASSES_CMD`
1258
+ (§Layout and configuration); the scan, the normalization, the marker lookup and
1259
+ the verdict are kit mechanism. Beyond the provenance seam every claim gate
1260
+ observes, this one has a reason of its own: **this SPEC is itself governed prose**,
1261
+ so a kit that enumerated a consumer's claim phrasings would match its own class
1262
+ while describing it and need a valve to say what it does. Holding the roster in
1263
+ consumer config means the kit's prose never spells a member. An unset command
1264
+ means no class is declared and the gate reports clean — the inactive-by-default
1265
+ posture its `*_CMD` siblings take, and the correct posture rather than a gap: only
1266
+ a consumer's own vocabulary can turn this gate on.
1267
+
1268
+ **The honest limit, and it is a property of what a roster can hold.** A claim
1269
+ stated in a **single implementation-tool token** with no predicate around it is out
1270
+ of reach: rostering the bare token would fire on every passing mention of the tool,
1271
+ and a gate that cries wolf is a gate its readers learn to bypass — the failure §When
1272
+ a gate earns its place (gate-sdk/SPEC.md) names as a defect in the gate rather than
1273
+ in the corpus. The general move for a noisy member is to roster **the predicate the
1274
+ noisy subject attaches to** rather than the subject, which recovers the site with
1275
+ none of the noise; a bare token offers no predicate to move to, and that is the
1276
+ residue. Two further bounds are deliberate: the gate cannot tell a **true** class
1277
+ member from a false one — it asserts the claim is *bound* to an oracle and
1278
+ `check-measured-claim` then asserts the oracle agrees — and neither reaches a
1279
+ sentence whose prose is true today and whose stated *reason* is wrong, which stays
1280
+ a human judgment.
1281
+
1282
+ **Criterion 4** (gate-sdk/SPEC.md §The port-candidate criteria) **clears**: the
1283
+ corpus is a pure glob expansion of the configured surface set, reaching no gate
1284
+ declaration path in this tree — the same verdict and the same reasoning as
1285
+ §check-prose-tells, and flippable by the same consumer config. **Born native**, with
1286
+ no shell form authored: a crate-carrying tree births a gate native by default and
1287
+ none of the three exception classes applies here (gate-sdk/SPEC.md §The
1288
+ port-candidate criteria). Its `good/`+`bad/` pair is its oracle — the `bad/` case
1289
+ carries a claim wrapped across a newline, so the line-keyed blindness above is
1290
+ executable rather than asserted — with `check-unmarked-claim.test.sh` holding the
1291
+ fail-closed vocabulary arms and the two distinct clean skips a pair cannot spell.
1292
+
1293
+ Producer of nothing but a verdict; its consumer is the committing session through
1294
+ the output contract, on the generated pre-commit hook, `run-gates.sh` and CI. Each
1295
+ paragraph is read at the single scan transition, no persistent state. `precommit`
1296
+ tier.
1297
+
984
1298
  ### check-prose-enum
985
1299
 
986
1300
  Invariant: within one manifest-prose paragraph, a delimited hand list naming two
@@ -0,0 +1,3 @@
1
+ # graph: couples=SPEC-*.md,*/SPEC-*.md,native/src/gates/amendment_update_target.rs,native/src/spec.rs dir=one valve=none tier=precommit
2
+ # install: zero-config
3
+ # spec: canon-kit/SPEC.md §check-amendment-update-target — every entry under an amendment's `## Existing sections updated` cites at least one delta and every cited delta is defined under `## What changes` in the same amendment, so an update target no delta claims stops at the gate rather than reaching build as an orphan a batch adopts on its own authority
@@ -0,0 +1,3 @@
1
+ # graph: couples=*.md,scripts/*.sh,kit:*.sh dir=one valve=none tier=precommit
2
+ # install: on-surface
3
+ # spec: canon-kit/SPEC.md §check-unmarked-claim — a paragraph matching a consumer-declared claim class carries a `measured:` marker: the class is the trigger and the marker one of three remedies, so a claim that must not go stale is bound to an oracle rather than left to authorial memory
@@ -0,0 +1,26 @@
1
+ # SPEC amendment: thing
2
+
3
+ ## What changes
4
+
5
+ ### A1. the bold-token grammar {design-bearing}
6
+
7
+ The grammar arm A rejects: a delta the citation rule cannot name.
8
+
9
+ ### (1) The first delta
10
+
11
+ Body prose.
12
+
13
+ ### (3) The delta numbered past the gap
14
+
15
+ A gap means a delta was split or dropped without its citations moving.
16
+
17
+ ## Existing sections updated
18
+
19
+ - **surface/one.md** — the target a batch would adopt on its own authority,
20
+ named here with no delta behind it at all.
21
+ - **surface/two.md** — carried by a delta that was renumbered out from under
22
+ it (delta 7).
23
+
24
+ ## Definition of Done
25
+
26
+ - [ ] **Causal completeness** — the fixture asserts nothing here.
@@ -0,0 +1,8 @@
1
+ delta headings outside the '### (<N>) <title>' form
2
+ SPEC-thing.md:5: ### A1. the bold-token grammar {design-bearing}
3
+ delta numbers that are not 1..n unique and ascending
4
+ SPEC-thing.md:13: delta (3) stands where (2) is owed
5
+ update targets citing no delta
6
+ SPEC-thing.md:19: - **surface/one.md**
7
+ citations naming a delta the amendment does not define
8
+ SPEC-thing.md:22: cites delta 7, which no '### (7)' heading defines
@@ -0,0 +1,47 @@
1
+ # SPEC amendment: widget
2
+
3
+ Pairs with the queue entry this fixture does not carry — the pairing is
4
+ `check-amendment-queue`'s axis, not this gate's.
5
+
6
+ ## What changes
7
+
8
+ ### (1) The first delta
9
+
10
+ Body prose.
11
+
12
+ ### (2) The second delta, whose body embeds a fenced block
13
+
14
+ The template sanctions an embedded wire-contract delta until merge, so a fence
15
+ must read as neither a delta heading nor an update target:
16
+
17
+ ```
18
+ ### (9) not a heading
19
+ - **not/a/target.md** — and no citation anywhere in it
20
+ ```
21
+
22
+ ### (3) The third delta
23
+
24
+ Body prose.
25
+
26
+ ## Producers and consumers
27
+
28
+ Out of this gate's reach; present so the fixture is a whole amendment.
29
+
30
+ ## Existing sections updated
31
+
32
+ Each names the delta that owns it.
33
+
34
+ - **component/SPEC.md §One** — a citation that wraps across the newline the
35
+ entry is written to (delta
36
+ 1).
37
+ - **component/SPEC.md §Two** — a list citation (deltas 2, 3) and a possessive
38
+ one, since delta 2's argument is what this target carries.
39
+ - **component/README.md** — a list joined by the word rather than the comma
40
+ (deltas 1 and 3).
41
+ <!-- update-target-exempt: the valve, exercised — this target is owned by no delta on purpose -->
42
+ - **component/CHANGELOG.md** — deliberately owned by no delta, and tagged.
43
+ - **The generated mirror** — stale the moment any delta lands (all deltas).
44
+
45
+ ## Definition of Done
46
+
47
+ - [ ] **Causal completeness** — the fixture asserts nothing here.
@@ -0,0 +1 @@
1
+ AMENDMENT-UPDATE-TARGET: clean (1 amendment(s), 3 delta(s) defined; 4 update target(s)