checkwright 0.37.0 → 0.39.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/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/gate-tests/check-amendment-queue.test.sh +8 -3
- package/payload/canon-kit/gate-tests/check-amendment-update-target.test.sh +3 -3
- package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +9 -4
- package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +3 -3
- package/payload/canon-kit/gate-tests/check-prose-bounds.test.sh +1 -1
- package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +2 -2
- package/payload/canon-kit/gate-tests/check-provenance-seam/good/TASK-QUEUE.md +4 -0
- package/payload/canon-kit/gate-tests/check-provenance-seam/good/widget-toolkit/SPEC.md +1 -1
- package/payload/canon-kit/gate-tests/check-todo-task-liveness.test.sh +42 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +7 -7
- package/payload/context-kit/gate-tests/check-surface-ratchet.test.sh +7 -6
- package/payload/delegation-kit/README.md +5 -2
- package/payload/delegation-kit/checks/check-brief-authority.gate +4 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/bad/args +1 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/bad/expect.txt +3 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/bad/grant.md +4 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/bad/rules.list +5 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/bad/scripts/delegation-config.knobs +2 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/bad/unquoted.md +2 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/good/args +1 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/good/brief.md +5 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/good/expect.txt +1 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/good/rules.list +5 -0
- package/payload/delegation-kit/gate-tests/check-brief-authority/good/scripts/delegation-config.knobs +2 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +90 -6
- package/payload/delegation-kit/templates/agent-execution.md +1 -1
- package/payload/delegation-kit/templates/brief-rules.list +20 -0
- package/payload/delegation-kit/templates/delegation-config.knobs +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +2 -2
- package/payload/drift-kit/README.md +1 -1
- package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +2 -2
- package/payload/evidence-kit/gate-tests/pre-hook.test.sh +5 -5
- package/payload/evidence-kit/gate-tests/producer-lock.test.sh +7 -7
- package/payload/evidence-kit/gate-tests/statement-store.test.sh +5 -5
- package/payload/evidence-kit/gate-tests/verify-gate-run-strict.test.sh +5 -4
- package/payload/gate-sdk/README.md +7 -0
- package/payload/gate-sdk/bin/build-native.sh +5 -4
- package/payload/gate-sdk/bin/run-gates.ps1 +8 -7
- package/payload/gate-sdk/bin/run-gates.sh +10 -8
- package/payload/gate-sdk/checks/check-binary-strings.gate +4 -0
- package/payload/gate-sdk/checks/check-exec-write.gate +4 -0
- package/payload/gate-sdk/checks/check-migration-guard.gate +4 -0
- package/payload/gate-sdk/checks/check-path-names.gate +4 -0
- package/payload/gate-sdk/checks/check-pipefail-readers.gate +4 -0
- package/payload/gate-sdk/checks/check-script-preflight.gate +4 -0
- package/payload/gate-sdk/checks/check-site-count.gate +4 -0
- package/payload/gate-sdk/checks/check-tree-terms.gate +1 -1
- package/payload/gate-sdk/gate-tests/binary-only-recipe.test.sh +2 -2
- package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +11 -11
- package/payload/gate-sdk/gate-tests/check-binary-strings/bad/expect.txt +4 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/bad/out/app.elf +0 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/bad/out/notes.bin +0 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/bad/scripts/gate-sdk-config.knobs +3 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/bad/shapes.list +2 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/bad/terms.list +2 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/good/out/app.elf +0 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/good/scripts/gate-sdk-config.knobs +3 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/good/shapes.list +2 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings/good/terms.list +4 -0
- package/payload/gate-sdk/gate-tests/check-binary-strings.test.sh +74 -0
- package/payload/gate-sdk/gate-tests/check-exec-write/bad/expect.txt +13 -0
- package/payload/gate-sdk/gate-tests/check-exec-write/bad/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-exec-write/bad/src/caller.rs +5 -0
- package/payload/gate-sdk/gate-tests/check-exec-write/bad/src/helper.rs +5 -0
- package/payload/gate-sdk/gate-tests/check-exec-write/bad/src/sites.rs +19 -0
- package/payload/gate-sdk/gate-tests/check-exec-write/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-exec-write/good/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-exec-write/good/src/helper.rs +5 -0
- package/payload/gate-sdk/gate-tests/check-exec-write/good/src/main.rs +15 -0
- package/payload/gate-sdk/gate-tests/check-exec-write.test.sh +69 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/args +1 -1
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/agent-budget-guard.md +20 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/agent-dispatch-guard.md +14 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/escalation-guard.md +7 -0
- package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/wakeup-guard.md +9 -0
- package/payload/gate-sdk/gate-tests/check-identity.test.sh +2 -2
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/base/0001_init.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/base/0002_orders.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/base/0003_audit.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/destructive.list +4 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/expect.txt +7 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/migrations/0001_init.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/migrations/0002_late.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/migrations/0003_audit_log.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/migrations/0004_prune.sql +3 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/bad/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/good/base/0001_init.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/good/base/0002_legacy.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/good/destructive.list +4 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/good/migrations/0001_init.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/good/migrations/0002_legacy.sql +1 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/good/migrations/0003_retire_legacy.sql +6 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard/good/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-migration-guard.test.sh +136 -0
- package/payload/gate-sdk/gate-tests/check-path-names/bad/expect.txt +6 -0
- package/payload/gate-sdk/gate-tests/check-path-names/bad/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/bad/terms.list +3 -0
- package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/ZePhYr.md +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo/a.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo/zephyr.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo-cli.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo.rs +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo_x.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/good/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/good/terms.list +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/good/tree/foobar.rs +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/good/tree/food/a.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names/good/tree/xfoo.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-path-names.test.sh +66 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/baseline.tsv +4 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/expect.txt +17 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/tree/over.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/tree/readers.sh +16 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/tree/shared-lib.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/tree/stale.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/baseline.tsv +2 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/tree/clean.sh +17 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/tree/lib/baselined-lib.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/tree/no-pipefail.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-pipefail-readers.test.sh +114 -0
- package/payload/gate-sdk/gate-tests/check-portability-floor.test.sh +1 -1
- package/payload/gate-sdk/gate-tests/check-script-preflight/bad/expect.txt +10 -0
- package/payload/gate-sdk/gate-tests/check-script-preflight/bad/rules.list +23 -0
- package/payload/gate-sdk/gate-tests/check-script-preflight/bad/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-script-preflight/bad/tree/submit-job.sh +13 -0
- package/payload/gate-sdk/gate-tests/check-script-preflight/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-script-preflight/good/rules.list +23 -0
- package/payload/gate-sdk/gate-tests/check-script-preflight/good/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-script-preflight/good/tree/submit-job.sh +17 -0
- package/payload/gate-sdk/gate-tests/check-script-preflight.test.sh +110 -0
- package/payload/gate-sdk/gate-tests/check-site-count/bad/expect.txt +4 -0
- package/payload/gate-sdk/gate-tests/check-site-count/bad/rules.list +5 -0
- package/payload/gate-sdk/gate-tests/check-site-count/bad/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-site-count/bad/sites.tsv +3 -0
- package/payload/gate-sdk/gate-tests/check-site-count/bad/tree/new.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-site-count/bad/tree/over.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-site-count/bad/tree/under.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-site-count/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-site-count/good/rules.list +5 -0
- package/payload/gate-sdk/gate-tests/check-site-count/good/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-site-count/good/sites.tsv +2 -0
- package/payload/gate-sdk/gate-tests/check-site-count/good/tree/blob.bin +0 -0
- package/payload/gate-sdk/gate-tests/check-site-count/good/tree/pinned.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-site-count/good/tree/plain.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-site-count/good/tree/tests/helper.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-site-count.test.sh +90 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +11 -8
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/patterns.list +4 -1
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/terms.list +4 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/terms.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/rosters/terms.list +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/words.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +36 -16
- package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +5 -6
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +8 -8
- package/payload/gate-sdk/gate-tests/native-git-hooks.test.sh +7 -7
- package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +4 -4
- package/payload/gate-sdk/gate-tests/run-for-path.test.sh +3 -3
- package/payload/gate-sdk/gate-tests/run-gates-linked-worktree.test.sh +6 -6
- package/payload/gate-sdk/gate-tests/run-json.test.sh +52 -0
- package/payload/gate-sdk/gate-tests/verdict-store.test.sh +99 -0
- package/payload/gate-sdk/lib/gate.sh +12 -9
- package/payload/gate-sdk/lib/test-hermetic.sh +2 -2
- package/payload/gate-sdk/templates/check-skeleton.sh +2 -1
- package/payload/gate-sdk/templates/migration-destructive.list +10 -0
- package/payload/gate-sdk/templates/script-rules.list +39 -0
- package/payload/gate-sdk/templates/strings-shapes.list +15 -0
- package/payload/guard-kit/gate-tests/consumer-rules.test.sh +5 -5
- package/payload/guard-kit/gate-tests/door-binding-corpus.test.sh +2 -2
- package/payload/lifecycle-kit/gate-tests/boundary-worktree-refusal.test.sh +1 -1
- package/payload/lifecycle-kit/gate-tests/check-dispatch-entry.test.sh +1 -1
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +3 -3
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +1 -1
- package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +2 -2
- package/payload/lifecycle-kit/gate-tests/lead-journal-open.test.sh +18 -2
- package/payload/lifecycle-kit/gate-tests/peer-channel.test.sh +35 -6
- package/payload/lifecycle-kit/gate-tests/preflight-valve.test.sh +4 -4
- package/payload/lifecycle-kit/templates/consult.md +1 -1
- package/payload/lifecycle-kit/templates/stages/scope.md +1 -1
- package/payload/queue-kit/README.md +1 -1
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness.test.sh +2 -2
- package/payload/queue-kit/gate-tests/check-task-conservation.test.sh +4 -4
- package/payload/site-kit/gate-tests/check-docs-liquid-parse-parser.test.sh +4 -4
- package/payload/site-kit/gate-tests/check-docs-render-fidelity-batch.test.sh +9 -9
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: gate-sdk/SPEC.md §run-gates — the verdict store end to end through the front end: a
|
|
3
|
+
# registry run on a clean tree keeps its verdict under the key its SARIF log's provenance carries,
|
|
4
|
+
# --verdict-lookup answers it there and answers absent under another digest, a tree that moves while
|
|
5
|
+
# members run or a modified tree keeps nothing, and an unset store is refused with its error
|
|
6
|
+
# document. Run by the --run-gate-tests arm.
|
|
7
|
+
set -uo pipefail
|
|
8
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
9
|
+
|
|
10
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
11
|
+
RUN="$ROOT/gate-sdk/bin/run-gates.sh"
|
|
12
|
+
[[ -x "$RUN" ]] || { echo "verdict-store.test: runner not found: $RUN"; exit 2; }
|
|
13
|
+
|
|
14
|
+
scratch="$(cd -P "$(mktemp -d)" && pwd -P)"
|
|
15
|
+
trap 'rm -rf "$scratch"' EXIT
|
|
16
|
+
|
|
17
|
+
fails=0
|
|
18
|
+
fail() { echo "FAIL [$1]: $2"; [[ -n "${3:-}" ]] && printf '%s\n' "$3"; fails=$((fails + 1)); }
|
|
19
|
+
|
|
20
|
+
repo="$scratch/repo" gates="$scratch/gates" store="$scratch/store" sarif="$scratch/run.sarif"
|
|
21
|
+
mkdir -p "$repo" "$gates"
|
|
22
|
+
printf 'a\n' > "$repo/a.txt"
|
|
23
|
+
git -C "$repo" init -q
|
|
24
|
+
git -C "$repo" add -A
|
|
25
|
+
git -C "$repo" -c user.name=t -c user.email=t@e.invalid commit -qm base
|
|
26
|
+
|
|
27
|
+
# One member, red exactly where the tree holds a file named red.
|
|
28
|
+
{ printf '#!/usr/bin/env bash\n'
|
|
29
|
+
printf '# graph: couples=a.txt dir=one valve=none tier=precommit\n'
|
|
30
|
+
printf '[[ -n "${MOVE_TREE:-}" ]] && { printf "m\\n" >> a.txt; git -c user.name=t -c user.email=t@e.invalid commit -qam moved; }\n'
|
|
31
|
+
printf '[[ -e red ]] && { echo "red: present"; exit 1; }\n'
|
|
32
|
+
printf 'echo "g: clean (no red file)"\n'
|
|
33
|
+
} > "$gates/g.sh"
|
|
34
|
+
chmod +x "$gates/g.sh"
|
|
35
|
+
printf 'g\n' > "$gates/gates.list"
|
|
36
|
+
|
|
37
|
+
# battery <VAR=value>... — the front end's --run on the scratch registry, extra environment first
|
|
38
|
+
battery() {
|
|
39
|
+
(cd "$repo" && env GATE_SDK_GATES_DIR="$gates" GATE_SDK_KIT_DIRS="$gates" GATE_SDK_TMP_DIR="$scratch/tmp" \
|
|
40
|
+
GATE_SDK_SARIF_FILE="$sarif" "$@" bash "$RUN" --run 2>&1)
|
|
41
|
+
}
|
|
42
|
+
lookup() {
|
|
43
|
+
(cd "$repo" && env "$@" bash "$RUN" --verdict-lookup "${key[@]}" 2>/dev/null)
|
|
44
|
+
}
|
|
45
|
+
# The key the run's provenance carries: treeId, tool.version and gateSet, read off the log.
|
|
46
|
+
read_key() {
|
|
47
|
+
local log
|
|
48
|
+
log="$(cat "$sarif")"
|
|
49
|
+
key=(
|
|
50
|
+
"$(grep -oE '"treeId": "[0-9a-f]+"' <<<"$log" | grep -oE '[0-9a-f]{40,64}')"
|
|
51
|
+
"$(awk '/"provenance": \{/ { p = 1 } p && /"tool": \{/ { t = 1 } t && /"version":/ { gsub(/[",]/, "", $2); print $2; exit } t && /\}/ { t = 0 }' <<<"$log")"
|
|
52
|
+
"$(grep -oE '"gateSet": "[0-9a-f]+"' <<<"$log" | grep -oE '[0-9a-f]{64}')"
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
out="$(battery GATE_SDK_VERDICT_STORE="$store")"; rc=$?
|
|
57
|
+
[[ "$rc" -eq 0 ]] || fail "pass run" "expected exit 0, got $rc" "$out"
|
|
58
|
+
read_key
|
|
59
|
+
# spec: gate-sdk/SPEC.md §run-gates — an unstamped binary keeps nothing, so it fails here rather
|
|
60
|
+
# than passing on an empty store
|
|
61
|
+
[[ -n "${key[1]}" ]] || fail "stamp" "the provenance carries no tool.version: the binary is unstamped"
|
|
62
|
+
[[ -n "${key[0]}" && -n "${key[2]}" ]] || fail "key" "the provenance carries no treeId or gateSet" "$(cat "$sarif")"
|
|
63
|
+
|
|
64
|
+
got="$(lookup GATE_SDK_VERDICT_STORE="$store")"; rc=$?
|
|
65
|
+
[[ "$rc" -eq 0 && "$got" == '{"contract":"1.0.0","verdict":"pass"}' ]] || fail "lookup pass" "exit $rc: $got"
|
|
66
|
+
pass_key=("${key[@]}")
|
|
67
|
+
|
|
68
|
+
printf 'r\n' > "$repo/red"
|
|
69
|
+
git -C "$repo" add red
|
|
70
|
+
git -C "$repo" -c user.name=t -c user.email=t@e.invalid commit -qm red
|
|
71
|
+
out="$(battery GATE_SDK_VERDICT_STORE="$store")"; rc=$?
|
|
72
|
+
[[ "$rc" -eq 1 ]] || fail "fail run" "expected exit 1, got $rc" "$out"
|
|
73
|
+
read_key
|
|
74
|
+
got="$(lookup GATE_SDK_VERDICT_STORE="$store")"; rc=$?
|
|
75
|
+
[[ "$rc" -eq 0 && "$got" == '{"contract":"1.0.0","verdict":"fail"}' ]] || fail "lookup fail" "a stored fail is an answer at 0: exit $rc: $got"
|
|
76
|
+
|
|
77
|
+
key=("${pass_key[0]}" "${pass_key[1]}" "$(printf 'f%.0s' {1..64})")
|
|
78
|
+
got="$(lookup GATE_SDK_VERDICT_STORE="$store")"; rc=$?
|
|
79
|
+
[[ "$rc" -eq 0 && "$got" == '{"contract":"1.0.0","verdict":"absent"}' ]] || fail "another digest" "exit $rc: $got"
|
|
80
|
+
|
|
81
|
+
# spec: gate-sdk/SPEC.md §run-gates — a commit landing while members run moves the tree under the
|
|
82
|
+
# run, so its outcomes key nothing
|
|
83
|
+
out="$(battery GATE_SDK_VERDICT_STORE="$scratch/moved" MOVE_TREE=1)"; rc=$?
|
|
84
|
+
[[ "$rc" -eq 1 ]] || fail "moved run" "expected exit 1, got $rc" "$out"
|
|
85
|
+
[[ ! -e "$scratch/moved" ]] || fail "moved run" "a run whose tree moved kept a verdict" "$(ls -A "$scratch/moved")"
|
|
86
|
+
grep -q 'moved while members ran; nothing stored' <<<"$out" || fail "moved run" "no line names the unkept verdict" "$out"
|
|
87
|
+
|
|
88
|
+
printf 'b\n' >> "$repo/a.txt"
|
|
89
|
+
out="$(battery GATE_SDK_VERDICT_STORE="$scratch/modified")"; rc=$?
|
|
90
|
+
[[ "$rc" -eq 1 ]] || fail "modified run" "expected exit 1, got $rc" "$out"
|
|
91
|
+
[[ ! -e "$scratch/modified" ]] || fail "modified run" "a modified tree kept a verdict" "$(ls -A "$scratch/modified")"
|
|
92
|
+
|
|
93
|
+
key=("${pass_key[@]}")
|
|
94
|
+
got="$(lookup)"; rc=$?
|
|
95
|
+
[[ "$rc" -eq 2 && "$got" == '{"contract":"1.0.0","error":"refused"}' ]] || fail "unset store" "exit $rc: $got"
|
|
96
|
+
|
|
97
|
+
[[ "$fails" -eq 0 ]] || { echo "verdict-store.test: $fails assertion(s) failed"; exit 1; }
|
|
98
|
+
echo "verdict-store.test: clean (a registry run on a clean tree kept its pass and its fail under the SARIF log's key, --verdict-lookup answered each at exit 0 and absent under another digest, a tree moved mid-run and a modified tree kept nothing, and an unset store was refused at exit 2 with its error document)"
|
|
99
|
+
exit 0
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
# spec: gate-sdk/SPEC.md §lib/gate.sh — sourced library: values + adapters, never gate structure
|
|
3
3
|
# no-port: gate-sdk/SPEC.md §lib/gate.sh, its port disposition — two grounds. Its API is shell functions sourced into bash callers (CI steps, the installer smoke, the author template, the front-ends and the test harness), and a binary arm cannot be sourced into bash; and its pre-binary accessors answer before any binary exists, the bootstrap cause bin/build-native.sh declares on. Structural, not a sizing judgment.
|
|
4
4
|
|
|
5
|
-
# spec: gate-sdk/SPEC.md §Fail-closed contract — non-zero capture status means the check could not run; exit
|
|
5
|
+
# spec: gate-sdk/SPEC.md §Fail-closed contract — non-zero capture status means the check could not run; exit 3, a tool error, never a false clean
|
|
6
6
|
fail_closed() {
|
|
7
7
|
if [[ "$1" -ne 0 ]]; then
|
|
8
8
|
printf '%s: %s exited %s — the check could not run; treating as ' \
|
|
9
9
|
"$2" "$3" "$1" >&2
|
|
10
10
|
printf 'failure (not clean)\n' >&2
|
|
11
|
-
exit
|
|
11
|
+
exit 3
|
|
12
12
|
fi
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -215,8 +215,11 @@ gate_prune_load() {
|
|
|
215
215
|
[[ -n "${_gate_prune_loaded:-}" ]] && return 0
|
|
216
216
|
local out n el
|
|
217
217
|
out="$(gate_knob_values GATE_SDK_PRUNE_DIRS GATE_SDK_PRUNE_EXTRA_DIRS)" || {
|
|
218
|
+
n=$?
|
|
218
219
|
echo "gate-sdk: the prune set could not be read from the gate binary; treating as failure (not clean)" >&2
|
|
219
|
-
|
|
220
|
+
# spec: gate-sdk/SPEC.md §Output contract — the binary's refusal of a malformed knob stays 2; every other failure to answer is a tool error
|
|
221
|
+
[[ "$n" -eq 2 ]] && exit 2
|
|
222
|
+
exit 3
|
|
220
223
|
}
|
|
221
224
|
_gate_prune=()
|
|
222
225
|
GATE_GREP_EXCLUDES=()
|
|
@@ -268,7 +271,7 @@ gate_resolve() {
|
|
|
268
271
|
return 1
|
|
269
272
|
}
|
|
270
273
|
|
|
271
|
-
# spec: gate-sdk/SPEC.md §lib/gate.sh — resolve a gate name to its *invocation argv*, one element per line; a `.gate` declaration's is the binary's `--emit gate-argv` answer. An absent or non-executable binary,
|
|
274
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — resolve a gate name to its *invocation argv*, one element per line; a `.gate` declaration's is the binary's `--emit gate-argv` answer. An absent or non-executable binary is a tool error at exit 3, and the arm's own refusal or error exits at its status — never a skip and never a pass (§Fail-closed contract).
|
|
272
275
|
gate_command() {
|
|
273
276
|
local g="$1" d bin
|
|
274
277
|
shift
|
|
@@ -283,9 +286,9 @@ gate_command() {
|
|
|
283
286
|
printf 'gate_command: %s dispatches to the native binary, but %s is ' "$g" "$bin" >&2
|
|
284
287
|
printf 'absent or not executable — the gate could not run; treating as ' >&2
|
|
285
288
|
printf 'failure (not clean). Build it: bash gate-sdk/bin/build-native.sh\n' >&2
|
|
286
|
-
exit
|
|
289
|
+
exit 3
|
|
287
290
|
fi
|
|
288
|
-
"$bin" --emit gate-argv "$d/$g.gate" || exit
|
|
291
|
+
"$bin" --emit gate-argv "$d/$g.gate" || exit
|
|
289
292
|
return 0
|
|
290
293
|
fi
|
|
291
294
|
done
|
|
@@ -358,13 +361,13 @@ gate_kit_roots() {
|
|
|
358
361
|
gate_check_dirs() {
|
|
359
362
|
gate_sdk_gates_dir
|
|
360
363
|
local k roots
|
|
361
|
-
roots="$(gate_kit_roots)" || return
|
|
364
|
+
roots="$(gate_kit_roots)" || return
|
|
362
365
|
while IFS= read -r k; do
|
|
363
366
|
[[ -n "$k" ]] && printf '%s/checks\n' "$k"
|
|
364
367
|
done <<<"$roots"
|
|
365
368
|
}
|
|
366
369
|
|
|
367
|
-
# spec: gate-sdk/SPEC.md §check-commit-msg — resolve the banned-pattern file set shared by check-commit-msg and check-tree-terms: explicit positional args win; otherwise GATE_SDK_MSG_PATTERN_FILES (tracked, must exist — fail-closed) plus GATE_SDK_MSG_PATTERN_FILES_LOCAL (gitignored, skipped when absent). Both are whitespace lists split with no expansion. Emits one existing readable file path per line; returns 2 when a required tracked file is missing.
|
|
370
|
+
# spec: gate-sdk/SPEC.md §check-commit-msg — resolve the banned-pattern file set shared by check-commit-msg and check-tree-terms: explicit positional args win; otherwise GATE_SDK_MSG_PATTERN_FILES (tracked, must exist — fail-closed) plus GATE_SDK_MSG_PATTERN_FILES_LOCAL (gitignored, skipped when absent). Both are whitespace lists split with no expansion. Emits one existing readable file path per line; returns 2 when a required tracked file is missing and 3 when one is unreadable.
|
|
368
371
|
gate_msg_pattern_files() {
|
|
369
372
|
if [[ $# -gt 0 ]]; then
|
|
370
373
|
printf '%s\n' "$@"
|
|
@@ -376,7 +379,7 @@ gate_msg_pattern_files() {
|
|
|
376
379
|
read -ra local_files <<<"$(_gate_prebinary_knob GATE_SDK_MSG_PATTERN_FILES_LOCAL "$dir/msg-patterns.local.list")"
|
|
377
380
|
for f in ${required[@]+"${required[@]}"}; do
|
|
378
381
|
[[ -f "$f" ]] || { echo "gate_msg_pattern_files: required tracked pattern file missing: $f" >&2; return 2; }
|
|
379
|
-
[[ -r "$f" ]] || { echo "gate_msg_pattern_files: pattern file not readable: $f" >&2; return
|
|
382
|
+
[[ -r "$f" ]] || { echo "gate_msg_pattern_files: pattern file not readable: $f" >&2; return 3; }
|
|
380
383
|
printf '%s\n' "$f"
|
|
381
384
|
done
|
|
382
385
|
for f in ${local_files[@]+"${local_files[@]}"}; do
|
|
@@ -55,13 +55,13 @@ gate_env() { # $1.. = NAME=VALUE — a case's environment, applied in the calle
|
|
|
55
55
|
return 0
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
# spec: gate-sdk/SPEC.md §The non-gate arm — the arm counterpart of gate_run below: invoke an arm through the binary rather than through bin/run-gates.sh. That front-end cds to the git toplevel and refuses outside a repository, and a hermetic harness drives its subject from a non-git sandbox cwd, so the harness locates the binary itself — the sanctioned second caller, not a second entry point into the emission path. An absent binary is exit
|
|
58
|
+
# spec: gate-sdk/SPEC.md §The non-gate arm — the arm counterpart of gate_run below: invoke an arm through the binary rather than through bin/run-gates.sh. That front-end cds to the git toplevel and refuses outside a repository, and a hermetic harness drives its subject from a non-git sandbox cwd, so the harness locates the binary itself — the sanctioned second caller, not a second entry point into the emission path. An absent binary is exit 3, a tool error, the verdict the dispatcher gives it.
|
|
59
59
|
gate_arm_run() { # $1=arm flag $2.. = the arm's own argv
|
|
60
60
|
local _ar_bin
|
|
61
61
|
# shellcheck source=./gate.sh
|
|
62
62
|
source "$GATE_SDK_TEST_LIB_DIR/gate.sh"
|
|
63
63
|
_ar_bin="$(gate_native_bin)"
|
|
64
|
-
[[ -x "$_ar_bin" ]] || return
|
|
64
|
+
[[ -x "$_ar_bin" ]] || return 3
|
|
65
65
|
"$_ar_bin" "$@"
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -8,8 +8,9 @@ SDK="${GATE_SDK_ROOT:-"${BASH_SOURCE[0]%/*}/../gate-sdk"}"
|
|
|
8
8
|
# shellcheck source=../lib/gate.sh
|
|
9
9
|
source "$SDK/lib/gate.sh"
|
|
10
10
|
|
|
11
|
+
[[ $# -le 1 ]] || { echo "check-skeleton: takes at most one file" >&2; exit 2; } # exit 2: the request refused as given — the caller fixes it
|
|
11
12
|
FILE="${1:-README.md}"
|
|
12
|
-
[[ -f "$FILE" ]] || { echo "check-skeleton: not found: $FILE" >&2; exit
|
|
13
|
+
[[ -f "$FILE" ]] || { echo "check-skeleton: not found: $FILE" >&2; exit 3; } # exit 3: a tool or input error — something the tool reads could not be read
|
|
13
14
|
|
|
14
15
|
out="$(grep -Hn -- 'never-matching-placeholder' "$FILE")"; st=$?
|
|
15
16
|
[[ "$st" -le 1 ]] || fail_closed "$st" check-skeleton grep # grep exit 1 is no match, a verdict
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# migration-destructive.list — destructive-statement template for check-migration-guard.
|
|
2
|
+
# gate-sdk/SPEC.md §check-migration-guard. One POSIX ERE per line; '#' comments and
|
|
3
|
+
# blank lines are ignored. Copy to your gates dir as migration-destructive.list and
|
|
4
|
+
# point GATE_SDK_MIGRATION_DIR at your migration directory. An ERE matches a
|
|
5
|
+
# statement with its comments and quoted strings stripped, each whitespace run read
|
|
6
|
+
# as one space, and upper-cased. A deliberate destructive statement takes
|
|
7
|
+
# '-- migration-ok: <reason>' on one of its lines.
|
|
8
|
+
DROP (TABLE|INDEX|VIEW|TRIGGER)
|
|
9
|
+
ALTER TABLE .* DROP
|
|
10
|
+
ALTER TABLE .* RENAME
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# script-rules.list — rules template for check-script-preflight.
|
|
2
|
+
# gate-sdk/SPEC.md §check-script-preflight. Copy to your gates dir as
|
|
3
|
+
# script-rules.list, name your scripts in GATE_SDK_SCRIPT_FILES, and uncomment
|
|
4
|
+
# the blocks you want, each bound to your own commands, paths and grammars.
|
|
5
|
+
#
|
|
6
|
+
# A block opens with 'rule <ID> <kind>' and takes the indented '<key> <value>'
|
|
7
|
+
# lines after it; '#' lines and blank lines are ignored. An ERE value is a search,
|
|
8
|
+
# so anchor it with ^ and $ to match the whole text. A site a rule cannot see is
|
|
9
|
+
# cleared by '# <waiver>: <reason>' on any physical line of its logical line.
|
|
10
|
+
|
|
11
|
+
# The shortest waiver reason, in characters; the default is 1.
|
|
12
|
+
# waiver-min 10
|
|
13
|
+
|
|
14
|
+
# Commands whose here-doc or quoted operand is read as a script of its own.
|
|
15
|
+
# body sbatch
|
|
16
|
+
|
|
17
|
+
# command: every invocation of cmd is refused unless an allow ERE matches its
|
|
18
|
+
# text, a before ERE matches the code ahead of it on its line, or a waiver clears it.
|
|
19
|
+
# rule KILL-BY-PARENT command
|
|
20
|
+
# cmd pkill
|
|
21
|
+
# allow ^pkill -P "[$][A-Za-z_][A-Za-z0-9_]*"$
|
|
22
|
+
# before ^timeout [0-9]+ $
|
|
23
|
+
# waiver kill-ok
|
|
24
|
+
|
|
25
|
+
# forbidden-token: a line's code holding any token is refused.
|
|
26
|
+
# rule SHARED-MOUNT forbidden-token
|
|
27
|
+
# token /mnt/shared
|
|
28
|
+
# waiver mount-ok
|
|
29
|
+
|
|
30
|
+
# early-exit: a reader that stops early, fed under pipefail.
|
|
31
|
+
# rule PIPEFAIL-READER early-exit
|
|
32
|
+
# waiver pipefail-ok
|
|
33
|
+
|
|
34
|
+
# id-grammar: each listed flag's value in an invocation of cmd must match grammar.
|
|
35
|
+
# rule OWNER-ID id-grammar
|
|
36
|
+
# cmd submit
|
|
37
|
+
# flag --owner
|
|
38
|
+
# grammar ^[a-z][a-z0-9_]{2,31}$
|
|
39
|
+
# waiver owner-ok
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# strings-shapes.list — starter leak-shape roster for check-binary-strings.
|
|
2
|
+
# gate-sdk/SPEC.md §check-binary-strings. One POSIX ERE per line, matched against
|
|
3
|
+
# each printable string a named build output ships; '#' comments and blank lines
|
|
4
|
+
# are ignored, and a '# rule: <ID>' line names the rule id of every shape after it.
|
|
5
|
+
# Copy to your gates dir as strings-shapes.list and name your shipped outputs in
|
|
6
|
+
# GATE_SDK_STRINGS_FILES; delete a shape your binaries carry by design.
|
|
7
|
+
|
|
8
|
+
# rule: HOME-PATH
|
|
9
|
+
/(home|root|Users)/
|
|
10
|
+
|
|
11
|
+
# rule: REGISTRY-PATH
|
|
12
|
+
\.cargo/registry/
|
|
13
|
+
|
|
14
|
+
# rule: URL
|
|
15
|
+
[A-Za-z][A-Za-z0-9+.-]*://
|
|
@@ -265,7 +265,7 @@ has "derive-nocases-named" "$tmp/out" "GUARD_KIT_CONSUMER_VARIANT_LIMITS"
|
|
|
265
265
|
eq "derive-nofile-status" "$(lane "$(derive_knobs nofile no-such-limits.tsv)")" 2
|
|
266
266
|
has "derive-nofile-named" "$tmp/out" "GUARD_KIT_CONSUMER_VARIANT_LIMITS"
|
|
267
267
|
printf 'block\tcd_compound\tsq-lead\n' >"$tmp/cwd/lane-bad-limits.tsv"
|
|
268
|
-
eq "derive-unreadable-status" "$(lane "$(derive_knobs unreadable lane-bad-limits.tsv)")"
|
|
268
|
+
eq "derive-unreadable-status" "$(lane "$(derive_knobs unreadable lane-bad-limits.tsv)")" 3
|
|
269
269
|
has "derive-unreadable-named" "$tmp/out" "GUARD_KIT_CONSUMER_VARIANT_LIMITS"
|
|
270
270
|
|
|
271
271
|
# --- the variant lane reads the fifth positional: a limit row nothing needs is a mismatch, and a
|
|
@@ -278,14 +278,14 @@ limits() { # $1=name $2..=rows — a limits table of those rows, its path echoe
|
|
|
278
278
|
}
|
|
279
279
|
eq "limits-stale-status" "$(lane "$tmp/lane-off.knobs" "$(limits stale 'fallthrough\tcd_compound\tsq-lead')")" 1
|
|
280
280
|
has "limits-stale-named" "$tmp/out" "limit row 'cd_compound sq-lead' admits a re-spelling that no longer fails"
|
|
281
|
-
eq "limits-floor-status" "$(lane "$tmp/lane-off.knobs" "$(limits floor 'block\tcd_compound\tsq-lead')")"
|
|
282
|
-
eq "limits-transform-status" "$(lane "$tmp/lane-off.knobs" "$(limits transform 'allow\tcd_compound\tsq')")"
|
|
283
|
-
eq "limits-twice-status" "$(lane "$tmp/lane-off.knobs" "$(limits twice 'allow\tcd_compound\tsq-lead' 'fallthrough\tcd_compound\tsq-lead')")"
|
|
281
|
+
eq "limits-floor-status" "$(lane "$tmp/lane-off.knobs" "$(limits floor 'block\tcd_compound\tsq-lead')")" 3
|
|
282
|
+
eq "limits-transform-status" "$(lane "$tmp/lane-off.knobs" "$(limits transform 'allow\tcd_compound\tsq')")" 3
|
|
283
|
+
eq "limits-twice-status" "$(lane "$tmp/lane-off.knobs" "$(limits twice 'allow\tcd_compound\tsq-lead' 'fallthrough\tcd_compound\tsq-lead')")" 3
|
|
284
284
|
eq "limits-missing-status" "$(lane "$tmp/lane-off.knobs" "$tmp/no-such-limits.tsv")" 2
|
|
285
285
|
|
|
286
286
|
if [[ "$fails" -gt 0 ]]; then
|
|
287
287
|
echo "consumer-rules.test: $fails of $checks assertion(s) failed"
|
|
288
288
|
exit 1
|
|
289
289
|
fi
|
|
290
|
-
echo "consumer-rules.test: ok ($checks assertions; the consumer command reads the payload bytes as received with the working directory and environment inherited, a block and a decision are relayed verbatim ahead of the generic ruleset, an empty result falls through to it, a fault — non-zero-non-2 exit, unparseable or non-object stdout, a command that cannot start — rides the ruleset's own answer and never silences it, an empty knob runs no stage; --guard-json field reads bytes verbatim, view prints the named view through the tool's reader, nothing for a tool no reader serves, and words prints the word read's values a segment a line, nothing where the read answers nothing, and refuses an operand; a raw control byte is blocked by name before any rule; --run-guard-tests' consumer lane drives the consumer's rows against its command from the arm's working directory, reds a mismatch either way, is silent where no table is named, and refuses a table with no command or no file at exit 2, and derives its rows' re-spellings only under a named limits table, held from both sides and refused at exit 2 with
|
|
290
|
+
echo "consumer-rules.test: ok ($checks assertions; the consumer command reads the payload bytes as received with the working directory and environment inherited, a block and a decision are relayed verbatim ahead of the generic ruleset, an empty result falls through to it, a fault — non-zero-non-2 exit, unparseable or non-object stdout, a command that cannot start — rides the ruleset's own answer and never silences it, an empty knob runs no stage; --guard-json field reads bytes verbatim, view prints the named view through the tool's reader, nothing for a tool no reader serves, and words prints the word read's values a segment a line, nothing where the read answers nothing, and refuses an operand; a raw control byte is blocked by name before any rule; --run-guard-tests' consumer lane drives the consumer's rows against its command from the arm's working directory, reds a mismatch either way, is silent where no table is named, and refuses a table with no command or no file at exit 2, and derives its rows' re-spellings only under a named limits table, held from both sides and refused with no cases table or no table file at exit 2 and with an unparseable table at exit 3; its variant lane counts the four tables' derived rows, reds a limit row nothing needs and refuses a limits table with no file at exit 2 and one it cannot parse at exit 3)"
|
|
291
291
|
exit 0
|
|
@@ -54,7 +54,7 @@ want "absent-entry" "no/such/page.md" 2 "resolves to neither a tracked file nor
|
|
|
54
54
|
printf 'untracked\n' >"$tmp/loose.md"
|
|
55
55
|
want "untracked-entry" "loose.md" 2 "resolves to neither a tracked file nor a directory"
|
|
56
56
|
|
|
57
|
-
# --- an unreadable configured surface: exit
|
|
57
|
+
# --- an unreadable configured surface: exit 3 rather than a clean over a corpus
|
|
58
58
|
# the gate could not read. Skipped for a caller that reads a mode-000 file anyway.
|
|
59
59
|
mkdir -p "$tmp/locked"
|
|
60
60
|
printf 'bash gate-sdk/bin/run-gates.sh --run-demo\n' >"$tmp/locked/page.md"
|
|
@@ -64,7 +64,7 @@ chmod 000 "$tmp/locked/page.md"
|
|
|
64
64
|
if head -c1 "$tmp/locked/page.md" >/dev/null 2>&1; then
|
|
65
65
|
echo " note: skipping the unreadable-surface case — this caller reads a mode-000 file"
|
|
66
66
|
else
|
|
67
|
-
want "unreadable-surface" "locked"
|
|
67
|
+
want "unreadable-surface" "locked" 3 "unreadable corpus file"
|
|
68
68
|
fi
|
|
69
69
|
chmod 644 "$tmp/locked/page.md"
|
|
70
70
|
|
|
@@ -215,7 +215,7 @@ seed "$refused"
|
|
|
215
215
|
printf 'gitdir: %s/absent\n' "$refused" >"$refused/.git"
|
|
216
216
|
before="$(state_of "$refused")"
|
|
217
217
|
out="$(run_enter "$refused" scope)"; rc=$?
|
|
218
|
-
[[ "$rc" -eq
|
|
218
|
+
[[ "$rc" -eq 3 && "$out" == *"marks a repository"* ]] || note refused "a refused repository skipped the worktree check (want exit 3 naming the mark): rc=$rc $out"
|
|
219
219
|
[[ "$(state_of "$refused")" == "$before" ]] || note refused-write "the refused entry wrote the state file"
|
|
220
220
|
|
|
221
221
|
[[ "$fails" -eq 0 ]] || { echo "boundary-worktree-refusal.test: $fails assertion(s) failed"; exit 1; }
|
|
@@ -56,7 +56,7 @@ expect 2 "$rc" "a missing message file fails closed"
|
|
|
56
56
|
(gate_run check-dispatch-entry "$DIR/checks" "$tmp/msg.txt" "$tmp/one.txt" >/dev/null 2>&1); rc=$?
|
|
57
57
|
expect 2 "$rc" "two arguments is a usage error"
|
|
58
58
|
(gate_run check-dispatch-entry "$DIR/checks" "$tmp/msg.txt" "$tmp/nope.txt" "$tmp/head.txt" "$tmp/head.txt" "$tmp/work.txt" >/dev/null 2>&1); rc=$?
|
|
59
|
-
expect
|
|
59
|
+
expect 3 "$rc" "an unreadable marker fails closed"
|
|
60
60
|
|
|
61
61
|
if [[ "$fails" -gt 0 ]]; then
|
|
62
62
|
echo "check-dispatch-entry.test: $fails assertion(s) failed"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# good/bad pair cannot hold: (A) a malformed disposition line reds on grammar;
|
|
4
4
|
# (B) a Lessons entry still present in the worktree is not a removal, so it
|
|
5
5
|
# needs no stamp; (C) a stored prefix matches a longer lead line (prefix join);
|
|
6
|
-
# (D-F) bare mode is clean outside a repository and exit
|
|
6
|
+
# (D-F) bare mode is clean outside a repository and exit 3 in one git refuses,
|
|
7
7
|
# a nested one git skips included.
|
|
8
8
|
#
|
|
9
9
|
# Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
|
|
@@ -64,13 +64,13 @@ bare_case "D no-repository" "$SANDBOX/none" 0 "no git repository"
|
|
|
64
64
|
# E: bare mode in a repository git refuses is the crosser's refusal, never that clean answer.
|
|
65
65
|
mkdir -p "$SANDBOX/refused"
|
|
66
66
|
printf 'gitdir: %s/absent\n' "$SANDBOX/refused" >"$SANDBOX/refused/.git"
|
|
67
|
-
bare_case "E refused-repository" "$SANDBOX/refused"
|
|
67
|
+
bare_case "E refused-repository" "$SANDBOX/refused" 3 "marks a repository"
|
|
68
68
|
|
|
69
69
|
# F: a nested repository git skips is refused too, though git answers the enclosing one at exit 0.
|
|
70
70
|
git init -q "$SANDBOX/outer"
|
|
71
71
|
mkdir -p "$SANDBOX/outer/inner/.git"
|
|
72
72
|
printf 'garbage\n' >"$SANDBOX/outer/inner/.git/HEAD"
|
|
73
|
-
bare_case "F nested-skipped-repository" "$SANDBOX/outer/inner"
|
|
73
|
+
bare_case "F nested-skipped-repository" "$SANDBOX/outer/inner" 3 "marks a repository beneath it"
|
|
74
74
|
|
|
75
75
|
if [[ "$fails" -gt 0 ]]; then
|
|
76
76
|
echo "check-lesson-disposition.test.sh: $fails case(s) failed"
|
|
@@ -44,7 +44,7 @@ cat >"$u/AGENT.md" <<'EOF'
|
|
|
44
44
|
<!-- lifecycle-kit:begin -->
|
|
45
45
|
The block opened but the end marker is gone.
|
|
46
46
|
EOF
|
|
47
|
-
check_case "unpaired-marker-failclosed" "$u"
|
|
47
|
+
check_case "unpaired-marker-failclosed" "$u" 3 "end marker missing"
|
|
48
48
|
|
|
49
49
|
# --- agent-file-missing: the configured target does not exist (fail-closed) ---
|
|
50
50
|
m="$SANDBOX/missing"; mkdir -p "$m"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
# matching none), the widened arm over git-object-shaped tokens in the OTHER four
|
|
11
11
|
# fields, which the hermetic pair cannot reach for the same reason, and its valve;
|
|
12
12
|
# plus the two inert shapes (no record at all, a header-only record), and a
|
|
13
|
-
# repository git refuses, which exits
|
|
13
|
+
# repository git refuses, which exits 3 rather than degrading to grammar only.
|
|
14
14
|
#
|
|
15
15
|
# Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
|
|
16
16
|
set -uo pipefail
|
|
@@ -139,7 +139,7 @@ check_case "valve-no-reason-still-probes" "$noreason" 1 "token names no object i
|
|
|
139
139
|
refused="$SANDBOX/refused"; mkdir -p "$refused"
|
|
140
140
|
printf 'gitdir: %s/absent\n' "$refused" >"$refused/.git"
|
|
141
141
|
write_record "$refused" "$(printf 'a%.0s' {1..40})"
|
|
142
|
-
check_case "refused-repository" "$refused"
|
|
142
|
+
check_case "refused-repository" "$refused" 3 "marks a repository"
|
|
143
143
|
|
|
144
144
|
if [[ "$fails" -gt 0 ]]; then
|
|
145
145
|
echo "check-survey-record.test.sh: $fails case(s) failed"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — --open-lead-journal end-to-end through a sandboxed enter-stage: the heading keyed on fields 2 through the last of the last stamp, creation with its directory, append after an undisposed segment, a disposed segment dropped, the idempotent no-op, --simulate writing nothing, the surplus refusal, the none key on a stampless state file, the session-role marker (written, rewritten on the journal no-op, left alone when held, skipped where the id does not derive, simulated unwritten, never written on a refusal), and no stamp ever appended
|
|
2
|
+
# spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — --open-lead-journal end-to-end through a sandboxed enter-stage: the heading keyed on fields 2 through the last of the last stamp, creation with its directory, append after an undisposed segment, a disposed segment dropped, the idempotent no-op, --simulate writing nothing, the surplus refusal, the none key on a stampless state file, the session-role marker (written, naming a resumed lead beside a newer stage child, rewritten on the journal no-op, left alone when held, skipped where the id does not derive, simulated unwritten, never written on a refusal), and no stamp ever appended
|
|
3
3
|
set -uo pipefail
|
|
4
4
|
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
5
5
|
|
|
@@ -83,6 +83,22 @@ out="$( cd "$sk" && unset LIFECYCLE_KIT_SESSION_ID CLAUDE_CODE_SESSION_ID CLAUDE
|
|
|
83
83
|
[[ -e "$sk/scratch/session-role" ]] && note marker-skip-file "an underived id wrote a marker"
|
|
84
84
|
grep -qF 'skipped the session-role marker' <<<"$out" || note marker-skip-report "the skip is not named: $out"
|
|
85
85
|
|
|
86
|
+
# --- a resumed lead: the harness's child flag set beside the lead's own uuid, a stage child's
|
|
87
|
+
# transcript newer than the lead's, and the marker still names the lead ---
|
|
88
|
+
rl="$SANDBOX/resumed-lead"
|
|
89
|
+
seed "$rl" stamps
|
|
90
|
+
lead_uuid=11112222-3333-4444-5555-666677778888
|
|
91
|
+
mkdir -p "$rl/sessions/$lead_uuid/subagents"
|
|
92
|
+
touch -t 202001010000 "$rl/sessions/$lead_uuid.jsonl"
|
|
93
|
+
touch -t 202001010001 "$rl/sessions/$lead_uuid/subagents/agent-aaaabbbb0000.jsonl"
|
|
94
|
+
out="$( cd "$rl" && unset LIFECYCLE_KIT_SESSION_ID \
|
|
95
|
+
&& gate_env GATE_SDK_TMP_DIR="$rl/scratch" LIFECYCLE_KIT_SESSIONS_DIR="$rl/sessions" \
|
|
96
|
+
CLAUDE_CODE_SESSION_ID="$lead_uuid" CLAUDE_CODE_CHILD_SESSION=1 \
|
|
97
|
+
&& gate_arm_run --enter-stage --open-lead-journal 2>&1 )"; rc=$?
|
|
98
|
+
[[ "$rc" -eq 0 ]] || note marker-resumed-lead "want exit 0, got $rc -- $out"
|
|
99
|
+
[[ "$(cat "$rl/scratch/session-role" 2>/dev/null)" == "lead 11112222" ]] \
|
|
100
|
+
|| note marker-resumed-lead-id "the marker does not name the lead: $(cat "$rl/scratch/session-role" 2>/dev/null)"
|
|
101
|
+
|
|
86
102
|
# --- --simulate relays the marker line and path under its prefix and writes no marker ---
|
|
87
103
|
ms="$SANDBOX/marker-simulate"
|
|
88
104
|
seed "$ms" stamps
|
|
@@ -156,5 +172,5 @@ out="$(run_open "$no" --open-lead-journal)"; rc=$?
|
|
|
156
172
|
|| note none-heading "a stampless state file did not key on none: $(cat "$no/scratch/lead-journal.md" 2>/dev/null)"
|
|
157
173
|
|
|
158
174
|
[[ "$fails" -eq 0 ]] || { echo "lead-journal-open.test: $fails assertion(s) failed"; exit 1; }
|
|
159
|
-
echo "lead-journal-open.test: clean (--open-lead-journal creates its keyed heading, appends after an undisposed segment, drops a disposed one, no-ops at the same cursor, simulates read-only under its prefix, refuses a surplus argument with nothing written, keys on none without a stamp, writes the session-role marker, rewrites it on the no-op, leaves a held one alone, skips it at exit 0 where the id does not derive, simulates it unwritten, and never stamps)"
|
|
175
|
+
echo "lead-journal-open.test: clean (--open-lead-journal creates its keyed heading, appends after an undisposed segment, drops a disposed one, no-ops at the same cursor, simulates read-only under its prefix, refuses a surplus argument with nothing written, keys on none without a stamp, writes the session-role marker, names a resumed lead in it beside a newer stage child, rewrites it on the no-op, leaves a held one alone, skips it at exit 0 where the id does not derive, simulates it unwritten, and never stamps)"
|
|
160
176
|
exit 0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# spec: lifecycle-kit/SPEC.md §The peer request channel — the four arms end-to-end over a scratch channel outside any repository: a request files from a non-git directory and lists as received, every legal move lands and an illegal one is refused leaving the reply byte-identical, both bulk forms move their matches and a bulk form matching none prints nothing, the ready notice prints a later release and stays silent on an earlier one, a malformed body, a tab in the need line
|
|
2
|
+
# spec: lifecycle-kit/SPEC.md §The peer request channel — the four arms end-to-end over a scratch channel outside any repository: a request files from a non-git directory and lists as received, every legal move lands and an illegal one is refused leaving the reply byte-identical, both bulk forms move their matches and a bulk form matching none prints nothing, the ready notice prints a later release and stays silent on an earlier one, a malformed body, a tab in the need line, an edited request and a multibyte filing time are input errors at exit 3, a tab in a refused reason, a relative channel, a missing one and one inside a work tree are refused at exit 2, a same-second refiling is a collision at exit 2 with the id alone on stdout and every other refusal prints nothing there, an unset channel reads as nothing, moves nothing in bulk and refuses a filing or a targeted move, and with no repository a stray scripts/ knob file configures neither peer arm
|
|
3
3
|
set -uo pipefail
|
|
4
4
|
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
5
5
|
|
|
@@ -81,30 +81,59 @@ out="$(arm "$CH" --emit-peer-ready peer-c)"; rc=$?
|
|
|
81
81
|
cp "$CH/$id.md" "$SANDBOX/keep.md"
|
|
82
82
|
printf 'more\n' >>"$CH/$id.md"
|
|
83
83
|
out="$(arm "$CH" --emit-peer-list)"; rc=$?
|
|
84
|
-
[[ "$rc" -eq
|
|
84
|
+
[[ "$rc" -eq 3 && "$out" == *"$id.md"*"edited after filing"* ]] || note edited "got $rc -- $out"
|
|
85
85
|
cp "$SANDBOX/keep.md" "$CH/$id.md"
|
|
86
86
|
|
|
87
87
|
# --- a malformed body is refused naming the section, and nothing is filed ---
|
|
88
88
|
n="$(find "$CH" -name '*.md' | wc -l)"
|
|
89
89
|
out="$(printf '## need\nx\n\n## wanted\ny\n' | arm "$CH" --emit-peer-file peer-a)"; rc=$?
|
|
90
|
-
[[ "$rc" -eq
|
|
90
|
+
[[ "$rc" -eq 3 && "$out" == *"## wanted"*"## repro"* ]] || note malformed "got $rc -- $out"
|
|
91
91
|
[[ "$(find "$CH" -name '*.md' | wc -l)" -eq "$n" ]] || note malformed-write "a malformed body was filed"
|
|
92
92
|
|
|
93
93
|
# --- a tab is refused where peer-list prints it: the need line and a refused reason ---
|
|
94
94
|
TAB=$'\t'
|
|
95
95
|
out="$(printf '%s' "${BODY/the gate refuses a path/a tabbed${TAB}ask}" | arm "$CH" --emit-peer-file peer-a)"; rc=$?
|
|
96
|
-
[[ "$rc" -eq
|
|
96
|
+
[[ "$rc" -eq 3 && "$out" == *"holds a tab"* ]] || note tab-need "got $rc -- $out"
|
|
97
97
|
[[ "$(find "$CH" -name '*.md' | wc -l)" -eq "$n" ]] || note tab-need-write "a tabbed need line was filed"
|
|
98
98
|
out="$(arm "$CH" --emit-peer-reply "$id3" refused $'no\tthanks')"; rc=$?
|
|
99
99
|
[[ "$rc" -eq 2 && "$out" == *"holds a tab"* ]] || note tab-reason "got $rc -- $out"
|
|
100
100
|
|
|
101
|
-
# --- a multibyte character across the filing time's byte 10 is malformed at exit
|
|
101
|
+
# --- a multibyte character across the filing time's byte 10 is malformed at exit 3, never a panic ---
|
|
102
102
|
bad_id=r20261124-00000000
|
|
103
103
|
printf '# peer-request v1\nid: %s\nfrom: peer-a\nfiled: 2026-11-2\xc3\xa910:20:30Z\n\n%s' "$bad_id" "$BODY" >"$CH/$bad_id.md"
|
|
104
104
|
out="$(arm "$CH" --emit-peer-list)"; rc=$?
|
|
105
|
-
[[ "$rc" -eq
|
|
105
|
+
[[ "$rc" -eq 3 && "$out" == *"$bad_id.md"*"not a UTC time"* ]] || note multibyte-filed "got $rc -- $out"
|
|
106
106
|
rm -f "$CH/$bad_id.md"
|
|
107
107
|
|
|
108
|
+
# --- a collision is exit 2 with the existing id alone on stdout, the streams captured apart ---
|
|
109
|
+
# Two filings straddling a second boundary are two requests, so the pair refiles until one lands in one second.
|
|
110
|
+
split() { # $1=channel value $2..=the arm flag and its argv; stdout to $SANDBOX/out, stderr to $SANDBOX/err
|
|
111
|
+
local ch="$1"; shift
|
|
112
|
+
( cd "$FREE" && gate_env LIFECYCLE_KIT_PEER_CHANNEL="$ch" && gate_arm_run "$@" >"$SANDBOX/out" 2>"$SANDBOX/err" )
|
|
113
|
+
}
|
|
114
|
+
CC="$SANDBOX/collide"
|
|
115
|
+
landed=''
|
|
116
|
+
for _ in 1 2 3 4 5; do
|
|
117
|
+
rm -rf "$CC" && mkdir -p "$CC"
|
|
118
|
+
printf '%s' "$BODY" | split "$CC" --emit-peer-file peer-a
|
|
119
|
+
first="$(cat "$SANDBOX/out")"
|
|
120
|
+
printf '%s' "$BODY" | split "$CC" --emit-peer-file peer-a; rc=$?
|
|
121
|
+
if [[ "$rc" -ne 0 ]]; then landed=yes; break; fi
|
|
122
|
+
done
|
|
123
|
+
if [[ -z "$landed" ]]; then
|
|
124
|
+
note collision-pair "five refilings never landed in one second"
|
|
125
|
+
else
|
|
126
|
+
[[ "$rc" -eq 2 && "$(cat "$SANDBOX/out")" == "$first" && "$(wc -l <"$SANDBOX/out" | tr -d ' ')" -eq 1 ]] \
|
|
127
|
+
|| note collision "want exit 2 and the id alone on stdout, got $rc -- $(cat "$SANDBOX/out")"
|
|
128
|
+
[[ "$(cat "$SANDBOX/err")" == *"$first"* ]] || note collision-err "stderr does not name the filed ask: $(cat "$SANDBOX/err")"
|
|
129
|
+
fi
|
|
130
|
+
printf '## need\nx\n' | split "$CC" --emit-peer-file peer-a; rc=$?
|
|
131
|
+
[[ "$rc" -eq 3 && ! -s "$SANDBOX/out" ]] || note quiet-malformed "a malformed body printed to stdout or did not exit 3 ($rc)"
|
|
132
|
+
printf '%s' "$BODY" | split "" --emit-peer-file peer-a; rc=$?
|
|
133
|
+
[[ "$rc" -eq 2 && ! -s "$SANDBOX/out" ]] || note quiet-unset "an unset channel printed to stdout or did not exit 2 ($rc)"
|
|
134
|
+
printf '%s' "$BODY" | split "$CC" --emit-peer-file Peer_A; rc=$?
|
|
135
|
+
[[ "$rc" -eq 2 && ! -s "$SANDBOX/out" ]] || note quiet-peer "a peer outside its grammar printed to stdout or did not exit 2 ($rc)"
|
|
136
|
+
|
|
108
137
|
# --- a bad channel value is refused at exit 2 naming the knob ---
|
|
109
138
|
mkdir -p "$SANDBOX/repo" && git -C "$SANDBOX/repo" init -q
|
|
110
139
|
: >"$SANDBOX/a-file"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — the one-shot pre-flight valve end-to-end through a sandboxed enter-stage: an armed line admits the entry past a refusing LIFECYCLE_KIT_ENTRY_PREFLIGHT command and is rewritten to used; an arming for another stage, another iteration, or one already used admits nothing; both malformed ledger shapes are exit
|
|
2
|
+
# spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — the one-shot pre-flight valve end-to-end through a sandboxed enter-stage: an armed line admits the entry past a refusing LIFECYCLE_KIT_ENTRY_PREFLIGHT command and is rewritten to used; an arming for another stage, another iteration, or one already used admits nothing; both malformed ledger shapes are exit 3 with nothing written; a configured-but-absent path is not-armed rather than an error and the refusal names it; and --simulate reports the would-be admission leaving the ledger byte-identical.
|
|
3
3
|
set -uo pipefail
|
|
4
4
|
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
5
5
|
|
|
@@ -119,7 +119,7 @@ sh="$(seed short 'demo-iteration build armed
|
|
|
119
119
|
')"
|
|
120
120
|
cp "$sh/.workflow/WORKFLOW-STATE.txt" "$sh/s.before"
|
|
121
121
|
out="$(run_enter "$sh" build)"; rc=$?
|
|
122
|
-
[[ "$rc" -eq
|
|
122
|
+
[[ "$rc" -eq 3 ]] || note short-rc "a reason-less line must be exit 3, got $rc -- $out"
|
|
123
123
|
grep -qF 'fewer than the four' <<<"$out" || note short-msg "the fail-closed refusal did not name the shape: $out"
|
|
124
124
|
cmp -s "$sh/s.before" "$sh/.workflow/WORKFLOW-STATE.txt" || note short-write "a fail-closed refusal wrote the state file"
|
|
125
125
|
|
|
@@ -127,7 +127,7 @@ cmp -s "$sh/s.before" "$sh/.workflow/WORKFLOW-STATE.txt" || note short-write "a
|
|
|
127
127
|
bt="$(seed bad-token 'demo-iteration build pending a token no reader knows
|
|
128
128
|
')"
|
|
129
129
|
out="$(run_enter "$bt" build)"; rc=$?
|
|
130
|
-
[[ "$rc" -eq
|
|
130
|
+
[[ "$rc" -eq 3 ]] || note token-rc "an unknown state token must be exit 3, got $rc -- $out"
|
|
131
131
|
grep -qF 'neither armed nor used' <<<"$out" || note token-msg "the fail-closed refusal did not name the token: $out"
|
|
132
132
|
|
|
133
133
|
# --- a configured path that does not exist is NOT ARMED, not an error, and the refusal names it ---
|
|
@@ -166,5 +166,5 @@ cmp -s "$sm/v.before" "$sm/.workflow/preflight-valve.txt" || note sim-ledger "--
|
|
|
166
166
|
cmp -s "$sm/s.before" "$sm/.workflow/WORKFLOW-STATE.txt" || note sim-state "--simulate wrote the state file"
|
|
167
167
|
|
|
168
168
|
[[ "$fails" -eq 0 ]] || { echo "preflight-valve.test: $fails assertion(s) failed"; exit 1; }
|
|
169
|
-
echo "preflight-valve.test: clean (armed admits once and flips to used with the prior-use count printed; another stage, another iteration and a spent line admit nothing; both malformed shapes exit
|
|
169
|
+
echo "preflight-valve.test: clean (armed admits once and flips to used with the prior-use count printed; another stage, another iteration and a spent line admit nothing; both malformed shapes exit 3 writing nothing; an absent path refuses and is named; --simulate relays the would-be admission and writes nothing)"
|
|
170
170
|
exit 0
|
|
@@ -2,7 +2,7 @@ The `consult` skill — a session that reconsiders a ruling with the operator or
|
|
|
2
2
|
|
|
3
3
|
The write authority this skill leans on is **not** the skill's to grant: it belongs to the ruling record itself, which states who may record a ruling there and under what condition. What this skill adds on top of that authority is **obligation**. Any session that closes a ruling with the operator is permitted to record it; a consultation has not finished until it has.
|
|
4
4
|
|
|
5
|
-
**First step — verify your tier.** A consultation runs on the class `--emit knob-values LIFECYCLE_KIT_CONSULT_CLASS` names. Run `--model-verdict --expect <that class>` on the gate binary `GATE_SDK_NATIVE_BIN` names (delegation-kit/SPEC.md §model-verdict; without delegation-kit, skip this). On exit 1, stop before reading in. Say that this session is below its floor, quoting the verdict line, so it is restarted on that class: to the operator, or, dispatched, to the lead in one escalation block. On exit 2 the tier is unverified and not refused: state the verdict line in your first message and proceed.
|
|
5
|
+
**First step — verify your tier.** A consultation runs on the class `--emit knob-values LIFECYCLE_KIT_CONSULT_CLASS` names. Run `--model-verdict --expect <that class>` on the gate binary `GATE_SDK_NATIVE_BIN` names (delegation-kit/SPEC.md §model-verdict; without delegation-kit, skip this). On exit 1, stop before reading in. Say that this session is below its floor, quoting the verdict line, so it is restarted on that class: to the operator, or, dispatched, to the lead in one escalation block. On exit 2 or 3 the tier is unverified and not refused: state the verdict line in your first message and proceed.
|
|
6
6
|
|
|
7
7
|
## Session ritual
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ The `scope` stage of an iteration — the exploratory half of design. Identify a
|
|
|
14
14
|
|
|
15
15
|
**Read each promoted entry's `[observed-by: <producer>]` and take one of two branches.** The tag says the entry's completion predicate is an observation of a remote run rather than a tree state (queue-kit/SPEC.md §The tag algebra), and this stage is the `<producer>` field's only reader. If a **mid-iteration push** produces that run, the push-placement rule governs (lifecycle-kit/SPEC.md §The state machine), the observation arrives in time to be drained, and the push counts toward the set's push need (below). If **only a release run** produces it, the placement is unsatisfiable — a release run is tag-triggered, so no mid-iteration push can fire it — and the entry **splits here**: promote the produce half now and file the observe half deferred, carrying the producer name, so the next iteration's first act is reading a run that already exists. Split at promotion rather than later because this is the one moment the unit set is bounded and the one session that may write the queue.
|
|
16
16
|
|
|
17
|
-
**An entry whose remaining work runs at the drain stage or later is never promoted untagged**, since that stage's entry refuses it (lifecycle-kit/SPEC.md §check-stage-entry, assertion B). Tag it `[drain-exempt: <reason>]` where the drain stage moves it;
|
|
17
|
+
**An entry whose remaining work runs at the drain stage or later is never promoted untagged**, since that stage's entry refuses it (lifecycle-kit/SPEC.md §check-stage-entry, assertion B). Tag it `[drain-exempt: <reason>]` only where the drain stage itself moves it; work of a later stage, a release cut or a notice at close, keeps it deferred with the obligation in the set record.
|
|
18
18
|
|
|
19
19
|
**A standing directive is a theme, not a unit list.** A directive received from a lead or operator at iteration open bounds this survey — it names the theme, never the units. The intake sweep and the premise re-verification run regardless, and the proposed unit set is escalated for ruling before promotion: to the lead under the split posture, to the user directly under none — the stage's ordinary stop. The destination changes; the proposal step does not.
|
|
20
20
|
|
|
@@ -65,7 +65,7 @@ gates="${GATE_SDK_NATIVE_BIN:-./scripts/checkwright-gates}"
|
|
|
65
65
|
"$gates" --emit queue-migrate --write TASK-QUEUE.md # once, on upgrade: bullet entries become ### headings with a tag line
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Each `--queue` verb runs the gates coupled to the queue file after it writes, and never stages or commits: exit 0 is written and green, 1 is written
|
|
68
|
+
Each `--queue` verb runs the gates coupled to the queue file after it writes, and never stages or commits: exit 0 is written and green, 1 is written and not green, to fix before you commit, 2 is nothing written.
|
|
69
69
|
|
|
70
70
|
The roadmap projection is opt-in: it emits nothing until you set the horizon and track vocabularies and a projection page in your config (step 3 above), so an unconfigured consumer gets a clean skip rather than a kit-shaped roadmap.
|
|
71
71
|
|
|
@@ -97,7 +97,7 @@ printf '%s\n' "$queue" >"$sb/TASK-QUEUE.md"
|
|
|
97
97
|
printf '# page\n\nThe pending `old-task` work.\n' >"$sb/docs/page.md"
|
|
98
98
|
mv "$sb/.git" "$sb/.git-saved"
|
|
99
99
|
printf 'gitdir: %s/absent\n' "$sb" >"$sb/.git"
|
|
100
|
-
expect refused-repository-exits-
|
|
100
|
+
expect refused-repository-exits-3 cite.knobs 3 "marks a repository"
|
|
101
101
|
rm "$sb/.git"
|
|
102
102
|
mv "$sb/.git-saved" "$sb/.git"
|
|
103
103
|
|
|
@@ -105,5 +105,5 @@ if [[ "$fails" -gt 0 ]]; then
|
|
|
105
105
|
echo "check-queue-slug-liveness.test.sh: $fails case(s) failed"
|
|
106
106
|
exit 1
|
|
107
107
|
fi
|
|
108
|
-
echo "check-queue-slug-liveness.test.sh: clean (retired set from the scratch repo's own history: the empty knob skips, a retired citation reds, a live name and a reasoned valve clear, a reasonless valve reds, a stale status reds and accurate ones clear, a refused repository exits
|
|
108
|
+
echo "check-queue-slug-liveness.test.sh: clean (retired set from the scratch repo's own history: the empty knob skips, a retired citation reds, a live name and a reasoned valve clear, a reasonless valve reds, a stale status reds and accurate ones clear, a refused repository exits 3, 8 cases)"
|
|
109
109
|
exit 0
|