checkwright 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +2 -2
- 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/canon-kit/README.md +2 -0
- package/payload/canon-kit/SPEC.md +329 -15
- package/payload/canon-kit/checks/check-amendment-update-target.gate +3 -0
- package/payload/canon-kit/checks/check-unmarked-claim.gate +3 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/SPEC-thing.md +26 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/expect.txt +8 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +47 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target.test.sh +82 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/SPEC.md +11 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/good/SPEC.md +18 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/good/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +85 -0
- package/payload/canon-kit/lib/spec.sh +16 -0
- package/payload/canon-kit/smoke/install.sh +2 -0
- package/payload/canon-kit/templates/SPEC-amendment.md +17 -2
- package/payload/context-kit/SPEC.md +16 -5
- package/payload/delegation-kit/README.md +11 -1
- package/payload/delegation-kit/SPEC.md +392 -26
- package/payload/delegation-kit/bin/wait-probe.sh +184 -0
- package/payload/delegation-kit/gate-tests/subagent-stop-liveness.test.sh +99 -0
- package/payload/delegation-kit/smoke/install.sh +20 -0
- package/payload/delegation-kit/templates/agent-execution.md +26 -9
- package/payload/delegation-kit/templates/subagent-stop-liveness.sh +56 -0
- package/payload/gate-sdk/README.md +7 -2
- package/payload/gate-sdk/SPEC.md +800 -66
- package/payload/gate-sdk/bin/build-native.sh +66 -1
- package/payload/gate-sdk/bin/run-gates.sh +136 -34
- package/payload/gate-sdk/checks/check-action-run-shell.sh +1 -1
- package/payload/gate-sdk/checks/check-gate-assertions.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +55 -2
- package/payload/gate-sdk/checks/check-tree-terms.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/expect.txt +5 -1
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +22 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-count.sh +11 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-extra.sh +14 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-zero.sh +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +27 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-qux.sh +13 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +117 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kit-spec.md +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-nospec.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-ungrounded.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kit-spec.md +12 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-held.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/multi.txt +4 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/second-leak.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/patterns.list +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/anchored.txt +4 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/worktrees/vendored-note.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +94 -0
- package/payload/gate-sdk/smoke/install.sh +23 -0
- package/payload/guard-kit/README.md +4 -3
- package/payload/guard-kit/SPEC.md +409 -57
- package/payload/guard-kit/bin/compare-settings-allow.sh +36 -12
- package/payload/guard-kit/bin/run-guard-tests.sh +22 -4
- package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +46 -1
- package/payload/guard-kit/guard-tests/background-cases.tsv +14 -0
- package/payload/guard-kit/guard-tests/cases.tsv +41 -11
- package/payload/guard-kit/lib/guard.sh +213 -34
- package/payload/guard-kit/templates/bash-guard.sh +2 -0
- package/payload/guard-kit/templates/close-triage.md +10 -3
- package/payload/guard-kit/templates/guard-config.sh +3 -0
- package/payload/lifecycle-kit/SPEC.md +2 -2
- package/payload/lifecycle-kit/templates/lead.md +8 -0
- package/payload/queue-kit/SPEC.md +78 -0
- package/payload/site-kit/SPEC.md +12 -0
- package/payload/gate-sdk/checks/check-gate-assertions.sh +0 -149
- package/payload/gate-sdk/checks/check-tree-terms.sh +0 -67
|
@@ -41,14 +41,19 @@ done
|
|
|
41
41
|
|
|
42
42
|
# spec: guard-kit/SPEC.md §compare-settings-allow — the breadth question: guard_allow_match with the
|
|
43
43
|
# arguments swapped, asking whether a local glob would auto-allow a probe rather than whether a
|
|
44
|
-
# committed glob already grants a local entry
|
|
44
|
+
# committed glob already grants a local entry, then partitions on an exact-string declaration lookup
|
|
45
45
|
too_broad=()
|
|
46
|
+
declared=()
|
|
46
47
|
for entry in "${LOCAL_ALLOW[@]}"; do
|
|
47
48
|
[[ -z "$entry" ]] && continue
|
|
48
49
|
for probe in "${GUARD_KIT_BREADTH_PROBES[@]}"; do
|
|
49
50
|
[[ -z "$probe" ]] && continue
|
|
50
51
|
if guard_allow_match "$probe" "$entry"; then
|
|
51
|
-
|
|
52
|
+
if [[ -n "${GUARD_KIT_BREADTH_DECLARED[$entry]+set}" ]]; then
|
|
53
|
+
declared+=("$entry ⊇ $probe — ${GUARD_KIT_BREADTH_DECLARED[$entry]}")
|
|
54
|
+
else
|
|
55
|
+
too_broad+=("$entry ⊇ $probe")
|
|
56
|
+
fi
|
|
52
57
|
break
|
|
53
58
|
fi
|
|
54
59
|
done
|
|
@@ -75,17 +80,36 @@ fi
|
|
|
75
80
|
[[ ${#GUARD_KIT_BREADTH_PROBES[@]} -eq 0 ]] && exit 0
|
|
76
81
|
|
|
77
82
|
echo
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
# spec: guard-kit/SPEC.md §compare-settings-allow — an over-broad set that is entirely declared
|
|
84
|
+
# prints the declared section and no narrowing section: the clean line would be false there
|
|
85
|
+
if [[ ${#too_broad[@]} -gt 0 || ${#declared[@]} -eq 0 ]]; then
|
|
86
|
+
echo "=== settings allowlist breadth (advisory — narrowing candidates) ==="
|
|
87
|
+
if [[ ${#too_broad[@]} -eq 0 ]]; then
|
|
88
|
+
echo "no over-broad local entries (no configured probe is auto-allowed by a $LOCAL glob)"
|
|
89
|
+
exit 0
|
|
90
|
+
fi
|
|
91
|
+
echo "${#too_broad[@]} local allow entr(ies) auto-allow a configured probe — candidates to narrow in $LOCAL:"
|
|
92
|
+
echo
|
|
93
|
+
printf ' %s\n' "${too_broad[@]}"
|
|
94
|
+
echo
|
|
95
|
+
echo "help: narrow each listed glob on the left, or record that the breadth is"
|
|
96
|
+
echo " intended — the probe on the right witnesses what it auto-allows."
|
|
97
|
+
echo " Probes are witnesses, not a roster: no completeness is claimed, so an"
|
|
98
|
+
echo " empty report is not a proof that every local glob is narrow enough."
|
|
82
99
|
fi
|
|
83
100
|
|
|
84
|
-
|
|
101
|
+
# spec: guard-kit/SPEC.md §compare-settings-allow — a declared glob is not dropped from the report:
|
|
102
|
+
# it moves out of the narrowing set and prints with its reason, so the ruling has a reader
|
|
103
|
+
[[ ${#declared[@]} -eq 0 ]] && exit 0
|
|
104
|
+
|
|
105
|
+
[[ ${#too_broad[@]} -gt 0 ]] && echo
|
|
106
|
+
echo "=== settings allowlist breadth (advisory — declared intended) ==="
|
|
107
|
+
echo "${#declared[@]} over-broad local allow entr(ies) whose breadth was ruled intended:"
|
|
85
108
|
echo
|
|
86
|
-
printf ' %s\n' "${
|
|
109
|
+
printf ' %s\n' "${declared[@]}"
|
|
87
110
|
echo
|
|
88
|
-
echo "help:
|
|
89
|
-
echo "
|
|
90
|
-
echo "
|
|
91
|
-
echo "
|
|
111
|
+
echo "help: no narrowing is owed — each glob on the left auto-allows the probe beside"
|
|
112
|
+
echo " it, and that breadth was ruled intended. The ruling lives with the probes"
|
|
113
|
+
echo " in the committed guard-kit config, as a GUARD_KIT_BREADTH_DECLARED entry."
|
|
114
|
+
echo " A declaration is keyed on the exact glob string it ruled, so re-spelling"
|
|
115
|
+
echo " or narrowing that glob returns the entry to the narrowing candidates."
|
|
@@ -8,8 +8,9 @@ ESC_GUARD="$KIT/templates/escalation-guard.sh"
|
|
|
8
8
|
LIB="$KIT/lib/guard.sh"
|
|
9
9
|
CASES="${1:-$KIT/guard-tests/cases.tsv}"
|
|
10
10
|
ESC_CASES="${2:-$KIT/guard-tests/escalation-cases.tsv}"
|
|
11
|
+
BG_CASES="${3:-$KIT/guard-tests/background-cases.tsv}"
|
|
11
12
|
|
|
12
|
-
for f in "$BASH_GUARD" "$ESC_GUARD" "$LIB" "$CASES" "$ESC_CASES"; do
|
|
13
|
+
for f in "$BASH_GUARD" "$ESC_GUARD" "$LIB" "$CASES" "$ESC_CASES" "$BG_CASES"; do
|
|
13
14
|
[[ -f "$f" ]] || { echo "run-guard-tests: missing $f" >&2; exit 2; }
|
|
14
15
|
done
|
|
15
16
|
command -v jq >/dev/null 2>&1 || { echo "run-guard-tests: jq not found on PATH" >&2; exit 2; }
|
|
@@ -18,7 +19,7 @@ SANDBOX="$(mktemp -d)"
|
|
|
18
19
|
trap 'rm -rf "$SANDBOX"' EXIT
|
|
19
20
|
git -C "$SANDBOX" init -q
|
|
20
21
|
printf 'scratch.txt\n.tmp/\nfriction.log\n' >"$SANDBOX/.gitignore"
|
|
21
|
-
# spec: guard-kit/SPEC.md §The generic ruleset — rule
|
|
22
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — rule 21 splits on tracked vs not, so the sandbox needs one of each
|
|
22
23
|
printf 'tracked\n' >"$SANDBOX/tracked.md"
|
|
23
24
|
printf 'scratch\n' >"$SANDBOX/scratch.txt"
|
|
24
25
|
git -C "$SANDBOX" add tracked.md
|
|
@@ -70,6 +71,23 @@ while IFS=$'\t' read -r want cmd; do
|
|
|
70
71
|
check_case "$want" "$(classify "$rc" "$out")" "$cmd"
|
|
71
72
|
done <"$CASES"
|
|
72
73
|
|
|
74
|
+
# spec: guard-kit/SPEC.md §Testing — drives rule 15's harness arm: the backgrounding flag is a tool parameter, so the payload carries it beside the command rather than in it
|
|
75
|
+
while IFS=$'\t' read -r want rib cmd; do
|
|
76
|
+
[[ -z "${want// }" ]] && continue
|
|
77
|
+
[[ "$want" == \#* ]] && continue
|
|
78
|
+
cmd="${cmd//@ROOT@/$SANDBOX}"
|
|
79
|
+
cmd="${cmd//@NL@/$'\n'}"
|
|
80
|
+
if [[ "$rib" == "true" ]]; then
|
|
81
|
+
json="$(jq -nc --arg c "$cmd" '{tool_input:{command:$c,run_in_background:true}}')"
|
|
82
|
+
else
|
|
83
|
+
json="$(jq -nc --arg c "$cmd" '{tool_input:{command:$c}}')"
|
|
84
|
+
fi
|
|
85
|
+
out="$(cd "$SANDBOX" && printf '%s' "$json" \
|
|
86
|
+
| GUARD_KIT_LIB="$LIB" GUARD_KIT_LOG="$LOG" bash "$BASH_GUARD" 2>/dev/null)"
|
|
87
|
+
rc=$?
|
|
88
|
+
check_case "$want" "$(classify "$rc" "$out")" "[run_in_background=$rib] $cmd"
|
|
89
|
+
done <"$BG_CASES"
|
|
90
|
+
|
|
73
91
|
# spec: guard-kit/SPEC.md §wakeup-guard — drives the escalation-guard advisory table
|
|
74
92
|
while IFS=$'\t' read -r want to msg; do
|
|
75
93
|
[[ -z "${want// }" ]] && continue
|
|
@@ -81,12 +99,12 @@ while IFS=$'\t' read -r want to msg; do
|
|
|
81
99
|
done <"$ESC_CASES"
|
|
82
100
|
|
|
83
101
|
if [[ "$ran" -eq 0 ]]; then
|
|
84
|
-
echo "run-guard-tests: no cases parsed from $CASES / $ESC_CASES" >&2
|
|
102
|
+
echo "run-guard-tests: no cases parsed from $CASES / $BG_CASES / $ESC_CASES" >&2
|
|
85
103
|
exit 2
|
|
86
104
|
fi
|
|
87
105
|
if [[ "$fails" -gt 0 ]]; then
|
|
88
106
|
echo "run-guard-tests: $fails/$ran case(s) failed"
|
|
89
107
|
exit 1
|
|
90
108
|
fi
|
|
91
|
-
echo "run-guard-tests: ok ($ran cases across the generic ruleset
|
|
109
|
+
echo "run-guard-tests: ok ($ran cases across the generic ruleset, the backgrounding arm, and the escalation advisory)"
|
|
92
110
|
exit 0
|
|
@@ -33,6 +33,20 @@ printf '%s\n' '{ "permissions": { "allow": ["Bash(git fetch --dry-run)"] } }' >
|
|
|
33
33
|
printf '%s\n' 'GUARD_KIT_BREADTH_PROBES=("Bash(git reset --hard)")' > "$sb/probes.sh"
|
|
34
34
|
printf '%s\n' '# no probes declared' > "$sb/empty.sh"
|
|
35
35
|
|
|
36
|
+
# The declaration is keyed on the exact local allow-rule string; 'off-by-one.sh'
|
|
37
|
+
# differs from the overlay entry by one character and must not silence it.
|
|
38
|
+
two_probes='GUARD_KIT_BREADTH_PROBES=("Bash(git reset --hard)" "Bash(gh repo delete)")'
|
|
39
|
+
{
|
|
40
|
+
printf '%s\n' "$two_probes"
|
|
41
|
+
printf '%s\n' 'declare -A GUARD_KIT_BREADTH_DECLARED=(["Bash(git *)"]="sandbox repo, every git write is disposable")'
|
|
42
|
+
} > "$sb/declared.sh"
|
|
43
|
+
{
|
|
44
|
+
printf '%s\n' "$two_probes"
|
|
45
|
+
printf '%s\n' 'declare -A GUARD_KIT_BREADTH_DECLARED=(["Bash(git*)"]="one character off the overlay entry")'
|
|
46
|
+
} > "$sb/off-by-one.sh"
|
|
47
|
+
|
|
48
|
+
printf '%s\n' '{ "permissions": { "allow": ["Bash(git *)", "Bash(gh *)"] } }' > "$sb/mixed.json"
|
|
49
|
+
|
|
36
50
|
# Firing probe: the blanket glob auto-allows the destructive probe, reported with its witness.
|
|
37
51
|
firing="$(run "$sb/broad.json" "$sb/probes.sh")"
|
|
38
52
|
assert_has firing-section 'settings allowlist breadth' "$firing"
|
|
@@ -59,6 +73,37 @@ c_empty="$(run "$sb/broad.json" "$sb/empty.sh" --count)"
|
|
|
59
73
|
c_absent="$(run "$sb/does-not-exist.json" "$sb/probes.sh" --count)"
|
|
60
74
|
[[ "$c_absent" == "0 0" ]] || { echo "FAIL [count-absent]: expected '0 0', got '$c_absent'"; fails=$((fails + 1)); }
|
|
61
75
|
|
|
76
|
+
# Empty declaration map (every case above): the declared subsection is absent too.
|
|
77
|
+
assert_absent empty-declared-silent 'advisory — declared intended' "$firing"
|
|
78
|
+
|
|
79
|
+
# An over-broad set that is entirely declared: the declared section prints with its
|
|
80
|
+
# reason, and no narrowing section and no false clean line appear.
|
|
81
|
+
all_declared="$(run "$sb/broad.json" "$sb/declared.sh")"
|
|
82
|
+
assert_has all-declared-section 'advisory — declared intended' "$all_declared"
|
|
83
|
+
assert_has all-declared-reason 'sandbox repo, every git write is disposable' "$all_declared"
|
|
84
|
+
assert_absent all-declared-narrow 'advisory — narrowing candidates' "$all_declared"
|
|
85
|
+
assert_absent all-declared-clean 'no over-broad local entries' "$all_declared"
|
|
86
|
+
|
|
87
|
+
# A mixed set: the declared entry leaves the narrowing set, the undeclared one stays.
|
|
88
|
+
mixed="$(run "$sb/mixed.json" "$sb/declared.sh")"
|
|
89
|
+
assert_has mixed-narrowing 'advisory — narrowing candidates' "$mixed"
|
|
90
|
+
assert_has mixed-undeclared 'Bash(gh *) ⊇ Bash(gh repo delete)' "$mixed"
|
|
91
|
+
assert_has mixed-declared 'Bash(git *) ⊇ Bash(git reset --hard) — sandbox repo' "$mixed"
|
|
92
|
+
# The narrowing lane prints the pair bare; only the declared lane appends the reason,
|
|
93
|
+
# so an exact whole-line match on the bare pair is the partition assertion.
|
|
94
|
+
grep -qxF -- ' Bash(git *) ⊇ Bash(git reset --hard)' <<<"$mixed" \
|
|
95
|
+
&& { echo "FAIL [mixed-partition]: the declared glob is still in the narrowing set"; fails=$((fails + 1)); }
|
|
96
|
+
|
|
97
|
+
# --count: the breadth number counts narrowing candidates, so the declared entry is excluded.
|
|
98
|
+
c_mixed="$(run "$sb/mixed.json" "$sb/declared.sh" --count)"
|
|
99
|
+
[[ "$c_mixed" == "0 1" ]] || { echo "FAIL [count-declared]: expected '0 1', got '$c_mixed'"; fails=$((fails + 1)); }
|
|
100
|
+
|
|
101
|
+
# Exactness: a declaration one character off the overlay entry silences nothing.
|
|
102
|
+
off="$(run "$sb/broad.json" "$sb/off-by-one.sh")"
|
|
103
|
+
assert_has off-by-one-narrowing 'advisory — narrowing candidates' "$off"
|
|
104
|
+
assert_has off-by-one-entry 'Bash(git *) ⊇ Bash(git reset --hard)' "$off"
|
|
105
|
+
assert_absent off-by-one-declared 'advisory — declared intended' "$off"
|
|
106
|
+
|
|
62
107
|
[[ "$fails" -eq 0 ]] || { echo "compare-settings-allow.test: $fails assertion(s) failed"; exit 1; }
|
|
63
|
-
echo "compare-settings-allow.test: clean (a firing probe names its witnessing glob, a non-firing probe reports clean, an empty probe set omits the section)"
|
|
108
|
+
echo "compare-settings-allow.test: clean (a firing probe names its witnessing glob, a non-firing probe reports clean, an empty probe set omits the section, a declared breadth moves out of the narrowing set and out of --count, and an exactness miss silences nothing)"
|
|
64
109
|
exit 0
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# spec: guard-kit/SPEC.md §Testing — rule 15's harness arm: the backgrounding flag is tool
|
|
2
|
+
# input, not command text, so it cannot be written in cases.tsv's decision/command grammar.
|
|
3
|
+
# Columns: <expected-decision> <TAB> <run_in_background> <TAB> <command>.
|
|
4
|
+
#
|
|
5
|
+
# rule 15 — a backgrounded launch that records no producer is advised. The
|
|
6
|
+
# non-firing cases are the load-bearing ones: an inline record
|
|
7
|
+
# discharges the obligation, a wait loop is a waiter rather than a
|
|
8
|
+
# producer, a read-only pipeline owns nothing a commit could corrupt,
|
|
9
|
+
# and a foreground call never reaches the rule at all.
|
|
10
|
+
advise true bash worker.sh
|
|
11
|
+
fallthrough true bash worker.sh > .tmp/worker.log 2>&1 & printf 'pid=1 run=worker\n' > .tmp/worker.run
|
|
12
|
+
fallthrough true until grep -q DONE .tmp/worker.log; do sleep 5; done
|
|
13
|
+
allow true grep -rn foo src | head
|
|
14
|
+
fallthrough false bash worker.sh
|
|
@@ -40,8 +40,8 @@ fallthrough awk '$1' data.txt
|
|
|
40
40
|
# cannot expand, and the shell is what guarantees that — so its body is inert
|
|
41
41
|
block cat <<EOF > .tmp/n.md@NL@value is $(date)@NL@EOF
|
|
42
42
|
fallthrough cat <<'EOF' > .tmp/n.md@NL@value is $(date)@NL@EOF
|
|
43
|
-
# reaches rule
|
|
44
|
-
# point is that rule 6 no longer blocks it before rule
|
|
43
|
+
# reaches rule 20's advisory, which is the correct verdict for a commit -F; the
|
|
44
|
+
# point is that rule 6 no longer blocks it before rule 20 is ever consulted
|
|
45
45
|
advise git commit -F - <<'MSG'@NL@names a $(cmd) in the body@NL@MSG
|
|
46
46
|
|
|
47
47
|
# rule 7 — unquoted brace glyph: bare {} placeholder rewritten, expansions blocked.
|
|
@@ -110,11 +110,14 @@ fallthrough pgrep run-smoke.sh; bash run-smoke.sh
|
|
|
110
110
|
|
|
111
111
|
# rule 13 — bare foreground sleep steered to a condition wait. The non-firing
|
|
112
112
|
# cases are the load-bearing ones: a sleep inside an `until … do … done`
|
|
113
|
-
# loop *is* the sanctioned form, and a quoted mention is inert.
|
|
113
|
+
# loop *is* the sanctioned form, and a quoted mention is inert. The
|
|
114
|
+
# quoted-mention row is an `allow` because rule 17 grants the append
|
|
115
|
+
# outright, which still proves rule 13 inert: a block exits 2 at rule
|
|
116
|
+
# 13 and never reaches an auto-allow eight rules later.
|
|
114
117
|
block sleep 30
|
|
115
118
|
block sleep 180; echo waited
|
|
116
119
|
fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done
|
|
117
|
-
|
|
120
|
+
allow printf 'sleep 5' >> .tmp/note.txt
|
|
118
121
|
|
|
119
122
|
# rule 14 — tracked-tree mutation under a live producer. The sandbox's only
|
|
120
123
|
# `*.run` record names a dead pid and a non-record file sits beside
|
|
@@ -127,11 +130,38 @@ fallthrough git stash
|
|
|
127
130
|
fallthrough git -C . commit -m done
|
|
128
131
|
fallthrough git rev-parse HEAD
|
|
129
132
|
|
|
130
|
-
# rule 15 —
|
|
133
|
+
# rule 15 — a backgrounded launch that records no producer is advised. The
|
|
134
|
+
# shell `&` arm lives here because it *is* command text; the harness
|
|
135
|
+
# flag is tool input and cannot be written in this grammar, so that
|
|
136
|
+
# arm lives in background-cases.tsv.
|
|
137
|
+
advise bash worker.sh &
|
|
138
|
+
fallthrough bash worker.sh & printf 'pid=1 run=worker\n' > .tmp/worker.run
|
|
139
|
+
|
|
140
|
+
# rule 16 — `: > file` truncation auto-allowed iff every target is gitignored
|
|
131
141
|
allow : > scratch.txt
|
|
132
142
|
fallthrough : > tracked.txt
|
|
133
143
|
|
|
134
|
-
# rule
|
|
144
|
+
# rule 17 — append-only write to gitignored targets auto-allowed. The four
|
|
145
|
+
# clauses each get their refusing case, because each is what keeps the
|
|
146
|
+
# grant from blessing something the redirect alone would: (a) a single
|
|
147
|
+
# truncating `>` anywhere, (b) a target outside the ignore set, (c) a
|
|
148
|
+
# leading command that writes somewhere other than its stdout, and the
|
|
149
|
+
# single-statement half of (c) — a second statement on a line of its
|
|
150
|
+
# own, which is what the heredoc residue must never be confused with.
|
|
151
|
+
# Targets are relative, as rules 3 and 16's are: the runner drives the
|
|
152
|
+
# guard from inside the sandbox, and an `@ROOT@`-absolute target would
|
|
153
|
+
# meet rule 5's repo-root-prefix block nine rules earlier.
|
|
154
|
+
allow cat >> .tmp/journal.md <<'EOF'@NL@line@NL@EOF
|
|
155
|
+
fallthrough cat > .tmp/journal.md <<'EOF'@NL@line@NL@EOF
|
|
156
|
+
fallthrough cat >> tracked.md <<'EOF'@NL@line@NL@EOF
|
|
157
|
+
fallthrough rm -rf .tmp/x >> .tmp/journal.md
|
|
158
|
+
fallthrough printf x >> .tmp/journal.md@NL@rm -rf .tmp/x
|
|
159
|
+
# the two inert targets are exempt from (a) and (b): neither is a file the
|
|
160
|
+
# append-only split protects, and neither is a path git check-ignore can answer
|
|
161
|
+
allow printf 'x@NL@' >> .tmp/journal.md 2>/dev/null
|
|
162
|
+
allow cat >> .tmp/journal.md 2>&1
|
|
163
|
+
|
|
164
|
+
# rule 18 — read-only pipeline auto-allow; a non-roster segment falls through
|
|
135
165
|
allow grep -rn foo src | head
|
|
136
166
|
fallthrough grep foo file | awk '{print}'
|
|
137
167
|
# banner tolerance (rules 9 and 10's, third caller): a literal echo/printf
|
|
@@ -139,7 +169,7 @@ fallthrough grep foo file | awk '{print}'
|
|
|
139
169
|
allow echo === | grep foo src
|
|
140
170
|
fallthrough echo a | echo b
|
|
141
171
|
# widened lead: a bare committed allow entry may lead, since it was reviewed —
|
|
142
|
-
# but only where something decorates it, so the undecorated form (rule
|
|
172
|
+
# but only where something decorates it, so the undecorated form (rule 19's
|
|
143
173
|
# 'fallthrough git status' below) is still never intercepted here
|
|
144
174
|
allow git status | head
|
|
145
175
|
allow git status | head -20
|
|
@@ -156,7 +186,7 @@ fallthrough grep -rln foo src | xargs sed -i s/a/b/
|
|
|
156
186
|
block ls | xargs chmod 777
|
|
157
187
|
block ls | xargs xargs rm
|
|
158
188
|
|
|
159
|
-
# rule
|
|
189
|
+
# rule 19 — decorated allowlisted bare lead with an unmatched segment blocked;
|
|
160
190
|
# chaining steer, redirect steer, and the untouched non-firing cases
|
|
161
191
|
block git status && rm -rf tmp
|
|
162
192
|
block git status 2>&1
|
|
@@ -165,7 +195,7 @@ fallthrough frobnicate && git status
|
|
|
165
195
|
fallthrough git status && ls
|
|
166
196
|
fallthrough git status && printf done
|
|
167
197
|
|
|
168
|
-
# rule
|
|
198
|
+
# rule 20 — git history-rewrite advisory: amend / commit -F / soft-reset steered;
|
|
169
199
|
# a plain commit and a non-soft reset pass
|
|
170
200
|
advise git commit --amend
|
|
171
201
|
advise git commit --amend --no-edit
|
|
@@ -174,7 +204,7 @@ advise git reset --soft HEAD~1
|
|
|
174
204
|
fallthrough git commit -m done
|
|
175
205
|
fallthrough git reset --hard HEAD~1
|
|
176
206
|
|
|
177
|
-
# rule
|
|
207
|
+
# rule 21 — bare rm of a tracked path steers to 'git rm -q'; untracked,
|
|
178
208
|
# gitignored, and the already-correct git rm form pass
|
|
179
209
|
block rm tracked.md
|
|
180
210
|
block rm -f tracked.md
|
|
@@ -183,5 +213,5 @@ fallthrough rm scratch.txt
|
|
|
183
213
|
fallthrough rm untracked-nowhere.md
|
|
184
214
|
fallthrough git rm -q tracked.md
|
|
185
215
|
|
|
186
|
-
# rule
|
|
216
|
+
# rule 22 — anything else falls through to the friction log
|
|
187
217
|
fallthrough make build
|