checkwright 0.38.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 +3 -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 +2 -2
- 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 +1 -1
- 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 +1 -1
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +2 -2
- 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-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
|
@@ -32,22 +32,24 @@ _run_gates_marked() {
|
|
|
32
32
|
done
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
# spec: gate-sdk/SPEC.md §run-gates — the one piece of per-arm knowledge the stub keeps, the fail-open set on one declaration line check-front-end-fail-open holds to the crate's FAIL_OPEN_ARMS: the unavailable
|
|
36
|
-
|
|
35
|
+
# spec: gate-sdk/SPEC.md §run-gates — the one piece of per-arm knowledge the stub keeps, the fail-open set on one declaration line check-front-end-fail-open holds to the crate's FAIL_OPEN_ARMS: the refused and unavailable statuses are read on precisely the paths where no binary runs, so they cannot be asked of the binary that would report them
|
|
36
|
+
ARM_REFUSED_STATUS=2
|
|
37
|
+
ARM_UNAVAILABLE_STATUS=3
|
|
37
38
|
FAIL_OPEN_ARMS='--hook --statusline'
|
|
38
39
|
for arm in $FAIL_OPEN_ARMS; do
|
|
39
40
|
if [[ "${1-}" == "$arm" ]]; then
|
|
41
|
+
ARM_REFUSED_STATUS=0
|
|
40
42
|
ARM_UNAVAILABLE_STATUS=0
|
|
41
43
|
fi
|
|
42
44
|
done
|
|
43
45
|
|
|
44
46
|
# spec: gate-sdk/SPEC.md §The harness-integration arm — a tree whose repository git refuses or skips runs no binary, so a fail-open arm declines there as on an absent binary
|
|
45
|
-
_run_gates_refuse() { # <line> <leading arm>
|
|
47
|
+
_run_gates_refuse() { # <line> <leading arm> <status>
|
|
46
48
|
echo "$1" >&2
|
|
47
49
|
if [[ "$2" == --hook ]]; then
|
|
48
50
|
printf '%s\n' '{"systemMessage":"run-gates: git refuses or skips the repository this session stands in, so every hook guard in this tree is off and each guarded call is allowed. git status prints its reason, or git --git-dir=<that .git> status for a skipped one"}'
|
|
49
51
|
fi
|
|
50
|
-
exit "$
|
|
52
|
+
exit "$3"
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
# spec: gate-sdk/SPEC.md §run-gates — the refusal is the stub's own line alone. The one lookup splits as the crate splits it (§The crate's crosser), and a failed one hands `cd` a path that is never a directory rather than an empty one: bash before 5.3 takes `cd ""` as a silent success
|
|
@@ -57,16 +59,16 @@ if answer="$(git rev-parse --show-toplevel --show-prefix 2>/dev/null)" && [[ -n
|
|
|
57
59
|
prefix=''
|
|
58
60
|
[[ "$answer" == *$'\n'* ]] && prefix="${answer#*$'\n'}"
|
|
59
61
|
if gate_skipped_mark "$top" "$prefix" >/dev/null; then
|
|
60
|
-
_run_gates_refuse "run-gates: git skipped the repository a .git entry marks between here and the toplevel it answered, and answered the enclosing one; git --git-dir=<that .git> status prints its reason" "${1-}"
|
|
62
|
+
_run_gates_refuse "run-gates: git skipped the repository a .git entry marks between here and the toplevel it answered, and answered the enclosing one; git --git-dir=<that .git> status prints its reason" "${1-}" "$ARM_UNAVAILABLE_STATUS"
|
|
61
63
|
fi
|
|
62
64
|
else
|
|
63
65
|
top=/dev/null
|
|
64
66
|
fi
|
|
65
67
|
cd "$top" 2>/dev/null || {
|
|
66
68
|
if _run_gates_marked; then
|
|
67
|
-
_run_gates_refuse "run-gates: git refuses the repository marked here (GIT_DIR, or a .git entry here or above); git status prints its reason" "${1-}"
|
|
69
|
+
_run_gates_refuse "run-gates: git refuses the repository marked here (GIT_DIR, or a .git entry here or above); git status prints its reason" "${1-}" "$ARM_UNAVAILABLE_STATUS"
|
|
68
70
|
fi
|
|
69
|
-
_run_gates_refuse "run-gates: not inside a git repository" "${1-}"
|
|
71
|
+
_run_gates_refuse "run-gates: not inside a git repository" "${1-}" "$ARM_REFUSED_STATUS"
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
# spec: gate-sdk/SPEC.md §Layout and configuration — the gate-sdk root locator, exported from this front-end's own location so every arm reaches the exact root
|
|
@@ -76,7 +78,7 @@ else
|
|
|
76
78
|
export GATE_SDK_ROOT="$SDK"
|
|
77
79
|
fi
|
|
78
80
|
|
|
79
|
-
# spec: gate-sdk/SPEC.md §run-gates — the binary located and exec'd with the environment this process already carries. $ARM_UNAVAILABLE_STATUS is the status a *dispatch* failure exits —
|
|
81
|
+
# spec: gate-sdk/SPEC.md §run-gates — the binary located and exec'd with the environment this process already carries. $ARM_UNAVAILABLE_STATUS is the status a *dispatch* failure exits — 3, a tool error, for every arm whose verdict a battery or a session reads, 0 for a harness-integration arm gating a user action, which §The non-gate arm rules must decline rather than wedge the session
|
|
80
82
|
exec_arm() {
|
|
81
83
|
local bin why=''
|
|
82
84
|
if [[ "$ARM_UNAVAILABLE_STATUS" -eq 0 ]]; then
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# graph: couples=knob:GATE_SDK_GATES_DIR/strings-shapes.list dir=one valve=none tier=precommit trigger=*
|
|
2
|
+
# install: on-surface
|
|
3
|
+
# armed-by: GATE_SDK_STRINGS_FILES
|
|
4
|
+
# spec: gate-sdk/SPEC.md §check-binary-strings — no named build output carries a deny term or a configured leak shape in a string it would ship (the record names an offset, a rule id and the entry's position, never the string)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# graph: couples=*.rs dir=one valve=none tier=precommit trigger=*
|
|
2
|
+
# install: on-surface
|
|
3
|
+
# armed-by: GATE_SDK_EXEC_WRITE_PATHS
|
|
4
|
+
# spec: gate-sdk/SPEC.md §check-exec-write — no Rust file but a declared helper writes a file with an execute bit (the record names the call or the mode constant, never the argument)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# graph: couples=*,knob:GATE_SDK_MIGRATION_DESTRUCTIVE dir=one valve=none tier=precommit trigger=*
|
|
2
|
+
# install: on-surface
|
|
3
|
+
# armed-by: GATE_SDK_MIGRATION_DIR
|
|
4
|
+
# spec: gate-sdk/SPEC.md §check-migration-guard — a branch only appends migrations, in order, and none it adds is destructive unless declared (the record names the migration file and, for a destructive statement, its first line and the matching ERE)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# graph: couples=* dir=one valve=none tier=precommit trigger=*
|
|
2
|
+
# install: on-surface
|
|
3
|
+
# armed-by: content GATE_SDK_DENY_TERMS
|
|
4
|
+
# spec: gate-sdk/SPEC.md §check-path-names — no tracked path has a component carrying a deny term as its stem (the record names the shortest hitting prefix and a rule id, never the term)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# graph: couples=*.sh,knob:GATE_SDK_PIPEFAIL_BASELINE dir=one valve=none tier=precommit trigger=*
|
|
2
|
+
# install: on-surface
|
|
3
|
+
# armed-by: GATE_SDK_PIPEFAIL_PATHS
|
|
4
|
+
# spec: gate-sdk/SPEC.md §check-pipefail-readers — no early-exit reader is fed under pipefail in the configured shell tree beyond its baselined count (the record names the reader, and [auto-fix] where --emit pipefail-fix rewrites it)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# graph: couples=*,knob:GATE_SDK_SCRIPT_RULES dir=one valve=none tier=precommit trigger=*
|
|
2
|
+
# install: on-surface
|
|
3
|
+
# armed-by: GATE_SDK_SCRIPT_FILES
|
|
4
|
+
# spec: gate-sdk/SPEC.md §check-script-preflight — no configured shell script breaks a rule in the consumer's rules file (the record names the rule id and the kind's subject, never a value from the script)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# graph: couples=*,knob:GATE_SDK_SITE_RULES dir=one valve=none tier=precommit trigger=*
|
|
2
|
+
# install: on-surface
|
|
3
|
+
# armed-by: content GATE_SDK_SITE_RULES
|
|
4
|
+
# spec: gate-sdk/SPEC.md §check-site-count — every tracked file's count of a configured site equals the count a person reviewed (the record names the path, the rule id and both counts, never a site)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# graph: couples=knob:GATE_SDK_GATES_DIR/msg-patterns.list dir=one valve=none tier=precommit trigger=*
|
|
2
2
|
# install: on-surface
|
|
3
|
-
# armed-by: content GATE_SDK_MSG_PATTERN_FILES GATE_SDK_MSG_PATTERN_FILES_LOCAL
|
|
3
|
+
# armed-by: content GATE_SDK_MSG_PATTERN_FILES GATE_SDK_MSG_PATTERN_FILES_LOCAL GATE_SDK_DENY_TERMS
|
|
4
4
|
# spec: gate-sdk/SPEC.md §check-tree-terms — no tracked file matches the banned-pattern set (the tracked-files half of the leak guard; the pattern files and their templates are self-exempt)
|
|
@@ -113,10 +113,10 @@ assert_clean "run, scoped member"
|
|
|
113
113
|
printf 'check-spec-dod-singleton\ncheck-spec-fence-balance\n' > "$gates/gates.list"
|
|
114
114
|
rm -f "$gates/owned-action-pinning.sh" "$gates/check-action-pinning.gate"
|
|
115
115
|
|
|
116
|
-
# the descriptor is the registry's: a list naming compiled-in gates with no descriptor beside it resolves nothing
|
|
116
|
+
# the descriptor is the registry's: a list naming compiled-in gates with no descriptor beside it resolves nothing, an error verdict
|
|
117
117
|
rm -f "$gates"/*.gate
|
|
118
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"
|
|
119
|
+
assert_rc "run, no descriptor" "$rc" 3 "$out"
|
|
120
120
|
grep -qF '(unresolved)' <<<"$out" || { echo "FAIL [run, no descriptor]: no member reported unresolved"; printf '%s\n' "$out"; fails=$((fails + 1)); }
|
|
121
121
|
assert_clean "run, no descriptor"
|
|
122
122
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Behavioral test of check-action-run-shell — the fidelity limit's refused class,
|
|
3
3
|
# which the one good/bad pair cannot hold: the pair models exit 0 and exit 1, and
|
|
4
|
-
# every refusal here is exit
|
|
4
|
+
# every refusal here is exit 3 by the fail-closed contract, a construct the extractor cannot read.
|
|
5
5
|
# Each case asserts the exit status AND the construct named in the message, so the
|
|
6
6
|
# boundary is proved by the oracle rather than described in prose.
|
|
7
7
|
#
|
|
@@ -38,19 +38,19 @@ check_case() {
|
|
|
38
38
|
# conformance requirement inside the gate's own subject.
|
|
39
39
|
check_case folded ' - run: >
|
|
40
40
|
echo folded
|
|
41
|
-
across lines'
|
|
41
|
+
across lines' 3 "a folded block scalar (run: >)"
|
|
42
42
|
|
|
43
43
|
check_case folded_chomped ' - run: >-
|
|
44
44
|
echo folded
|
|
45
|
-
across lines'
|
|
45
|
+
across lines' 3 "a folded block scalar (run: >-)"
|
|
46
46
|
|
|
47
47
|
# B — an explicit block-scalar indentation indicator can contradict the indent the
|
|
48
48
|
# extractor derives from the first body line.
|
|
49
49
|
check_case indicator ' - run: |2
|
|
50
|
-
echo indicated'
|
|
50
|
+
echo indicated' 3 "an explicit block-scalar indentation indicator (run: |2)"
|
|
51
51
|
|
|
52
52
|
# C — a YAML alias as the run: value. No anchor resolution is attempted.
|
|
53
|
-
check_case alias ' - run: *setup'
|
|
53
|
+
check_case alias ' - run: *setup' 3 "a YAML alias as the run: value (run: *setup)"
|
|
54
54
|
|
|
55
55
|
# C2 — the anchor half of the same rule. This fell through every refusal arm and
|
|
56
56
|
# landed on the plain-scalar counter, so an anchored body was reported skipped and
|
|
@@ -58,11 +58,11 @@ check_case alias ' - run: *setup' 2 "a YAML alias as the run: value (run: *
|
|
|
58
58
|
# shell. The body below is ShellCheck-dirty, so a regression here reads as clean.
|
|
59
59
|
check_case anchor ' - run: &setup |
|
|
60
60
|
echo "$undefined_var"
|
|
61
|
-
unused=1'
|
|
61
|
+
unused=1' 3 "a YAML anchor on the run: value (run: &setup |)"
|
|
62
62
|
|
|
63
63
|
# C3 — an anchor on a plain scalar refuses too: the anchor is what we cannot
|
|
64
64
|
# resolve, independent of the scalar style it decorates.
|
|
65
|
-
check_case anchor_plain ' - run: &setup echo hi'
|
|
65
|
+
check_case anchor_plain ' - run: &setup echo hi' 3 "a YAML anchor on the run: value (run: &setup echo hi)"
|
|
66
66
|
|
|
67
67
|
# C4 — a quoted value merely beginning with & is an ordinary string, not an anchor.
|
|
68
68
|
check_case anchor_quoted ' - run: "echo && echo"' 0 "0 run: block(s) linted"
|
|
@@ -71,7 +71,7 @@ check_case anchor_quoted ' - run: "echo && echo"' 0 "0 run: block(s) linted
|
|
|
71
71
|
# the fragment, so the line is refused rather than linted wrong.
|
|
72
72
|
check_case unbalanced ' - run: |
|
|
73
73
|
echo "${{ github.ref_name"
|
|
74
|
-
echo tail'
|
|
74
|
+
echo tail' 3 "an unbalanced GitHub expression"
|
|
75
75
|
|
|
76
76
|
# E — the chomping indicators are ordinary spellings, handled rather than refused.
|
|
77
77
|
# An author reaches for |- by habit, so silently skipping these would be the worst
|
|
@@ -115,7 +115,7 @@ jobs:
|
|
|
115
115
|
runs-on: ubuntu-latest
|
|
116
116
|
steps:
|
|
117
117
|
- run: |
|
|
118
|
-
echo body'
|
|
118
|
+
echo body' 3 "$defaults_refusal"
|
|
119
119
|
|
|
120
120
|
wf_case defaults_job 'name: job-level defaults
|
|
121
121
|
|
|
@@ -127,7 +127,7 @@ jobs:
|
|
|
127
127
|
shell: pwsh
|
|
128
128
|
steps:
|
|
129
129
|
- run: |
|
|
130
|
-
echo body'
|
|
130
|
+
echo body' 3 "$defaults_refusal"
|
|
131
131
|
|
|
132
132
|
# E3 — the refusal is the `run:` key, not the `defaults:` key. A defaults block
|
|
133
133
|
# setting anything else changes no step's dialect, so it is extracted normally —
|
|
@@ -192,5 +192,5 @@ if [[ "$fails" -gt 0 ]]; then
|
|
|
192
192
|
echo "check-action-run-shell.test: $fails assertion(s) failed"
|
|
193
193
|
exit 1
|
|
194
194
|
fi
|
|
195
|
-
echo "check-action-run-shell.test: ok (folded scalars, an explicit indentation indicator, a YAML alias, a YAML anchor on either scalar style, an unbalanced GitHub expression and a defaults: subtree carrying run: at either level each refuse at exit
|
|
195
|
+
echo "check-action-run-shell.test: ok (folded scalars, an explicit indentation indicator, a YAML alias, a YAML anchor on either scalar style, an unbalanced GitHub expression and a defaults: subtree carrying run: at either level each refuse at exit 3 naming the construct; |- and |+ extract normally; a quoted value merely starting with & is not an anchor; a defaults: block with no run: key extracts normally; an absent shell: key under a Windows or an unreadable runs-on is a finding at exit 1 and naming the key clears it; a refusable construct outside the Actions-shape subject is skipped and counted rather than refused)"
|
|
196
196
|
exit 0
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
BINARY-STRINGS: clean (1 build output(s) scanned; none carry the 2 deny term(s) or 1 shape(s))
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Behavioral test of check-binary-strings over the arms the good/+bad/ pair cannot
|
|
3
|
+
# reach: a case names its outputs in its knob file and both of its outputs read,
|
|
4
|
+
# so a named output that is absent, an ELF header cut short, a GNU escape in a
|
|
5
|
+
# shape list and the record order across files live here. Each expect.txt line is
|
|
6
|
+
# an independent substring assertion, so record *order* is assertable only here.
|
|
7
|
+
#
|
|
8
|
+
# Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
|
|
9
|
+
set -uo pipefail
|
|
10
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
11
|
+
|
|
12
|
+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # gate-sdk/
|
|
13
|
+
CHECKS="$DIR/checks"
|
|
14
|
+
CASES="$DIR/gate-tests/check-binary-strings"
|
|
15
|
+
SANDBOX="$(mktemp -d)"
|
|
16
|
+
trap 'rm -rf "$SANDBOX"' EXIT
|
|
17
|
+
|
|
18
|
+
fails=0
|
|
19
|
+
|
|
20
|
+
expect() { # expect <label> <want-rc> <substring> <got-rc> <output>
|
|
21
|
+
if [[ "$4" -ne "$2" ]]; then
|
|
22
|
+
echo " FAIL [$1]: want exit $2, got $4 -- $5"; fails=$((fails + 1))
|
|
23
|
+
elif ! grep -qF -- "$3" <<<"$5"; then
|
|
24
|
+
echo " FAIL [$1]: exit $2 but output lacks '$3': $5"; fails=$((fails + 1))
|
|
25
|
+
fi
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
mkdir -p "$SANDBOX/repo"
|
|
29
|
+
git -C "$SANDBOX/repo" init -q
|
|
30
|
+
|
|
31
|
+
# --- a named output that is not there refuses at 2: the knob names it exactly, so
|
|
32
|
+
# its absence is a layout the consumer must fix, never an output with no strings.
|
|
33
|
+
out="$( cd "$SANDBOX/repo" && gate_env GATE_SDK_STRINGS_FILES=absent.bin \
|
|
34
|
+
&& gate_run check-binary-strings "$CHECKS" 2>&1 )"; rc=$?
|
|
35
|
+
expect absent-output 2 'no build output at absent.bin' "$rc" "$out"
|
|
36
|
+
|
|
37
|
+
# --- an ELF64 little-endian file whose header is cut short is unparseable input at 3.
|
|
38
|
+
printf '\177ELF\002\001 cut short' > "$SANDBOX/repo/short.elf"
|
|
39
|
+
out="$( cd "$SANDBOX/repo" && gate_env GATE_SDK_STRINGS_FILES=short.elf \
|
|
40
|
+
&& gate_run check-binary-strings "$CHECKS" 2>&1 )"; rc=$?
|
|
41
|
+
expect truncated-elf 3 'ELF header truncated' "$rc" "$out"
|
|
42
|
+
|
|
43
|
+
# --- a GNU escape in a shape list is refused at 2, never read as a clean output.
|
|
44
|
+
printf 'plain bytes here\n' > "$SANDBOX/repo/plain.bin"
|
|
45
|
+
printf '\\bplain\\b\n' > "$SANDBOX/repo/gnu.list"
|
|
46
|
+
out="$( cd "$SANDBOX/repo" && gate_env GATE_SDK_STRINGS_FILES=plain.bin GATE_SDK_STRINGS_SHAPES=gnu.list \
|
|
47
|
+
&& gate_run check-binary-strings "$CHECKS" 2>&1 )"; rc=$?
|
|
48
|
+
expect gnu-escape 2 'shape-compile' "$rc" "$out"
|
|
49
|
+
|
|
50
|
+
# --- record order over the bad pair's outputs, named in reverse of their path order:
|
|
51
|
+
# files in knob order, then offset within a file, whichever list the hit came from.
|
|
52
|
+
out="$( cd "$CASES/bad" \
|
|
53
|
+
&& gate_env GATE_SDK_STRINGS_FILES='out/notes.bin out/app.elf' GATE_SDK_STRINGS_SHAPES=shapes.list \
|
|
54
|
+
GATE_SDK_DENY_TERMS=terms.list \
|
|
55
|
+
&& gate_run check-binary-strings "$CHECKS" 2>&1 )"; rc=$?
|
|
56
|
+
got="$(grep -E '^out/' <<<"$out")"
|
|
57
|
+
want="$(printf '%s\n' \
|
|
58
|
+
'out/notes.bin@11: [CODENAME] term 1' \
|
|
59
|
+
'out/app.elf@83: [HOME-PATH] shape 1' \
|
|
60
|
+
'out/app.elf@115: [CODENAME] term 1')"
|
|
61
|
+
if [[ "$rc" -ne 1 ]]; then
|
|
62
|
+
echo " FAIL [record-order]: want exit 1, got $rc -- $out"; fails=$((fails + 1))
|
|
63
|
+
elif [[ "$got" != "$want" ]]; then
|
|
64
|
+
echo " FAIL [record-order]: record sequence is not knob-then-offset order:"
|
|
65
|
+
printf ' %s\n' "$got"
|
|
66
|
+
fails=$((fails + 1))
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
if [[ "$fails" -gt 0 ]]; then
|
|
70
|
+
echo "check-binary-strings.test.sh: $fails case(s) failed"
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
echo "check-binary-strings.test.sh: clean (the arms a case dir cannot reach: an absent named output, a truncated ELF header, a GNU escape in a shape list, and the record order across outputs — 4 cases)"
|
|
74
|
+
exit 0
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
src/caller.rs:4: [EXEC-WRITE] set_mode
|
|
2
|
+
src/sites.rs:6: [EXEC-WRITE] from_mode
|
|
3
|
+
src/sites.rs:7: [EXEC-WRITE] from_raw_mode
|
|
4
|
+
src/sites.rs:8: [EXEC-WRITE] mode
|
|
5
|
+
src/sites.rs:10: [EXEC-WRITE] set_mode
|
|
6
|
+
src/sites.rs:11: [EXEC-WRITE] set_permissions
|
|
7
|
+
src/sites.rs:12: [EXEC-WRITE] chmod
|
|
8
|
+
src/sites.rs:13: [EXEC-WRITE] fchmodat
|
|
9
|
+
src/sites.rs:14: [EXEC-WRITE] open
|
|
10
|
+
src/sites.rs:15: [EXEC-WRITE] creat
|
|
11
|
+
src/sites.rs:16: [EXEC-WRITE] copy
|
|
12
|
+
src/sites.rs:17: [EXEC-WRITE] chmod
|
|
13
|
+
src/sites.rs:18: [EXEC-WRITE] S_IXUSR
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
use std::fs;
|
|
2
|
+
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};
|
|
3
|
+
use std::process::Command;
|
|
4
|
+
|
|
5
|
+
pub fn every_site(p: &str, fd: i32, mode: u32) {
|
|
6
|
+
let _ = fs::Permissions::from_mode(0o755);
|
|
7
|
+
let _ = fs::Permissions::from_raw_mode(0o700);
|
|
8
|
+
let _ = fs::OpenOptions::new().mode(0o711);
|
|
9
|
+
let mut perms = fs::metadata(p).unwrap().permissions();
|
|
10
|
+
perms.set_mode(mode);
|
|
11
|
+
let _ = fs::set_permissions(p, perms);
|
|
12
|
+
unsafe { libc::chmod(p.as_ptr().cast(), 0o755) };
|
|
13
|
+
unsafe { libc::fchmodat(fd, p.as_ptr().cast(), 0o755, 0) };
|
|
14
|
+
unsafe { libc::open(p.as_ptr().cast(), libc::O_CREAT, 0o777) };
|
|
15
|
+
unsafe { libc::creat(p.as_ptr().cast(), 0o755) };
|
|
16
|
+
let _ = fs::copy(p, "out");
|
|
17
|
+
let _ = Command::new("chmod").arg("+x").arg(p);
|
|
18
|
+
let _ = libc::S_IXUSR;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
EXEC-WRITE: clean (1 Rust file(s) read, 1 helper(s) exempt)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
use std::fs;
|
|
2
|
+
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};
|
|
3
|
+
|
|
4
|
+
mod helper;
|
|
5
|
+
|
|
6
|
+
pub fn quiet(p: &str) {
|
|
7
|
+
let _ = fs::set_permissions(p, fs::Permissions::from_mode(0o644));
|
|
8
|
+
let _ = fs::OpenOptions::new().create(true).mode(0o600);
|
|
9
|
+
let note = "fs::copy(a, b) and Command::new(\"chmod\") and S_IXUSR";
|
|
10
|
+
let raw = r#"libc::chmod(p, 0o755); Permissions::from_mode(0o755)"#;
|
|
11
|
+
// fs::copy(p, q) then libc::S_IRWXU through Permissions::from_mode(0o777)
|
|
12
|
+
let _ = (note, raw);
|
|
13
|
+
let mut perms = fs::metadata(p).unwrap().permissions();
|
|
14
|
+
helper::make_runnable(&mut perms);
|
|
15
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Behavioral test of check-exec-write's refusals and unparseable spans, which a good/+bad/ pair
|
|
3
|
+
# cannot hold: a pair case exits 0 or 1. Each case runs in a sandbox repository.
|
|
4
|
+
#
|
|
5
|
+
# Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
|
|
6
|
+
set -uo pipefail
|
|
7
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
8
|
+
|
|
9
|
+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # gate-sdk/
|
|
10
|
+
CHECKS="$DIR/checks"
|
|
11
|
+
SANDBOX="$(mktemp -d)"
|
|
12
|
+
trap 'rm -rf "$SANDBOX"' EXIT
|
|
13
|
+
|
|
14
|
+
fails=0
|
|
15
|
+
cases=0
|
|
16
|
+
|
|
17
|
+
expect() { # expect <label> <want-rc> <substring> <got-rc> <output>
|
|
18
|
+
cases=$((cases + 1))
|
|
19
|
+
if [[ "$4" -ne "$2" ]]; then
|
|
20
|
+
echo " FAIL [$1]: want exit $2, got $4 -- $5"; fails=$((fails + 1))
|
|
21
|
+
elif ! grep -qF -- "$3" <<<"$5"; then
|
|
22
|
+
echo " FAIL [$1]: exit $2 but output lacks '$3': $5"; fails=$((fails + 1))
|
|
23
|
+
fi
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
repo="$SANDBOX/repo"
|
|
27
|
+
mkdir -p "$repo/src"
|
|
28
|
+
git -C "$repo" init -q
|
|
29
|
+
printf 'pub fn f() {}\n' > "$repo/src/lib.rs"
|
|
30
|
+
printf 'pub fn h() {}\n' > "$repo/src/helper.rs"
|
|
31
|
+
git -C "$repo" add src
|
|
32
|
+
|
|
33
|
+
guard() { # guard <helpers> [gate args…] — the gate in the sandbox over src
|
|
34
|
+
local helpers="$1"
|
|
35
|
+
shift
|
|
36
|
+
( cd "$repo" && gate_env GATE_SDK_EXEC_WRITE_PATHS=src GATE_SDK_EXEC_WRITE_HELPERS="$helpers" \
|
|
37
|
+
&& gate_run check-exec-write "$CHECKS" "$@" 2>&1 )
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# --- the paths knob empty: clean, not applicable.
|
|
41
|
+
out="$( cd "$repo" && gate_run check-exec-write "$CHECKS" 2>&1 )"; rc=$?
|
|
42
|
+
expect not-applicable 0 'not applicable: no Rust path configured' "$rc" "$out"
|
|
43
|
+
out="$(guard src/helper.rs)"; rc=$?
|
|
44
|
+
expect clean 0 'clean (1 Rust file(s) read, 1 helper(s) exempt)' "$rc" "$out"
|
|
45
|
+
|
|
46
|
+
# --- a helper outside the tree, absent, or absolute, and an operand, are refused at 2.
|
|
47
|
+
out="$(guard ../src/helper.rs)"; rc=$?
|
|
48
|
+
expect helper-dotdot 2 "helper '../src/helper.rs' holds '..'" "$rc" "$out"
|
|
49
|
+
out="$(guard src/absent.rs)"; rc=$?
|
|
50
|
+
expect helper-absent 2 "helper 'src/absent.rs' names no file" "$rc" "$out"
|
|
51
|
+
out="$(guard "$repo/src/helper.rs")"; rc=$?
|
|
52
|
+
expect helper-absolute 2 'is absolute' "$rc" "$out"
|
|
53
|
+
out="$(guard src/helper.rs src/lib.rs)"; rc=$?
|
|
54
|
+
expect usage 2 'takes no arguments' "$rc" "$out"
|
|
55
|
+
|
|
56
|
+
# --- an unterminated raw string and an unbalanced call are unparseable spans at 3.
|
|
57
|
+
printf 'pub fn f() {\n let s = r#"open";\n}\n' > "$repo/src/lib.rs"
|
|
58
|
+
out="$(guard src/helper.rs)"; rc=$?
|
|
59
|
+
expect raw-unterminated 3 'src/lib.rs:2: [LINT-PARSE] unparseable span' "$rc" "$out"
|
|
60
|
+
printf 'pub fn f() {\n g(a,\n}\n' > "$repo/src/lib.rs"
|
|
61
|
+
out="$(guard src/helper.rs)"; rc=$?
|
|
62
|
+
expect call-unbalanced 3 'src/lib.rs:3: [LINT-PARSE] unparseable span' "$rc" "$out"
|
|
63
|
+
|
|
64
|
+
if [[ "$fails" -gt 0 ]]; then
|
|
65
|
+
echo "check-exec-write.test.sh: $fails case(s) failed"
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
68
|
+
echo "check-exec-write.test.sh: clean (the helper refusals and the unparseable spans — $cases cases)"
|
|
69
|
+
exit 0
|
|
@@ -62,7 +62,7 @@ check_case "absent-count-excludes-unverified" 0 "2 expectation(s) match" \
|
|
|
62
62
|
# present and unreadable whatever uid runs the battery, where a chmod-000 file
|
|
63
63
|
# is readable by root and would make this case pass vacuously in a container.
|
|
64
64
|
mkdir -p "$SANDBOX/hosts-is-a-dir"
|
|
65
|
-
check_case "unreadable-fail-closed"
|
|
65
|
+
check_case "unreadable-fail-closed" 3 "not readable" "$SANDBOX/hosts-is-a-dir" "$MANIFEST"
|
|
66
66
|
|
|
67
67
|
# Posture 3 — present, no block for the configured host: a violation. The
|
|
68
68
|
# manifest says the account should be one thing and this machine is not logged
|
|
@@ -80,7 +80,7 @@ cat >"$SANDBOX/no-user-key.yml" <<'EOF'
|
|
|
80
80
|
host.example:
|
|
81
81
|
git_protocol: ssh
|
|
82
82
|
EOF
|
|
83
|
-
check_case "unrecognized-shape-fail-closed"
|
|
83
|
+
check_case "unrecognized-shape-fail-closed" 3 "no active-account key" \
|
|
84
84
|
"$SANDBOX/no-user-key.yml" "$MANIFEST"
|
|
85
85
|
|
|
86
86
|
# The collision the parse is ruled over: `users` is the map of accounts available
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE TABLE accounts (id INTEGER PRIMARY KEY, name TEXT NOT NULL);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE TABLE orders (id INTEGER PRIMARY KEY, account INTEGER);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE TABLE audit (id INTEGER PRIMARY KEY, note TEXT);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
migrations/0001_init.sql: [MIGRATION-EDITED]
|
|
2
|
+
migrations/0002_orders.sql: [MIGRATION-EDITED]
|
|
3
|
+
migrations/0003_audit.sql: [MIGRATION-EDITED]
|
|
4
|
+
migrations/0003_audit_log.sql: [MIGRATION-ORDER] 0003 <= 0003
|
|
5
|
+
migrations/0002_late.sql: [MIGRATION-ORDER] 0002 <= 0003
|
|
6
|
+
migrations/0004_prune.sql:1: [MIGRATION-DESTRUCTIVE] matches 'DROP (TABLE|INDEX|VIEW|TRIGGER)'
|
|
7
|
+
migrations/0004_prune.sql:2: [MIGRATION-DESTRUCTIVE] matches 'ALTER TABLE .* DROP', its waiver reason empty
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE TABLE accounts (id INTEGER PRIMARY KEY, name TEXT NOT NULL, email TEXT);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE INDEX orders_account ON orders (account);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE TABLE audit (id INTEGER PRIMARY KEY, note TEXT);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE TABLE accounts (id INTEGER PRIMARY KEY, name TEXT NOT NULL);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE TABLE legacy_sessions (id INTEGER PRIMARY KEY);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MIGRATION-GUARD: clean (3 migration(s), 1 added, against base)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE TABLE accounts (id INTEGER PRIMARY KEY, name TEXT NOT NULL);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE TABLE legacy_sessions (id INTEGER PRIMARY KEY);
|
package/payload/gate-sdk/gate-tests/check-migration-guard/good/migrations/0003_retire_legacy.sql
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
-- An addition numbered above the highest: a declared destructive statement, and
|
|
2
|
+
-- destructive text only inside a comment and a string.
|
|
3
|
+
DROP TABLE legacy_sessions; -- migration-ok: replaced by accounts in 0001
|
|
4
|
+
/* DROP TABLE accounts; would lose every account */
|
|
5
|
+
INSERT INTO accounts (name) VALUES ('DROP TABLE accounts');
|
|
6
|
+
ALTER TABLE accounts ADD COLUMN email TEXT;
|