checkwright 0.35.0 → 0.37.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.
- package/README.md +3 -0
- package/package.json +2 -2
- package/payload/artifact/aarch64-apple-darwin/checkwright-gates +0 -0
- package/payload/artifact/aarch64-apple-darwin/checkwright-gates.sha256 +1 -1
- package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe +0 -0
- package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
- package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates +0 -0
- package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
- package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates +0 -0
- package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
- package/payload/artifact/x86_64-apple-darwin/checkwright-gates +0 -0
- package/payload/artifact/x86_64-apple-darwin/checkwright-gates.sha256 +1 -1
- package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe +0 -0
- package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
- package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates +0 -0
- package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
- package/payload/canon-kit/README.md +1 -0
- package/payload/canon-kit/checks/check-comment-tier.gate +1 -1
- package/payload/canon-kit/checks/check-rule-id-coverage.gate +4 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue.test.sh +39 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/lib/rules.rs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/scripts/canon-config.knobs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +1 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/scripts/canon-config.knobs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/src/rules.rs +5 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/bad/scripts/canon-config.knobs +5 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/bad/specs/access.md +7 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/bad/specs/export.md +3 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/bad/src/rules.rs +5 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/good/scripts/canon-config.knobs +7 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/good/specs/access.md +9 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/good/specs/export.md +3 -0
- package/payload/canon-kit/gate-tests/check-rule-id-coverage/good/src/rules.rs +7 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +2 -2
- package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +5 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +35 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +2 -2
- package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +26 -0
- package/payload/delegation-kit/README.md +1 -1
- package/payload/delegation-kit/usage-tests/cases.tsv +13 -0
- package/payload/doctrine-kit/DOCTRINE.md +1 -1
- package/payload/evidence-kit/README.md +8 -5
- package/payload/evidence-kit/checks/check-test-control.gate +4 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/validate-evidence.txt +2 -2
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/validate-evidence.txt +2 -2
- package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +56 -7
- package/payload/evidence-kit/gate-tests/check-test-control/bad/TASK-QUEUE.md +1 -0
- package/payload/evidence-kit/gate-tests/check-test-control/bad/WORKFLOW-STATE.txt +4 -0
- package/payload/evidence-kit/gate-tests/check-test-control/bad/args +5 -0
- package/payload/evidence-kit/gate-tests/check-test-control/bad/expect.txt +2 -0
- package/payload/evidence-kit/gate-tests/check-test-control/bad/scripts/evidence-config.knobs +4 -0
- package/payload/evidence-kit/gate-tests/check-test-control/bad/since-baseline.txt +2 -0
- package/payload/evidence-kit/gate-tests/check-test-control/bad/validate-baseline.txt +4 -0
- package/payload/evidence-kit/gate-tests/check-test-control/bad/validate-evidence.txt +3 -0
- package/payload/evidence-kit/gate-tests/check-test-control/good/TASK-QUEUE.md +1 -0
- package/payload/evidence-kit/gate-tests/check-test-control/good/WORKFLOW-STATE.txt +4 -0
- package/payload/evidence-kit/gate-tests/check-test-control/good/args +5 -0
- package/payload/evidence-kit/gate-tests/check-test-control/good/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-test-control/good/scripts/evidence-config.knobs +4 -0
- package/payload/evidence-kit/gate-tests/check-test-control/good/since-baseline.txt +2 -0
- package/payload/evidence-kit/gate-tests/check-test-control/good/validate-baseline.txt +3 -0
- package/payload/evidence-kit/gate-tests/check-test-control/good/validate-evidence.txt +3 -0
- package/payload/evidence-kit/gate-tests/check-test-control.test.sh +121 -0
- package/payload/evidence-kit/gate-tests/pre-hook.test.sh +18 -2
- package/payload/evidence-kit/gate-tests/producer-lock.test.sh +1 -1
- package/payload/evidence-kit/gate-tests/run-member-door.test.sh +1 -1
- package/payload/evidence-kit/gate-tests/statement-store.test.sh +64 -0
- package/payload/evidence-kit/gate-tests/test-control-run.test.sh +91 -0
- package/payload/evidence-kit/gate-tests/verify-gate-run-strict.test.sh +121 -0
- package/payload/evidence-kit/templates/evidence-config.knobs +7 -0
- package/payload/gate-sdk/README.md +1 -0
- package/payload/gate-sdk/checks/check-hook-knobs-fresh.gate +5 -0
- package/payload/gate-sdk/gate-tests/binary-only-recipe.test.sh +125 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/docs/enforcement.md +1 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/bad/hooks/not-a-hook.md +4 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/bad/hooks/shell-guard.md +3 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/bad/hooks/subagent-stop-liveness.md +12 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/subagent-stop-liveness.md +16 -0
- package/payload/gate-sdk/gate-tests/lib-test-hermetic.test.sh +19 -1
- package/payload/gate-sdk/gate-tests/run-for-path.test.sh +16 -1
- package/payload/gate-sdk/lib/test-hermetic.sh +6 -1
- package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +11 -1
- package/payload/lifecycle-kit/README.md +4 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +1 -1
- package/payload/lifecycle-kit/gate-tests/peer-channel.test.sh +150 -0
- package/payload/lifecycle-kit/templates/stages/close.md +2 -2
- package/payload/lifecycle-kit/templates/stages/scope.md +2 -0
- package/payload/lifecycle-kit/templates/stages/validate.md +1 -1
- package/payload/queue-kit/gate-tests/roadmap.test.sh +1 -1
- package/payload/site-kit/README.md +3 -0
- package/payload/site-kit/checks/check-docs-since.gate +4 -0
- package/payload/site-kit/gate-tests/check-docs-since/bad/expect.txt +6 -0
- package/payload/site-kit/gate-tests/check-docs-since/bad/notes/2026-01-01-v99-1-0.md +7 -0
- package/payload/site-kit/gate-tests/check-docs-since/bad/scripts/site-config.knobs +3 -0
- package/payload/site-kit/gate-tests/check-docs-since/bad/site/bare.md +7 -0
- package/payload/site-kit/gate-tests/check-docs-since/bad/site/odd.md +8 -0
- package/payload/site-kit/gate-tests/check-docs-since/bad/site/open.md +8 -0
- package/payload/site-kit/gate-tests/check-docs-since/bad/site/twice.md +9 -0
- package/payload/site-kit/gate-tests/check-docs-since/good/expect.txt +1 -0
- package/payload/site-kit/gate-tests/check-docs-since/good/notes/announce.md +3 -0
- package/payload/site-kit/gate-tests/check-docs-since/good/scripts/site-config.knobs +3 -0
- package/payload/site-kit/gate-tests/check-docs-since/good/site/done.md +8 -0
- package/payload/site-kit/gate-tests/check-docs-since/good/site/open.md +8 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: evidence-kit/SPEC.md §verify-gate-run — each EVIDENCE_KIT_VERIFY_REQUIRE word reds its own case and holds on a run of HEAD with every suite clean; EVIDENCE_KIT_TREE_UNTRACKED=count reads an untracked path as modified unless it is ignored or the run's own write, a link judged where it sits; --json prints the result as one document on exit 0 and 1 and none on a refusal, and the import arm refuses the option.
|
|
3
|
+
#
|
|
4
|
+
# Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
7
|
+
|
|
8
|
+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # evidence-kit/
|
|
9
|
+
FE="$(cd "$DIR/../gate-sdk/bin" && pwd)/run-gates.sh"
|
|
10
|
+
|
|
11
|
+
fails=0
|
|
12
|
+
tmp="$(mktemp -d)"
|
|
13
|
+
trap 'rm -rf "$tmp"' EXIT
|
|
14
|
+
fail() { echo " FAIL: $*"; fails=$((fails + 1)); }
|
|
15
|
+
|
|
16
|
+
# spec: evidence-kit/SPEC.md §bin/run-validate.sh — each scratch tree is its own git toplevel, crossing the absolute binary the preamble exports; the tmp dir is left unignored so only the run-write exclusion keeps it out of a count.
|
|
17
|
+
mk_tree() {
|
|
18
|
+
rm -rf "$1"; mkdir -p "$1/.workflow" "$1/scripts" "$1/out"
|
|
19
|
+
( cd "$1" && git init -q . && git config user.name t && git config user.email t@t ) >/dev/null 2>&1
|
|
20
|
+
printf '# baseline\nok ok pass\nbad bad pass\n' >"$1/.workflow/validate-baseline.txt"
|
|
21
|
+
printf '# contract: evidence-manifest v2\n' >"$1/.workflow/validate-evidence.txt"
|
|
22
|
+
printf 'ignored.txt\n' >"$1/.gitignore"
|
|
23
|
+
printf '%s\n' "EVIDENCE_KIT_SUITES[] = $2" \
|
|
24
|
+
"EVIDENCE_KIT_RUN_ID = strict" \
|
|
25
|
+
"EVIDENCE_KIT_RUN_ok = true" \
|
|
26
|
+
"EVIDENCE_KIT_RUN_bad = false" \
|
|
27
|
+
"EVIDENCE_KIT_STATEMENT_FILE = out/statement.json" >"$1/scripts/evidence-config.knobs"
|
|
28
|
+
( cd "$1" && git add -A && git commit -q -m base ) >/dev/null 2>&1
|
|
29
|
+
}
|
|
30
|
+
_fe() { local d="$1"; shift; ( cd "$d" && EVIDENCE_KIT_KNOB_FILE=scripts/evidence-config.knobs bash "$FE" "$@" 2>&1 ); }
|
|
31
|
+
_commit() { ( cd "$1" && git add -A && git commit -q --allow-empty -m "${2:-next}" ) >/dev/null 2>&1; }
|
|
32
|
+
|
|
33
|
+
# A — head: clean on a Statement of HEAD, red one commit later, and the default selection reds neither.
|
|
34
|
+
mk_tree "$tmp/a" ok
|
|
35
|
+
_fe "$tmp/a" --run-validate >/dev/null
|
|
36
|
+
out="$(EVIDENCE_KIT_VERIFY_REQUIRE="head" _fe "$tmp/a" --verify-gate-run out/statement.json)"; rc=$?
|
|
37
|
+
[[ "$rc" -eq 0 && "$out" == *"clean"*"ahead=0"* ]] || fail "head must hold on a Statement of HEAD (rc=$rc): $out"
|
|
38
|
+
cp "$tmp/a/out/statement.json" "$tmp/a-statement.json"
|
|
39
|
+
_commit "$tmp/a"
|
|
40
|
+
out="$(EVIDENCE_KIT_VERIFY_REQUIRE="head" _fe "$tmp/a" --verify-gate-run "$tmp/a-statement.json")"; rc=$?
|
|
41
|
+
[[ "$rc" -eq 1 && "$out" == *"is 1 commit(s) behind HEAD (EVIDENCE_KIT_VERIFY_REQUIRE: head)"* && "$out" == *"ahead=1"* ]] \
|
|
42
|
+
|| fail "head must red a Statement one commit behind HEAD, naming the requirement (rc=$rc): $out"
|
|
43
|
+
out="$(_fe "$tmp/a" --verify-gate-run "$tmp/a-statement.json")"; rc=$?
|
|
44
|
+
[[ "$rc" -eq 0 ]] || fail "the empty default must not red a Statement behind HEAD (rc=$rc): $out"
|
|
45
|
+
|
|
46
|
+
# A' — --json: the document's top-level verdict and ahead on a clean and on a contradicted Statement,
|
|
47
|
+
# no document on a refusal, and the import arm keeps refusing the option.
|
|
48
|
+
out="$(_fe "$tmp/a" --verify-gate-run --json "$tmp/a-statement.json")"; rc=$?
|
|
49
|
+
[[ "$rc" -eq 0 && "$out" == '{"ahead":1,'* && "$out" == *'],"verdict":"clean"}' ]] \
|
|
50
|
+
|| fail "--json must print a clean document at ahead 1 (rc=$rc): $out"
|
|
51
|
+
out="$(EVIDENCE_KIT_VERIFY_REQUIRE="head" _fe "$tmp/a" --verify-gate-run "$tmp/a-statement.json" --json)"; rc=$?
|
|
52
|
+
[[ "$rc" -eq 1 && "$out" == '{"ahead":1,'* && "$out" == *'],"verdict":"contradiction"}' ]] \
|
|
53
|
+
|| fail "--json must print a contradiction document, the option after the operand (rc=$rc): $out"
|
|
54
|
+
out="$( cd "$tmp/a" && EVIDENCE_KIT_KNOB_FILE=scripts/evidence-config.knobs bash "$FE" --verify-gate-run --json "$tmp/absent.json" 2>/dev/null )"; rc=$?
|
|
55
|
+
[[ "$rc" -eq 2 && -z "$out" ]] || fail "--json must print no document on a refusal (rc=$rc): $out"
|
|
56
|
+
out="$(EVIDENCE_KIT_IMPORTED_RUNS=accept _fe "$tmp/a" --import-gate-run --json "$tmp/a-statement.json")"; rc=$?
|
|
57
|
+
[[ "$rc" -eq 2 && "$out" == *"at most one operand (got: --json "* ]] || fail "--import-gate-run must keep refusing --json (rc=$rc): $out"
|
|
58
|
+
|
|
59
|
+
# B — verdict: clean on a passing suite, red on a failing one, and the default selection reds neither.
|
|
60
|
+
out="$(EVIDENCE_KIT_VERIFY_REQUIRE=verdict _fe "$tmp/a" --verify-gate-run "$tmp/a-statement.json")"; rc=$?
|
|
61
|
+
[[ "$rc" -eq 0 ]] || fail "verdict must hold on a passing suite (rc=$rc): $out"
|
|
62
|
+
mk_tree "$tmp/b" bad
|
|
63
|
+
_fe "$tmp/b" --run-validate >/dev/null; rc=$?
|
|
64
|
+
[[ "$rc" -eq 1 && -s "$tmp/b/out/statement.json" ]] || fail "a failing suite must exit 1 and still write its Statement (rc=$rc)"
|
|
65
|
+
out="$(EVIDENCE_KIT_VERIFY_REQUIRE=verdict _fe "$tmp/b" --verify-gate-run out/statement.json)"; rc=$?
|
|
66
|
+
[[ "$rc" -eq 1 && "$out" == *"suite 'bad' verdict: new-failures (EVIDENCE_KIT_VERIFY_REQUIRE: verdict)"* ]] \
|
|
67
|
+
|| fail "verdict must red a failing suite, naming the requirement (rc=$rc): $out"
|
|
68
|
+
out="$(_fe "$tmp/b" --verify-gate-run out/statement.json)"; rc=$?
|
|
69
|
+
[[ "$rc" -eq 0 ]] || fail "the empty default must not red a failing suite's Statement (rc=$rc): $out"
|
|
70
|
+
out="$(EVIDENCE_KIT_VERIFY_REQUIRE=ahead _fe "$tmp/b" --verify-gate-run out/statement.json)"; rc=$?
|
|
71
|
+
[[ "$rc" -eq 2 && "$out" == *"EVIDENCE_KIT_VERIFY_REQUIRE word 'ahead'"* ]] || fail "an unknown requirement word must refuse at exit 2 (rc=$rc): $out"
|
|
72
|
+
|
|
73
|
+
# C — count: clean with only an ignored file and the run's own writes untracked, modified with another
|
|
74
|
+
# untracked file; the default ignore reads that same tree clean.
|
|
75
|
+
mk_tree "$tmp/c" ok
|
|
76
|
+
: >"$tmp/c/ignored.txt"
|
|
77
|
+
EVIDENCE_KIT_TREE_UNTRACKED=count _fe "$tmp/c" --run-validate >/dev/null
|
|
78
|
+
grep -q '^strict ok .* tree=clean ' "$tmp/c/.workflow/validate-evidence.txt" \
|
|
79
|
+
|| fail "count must read clean with only an ignored file and the tmp dir untracked: $(cat "$tmp/c/.workflow/validate-evidence.txt")"
|
|
80
|
+
_commit "$tmp/c"
|
|
81
|
+
git -C "$tmp/c" rm -q --cached out/statement.json >/dev/null 2>&1; _commit "$tmp/c"
|
|
82
|
+
[[ -f "$tmp/c/out/statement.json" ]] || fail "the Statement under test is missing"
|
|
83
|
+
EVIDENCE_KIT_TREE_UNTRACKED=count _fe "$tmp/c" --run-validate >/dev/null
|
|
84
|
+
grep -q '^strict ok .* tree=clean ' "$tmp/c/.workflow/validate-evidence.txt" \
|
|
85
|
+
|| fail "count must not read the untracked Statement it wrote: $(cat "$tmp/c/.workflow/validate-evidence.txt")"
|
|
86
|
+
_commit "$tmp/c"
|
|
87
|
+
git -C "$tmp/c" rm -q --cached out/statement.json >/dev/null 2>&1; _commit "$tmp/c"
|
|
88
|
+
: >"$tmp/c/stray.txt"
|
|
89
|
+
EVIDENCE_KIT_TREE_UNTRACKED=count _fe "$tmp/c" --run-validate >/dev/null
|
|
90
|
+
grep -q '^strict ok .* tree=modified ' "$tmp/c/.workflow/validate-evidence.txt" \
|
|
91
|
+
|| fail "count must read modified with another untracked file: $(cat "$tmp/c/.workflow/validate-evidence.txt")"
|
|
92
|
+
out="$(_fe "$tmp/c" --verify-gate-run out/statement.json)"; rc=$?
|
|
93
|
+
[[ "$rc" -eq 1 && "$out" == *"suite 'ok' tree: modified"* ]] || fail "verify must red the Statement count produced (rc=$rc): $out"
|
|
94
|
+
_commit "$tmp/c"
|
|
95
|
+
git -C "$tmp/c" rm -q --cached out/statement.json >/dev/null 2>&1; _commit "$tmp/c"
|
|
96
|
+
: >"$tmp/c/stray2.txt"
|
|
97
|
+
_fe "$tmp/c" --run-validate >/dev/null
|
|
98
|
+
grep -q '^strict ok .* tree=clean ' "$tmp/c/.workflow/validate-evidence.txt" \
|
|
99
|
+
|| fail "the default ignore must read an untracked file clean: $(cat "$tmp/c/.workflow/validate-evidence.txt")"
|
|
100
|
+
out="$(EVIDENCE_KIT_TREE_UNTRACKED=all _fe "$tmp/c" --run-validate)"; rc=$?
|
|
101
|
+
[[ "$rc" -eq 2 && "$out" == *"EVIDENCE_KIT_TREE_UNTRACKED is 'all'"* ]] || fail "an unknown untracked selection must refuse at exit 2 (rc=$rc): $out"
|
|
102
|
+
|
|
103
|
+
# D — count judges a link where it sits: an untracked symlink outside the tmp dir whose target lies
|
|
104
|
+
# inside it is no write of the run's. Git Bash copies on a plain `ln -s`, so a copy is a skip.
|
|
105
|
+
mk_tree "$tmp/d" ok
|
|
106
|
+
mkdir -p "$tmp/d/.tmp/inside"
|
|
107
|
+
MSYS=winsymlinks:nativestrict ln -s .tmp/inside "$tmp/d/escape" 2>/dev/null
|
|
108
|
+
if [[ -L "$tmp/d/escape" ]]; then
|
|
109
|
+
EVIDENCE_KIT_TREE_UNTRACKED=count _fe "$tmp/d" --run-validate >/dev/null
|
|
110
|
+
grep -q '^strict ok .* tree=modified ' "$tmp/d/.workflow/validate-evidence.txt" \
|
|
111
|
+
|| fail "count must read an untracked link into the tmp dir as modified: $(cat "$tmp/d/.workflow/validate-evidence.txt")"
|
|
112
|
+
else
|
|
113
|
+
echo "verify-gate-run-strict.test: skip [D]: this host made no symlink"
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
if [[ "$fails" -gt 0 ]]; then
|
|
117
|
+
echo "verify-gate-run-strict.test: $fails assertion(s) failed"
|
|
118
|
+
exit 1
|
|
119
|
+
fi
|
|
120
|
+
echo "verify-gate-run-strict.test: ok (head clean at the subject and red one commit later, verdict clean on a passing suite and red on a failing one, count clean with only ignored and run-written untracked files and modified with another or with a link into the tmp dir, unknown words refused at exit 2, --json a document on exit 0 and 1 and none on a refusal)"
|
|
121
|
+
exit 0
|
|
@@ -1 +1,8 @@
|
|
|
1
1
|
# spec: evidence-kit/SPEC.md §Layout and configuration — the knob roster (every knob, its default) and the line grammar; the gate binary at `GATE_SDK_NATIVE_BIN` prints the defaults with `--emit knob-roster`; set only what you override
|
|
2
|
+
|
|
3
|
+
# spec: evidence-kit/SPEC.md §Test controls — the ordered control names and one declaration each, its assignments re-introducing the defect its scenario catches; default empty (no control run, check-test-control asserting nothing)
|
|
4
|
+
# EVIDENCE_KIT_CONTROLS[] = <name>
|
|
5
|
+
# EVIDENCE_KIT_CONTROL_<name> = <suite> <scenario> <VAR>=<value>
|
|
6
|
+
|
|
7
|
+
# spec: evidence-kit/SPEC.md §check-test-control — the since commit where the state file carries no iteration start; default empty (the new-test assertion disarmed)
|
|
8
|
+
# EVIDENCE_KIT_CONTROL_SINCE = <revision>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# graph: couples=knob:GATE_SDK_HOOK_PAGES_DIR/*.md,native/src/hook/mod.rs,native/src/emit/hook_knobs.rs,native/src/knobs/*.rs dir=one valve=none tier=precommit
|
|
2
|
+
# projection: knob:GATE_SDK_HOOK_PAGES_DIR/*.md
|
|
3
|
+
# install: zero-config
|
|
4
|
+
# armed-by: GATE_SDK_HOOK_PAGES_DIR
|
|
5
|
+
# spec: gate-sdk/SPEC.md §check-hook-knobs-fresh — each hook page's hook-knobs block is the byte-fresh table of its member's knob slice, every page names a member, and every tree-free member has a page
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: gate-sdk/SPEC.md §run-gates — the binary-only recipe's oracle (docs/binary-only.md): on a scratch
|
|
3
|
+
# checkout holding no kit, the direct form's exit codes on a read-only tree, the root positional's
|
|
4
|
+
# narrowing, exit 2 for a missing <KIT>_KNOB_FILE and outside a worktree, GATE_SDK_KIT_DIRS keeping a
|
|
5
|
+
# top-level checks/ directory in the scan, and --run over a registry
|
|
6
|
+
# outside the checkout writing its SARIF log there and leaving the checkout's status empty.
|
|
7
|
+
# Run by the --run-gate-tests arm.
|
|
8
|
+
set -uo pipefail
|
|
9
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
10
|
+
|
|
11
|
+
SRC="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
12
|
+
BIN="$GATE_SDK_NATIVE_BIN"
|
|
13
|
+
[[ -x "$BIN" ]] || { echo "binary-only-recipe.test: gate binary not found: $BIN"; exit 2; }
|
|
14
|
+
|
|
15
|
+
scratch="$(cd -P "$(mktemp -d)" && pwd -P)"
|
|
16
|
+
trap 'chmod -R u+w "$scratch" 2>/dev/null; rm -rf "$scratch"' EXIT
|
|
17
|
+
|
|
18
|
+
fails=0
|
|
19
|
+
assert_rc() { [[ "$2" -eq "$3" ]] || { echo "FAIL [$1]: expected exit $3, got $2"; [[ -n "${4:-}" ]] && printf '%s\n' "$4"; fails=$((fails + 1)); }; }
|
|
20
|
+
assert_clean() {
|
|
21
|
+
local st
|
|
22
|
+
st="$(git -C "$repo" status --porcelain --untracked-files=all --ignored)"
|
|
23
|
+
[[ -z "$st" ]] || { echo "FAIL [$1]: the checkout's status is not empty:"; printf '%s\n' "$st"; fails=$((fails + 1)); }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
# The container: the binary, git, PATH and HOME, and nothing a vendored kit or a knob file would set.
|
|
27
|
+
mkdir -p "$scratch/home"
|
|
28
|
+
container() {
|
|
29
|
+
env -i PATH="$PATH" HOME="$scratch/home" TMPDIR="$scratch" \
|
|
30
|
+
GIT_CONFIG_GLOBAL="$GIT_CONFIG_GLOBAL" GIT_CONFIG_NOSYSTEM=1 \
|
|
31
|
+
GIT_CEILING_DIRECTORIES="$scratch" "$@"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
repo="$scratch/repo"
|
|
35
|
+
mkdir -p "$repo/crates/a" "$repo/owned" "$repo/.github/workflows"
|
|
36
|
+
printf '# A spec\n\nbody\n\n## Definition of Done\n\n- x\n' > "$repo/crates/a/SPEC.md"
|
|
37
|
+
printf '# a\n\n## What changes\n\n### (1) x\n\ny\n\n## Retired spellings\n\n- None — nothing\n' > "$repo/crates/a/SPEC-x.md"
|
|
38
|
+
sha=0123456789abcdef0123456789abcdef01234567
|
|
39
|
+
printf 'on: push\njobs:\n a:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@%s\n' "$sha" > "$repo/owned/ci.yml"
|
|
40
|
+
printf 'on: push\njobs:\n a:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n' > "$repo/.github/workflows/upstream.yml"
|
|
41
|
+
git -C "$repo" init -q
|
|
42
|
+
git -C "$repo" add -A
|
|
43
|
+
git -C "$repo" -c user.name=t -c user.email=t@e.invalid commit -qm base
|
|
44
|
+
|
|
45
|
+
# ---- the direct form, on a read-only checkout ------------------------------------
|
|
46
|
+
chmod -R a-w "$repo"
|
|
47
|
+
for g in check-spec-dod-singleton check-amendment-update-target check-amendment-retired-spelling check-spec-fence-balance; do
|
|
48
|
+
out="$(cd "$repo" && container "$BIN" "$g" 2>&1)"; rc=$?
|
|
49
|
+
assert_rc "direct $g" "$rc" 0 "$out"
|
|
50
|
+
done
|
|
51
|
+
# spec: gate-sdk/SPEC.md §The install disposition — the scan root is the adopter's scope: the
|
|
52
|
+
# upstream workflow reds a whole-tree scan, and the owned directory alone passes
|
|
53
|
+
out="$(cd "$repo" && container "$BIN" check-action-pinning 2>&1)"; rc=$?
|
|
54
|
+
assert_rc "root positional, whole tree" "$rc" 1 "$out"
|
|
55
|
+
out="$(cd "$repo" && container "$BIN" check-action-pinning owned 2>&1)"; rc=$?
|
|
56
|
+
assert_rc "root positional, owned" "$rc" 0 "$out"
|
|
57
|
+
out="$(cd "$repo" && container CANON_KIT_KNOB_FILE="$scratch/absent.knobs" "$BIN" check-spec-dod-singleton 2>&1)"; rc=$?
|
|
58
|
+
assert_rc "missing knob file" "$rc" 2 "$out"
|
|
59
|
+
chmod -R u+w "$repo"
|
|
60
|
+
assert_clean direct
|
|
61
|
+
|
|
62
|
+
# a finding is exit 1, and a knob file outside the checkout configures the gate away from it
|
|
63
|
+
printf '# A spec\n\nbody\n' > "$repo/crates/a/SPEC.md"
|
|
64
|
+
out="$(cd "$repo" && container "$BIN" check-spec-dod-singleton 2>&1)"; rc=$?
|
|
65
|
+
assert_rc "finding" "$rc" 1 "$out"
|
|
66
|
+
printf 'CANON_KIT_DOD_MODE = at-most-one\n' > "$scratch/canon.knobs"
|
|
67
|
+
out="$(cd "$repo" && container CANON_KIT_KNOB_FILE="$scratch/canon.knobs" "$BIN" check-spec-dod-singleton 2>&1)"; rc=$?
|
|
68
|
+
assert_rc "knob file outside the checkout" "$rc" 0 "$out"
|
|
69
|
+
git -C "$repo" checkout -q -- crates/a/SPEC.md
|
|
70
|
+
|
|
71
|
+
# a top-level directory holding checks/ reads as a kit root and leaves the scan; the override keeps it in
|
|
72
|
+
mkdir -p "$repo/tools/checks"
|
|
73
|
+
printf '# A tool spec\n\nbody\n' > "$repo/tools/SPEC.md"
|
|
74
|
+
out="$(cd "$repo" && container "$BIN" check-spec-dod-singleton 2>&1)"; rc=$?
|
|
75
|
+
assert_rc "derived kit roots" "$rc" 0 "$out"
|
|
76
|
+
out="$(cd "$repo" && container GATE_SDK_KIT_DIRS=gate-sdk "$BIN" check-spec-dod-singleton 2>&1)"; rc=$?
|
|
77
|
+
assert_rc "kit-dirs override" "$rc" 1 "$out"
|
|
78
|
+
rm -rf "$repo/tools"
|
|
79
|
+
|
|
80
|
+
# a gate that reads history needs a worktree: a retired spelling declared on a tree without git is exit 2
|
|
81
|
+
mkdir -p "$scratch/nogit"
|
|
82
|
+
cp -R "$repo/crates" "$scratch/nogit/"
|
|
83
|
+
printf '# a\n\n## What changes\n\n### (1) x\n\ny\n\n## Retired spellings\n\n- `oldname` — gone (delta 1)\n' > "$scratch/nogit/crates/a/SPEC-x.md"
|
|
84
|
+
out="$(cd "$scratch/nogit" && container "$BIN" check-amendment-retired-spelling 2>&1)"; rc=$?
|
|
85
|
+
assert_rc "no worktree" "$rc" 2 "$out"
|
|
86
|
+
|
|
87
|
+
# ---- a set with a SARIF verdict, through a registry outside the checkout ---------
|
|
88
|
+
gates="$scratch/gates"
|
|
89
|
+
mkdir -p "$gates"
|
|
90
|
+
printf 'check-spec-dod-singleton\ncheck-spec-fence-balance\n' > "$gates/gates.list"
|
|
91
|
+
cp "$SRC/canon-kit/checks/check-spec-dod-singleton.gate" "$SRC/canon-kit/checks/check-spec-fence-balance.gate" "$gates/"
|
|
92
|
+
sarif="$scratch/gates.sarif"
|
|
93
|
+
out="$(cd "$repo" && container GATE_SDK_SARIF_FILE="$sarif" GATE_SDK_TMP_DIR="$scratch/run" "$BIN" --run --gates-dir "$gates" 2>&1)"; rc=$?
|
|
94
|
+
assert_rc "run" "$rc" 0 "$out"
|
|
95
|
+
[[ -s "$sarif" ]] || { echo "FAIL [run]: no SARIF log at $sarif"; fails=$((fails + 1)); }
|
|
96
|
+
assert_clean run
|
|
97
|
+
|
|
98
|
+
# spec: gate-sdk/SPEC.md §The install disposition — a registered member scans from the tree's root, so
|
|
99
|
+
# an action gate is scoped inside the battery by a member of the adopter's own calling the direct form
|
|
100
|
+
printf 'check-action-pinning\n' > "$gates/gates.list"
|
|
101
|
+
cp "$SRC/gate-sdk/checks/check-action-pinning.gate" "$gates/"
|
|
102
|
+
out="$(cd "$repo" && container GATE_SDK_TMP_DIR="$scratch/run" "$BIN" --run --gates-dir "$gates" 2>&1)"; rc=$?
|
|
103
|
+
assert_rc "run, registered action gate" "$rc" 1 "$out"
|
|
104
|
+
{ printf '#!/usr/bin/env bash\n'
|
|
105
|
+
printf '# graph: couples=owned dir=one valve=none tier=precommit trigger=owned/*\n'
|
|
106
|
+
printf 'exec %q check-action-pinning owned\n' "$BIN"
|
|
107
|
+
} > "$gates/owned-action-pinning.sh"
|
|
108
|
+
chmod +x "$gates/owned-action-pinning.sh"
|
|
109
|
+
printf 'owned-action-pinning\n' > "$gates/gates.list"
|
|
110
|
+
out="$(cd "$repo" && container GATE_SDK_TMP_DIR="$scratch/run" "$BIN" --run --gates-dir "$gates" 2>&1)"; rc=$?
|
|
111
|
+
assert_rc "run, scoped member" "$rc" 0 "$out"
|
|
112
|
+
assert_clean "run, scoped member"
|
|
113
|
+
printf 'check-spec-dod-singleton\ncheck-spec-fence-balance\n' > "$gates/gates.list"
|
|
114
|
+
rm -f "$gates/owned-action-pinning.sh" "$gates/check-action-pinning.gate"
|
|
115
|
+
|
|
116
|
+
# the descriptor is the registry's: a list naming compiled-in gates with no descriptor beside it resolves nothing
|
|
117
|
+
rm -f "$gates"/*.gate
|
|
118
|
+
out="$(cd "$repo" && container GATE_SDK_TMP_DIR="$scratch/run" "$BIN" --run --gates-dir "$gates" 2>&1)"; rc=$?
|
|
119
|
+
assert_rc "run, no descriptor" "$rc" 1 "$out"
|
|
120
|
+
grep -qF '(unresolved)' <<<"$out" || { echo "FAIL [run, no descriptor]: no member reported unresolved"; printf '%s\n' "$out"; fails=$((fails + 1)); }
|
|
121
|
+
assert_clean "run, no descriptor"
|
|
122
|
+
|
|
123
|
+
[[ "$fails" -eq 0 ]] || { echo "binary-only-recipe.test: $fails assertion(s) failed"; exit 1; }
|
|
124
|
+
echo "binary-only-recipe.test: clean (the direct form's four kit-free gates green on a read-only checkout, a finding at exit 1, a missing knob file and a worktree-less tree at exit 2, the root positional narrowing an action gate's scan to the owned directory, a knob file outside the checkout read, a top-level checks/ directory scanned once GATE_SDK_KIT_DIRS names the kit set, and --run over an out-of-tree registry writing its SARIF log outside a checkout left clean, an action gate scoped there by a member of the adopter's own, its members unresolved once its descriptors are gone)"
|
|
125
|
+
exit 0
|
|
@@ -16,6 +16,7 @@ Every governed surface in the repository this map is generated from is held by o
|
|
|
16
16
|
- A **session warning** surfaces context when a session opens. Owner: `context-kit/SPEC.md` §The session-context hook.
|
|
17
17
|
- A **validate suite** holds a test baseline that a per-run evidence manifest attests. Owner: `evidence-kit/SPEC.md` §Baseline manifest.
|
|
18
18
|
- A **monitor** watches deployment truth rather than tree truth, so it reds a scheduled run, never a merge. Owner: `site-kit/SPEC.md` §The monitor boundary.
|
|
19
|
+
- An **observed hook** is a registered hook run under `--observe`, which logs the decision it would have made and refuses nothing. Owner: `gate-sdk/SPEC.md` §The harness-integration arm.
|
|
19
20
|
|
|
20
21
|
The rows below derive from the class registries — the gate registry, the KPI registry, the harness settings hooks, the evidence-suite config, and the `# enforce:` markers a non-gate surface declares itself with — so this map cannot drift from what actually runs. A registry a consumer has not adopted leaves its section absent. A surface that lives under no kit directory, the repository's own rather than a kit's, is grouped as `(consumer)`.
|
|
21
22
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
check-hook-knobs-fresh: hooks/not-a-hook.md names no hook member
|
|
2
|
+
check-hook-knobs-fresh: hooks/shell-guard.md: needs exactly one <!-- hook-knobs:begin --> … <!-- hook-knobs:end --> pair, in order (0 begin, 0 end)
|
|
3
|
+
check-hook-knobs-fresh: stale block — hooks/subagent-stop-liveness.md:3 differs from the table subagent-stop-liveness's knobs derive:
|
|
4
|
+
< | `DELEGATION_KIT_STOP_WAIT` | delegation-kit | scalar | `wait` |
|
|
5
|
+
> | `DELEGATION_KIT_STOP_WAIT` | delegation-kit | scalar | `refuse` |
|
package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/bad/hooks/subagent-stop-liveness.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Subagent stop liveness
|
|
2
|
+
|
|
3
|
+
<!-- hook-knobs:begin -->
|
|
4
|
+
|
|
5
|
+
| Knob | Kit | Shape | Default |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| `DELEGATION_KIT_STOP_LOG` | delegation-kit | scalar | `.workflow/subagent-stop-liveness.log` |
|
|
8
|
+
| `DELEGATION_KIT_STOP_WAIT` | delegation-kit | scalar | `wait` |
|
|
9
|
+
| `DELEGATION_KIT_LIVENESS_CMD` | delegation-kit | indexed | (empty) |
|
|
10
|
+
| `GATE_SDK_TMP_DIR` | gate-sdk | scalar | `.tmp` |
|
|
11
|
+
|
|
12
|
+
<!-- hook-knobs:end -->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
HOOK-KNOBS-FRESH: clean (1 page(s) under hooks carry the tables their members' knobs derive)
|
package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/subagent-stop-liveness.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Subagent stop liveness
|
|
2
|
+
|
|
3
|
+
Prose the gate never reads.
|
|
4
|
+
|
|
5
|
+
<!-- hook-knobs:begin -->
|
|
6
|
+
|
|
7
|
+
| Knob | Kit | Shape | Default |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| `DELEGATION_KIT_STOP_LOG` | delegation-kit | scalar | `.workflow/subagent-stop-liveness.log` |
|
|
10
|
+
| `DELEGATION_KIT_STOP_WAIT` | delegation-kit | scalar | `refuse` |
|
|
11
|
+
| `DELEGATION_KIT_LIVENESS_CMD` | delegation-kit | indexed | (empty) |
|
|
12
|
+
| `GATE_SDK_TMP_DIR` | gate-sdk | scalar | `.tmp` |
|
|
13
|
+
|
|
14
|
+
<!-- hook-knobs:end -->
|
|
15
|
+
|
|
16
|
+
Trailing prose.
|
|
@@ -21,4 +21,22 @@ out="$(bash -c '
|
|
|
21
21
|
exit 1
|
|
22
22
|
}
|
|
23
23
|
[[ "$out" == survived ]] || exit 1
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
hostile="$(mktemp -d)"
|
|
26
|
+
trap 'rm -rf "$hostile"' EXIT
|
|
27
|
+
mkdir -p "$hostile/home/.config/git" "$hostile/plain"
|
|
28
|
+
printf '[core]\n\thooksPath = %s\n' /hostile-system >"$hostile/system.config"
|
|
29
|
+
printf '[core]\n\thooksPath = %s\n' /hostile-global >"$hostile/global.config"
|
|
30
|
+
printf '[core]\n\thooksPath = %s\n' /hostile-home >"$hostile/home/.gitconfig"
|
|
31
|
+
printf '[core]\n\thooksPath = %s\n' /hostile-xdg >"$hostile/home/.config/git/config"
|
|
32
|
+
system=GIT_CONFIG_SYSTEM
|
|
33
|
+
case "${OSTYPE:-}" in msys* | cygwin* | win32*) system=GIT_CONFIG_HOSTILE_UNREAD ;; esac
|
|
34
|
+
leaked="$(env -u GIT_CONFIG_NOSYSTEM "$system=$hostile/system.config" GIT_CONFIG_GLOBAL="$hostile/global.config" \
|
|
35
|
+
HOME="$hostile/home" XDG_CONFIG_HOME="$hostile/home/.config" \
|
|
36
|
+
bash -c 'source "$1"; git -C "$2" config --get-all core.hooksPath' \
|
|
37
|
+
bash "$GATE_SDK_TEST_LIB_DIR/test-hermetic.sh" "$hostile/plain")"
|
|
38
|
+
[[ -z "$leaked" ]] || {
|
|
39
|
+
printf 'FAIL: a sourcing suite read host git config: %s\n' "$leaked"
|
|
40
|
+
exit 1
|
|
41
|
+
}
|
|
42
|
+
echo 'LIB-TEST-HERMETIC: clean (inherited kit variables cleared, binary kept, library and later pins applied, host git config unread)'
|
|
@@ -67,6 +67,21 @@ assert_has nomatch "no registered gate couples to zzz/nowhere.md" "$out"
|
|
|
67
67
|
assert_has nomatch "nothing to run" "$out"
|
|
68
68
|
[[ "$rc" -eq 0 ]] || { echo "FAIL [nomatch]: expected exit 0, got $rc"; fails=$((fails + 1)); }
|
|
69
69
|
|
|
70
|
+
# An empty selection still writes the SARIF log, replacing a prior run's: scope for, no result.
|
|
71
|
+
printf 'stale\n' > "$scratch/log.sarif"
|
|
72
|
+
out="$(GATE_SDK_SARIF_FILE="$scratch/log.sarif" run_for zzz/nowhere.md)"; rc=$?
|
|
73
|
+
[[ "$rc" -eq 0 ]] || { echo "FAIL [emptylog]: expected exit 0, got $rc -- $out"; fails=$((fails + 1)); }
|
|
74
|
+
log="$(cat "$scratch/log.sarif")"
|
|
75
|
+
assert_absent emptylog "stale" "$log"
|
|
76
|
+
assert_has emptylog '"scope": "for"' "$log"
|
|
77
|
+
assert_has emptylog '"results": []' "$log"
|
|
78
|
+
|
|
79
|
+
# An empty selection still refuses a bad result selection at exit 2, naming the knob.
|
|
80
|
+
out="$(GATE_SDK_SARIF_FILE="$scratch/log.sarif" GATE_SDK_SARIF_RESULTS=bogus run_for zzz/nowhere.md)"; rc=$?
|
|
81
|
+
[[ "$rc" -eq 2 ]] || { echo "FAIL [emptyrefusal]: expected exit 2, got $rc -- $out"; fails=$((fails + 1)); }
|
|
82
|
+
assert_has emptyrefusal "GATE_SDK_SARIF_RESULTS" "$out"
|
|
83
|
+
assert_absent emptyrefusal "nothing to run" "$out"
|
|
84
|
+
|
|
70
85
|
# --for with no path is a usage error (exit 2).
|
|
71
86
|
GATE_SDK_GATES_DIR="$scratch" GATE_SDK_KIT_DIRS="$scratch" \
|
|
72
87
|
GATE_SDK_TMP_DIR="$scratch/.tmp" bash "$RUN" --for >/dev/null 2>&1
|
|
@@ -83,5 +98,5 @@ fi
|
|
|
83
98
|
chmod 755 "$scratch/g_glob.sh"
|
|
84
99
|
|
|
85
100
|
[[ "$fails" -eq 0 ]] || { echo "run-for-path.test: $fails assertion(s) failed"; exit 1; }
|
|
86
|
-
echo "run-for-path.test: clean (--for selects by shared matcher; trigger='*' universal, mode=staged pathspec passes args, ungoverned path noted, an unreadable resolved member refused at 2)"
|
|
101
|
+
echo "run-for-path.test: clean (--for selects by shared matcher; trigger='*' universal, mode=staged pathspec passes args, ungoverned path noted and its empty selection logged or its bad result selection refused, an unreadable resolved member refused at 2)"
|
|
87
102
|
exit 0
|
|
@@ -24,6 +24,11 @@ _th_sep=:
|
|
|
24
24
|
case "${OSTYPE:-}" in msys* | cygwin* | win32*) _th_sep=';' ;; esac
|
|
25
25
|
_th_tmp="$(cd -P "${TMPDIR:-/tmp}" && pwd -P)"
|
|
26
26
|
export GIT_CEILING_DIRECTORIES="${_th_tmp}${GIT_CEILING_DIRECTORIES:+${_th_sep}${GIT_CEILING_DIRECTORIES}}"
|
|
27
|
+
# spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — git reads no host global config, and no system config off native Windows
|
|
28
|
+
_th_git_global="${TMPDIR:-/tmp}/gate-sdk-hermetic-empty.gitconfig"
|
|
29
|
+
: >"$_th_git_global"
|
|
30
|
+
export GIT_CONFIG_GLOBAL="$_th_git_global"
|
|
31
|
+
[[ "$_th_sep" == ';' ]] || export GIT_CONFIG_NOSYSTEM=1
|
|
27
32
|
GATE_SDK_TEST_LIB_DIR="$(cd "${BASH_SOURCE[0]%/*}" && pwd)"
|
|
28
33
|
# spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — the gate-sdk root locator, absolute from this library's own anchor, because a suite drives its subject from a sandbox cwd the default cannot reach
|
|
29
34
|
export GATE_SDK_ROOT="${GATE_SDK_TEST_LIB_DIR%/lib}"
|
|
@@ -39,7 +44,7 @@ if [[ -z "${GATE_SDK_NATIVE_BIN:-}" ]]; then
|
|
|
39
44
|
fi
|
|
40
45
|
# spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — gate-sdk's overlay is pinned after the binary read above, outside its already-set guard
|
|
41
46
|
export GATE_SDK_LOCAL_KNOB_FILE="$_th_empty_knobs"
|
|
42
|
-
unset _th_name _th_root _th_empty _th_empty_knobs _th_kit _th_var _th_bin _th_sep _th_tmp
|
|
47
|
+
unset _th_name _th_root _th_empty _th_empty_knobs _th_kit _th_var _th_bin _th_sep _th_tmp _th_git_global
|
|
43
48
|
|
|
44
49
|
# spec: gate-sdk/SPEC.md §run-gate-tests — invoke a gate through its declared dispatch rather
|
|
45
50
|
# than by script path, so a bespoke test names a gate and never a substrate: gate_command
|
|
@@ -103,6 +103,16 @@ if ! grep -qF "validate-batch" "$tmp/err" || ! grep -qF "$live" "$tmp/err"; then
|
|
|
103
103
|
fails=$((fails + 1))
|
|
104
104
|
fi
|
|
105
105
|
|
|
106
|
+
# --- a live record carrying the optional `handoff=` field is the same live producer: it parses
|
|
107
|
+
# through the one grammar, so the guard blocks on it rather than skipping it
|
|
108
|
+
rm -f "$tmp/scratch/validate-batch.run"
|
|
109
|
+
printf 'pid=%s run=handoff-batch handoff=%s/handoff\n' "$live" "$tmp" >"$tmp/scratch/handoff-batch.run"
|
|
110
|
+
want "handoff-record-commit" "git commit -m done" 2
|
|
111
|
+
checks=$((checks + 1))
|
|
112
|
+
grep -qF "handoff-batch" "$tmp/err" || { echo " FAIL [handoff-names-the-run]: $(cat "$tmp/err")"; fails=$((fails + 1)); }
|
|
113
|
+
rm -f "$tmp/scratch/handoff-batch.run"
|
|
114
|
+
printf 'pid=%s run=validate-batch\n' "$live" >"$tmp/scratch/validate-batch.run"
|
|
115
|
+
|
|
106
116
|
# --- a PowerShell call meets the rule too: git's argv and the record are the same
|
|
107
117
|
# under both tools, and its expansion decline is the PowerShell reader's any `$`
|
|
108
118
|
want "powershell-commit" "git commit -m done" 2 "" PowerShell
|
|
@@ -188,5 +198,5 @@ if [[ "$fails" -gt 0 ]]; then
|
|
|
188
198
|
echo "git-mutation-under-producer.test: $fails of $checks assertion(s) failed"
|
|
189
199
|
exit 1
|
|
190
200
|
fi
|
|
191
|
-
echo "git-mutation-under-producer.test: ok ($checks assertions; the write set blocks under a live record on a Bash or a PowerShell call however git and its subcommand are spelled, read-only git and every conservative direction decline, rule \`bounded_write\` withholds a removal of a live record, and rule \`wait_no_producer\` blocks a backgrounded file-test wait, bare or behind a banner, until a record names a live pid)"
|
|
201
|
+
echo "git-mutation-under-producer.test: ok ($checks assertions; the write set blocks under a live record, a handoff-bearing one included, on a Bash or a PowerShell call however git and its subcommand are spelled, read-only git and every conservative direction decline, rule \`bounded_write\` withholds a removal of a live record, and rule \`wait_no_producer\` blocks a backgrounded file-test wait, bare or behind a banner, until a record names a live pid)"
|
|
192
202
|
exit 0
|
|
@@ -74,6 +74,10 @@ gates="${GATE_SDK_NATIVE_BIN:-./scripts/checkwright-gates}"
|
|
|
74
74
|
"$gates" --emit file-gap "<gap>" # route a work-shaped finding to the gap inbox
|
|
75
75
|
"$gates" --emit file-consult "<item>" # route a ruling to reconsider or a request for advice to the consult inbox
|
|
76
76
|
"$gates" --emit consult-count # one line counting the consult inbox, nothing when it is empty
|
|
77
|
+
"$gates" --emit peer-file <peer> <request.md # a peer files a request to the peer channel; prints its id
|
|
78
|
+
"$gates" --emit peer-list # one row per peer request: id, peer, date, state, need
|
|
79
|
+
"$gates" --emit peer-reply <id> filed <slug> # record a request's state; also refused, landed, --landed <slug>, --shipped <tag>
|
|
80
|
+
"$gates" --emit peer-ready <peer> # a peer's shipped requests this binary does not carry yet
|
|
77
81
|
"$gates" --emit file-survey "<question>" "<corpus>" "<oracle>" "<inferred>" "<finding>"
|
|
78
82
|
"$gates" --emit journal "<finding>" # append to the resume journal of the stage you entered
|
|
79
83
|
"$gates" --emit journal --lead "<finding>" # a lead session: append to the lead journal its opener opened
|
|
@@ -85,7 +85,7 @@ check_case "rev-unknown" "$ghost" 1 "rev names no commit in this repository"
|
|
|
85
85
|
# --- an absent record is clean and counted inert: the surface is optional ---
|
|
86
86
|
empty="$SANDBOX/empty"; mkdir -p "$empty"
|
|
87
87
|
seed_repo "$empty" >/dev/null
|
|
88
|
-
check_case "no-record" "$empty" 0 "
|
|
88
|
+
check_case "no-record" "$empty" 0 "clean (not applicable: no record at"
|
|
89
89
|
|
|
90
90
|
# --- a header-only record (the shape the iteration boundary leaves behind) ---
|
|
91
91
|
hdr="$SANDBOX/header-only"; mkdir -p "$hdr/.workflow"
|