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
@@ -0,0 +1,6 @@
1
+ # fixture SPEC surface — assertion H opens the section a declaration's pointer names
2
+
3
+ ## check-ungrounded
4
+
5
+ A section that discusses the gate and never states a hold, so the hop from the
6
+ declaration lands somewhere that does not carry the ground.
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ # graph: couples=docs/*.md dir=one valve=none tier=precommit
3
+ # port-until: fixture-held-entry
4
+ echo "NOSPEC: clean (stub)"
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ # graph: couples=docs/*.md dir=one valve=none tier=precommit
3
+ # port-until: fixture-held-entry
4
+ # spec: kit-spec.md §check-ungrounded — fixture: the pointer resolves and the section states no hold
5
+ echo "UNGROUNDED: clean (stub)"
@@ -5,3 +5,5 @@ check-heldtwice
5
5
  check-dup
6
6
  check-orphan
7
7
  check-twice
8
+ check-nospec
9
+ check-ungrounded
@@ -1,5 +1,5 @@
1
1
  GATE-SUBSTRATE-PARITY: clean
2
- 1 of the 2 shell declaration(s) declare '# no-port:' with a cause and 1 declare '# port-until:' with a slug, neither on any descriptor nor both on one declaration
2
+ 1 of the 2 shell declaration(s) declare '# no-port:' with a cause and 1 declare '# port-until:' with a slug, neither on any descriptor nor both on one declaration; 1 of those held declaration(s) reach their ground in one hop, the section their own '# spec:' field names stating the hold
3
3
  1 descriptor(s) in parity with the 2-subcommand roster (2 in scope, 0 out of scope — an unvendored kit, or a consumer declaration from another tree — owner column unavailable), 1 reference-only
4
4
  1 substrate-sensitive member(s) all dispositioned
5
5
  1 implementation source(s) free of manifest-class annotation
@@ -0,0 +1,12 @@
1
+ # fixture SPEC surface — assertion H resolves a declaration's own `# spec:` pointer here
2
+
3
+ ## check-held
4
+
5
+ The held member's ground, stated in the section its declaration points at: this
6
+ fixture gate is held on shell, so it declares `# port-until:` naming the entry
7
+ that owns the blocker.
8
+
9
+ ## check-other
10
+
11
+ A sibling section, present so the extraction has a same-level heading to stop at
12
+ rather than running to end of file.
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
  # graph: couples=docs/*.md dir=one valve=none tier=precommit
3
3
  # port-until: fixture-held-entry
4
+ # spec: kit-spec.md §check-held — fixture: the held declaration whose own pointer reaches its ground
4
5
  echo "HELD: clean (stub)"
@@ -1 +1,6 @@
1
1
  match a banned pattern
2
+ tree/leak.txt:1:Install notes: clone into /home/bob/projects and run the setup script.
3
+ tree/multi.txt:1:two leaks on one line: /home/alice/one and /home/bob/two
4
+ tree/multi.txt:3:one leak on its own line: /home/carol/three
5
+ tree/multi.txt:4:one leak on its own line: /home/carol/three
6
+ tree/second-leak.txt:2:a single line: the promo URL claude.com/claude-code is banned here too.
@@ -0,0 +1,4 @@
1
+ two leaks on one line: /home/alice/one and /home/bob/two
2
+ a clean line between them
3
+ one leak on its own line: /home/carol/three
4
+ one leak on its own line: /home/carol/three
@@ -0,0 +1,2 @@
1
+ A second leaking file, so the red output is a multi-file record set rather than
2
+ a single line: the promo URL claude.com/claude-code is banned here too.
@@ -1 +1 @@
1
- TREE-TERMS: clean
1
+ TREE-TERMS: clean (2 tracked file(s) scanned under tree; none match the 4 banned pattern(s))
@@ -1,3 +1,6 @@
1
1
  # banned-pattern fixture (grep -E, one per line; '#' + blank ignored)
2
2
  /(home|Users)/[A-Za-z0-9._-]+
3
3
  claude\.com/claude-code
4
+
5
+ claude\.ai/
6
+ ^[A-Za-z][A-Za-z-]*: .*[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
@@ -0,0 +1,4 @@
1
+ Near misses for the anchored trailer shape, which is the one an ERE port can
2
+ silently get wrong by dropping the leading anchor:
3
+ Session-Id: 3f2504e0-4f89-41d3-9a0c-0305e82c3301
4
+ a-bare-uuid 3f2504e0-4f89-41d3-9a0c-0305e82c3301 with no trailer key
@@ -0,0 +1,2 @@
1
+ # A pattern list contains, by construction, what it bans: /home/bob/projects.
2
+ # Its basename is self-exempt, so the gate never reads it as content.
@@ -0,0 +1,3 @@
1
+ # The self-exemption is a prefix glob, not an exact-name match: this basename
2
+ # begins msg-patterns and is exempt too, though it is nobody's exact name.
3
+ # It carries /home/bob/projects for the same constructional reason.
@@ -0,0 +1,3 @@
1
+ A file under a pruned directory. It carries /home/bob/projects, a shape the
2
+ pattern set bans, and the gate must still report clean: the prune is a path
3
+ filter, so a leak here is out of the scanned corpus rather than tolerated in it.
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env bash
2
+ # Behavioral test of check-tree-terms over the arms the good/+bad/ pair cannot
3
+ # reach. A case dir is not its own repository — `git ls-files` inside one returns
4
+ # the outer repo's index scoped to that subdir — so the non-repository arm is
5
+ # structurally unreachable from a case, and both cases pass a positional
6
+ # pattern-file, which short-circuits the whole env-knob resolution path. The last
7
+ # arm pins what a pair cannot: each expect.txt line is an independent substring
8
+ # assertion, so record *order* is assertable only here.
9
+ #
10
+ # Run by run-gate-tests.sh (any <tests-dir>/*.test.sh; must exit 0).
11
+ set -uo pipefail
12
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
13
+
14
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # gate-sdk/
15
+ CHECKS="$DIR/checks"
16
+ CASES="$DIR/gate-tests/check-tree-terms"
17
+ SANDBOX="$(mktemp -d)"
18
+ trap 'rm -rf "$SANDBOX"' EXIT
19
+
20
+ fails=0
21
+
22
+ expect() { # expect <label> <want-rc> <substring> <got-rc> <output>
23
+ if [[ "$4" -ne "$2" ]]; then
24
+ echo " FAIL [$1]: want exit $2, got $4 -- $5"; fails=$((fails + 1))
25
+ elif ! grep -qF -- "$3" <<<"$5"; then
26
+ echo " FAIL [$1]: exit $2 but output lacks '$3': $5"; fails=$((fails + 1))
27
+ fi
28
+ }
29
+
30
+ # --- a non-repository cwd: fail-closed, never a clean report over zero files ---
31
+ mkdir -p "$SANDBOX/outside"
32
+ printf 'a-pattern\n' > "$SANDBOX/outside/patterns.list"
33
+ out="$( cd "$SANDBOX/outside" && gate_run check-tree-terms "$CHECKS" . patterns.list 2>&1 )"; rc=$?
34
+ expect non-repository 2 'not a git repository' "$rc" "$out"
35
+
36
+ # --- the env-knob resolution path, reached only with no positional pattern-file ---
37
+ mkdir -p "$SANDBOX/repo"
38
+ git -C "$SANDBOX/repo" init -q
39
+ printf 'nothing banned here\n' > "$SANDBOX/repo/a.txt"
40
+ git -C "$SANDBOX/repo" add a.txt
41
+ out="$( cd "$SANDBOX/repo" \
42
+ && gate_env GATE_SDK_MSG_PATTERN_FILES="$SANDBOX/repo/absent.list" \
43
+ && gate_run check-tree-terms "$CHECKS" . 2>&1 )"; rc=$?
44
+ expect missing-pattern-file 2 'required tracked pattern file missing' "$rc" "$out"
45
+
46
+ # --- an empty pattern set leaves the tree unchecked: clean, not fail-closed.
47
+ # The fail-closed obligation is on a missing file, never on an empty one.
48
+ printf '# only a comment\n\n' > "$SANDBOX/repo/empty.list"
49
+ out="$( cd "$SANDBOX/repo" \
50
+ && gate_env GATE_SDK_MSG_PATTERN_FILES="$SANDBOX/repo/empty.list" \
51
+ && gate_run check-tree-terms "$CHECKS" . 2>&1 )"; rc=$?
52
+ expect empty-pattern-set 0 '0 banned pattern(s) configured; tree unchecked' "$rc" "$out"
53
+
54
+ # --- a banned shape inside a tracked binary: a path-only record, and still red.
55
+ # Dead on this tree (no tracked binaries) and live in a consumer's, which is why
56
+ # it is asserted here rather than discovered there; the fixture pair stays at the
57
+ # three-way split its own measurement fixed. The banned shape is composed, not
58
+ # spelled: this file's directory is pruned, but the composition is the same rule
59
+ # the module itself carries and reads better held in one place.
60
+ printf 'PNG\x00\x01 clone into /%s/bob/x and more\x00bytes\n' home > "$SANDBOX/repo/blob.bin"
61
+ printf '/(home|Users)/[A-Za-z0-9._-]+\n' > "$SANDBOX/repo/banned.list"
62
+ git -C "$SANDBOX/repo" add blob.bin
63
+ out="$( cd "$SANDBOX/repo" && gate_run check-tree-terms "$CHECKS" . banned.list 2>&1 )"; rc=$?
64
+ expect binary-record 1 'blob.bin' "$rc" "$out"
65
+ if grep -qE '^blob\.bin:[0-9]+:' <<<"$out"; then
66
+ echo " FAIL [binary-record]: a binary match must not carry :lineno:line -- $out"
67
+ fails=$((fails + 1))
68
+ fi
69
+
70
+ # --- multi-record order over the tracked bad/ case: path order, then line order,
71
+ # one record per matching *line* however many patterns hit it, and no dedup of
72
+ # two identical lines. Read off the pair so the corpus has one home.
73
+ out="$( cd "$CASES/bad" && gate_run check-tree-terms "$CHECKS" tree patterns.list 2>&1 )"; rc=$?
74
+ got="$(grep -E '^tree/' <<<"$out")"
75
+ want="$(printf '%s\n' \
76
+ 'tree/leak.txt:1:' \
77
+ 'tree/multi.txt:1:' \
78
+ 'tree/multi.txt:3:' \
79
+ 'tree/multi.txt:4:' \
80
+ 'tree/second-leak.txt:2:')"
81
+ if [[ "$rc" -ne 1 ]]; then
82
+ echo " FAIL [record-order]: want exit 1, got $rc -- $out"; fails=$((fails + 1))
83
+ elif [[ "$(sed 's/^\([^:]*:[0-9]*:\).*/\1/' <<<"$got")" != "$want" ]]; then
84
+ echo " FAIL [record-order]: record sequence is not path-then-line order:"
85
+ printf ' %s\n' "$got"
86
+ fails=$((fails + 1))
87
+ fi
88
+
89
+ if [[ "$fails" -gt 0 ]]; then
90
+ echo "check-tree-terms.test.sh: $fails case(s) failed"
91
+ exit 1
92
+ fi
93
+ echo "check-tree-terms.test.sh: clean (the arms a case dir cannot reach: a non-repository cwd, the env-knob resolution path through a missing required pattern file, an empty pattern set leaving the tree unchecked, a banned shape inside a tracked binary yielding a path-only record, and the bad pair's record order — 6 assertions over 5 cases)"
94
+ exit 0
@@ -77,8 +77,31 @@ if out="$(qg_run)"; then echo "smoke(quiet): red battery exited green" >&2; exit
77
77
  grep -q '===== check-smoke-fail =====' <<<"$out" || { echo "smoke(quiet): red run lost the failing banner" >&2; exit 1; }
78
78
  grep -q 'SMOKE-FAIL: 1 stub finding' <<<"$out" || { echo "smoke(quiet): red output not verbatim" >&2; exit 1; }
79
79
  if grep -q 'SMOKE-PASS: clean' <<<"$out"; then echo "smoke(quiet): red run printed the passing gate's output" >&2; exit 1; fi
80
+
81
+ # spec: gate-sdk/SPEC.md §run-gates — --only selects by name off argv and refuses an unregistered
82
+ # one; the registry still holds the failing stub, so a leg that goes green proves the selection
83
+ # narrowed rather than that the battery happened to pass
84
+ only_run() { env -u GATE_SDK_VERBOSE GATE_SDK_GATES_DIR="$q" GATE_SDK_TMP_DIR="$q/tmp" bash "$SDK/bin/run-gates.sh" "$@"; }
85
+
86
+ out="$(only_run --only check-smoke-pass)" || { echo "smoke(--only): selecting the passing member of a red registry went red" >&2; exit 1; }
87
+ grep -q 'All 1 gates passed' <<<"$out" || { echo "smoke(--only): summary N is not the selected count" >&2; exit 1; }
88
+ if grep -q 'SMOKE-FAIL: 1 stub finding' <<<"$out"; then echo "smoke(--only): ran a member that was not selected" >&2; exit 1; fi
89
+
90
+ if out="$(only_run --only check-smoke-absent 2>&1)"; then echo "smoke(--only): an unregistered name did not refuse" >&2; exit 1; fi
91
+ grep -q "check-smoke-absent" <<<"$out" || { echo "smoke(--only): refusal did not name the name" >&2; exit 1; }
92
+ grep -q "$q/gates.list" <<<"$out" || { echo "smoke(--only): refusal did not name the registry" >&2; exit 1; }
80
93
  rm -rf "$q"
81
94
 
95
+ # spec: gate-sdk/SPEC.md §The bin/-tool contract — behavioural coverage of a bin/ tool's help and
96
+ # refusal, on the precedent that rule names: no gate reads it, so these two legs are what keeps
97
+ # `--help` from falling back through to the gates-dir positional
98
+ out="$(bash "$SDK/bin/run-gates.sh" --help 2>/dev/null)" || { echo "smoke(--help): a help request did not exit 0" >&2; exit 1; }
99
+ grep -q '^usage: run-gates.sh' <<<"$out" || { echo "smoke(--help): usage did not reach stdout" >&2; exit 1; }
100
+
101
+ if err="$(bash "$SDK/bin/run-gates.sh" --smoke-nope 2>&1 >/dev/null)"; then echo "smoke(refusal): an unrecognized option was not refused" >&2; exit 1; fi
102
+ grep -q 'unrecognized option: --smoke-nope' <<<"$err" || { echo "smoke(refusal): refusal did not name the option" >&2; exit 1; }
103
+ grep -q '^usage: run-gates.sh' <<<"$err" || { echo "smoke(refusal): usage did not reach stderr" >&2; exit 1; }
104
+
82
105
  # spec: gate-sdk/SPEC.md §gen-pre-commit — the emitted hook's capture wrapper: green is one summary line, a red gate's output reprints verbatim
83
106
  cat > scripts/smoke-hook-probe.sh <<'EOF'
84
107
  #!/usr/bin/env bash
@@ -50,9 +50,10 @@ Vendor the kit beside [gate-sdk](../gate-sdk/), then:
50
50
 
51
51
  Configuration follows the established kit pattern — override any knob in
52
52
  `guard-config.sh` (log paths, settings paths, `GUARD_KIT_RO_SCRIPTS`,
53
- `GUARD_KIT_RO_BINS`, `GUARD_KIT_SCRATCH_DIRS`, `GUARD_KIT_BREADTH_PROBES`);
54
- defaults are this repo's layout, and the probe set defaults to empty because
55
- its contents are your project's vocabulary, not the kit's.
53
+ `GUARD_KIT_RO_BINS`, `GUARD_KIT_SCRATCH_DIRS`, `GUARD_KIT_BREADTH_PROBES`,
54
+ `GUARD_KIT_BREADTH_DECLARED`); defaults are this repo's layout, and the probe set
55
+ and the declaration map both default to empty because their contents are your
56
+ project's vocabulary, not the kit's.
56
57
 
57
58
  ## Use
58
59