checkwright 0.26.0 → 0.27.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 (79) hide show
  1. package/README.md +7 -7
  2. package/bin/checkwright.ps1 +59 -40
  3. package/bin/checkwright.sh +53 -53
  4. package/package.json +3 -3
  5. package/payload/artifact/aarch64-apple-darwin/checkwright-gates +0 -0
  6. package/payload/artifact/aarch64-apple-darwin/checkwright-gates.sha256 +1 -1
  7. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe +0 -0
  8. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  9. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates +0 -0
  10. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  11. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates +0 -0
  12. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates.sha256 +1 -0
  13. package/payload/artifact/targets.list +29 -16
  14. package/payload/artifact/x86_64-apple-darwin/checkwright-gates +0 -0
  15. package/payload/artifact/x86_64-apple-darwin/checkwright-gates.sha256 +1 -1
  16. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe +0 -0
  17. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  18. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  19. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  20. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates +0 -0
  21. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates.sha256 +1 -0
  22. package/payload/canon-kit/README.md +3 -1
  23. package/payload/canon-kit/checks/check-citation-link.gate +4 -0
  24. package/payload/canon-kit/checks/check-comment-tier.gate +1 -1
  25. package/payload/canon-kit/checks/check-deprecation-task.gate +1 -1
  26. package/payload/canon-kit/checks/check-docs-page-repeat.gate +4 -0
  27. package/payload/canon-kit/checks/check-spec-pointer.gate +1 -1
  28. package/payload/canon-kit/checks/check-todo-task-liveness.gate +1 -1
  29. package/payload/canon-kit/gate-tests/check-citation-link/bad/expect.txt +6 -0
  30. package/payload/canon-kit/gate-tests/check-citation-link/bad/scripts/canon-config.knobs +2 -0
  31. package/payload/canon-kit/gate-tests/check-citation-link/bad/site/page.md +13 -0
  32. package/payload/canon-kit/gate-tests/check-citation-link/good/expect.txt +1 -0
  33. package/payload/canon-kit/gate-tests/check-citation-link/good/scripts/canon-config.knobs +2 -0
  34. package/payload/canon-kit/gate-tests/check-citation-link/good/site/page.md +28 -0
  35. package/payload/canon-kit/gate-tests/check-comment-tier/bad/.github/workflows/ci.yml +15 -0
  36. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +2 -0
  37. package/payload/canon-kit/gate-tests/check-comment-tier/bad/scripts/canon-config.knobs +2 -0
  38. package/payload/canon-kit/gate-tests/check-comment-tier/good/.github/workflows/ci.yml +23 -0
  39. package/payload/canon-kit/gate-tests/check-comment-tier/good/config.yml +2 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
  41. package/payload/canon-kit/gate-tests/check-comment-tier/good/scripts/canon-config.knobs +2 -0
  42. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/expect.txt +2 -0
  43. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/scripts/canon-config.knobs +2 -0
  44. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/page.md +8 -0
  45. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/expect.txt +1 -0
  46. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/scripts/canon-config.knobs +2 -0
  47. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/site/page.md +24 -0
  48. package/payload/context-kit/README.md +2 -2
  49. package/payload/context-kit/gate-tests/check-footprint-fresh/good/docs/footprint.md +2 -0
  50. package/payload/context-kit/templates/session-context.sh +1 -1
  51. package/payload/delegation-kit/README.md +6 -6
  52. package/payload/doctrine-kit/README.md +1 -1
  53. package/payload/drift-kit/README.md +9 -9
  54. package/payload/evidence-kit/README.md +8 -4
  55. package/payload/gate-sdk/README.md +4 -4
  56. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/docs/enforcement.md +2 -2
  57. package/payload/gate-sdk/templates/gates-workflow.yml +6 -35
  58. package/payload/guard-kit/README.md +4 -4
  59. package/payload/guard-kit/gate-tests/scratch-run.test.sh +3 -2
  60. package/payload/lifecycle-kit/README.md +10 -8
  61. package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +6 -4
  62. package/payload/lifecycle-kit/gate-tests/capture-linked-worktree.test.sh +53 -0
  63. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +23 -20
  64. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +1 -0
  65. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +11 -4
  66. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -1
  67. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +11 -4
  68. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +25 -17
  69. package/payload/lifecycle-kit/gate-tests/stamp-before-write.test.sh +13 -2
  70. package/payload/lifecycle-kit/templates/lead.md +6 -2
  71. package/payload/queue-kit/README.md +2 -2
  72. package/payload/site-kit/README.md +5 -2
  73. package/payload/site-kit/checks/check-docs-collapsible.gate +3 -0
  74. package/payload/site-kit/gate-tests/check-docs-collapsible/bad/docs/regions.md +23 -0
  75. package/payload/site-kit/gate-tests/check-docs-collapsible/bad/expect.txt +4 -0
  76. package/payload/site-kit/gate-tests/check-docs-collapsible/good/docs/plain.md +3 -0
  77. package/payload/site-kit/gate-tests/check-docs-collapsible/good/docs/regions.md +26 -0
  78. package/payload/site-kit/gate-tests/check-docs-collapsible/good/expect.txt +1 -0
  79. package/payload/site-kit/templates/site-health.yml +10 -101
@@ -1,18 +1,4 @@
1
- # Scheduled probe of the live docs site — monitoring, NOT a gate. It verifies a
2
- # deployment, not a tree, so it reds on causes no commit produced (DNS, a Pages
3
- # incident, a stalled cert renewal), breaking both the low-false-positive gate
4
- # contract and the CI backstop's checkout+bash hermeticity — see
5
- # gate-sdk/SPEC.md §Enforcement tiers. It therefore lives beside your gates
6
- # workflow, never inside it: a failed probe opens (or updates, never duplicates)
7
- # a site-health issue and reds this run, never a merge. Recovery self-clears (a
8
- # green run closes the open issue). No README badge, by the standing ruling.
9
- #
10
- # Copy verbatim into .github/workflows/, then set three groups of env below or
11
- # delete the arm each belongs to: ALT_DOMAIN (drop probe #4 if you serve no
12
- # redirect alias), the three RELEASE_NOTE_* knobs (drop probe #6 if you
13
- # publish no release notes), and the two HIGHLIGHT_* knobs (probe #7, skipped
14
- # while both are empty). The apex host is read from the CNAME file — no
15
- # second place to keep it.
1
+ # spec: site-kit/SPEC.md §templates/site-health.yml — copy verbatim; set each arm's env or delete the arm
16
2
  # enforce: class=monitor live docs-site deployment — apex/www/http HTTPS, redirects, cert expiry, release-body note pointers, and theme highlight-class drift against the tracked snapshot
17
3
  name: site-health
18
4
 
@@ -26,10 +12,7 @@ on:
26
12
  type: boolean
27
13
  default: false
28
14
 
29
- # A permissions: block is an allowlist, not an addition — every scope it omits is
30
- # none. issues:write carries the open/update/close path; contents:read is what
31
- # lets the probe read the tag list and the Release bodies. Without it those reads
32
- # 404, which reads like "no such Release" rather than "not permitted".
15
+ # spec: site-kit/SPEC.md §templates/site-health.yml — the permissions block is an allowlist
33
16
  permissions:
34
17
  issues: write
35
18
  contents: read
@@ -38,41 +21,24 @@ jobs:
38
21
  probe:
39
22
  runs-on: ubuntu-latest
40
23
  steps:
41
- # The CNAME file is the single source of truth for the apex host; reading
42
- # it here gives the monitor a cutover for free.
43
24
  - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
44
25
 
45
26
  - name: probe live site
46
27
  id: probe
47
28
  env:
48
- # Alternate redirect host — a bare public hostname, never a URL
49
- # literal (a docs-cname-parity gate bars the alias in ://url form);
50
- # the probe builds the URL from this at run time. Set to your redirect
51
- # alias, or delete this env and probe #4 below if you have none.
29
+ # spec: site-kit/SPEC.md §templates/site-health.yml — your redirect alias, or delete it with its arm
52
30
  ALT_DOMAIN: alt.example.com
53
- # Release-note pointer arm (#6) — set all three, or delete them along
54
- # with probe #6 below. Step-level workflow env, not the kit's SITE_KIT_*
55
- # knobs: this file is copied and edited, never sourced, so it must not
56
- # reach into a vendored gates dir. The host is deliberately absent —
57
- # the CNAME file stays its single source, so a rename is one edit.
31
+ # spec: site-kit/SPEC.md §templates/site-health.yml — set all three, or delete them with the release-body arm
58
32
  RELEASE_NOTE_GLOB: 'docs/posts/*.md'
59
33
  RELEASE_NOTE_TAG_KEY: 'release'
60
- # Path only; {slug} is the note filename minus its extension. Check the
61
- # form your host actually serves — a generator that emits
62
- # /posts/<slug>.html often serves the extensionless form too, and the
63
- # value must match what your release bodies are written to carry.
34
+ # spec: site-kit/SPEC.md §templates/site-health.yml — path only; {slug} is the note filename minus extension
64
35
  RELEASE_NOTE_URL_PATH: '/posts/{slug}'
65
- # Theme-drift arm (#7) — set both to arm it, or delete them along with
66
- # probe #7 below; left empty, the arm is skipped. The site path of the
67
- # theme stylesheet, and the tracked snapshot file your
68
- # SITE_KIT_HIGHLIGHT_TOKENS knob names (the same file).
36
+ # spec: site-kit/SPEC.md §templates/site-health.yml — set both, or delete them with the theme-drift arm
69
37
  HIGHLIGHT_CSS_PATH: ''
70
38
  HIGHLIGHT_TOKENS_FILE: ''
71
39
  FORCE_FAIL: ${{ inputs.force_fail }}
72
40
  GH_TOKEN: ${{ github.token }}
73
41
  run: |
74
- # A probe expects individual checks to fail; -e would abort the battery
75
- # on the first red, so disable it and collect failures explicitly.
76
42
  set +e
77
43
  set -uo pipefail
78
44
 
@@ -85,36 +51,28 @@ jobs:
85
51
 
86
52
  failures=()
87
53
 
88
- # 1. apex answers 200 over HTTPS; curl validates the cert at handshake,
89
- # so a TLS fault also reds here.
90
54
  code="$(curl -sS -m 20 -o /dev/null -w '%{http_code}' "https://$apex/")"
91
55
  [ "$code" = 200 ] || failures+=("apex https did not answer 200 (got '$code')")
92
56
 
93
- # 2. www 301s to the apex.
94
57
  read -r code loc < <(curl -sS -m 20 -o /dev/null -w '%{http_code} %{redirect_url}' "https://www.$apex/") || true
95
58
  case "${code}::${loc}" in
96
59
  301::*"//$apex/"*) ;;
97
60
  *) failures+=("www did not 301 to apex (got '$code' -> '$loc')") ;;
98
61
  esac
99
62
 
100
- # 3. http:// 301s to https:// — proves Enforce-HTTPS has not silently flipped.
101
63
  read -r code loc < <(curl -sS -m 20 -o /dev/null -w '%{http_code} %{redirect_url}' "http://$apex/") || true
102
64
  case "${code}::${loc}" in
103
65
  301::https://*) ;;
104
66
  *) failures+=("http did not 301 to https (got '$code' -> '$loc')") ;;
105
67
  esac
106
68
 
107
- # 4. the alternate host 301s to the apex, request path kept. Delete this
108
- # block along with ALT_DOMAIN above if you serve no redirect alias.
69
+ # spec: site-kit/SPEC.md §templates/site-health.yml — the ALT_DOMAIN arm; delete it with its env if unused
109
70
  read -r code loc < <(curl -sS -m 20 -o /dev/null -w '%{http_code} %{redirect_url}' "https://$ALT_DOMAIN/install.html") || true
110
71
  case "${code}::${loc}" in
111
72
  301::*"//$apex/install.html"*) ;;
112
73
  *) failures+=("$ALT_DOMAIN did not 301 to apex keeping path (got '$code' -> '$loc')") ;;
113
74
  esac
114
75
 
115
- # 5. certificate expiry >= 14 days — the real payload. Pages renews ~30d
116
- # out, so inside 14 days means renewal has silently stalled. curl -v
117
- # prints the handshake's "expire date:", keeping this curl-only.
118
76
  expire="$(curl -sSv -m 20 "https://$apex/" 2>&1 >/dev/null | sed -n 's/^\* *expire date: //p' | head -1)"
119
77
  if [ -z "$expire" ]; then
120
78
  failures+=("could not read certificate expiry for $apex")
@@ -128,14 +86,7 @@ jobs:
128
86
  fi
129
87
  fi
130
88
 
131
- # 6. every tracked release note naming an existing tag has a Release
132
- # whose body points at that note, and every apex URL that body
133
- # carries resolves. The two assertions run over two different
134
- # strings — presence over the URL derived here, resolution over the
135
- # URLs the body actually carries — and collapsing them re-opens the
136
- # defects this arm exists for (site-kit/SPEC.md §templates/site-health.yml).
137
- # Delete this whole block along with the RELEASE_NOTE_* env above if
138
- # you publish no release notes.
89
+ # spec: site-kit/SPEC.md §templates/site-health.yml — the release-body arm; delete it with its env if unused
139
90
  notes=()
140
91
  shopt -s nullglob
141
92
  for f in $RELEASE_NOTE_GLOB; do
@@ -146,19 +97,11 @@ jobs:
146
97
  failures+=("release-note glob matched nothing: '$RELEASE_NOTE_GLOB' — set the RELEASE_NOTE_* env above, or delete this arm")
147
98
  fi
148
99
 
149
- # The tag list comes from the API, never `git tag`: checkout fetches no
150
- # tags at depth 1, so a git-driven arm finds zero released notes and
151
- # reads green forever. --paginate concatenates the pages' arrays, so
152
- # count by streaming the names — --jq 'length' returns the last page's
153
- # count, which understates exactly once pagination starts to matter.
100
+ # spec: site-kit/SPEC.md §templates/site-health.yml — the tag list comes from the API, paginated
154
101
  tag_err="$(mktemp)"
155
102
  tags="$(gh api --paginate 'repos/{owner}/{repo}/tags' --jq '.[].name' 2>"$tag_err")"
156
103
  tag_rc=$?
157
104
  if [ "$tag_rc" -ne 0 ]; then
158
- # Asserted on the call's own exit status, never inferred from the
159
- # count below: this step runs under `set +e`, so a failed call yields
160
- # an empty tag list and a zero exit, every note then reads "not yet
161
- # released", and the arm reports a clean run forever.
162
105
  failures+=("could not read the tag list (gh exit $tag_rc): $(tr '\n' ' ' < "$tag_err")")
163
106
  tags=""
164
107
  fi
@@ -168,21 +111,13 @@ jobs:
168
111
  n_found="${#notes[@]}"; n_keyed=0; n_released=0; n_checked=0
169
112
  for f in "${notes[@]:-}"; do
170
113
  [ -n "$f" ] || continue
171
- # Anchored inside the opening front-matter fence. A bare ^key: match
172
- # also hits the body.
173
114
  tag="$(awk -v key="$RELEASE_NOTE_TAG_KEY" '
174
115
  /^---[[:space:]]*$/ { fm++; next }
175
116
  fm == 1 && index($0, key ":") == 1 {
176
117
  v = substr($0, length(key) + 2); sub(/^[[:space:]]+/, "", v); print v; exit
177
118
  }' "$f")"
178
- # A post carrying no tag key is not a release note. Silent by ruling:
179
- # the census line below is how that case stays readable.
180
119
  [ -n "$tag" ] || continue
181
120
  n_keyed=$(( n_keyed + 1 ))
182
- # A note whose tag is not on the remote is a legitimate skip — its
183
- # release is deferred. This is why the tag list is not replaceable by
184
- # the per-tag lookup below: a 404 there cannot tell that apart from a
185
- # tag whose Release is genuinely missing.
186
121
  grep -Fxq -- "$tag" <<<"$tags" || continue
187
122
  n_released=$(( n_released + 1 ))
188
123
 
@@ -200,23 +135,11 @@ jobs:
200
135
  rm -f "$rel_err"
201
136
  n_checked=$(( n_checked + 1 ))
202
137
 
203
- # Presence: containment, never equality — an older body may write a
204
- # suffixed variant of its URL. Scheme-qualified, because a markdown
205
- # link's visible label often repeats the URL scheme-less and would
206
- # satisfy a scheme-less match while the link target went unchecked.
207
138
  case "$body" in
208
139
  *"$want"*) ;;
209
140
  *) failures+=("$tag: Release body does not carry the note URL $want") ;;
210
141
  esac
211
142
 
212
- # Resolution: every apex URL as literally written in the body — this
213
- # is what catches a trailing-slash URL that presence's containment
214
- # lets through. Scheme-anchored so a label is never mistaken for a
215
- # target. The trailing punctuation that occurs in practice is
216
- # markdown-structural, `)` closing a link target and `)**` closing
217
- # one inside bold, so the set covers `)` and `*` and strips a run.
218
- # Deliberately not filtered to note URLs: a body's other apex links
219
- # are covered too.
220
143
  while read -r u; do
221
144
  [ -n "$u" ] || continue
222
145
  case "$u" in
@@ -228,16 +151,9 @@ jobs:
228
151
  done < <(grep -oE 'https?://[^[:space:]<>"]+' <<<"$body" | sed -E 's/[).,;:!?*]+$//' | sort -u)
229
152
  done
230
153
 
231
- # Which zero-case a reader is in. A diagnostic, not an assertion — the
232
- # rulings above are what make a vacuous pass impossible.
233
154
  echo "release-body: $n_found note(s) found, $n_keyed keyed '$RELEASE_NOTE_TAG_KEY:', $n_released released of $n_tags remote tag(s), $n_checked checked"
234
155
 
235
- # 7. the classes the live theme stylesheet colours under .highlight
236
- # match the tracked snapshot check-docs-highlight-coverage reads, in
237
- # both directions. On a finding, paste the printed list into the
238
- # snapshot below its header, then add the overrides that gate reds
239
- # on. Delete this block along with the HIGHLIGHT_* env above if you
240
- # do not restyle code highlighting.
156
+ # spec: site-kit/SPEC.md §templates/site-health.yml — the theme-drift arm; delete it with its env if unused
241
157
  if [ -z "${HIGHLIGHT_CSS_PATH:-}${HIGHLIGHT_TOKENS_FILE:-}" ]; then
242
158
  echo "theme-drift: skipped (HIGHLIGHT_CSS_PATH and HIGHLIGHT_TOKENS_FILE unset)"
243
159
  elif [ -z "${HIGHLIGHT_CSS_PATH:-}" ] || [ -z "${HIGHLIGHT_TOKENS_FILE:-}" ]; then
@@ -252,9 +168,6 @@ jobs:
252
168
  if [ "$css_rc" -ne 0 ]; then
253
169
  failures+=("theme-drift: could not fetch https://$apex$HIGHLIGHT_CSS_PATH (curl exit $css_rc): $(tr '\n' ' ' < "$css_err")")
254
170
  else
255
- # The extraction rule: rules split at }, kept when the declaration
256
- # block sets color, background or background-color; each selector
257
- # list split on , and kept when exactly .highlight .<class>.
258
171
  extracted="$(tr '\n' ' ' < "$css" | sed -E 's#/\*([^*]|\*+[^*/])*\*+/##g' | awk '
259
172
  BEGIN { RS = "}" }
260
173
  {
@@ -288,8 +201,6 @@ jobs:
288
201
  rm -f "$css" "$css_err"
289
202
  fi
290
203
 
291
- # DoD hook: a workflow_dispatch with force_fail=true exercises the issue
292
- # path on demand without waiting for a real outage.
293
204
  if [ "$FORCE_FAIL" = true ]; then
294
205
  failures+=("synthetic failure (force_fail dispatch input)")
295
206
  fi
@@ -317,7 +228,6 @@ jobs:
317
228
  run: |
318
229
  set -euo pipefail
319
230
  label=site-health
320
- # Idempotent: creates the label on first use, no-ops once it exists.
321
231
  gh label create "$label" --color b60205 \
322
232
  --description "Live-site monitoring probe failure" 2>/dev/null || true
323
233
 
@@ -336,7 +246,6 @@ jobs:
336
246
  gh issue create --label "$label" \
337
247
  --title "Site health: live-site probe failed" --body "$body"
338
248
  fi
339
- # Red this run as the operator's second signal (reds no merge).
340
249
  exit 1
341
250
  fi
342
251