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
@@ -1,149 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=kit:SPEC.md,scripts/*.sh,kit:*.sh,native/src/gates/*.rs dir=bi valve=none tier=align-only
3
- # install: zero-config
4
- # port-until: cohort-held-members-port-prerequisites
5
- # spec: gate-sdk/SPEC.md §check-gate-assertions — couple each §<gate> enumerated-assertion span+count to the gate code's `# assertion` markers
6
- #
7
- # usage: check-gate-assertions.sh [spec [scripts-dir]] (defaults: kit SPEC.md set; kit checks/ dirs)
8
- # requires GNU awk (3-arg match)
9
- set -uo pipefail
10
-
11
- SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
12
- # shellcheck source=../lib/gate.sh
13
- source "$SDK/lib/gate.sh"
14
-
15
- GATES_DIR="$(gate_sdk_gates_dir)"
16
- SPECS=()
17
- if [[ $# -gt 0 ]]; then
18
- SPECS=("$1")
19
- else
20
- [[ -f "$GATES_DIR/SPEC.md" ]] && SPECS+=("$GATES_DIR/SPEC.md")
21
- while IFS= read -r k; do
22
- [[ -f "$k/SPEC.md" ]] && SPECS+=("$k/SPEC.md")
23
- done < <(gate_kit_roots)
24
- fi
25
- SCRIPTS_DIR="${2:-}"
26
- [[ ${#SPECS[@]} -gt 0 ]] || { echo "check-gate-assertions: no SPEC.md found (run from repo root)" >&2; exit 2; }
27
- for s in "${SPECS[@]}"; do
28
- [[ -f "$s" ]] || { echo "check-gate-assertions: not found: $s (run from repo root)" >&2; exit 2; }
29
- done
30
-
31
- extract_contracts() { awk '
32
- function wn(w) {
33
- if (w=="two")return 2; if (w=="three")return 3; if (w=="four")return 4
34
- if (w=="five")return 5; if (w=="six")return 6; if (w=="seven")return 7
35
- if (w=="eight")return 8; if (w=="nine")return 9; return 0
36
- }
37
- /^### / { if (h!="") emit(); h=$0; sub(/^### /,"",h); p=""; started=0; done=0; next }
38
- /^## / { if (h!="") { emit(); h="" } next }
39
- {
40
- if (h=="" || done) next
41
- if (!started) { if ($0 ~ /^[[:space:]]*$/) next; started=1; p=$0; next }
42
- if ($0 ~ /^[[:space:]]*$/) { done=1; next }
43
- p = p " " $0
44
- }
45
- END { if (h!="") emit() }
46
- function emit( low,rx,arr,lab,after,ns,nl,n,cnt,csv,i,labs) {
47
- low = tolower(p)
48
- rx = "(^|[^a-z])(two|three|four|five|six|seven|eight|nine)[[:space:]]+([a-z]+[[:space:]]+)?(assertion|assertions|axes|axis|checks)([^a-z]|$)"
49
- if (!match(low, rx)) return
50
- ns = RSTART; nl = RLENGTH
51
- if (match(substr(low, ns, nl), /(two|three|four|five|six|seven|eight|nine)/, arr)) n = wn(arr[1])
52
- after = substr(p, ns + nl - 1)
53
- if (match(after, /\([^)]*\)/, arr)) {
54
- if (arr[0] !~ /^\([A-Za-z0-9]\)$/) return
55
- } else return
56
- delete seen; cnt = 0; csv = ""
57
- while (match(after, /\(([A-Za-z0-9])\)/, arr)) {
58
- lab = arr[1]
59
- if (!(lab in seen)) { seen[lab]=1; cnt++; csv = (csv==""?lab:csv","lab) }
60
- after = substr(after, RSTART + RLENGTH)
61
- }
62
- if (cnt >= 2) printf "%s|%d|%s\n", h, n, csv
63
- }
64
- ' "$1"; }
65
-
66
- # spec: gate-sdk/SPEC.md §check-gate-assertions — a `.gate`-declared member carries its rule in
67
- # the implementation module, so the markers are looked for there: the same follow-the-rule-to-the-
68
- # module resolution §check-gate-output already owns, arriving here with the kit-roots cohort
69
- # spec: gate-sdk/SPEC.md §check-gate-assertions — crate presence is the manifest, never the directory, for the reason §check-gate-output states: a build artifact creates the directory. Exit 3 means the member declares a compiled rule this tree does not carry — a vendored consumer's normal state, since no consumer receives the crate — and is skipped-and-counted rather than red, because a marker set that is not in the tree is not one this gate can assert over.
70
- CRATE_MANIFEST="$(gate_native_crate)/Cargo.toml"
71
- resolve_gate_file() {
72
- if [[ -n "$SCRIPTS_DIR" ]]; then
73
- [[ -f "$SCRIPTS_DIR/$1.sh" ]] && { printf '%s\n' "$SCRIPTS_DIR/$1.sh"; return 0; }
74
- return 1
75
- fi
76
- local -a dirs
77
- local decl
78
- mapfile -t dirs < <(gate_check_dirs)
79
- decl="$(gate_resolve "$1" "${dirs[@]}")" || return 1
80
- if [[ "$decl" == *.gate ]]; then
81
- [[ -f "$CRATE_MANIFEST" ]] || return 3
82
- decl="$(gate_native_module "$1")"
83
- fi
84
- [[ -f "$decl" ]] || return 1
85
- printf '%s\n' "$decl"
86
- }
87
-
88
- findings=()
89
- out_of_reach=()
90
- coupled=0
91
- for spec in "${SPECS[@]}"; do
92
- contracts="$(extract_contracts "$spec")"; st=$?
93
- fail_closed "$st" check-gate-assertions awk
94
-
95
- while IFS='|' read -r gate n labels; do
96
- [[ -z "$gate" ]] && continue
97
- coupled=$((coupled + 1))
98
-
99
- lcount="$(awk -F, '{print NF}' <<< "$labels")"
100
- if [[ "$lcount" -ne "$n" ]]; then
101
- findings+=("$spec §$gate: count-word says $n but the (X) span enumerates $lcount label(s) [$labels] — the contract is internally inconsistent")
102
- fi
103
-
104
- file="$(resolve_gate_file "$gate")"; rst=$?
105
- if [[ "$rst" -eq 3 ]]; then
106
- out_of_reach+=("$gate")
107
- continue
108
- fi
109
- if [[ "$rst" -ne 0 ]]; then
110
- findings+=("$spec §$gate: enumerated contract but no gate code resolves for '$gate' (heading must name the script)")
111
- continue
112
- fi
113
-
114
- # spec: gate-sdk/SPEC.md §check-gate-assertions — the comment leader is the substrate's,
115
- # so both spellings are read: a marker is a code marker either way
116
- markers="$(grep -oE '(#|//)[[:space:]]*assertion[[:space:]]+[A-Za-z0-9]+:' "$file" \
117
- | sed -E 's/^.*assertion[[:space:]]+([A-Za-z0-9]+):$/\1/' | sort -u | paste -sd, -)"
118
-
119
- if [[ -z "$markers" ]]; then
120
- findings+=("$spec §$gate: contract enumerates [$labels] but $file carries zero \`# assertion\` markers (retrofit obligation)")
121
- continue
122
- fi
123
-
124
- want="$(tr ',' '\n' <<< "$labels" | sort -u | paste -sd, -)"
125
- have="$markers"
126
- if [[ "$want" != "$have" ]]; then
127
- missing="$(comm -23 <(tr ',' '\n' <<< "$want") <(tr ',' '\n' <<< "$have") | paste -sd, -)"
128
- extra="$(comm -13 <(tr ',' '\n' <<< "$want") <(tr ',' '\n' <<< "$have") | paste -sd, -)"
129
- msg="$spec §$gate: marker set [$have] != contract span [$want]"
130
- [[ -n "$missing" ]] && msg="$msg; missing marker(s): $missing"
131
- [[ -n "$extra" ]] && msg="$msg; extra marker(s): $extra"
132
- findings+=("$msg")
133
- fi
134
- done <<< "$contracts"
135
- done
136
-
137
- if [[ ${#findings[@]} -gt 0 ]]; then
138
- echo "check-gate-assertions: §<gate> assertion enumeration ↔ gate-code marker mismatch:"
139
- for f in "${findings[@]}"; do echo " $f"; done
140
- echo " help: add/align a '# assertion <label>: <tag>' marker per enumerated assertion in the gate code so its label set matches the §<gate> contract span (and the count-word), or fix the contract's enumeration"
141
- exit 1
142
- fi
143
-
144
- declared=""
145
- if [[ ${#out_of_reach[@]} -gt 0 ]]; then
146
- declared=", ${#out_of_reach[@]} declared out of reach with no crate at $CRATE_MANIFEST — ${out_of_reach[*]}"
147
- fi
148
- echo "GATE-ASSERTIONS: clean ($((coupled - ${#out_of_reach[@]})) of $coupled enumerated contract(s) coupled$declared)"
149
- exit 0
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=scripts/msg-patterns.list dir=one valve=none tier=precommit trigger=*
3
- # install: zero-config
4
- # port-until: cohort-held-members-port-prerequisites
5
- # spec: gate-sdk/SPEC.md §check-tree-terms — no tracked file matches the banned-pattern set (the tracked-files half of the leak guard; the pattern files and their templates are self-exempt)
6
- #
7
- # usage: check-tree-terms.sh [scan-root] [pattern-file...]
8
- # scan-root enumerated via git ls-files (default '.'); pattern-file args
9
- # override GATE_SDK_MSG_PATTERN_FILES (+ _LOCAL). Skips per spec: above.
10
- set -uo pipefail
11
-
12
- SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
13
- # shellcheck source=../lib/gate.sh
14
- source "$SDK/lib/gate.sh"
15
-
16
- SCANROOT="${1:-.}"
17
- shift || true
18
-
19
- git rev-parse --git-dir >/dev/null 2>&1 || {
20
- echo "check-tree-terms: not a git repository — cannot enumerate tracked files" >&2; exit 2; }
21
-
22
- pat_list="$(gate_msg_pattern_files "$@")"; st=$?
23
- fail_closed "$st" TREE-TERMS pattern-files
24
- mapfile -t PATS < <(printf '%s' "$pat_list")
25
-
26
- patterns="$(grep -hEv '^[[:space:]]*(#|$)' "${PATS[@]+"${PATS[@]}"}")"; gst=$?
27
- [[ "$gst" -le 1 ]] || fail_closed "$gst" TREE-TERMS grep-patterns
28
-
29
- npat=0
30
- [[ -n "$patterns" ]] && npat="$(grep -c '' <<<"$patterns")"
31
- if [[ "$npat" -eq 0 ]]; then
32
- echo "TREE-TERMS: clean (0 banned pattern(s) configured; tree unchecked)"
33
- exit 0
34
- fi
35
-
36
- listing="$(git ls-files -- "$SCANROOT")"; st=$?
37
- fail_closed "$st" TREE-TERMS git-ls-files
38
-
39
- # spec: gate-sdk/SPEC.md §check-tree-terms — the filter pass (pruned dirs, the pattern-file's own basename, non-regular files) stays a per-path loop with no fork in it; the grep itself batches every surviving path into one process instead of re-materialising the pattern file and re-execing grep per file
40
- paths=()
41
- while IFS= read -r path; do
42
- [[ -n "$path" ]] || continue
43
- gate_path_pruned "$path" && continue
44
- base="${path##*/}"
45
- [[ "$base" == msg-patterns* ]] && continue
46
- [[ -f "$path" ]] || continue
47
- paths+=("$path")
48
- done <<< "$listing"
49
- scanned="${#paths[@]}"
50
-
51
- hits=""
52
- if [[ "$scanned" -gt 0 ]]; then
53
- m="$(grep -EnHf <(printf '%s\n' "$patterns") "${paths[@]}")"; mst=$?
54
- [[ "$mst" -le 1 ]] || fail_closed "$mst" TREE-TERMS grep
55
- [[ -n "$m" ]] && hits="$m"$'\n'
56
- fi
57
-
58
- if [[ -n "$hits" ]]; then
59
- echo "check-tree-terms: tracked file(s) match a banned pattern (leaked local/private term):"
60
- printf '%s' "$hits"
61
- echo " help: remove the leaked term from the tracked file; private term lists"
62
- echo " belong in the gitignored local pattern file, never in a tracked one."
63
- exit 1
64
- fi
65
-
66
- echo "TREE-TERMS: clean ($scanned tracked file(s) scanned under $SCANROOT; none match the $npat banned pattern(s))"
67
- exit 0