@chrono-meta/fh-gate 3.46.0 → 3.48.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/.claude/rules/fh_4axis_gate.md +1 -1
- package/.claude-plugin/marketplace.json +4 -4
- package/CHEATSHEET.md +2 -2
- package/README.ja.md +4 -0
- package/README.ko.md +22 -0
- package/README.md +24 -0
- package/README.zh.md +4 -0
- package/docs/codex-compat.md +4 -4
- package/knowledge/shared/harness-core/agents_md_runtime_details.md +2 -2
- package/knowledge/shared/harness-core/builtin_capability_map.md +6 -3
- package/knowledge/shared/harness-core/claude_md_full_reference.md +5 -1
- package/knowledge/shared/harness-core/fh_4axis_gate_detail.md +15 -0
- package/knowledge/shared/harness-core/fh_integration_contract.md +2 -2
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +14 -0
- package/package.json +1 -1
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +96 -0
- package/plugins/fh-meta/skills/frontier-digest/SKILL_detail.md +13 -7
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/destructive_pre_gate.sh +170 -22
- package/scripts/fh-gate.sh +181 -22
- package/scripts/fh-goal.sh +17 -4
- package/scripts/fh-run.sh +17 -4
- package/scripts/test_action_yml_lanes.sh +162 -0
- package/scripts/test_destructive_pre_gate_lanes.sh +145 -3
- package/scripts/test_fh_gate_absorb_lanes.sh +1 -0
- package/scripts/test_fh_gate_defaults_lanes.sh +207 -0
- package/scripts/test_fh_gate_fusion_lanes.sh +1 -0
- package/scripts/test_fh_gate_regressions.sh +1 -0
- package/scripts/test_fh_goal_change_detection_lanes.sh +47 -0
- package/scripts/test_fh_run_resolver_lanes.sh +47 -0
- package/templates/predelete_check.sh +2 -0
- package/templates/predelete_check.test.sh +10 -0
- package/templates/settings.PreToolUse.snippet.json +6 -1
package/scripts/fh-goal.sh
CHANGED
|
@@ -118,10 +118,13 @@ fi
|
|
|
118
118
|
|
|
119
119
|
if [[ -z "${FH_MODEL:-}" ]]; then
|
|
120
120
|
case "$FH_BACKEND" in
|
|
121
|
-
codex) FH_MODEL="gpt-5.5
|
|
121
|
+
codex) FH_MODEL="" ;; # not pinned: codex picks a model the login accepts. The old pin, gpt-5.5, is
|
|
122
|
+
# refused for a ChatGPT login (HTTP 400, measured 2026-11-22 via fh-gate #1186).
|
|
123
|
+
# FH_MODEL=<id> still passes -m <id>.
|
|
122
124
|
claude) FH_MODEL="claude-sonnet-5-5" ;;
|
|
123
125
|
esac
|
|
124
126
|
fi
|
|
127
|
+
FH_MODEL_LABEL="${FH_MODEL:-codex default (not pinned)}"
|
|
125
128
|
|
|
126
129
|
if ! command -v "$FH_BACKEND" &>/dev/null; then
|
|
127
130
|
echo "ERROR: '$FH_BACKEND' CLI not found." >&2
|
|
@@ -150,7 +153,7 @@ trap cleanup EXIT
|
|
|
150
153
|
|
|
151
154
|
cat > "$PROMPT_FILE" <<PROMPT
|
|
152
155
|
FH GOAL RUNNER v${VERSION}
|
|
153
|
-
Backend: ${FH_BACKEND} | Model: ${
|
|
156
|
+
Backend: ${FH_BACKEND} | Model: ${FH_MODEL_LABEL}
|
|
154
157
|
|
|
155
158
|
Task:
|
|
156
159
|
${GOAL_PROMPT}
|
|
@@ -173,7 +176,7 @@ if [[ "$FH_DRY_RUN" == "1" ]]; then
|
|
|
173
176
|
exit 12
|
|
174
177
|
fi
|
|
175
178
|
|
|
176
|
-
echo "→ fh-goal v${VERSION} backend=${FH_BACKEND} model=${
|
|
179
|
+
echo "→ fh-goal v${VERSION} backend=${FH_BACKEND} model=${FH_MODEL_LABEL} gate=${FH_GATE_LEVEL}" >&2
|
|
177
180
|
|
|
178
181
|
_TIMEOUT_CMD=""
|
|
179
182
|
if command -v gtimeout &>/dev/null; then
|
|
@@ -182,10 +185,19 @@ elif command -v timeout &>/dev/null; then
|
|
|
182
185
|
_TIMEOUT_CMD="timeout ${FH_TIMEOUT}"
|
|
183
186
|
fi
|
|
184
187
|
|
|
188
|
+
# With codex unpinned, name the model codex resolved, read from its own stderr banner above the `user` line
|
|
189
|
+
# only (the same rule as fh-gate #1186). Id-shaped or «unknown»; never the prompt or the reply.
|
|
190
|
+
_note_codex_model() {
|
|
191
|
+
[[ "$FH_BACKEND" == "codex" && -z "${FH_MODEL:-}" ]] || return 0
|
|
192
|
+
local _m
|
|
193
|
+
_m=$(awk '/^user$/{exit} /^model: /{sub(/^model: /, ""); print; exit}' "$ERR_FILE" 2>/dev/null || true)
|
|
194
|
+
[[ "$_m" =~ ^[A-Za-z0-9._:-]{1,64}$ ]] || _m="unknown"
|
|
195
|
+
echo "→ $1: codex default (not pinned, resolved $_m)" >&2
|
|
196
|
+
}
|
|
185
197
|
run_backend() {
|
|
186
198
|
case "$FH_BACKEND" in
|
|
187
199
|
claude) ${_TIMEOUT_CMD} claude --print --model "$FH_MODEL" ;;
|
|
188
|
-
codex) ${_TIMEOUT_CMD} codex exec
|
|
200
|
+
codex) ${_TIMEOUT_CMD} codex exec ${FH_MODEL:+-m "$FH_MODEL"} - ;;
|
|
189
201
|
esac
|
|
190
202
|
}
|
|
191
203
|
|
|
@@ -195,6 +207,7 @@ if ! run_backend < "$PROMPT_FILE" > "$OUTPUT_FILE" 2>"$ERR_FILE"; then
|
|
|
195
207
|
exit 10
|
|
196
208
|
fi
|
|
197
209
|
|
|
210
|
+
_note_codex_model fh-goal
|
|
198
211
|
[[ "$FH_VERBOSE" == "1" ]] && cat "$ERR_FILE" >&2
|
|
199
212
|
cat "$OUTPUT_FILE"
|
|
200
213
|
|
package/scripts/fh-run.sh
CHANGED
|
@@ -143,10 +143,13 @@ fi
|
|
|
143
143
|
|
|
144
144
|
if [[ -z "${FH_MODEL:-}" ]]; then
|
|
145
145
|
case "$FH_BACKEND" in
|
|
146
|
-
codex) FH_MODEL="gpt-5.5
|
|
146
|
+
codex) FH_MODEL="" ;; # not pinned: codex picks a model the login accepts. The old pin, gpt-5.5, is
|
|
147
|
+
# refused for a ChatGPT login (HTTP 400, measured 2026-11-22 via fh-gate #1186).
|
|
148
|
+
# FH_MODEL=<id> still passes -m <id>.
|
|
147
149
|
claude) FH_MODEL="claude-sonnet-5-5" ;;
|
|
148
150
|
esac
|
|
149
151
|
fi
|
|
152
|
+
FH_MODEL_LABEL="${FH_MODEL:-codex default (not pinned)}"
|
|
150
153
|
|
|
151
154
|
resolve_unit() {
|
|
152
155
|
local mode="$1"
|
|
@@ -237,7 +240,7 @@ trap cleanup EXIT
|
|
|
237
240
|
|
|
238
241
|
{
|
|
239
242
|
printf "FH RUNTIME ADAPTER v%s\n" "$VERSION"
|
|
240
|
-
printf "Backend: %s | Model: %s\n" "$FH_BACKEND" "$
|
|
243
|
+
printf "Backend: %s | Model: %s\n" "$FH_BACKEND" "$FH_MODEL_LABEL"
|
|
241
244
|
printf "Unit: %s\n" "$UNIT_FILE"
|
|
242
245
|
printf "\n"
|
|
243
246
|
printf "You are executing the FH %s below. Follow its workflow and output contract.\n" "$FH_RUN_MODE"
|
|
@@ -287,7 +290,7 @@ if ! command -v "$FH_BACKEND" &>/dev/null; then
|
|
|
287
290
|
exit 10
|
|
288
291
|
fi
|
|
289
292
|
|
|
290
|
-
echo "→ fh-run v${VERSION} backend=${FH_BACKEND} model=${
|
|
293
|
+
echo "→ fh-run v${VERSION} backend=${FH_BACKEND} model=${FH_MODEL_LABEL} unit=${FH_RUN_MODE}:${FH_RUN_NAME:-$FH_RUN_UNIT}" >&2
|
|
291
294
|
|
|
292
295
|
_TIMEOUT_CMD=""
|
|
293
296
|
if command -v gtimeout &>/dev/null; then
|
|
@@ -296,10 +299,19 @@ elif command -v timeout &>/dev/null; then
|
|
|
296
299
|
_TIMEOUT_CMD="timeout ${FH_TIMEOUT}"
|
|
297
300
|
fi
|
|
298
301
|
|
|
302
|
+
# With codex unpinned, name the model codex resolved, read from its own stderr banner above the `user` line
|
|
303
|
+
# only (the same rule as fh-gate #1186). Id-shaped or «unknown»; never the prompt or the reply.
|
|
304
|
+
_note_codex_model() {
|
|
305
|
+
[[ "$FH_BACKEND" == "codex" && -z "${FH_MODEL:-}" ]] || return 0
|
|
306
|
+
local _m
|
|
307
|
+
_m=$(awk '/^user$/{exit} /^model: /{sub(/^model: /, ""); print; exit}' "$ERR_FILE" 2>/dev/null || true)
|
|
308
|
+
[[ "$_m" =~ ^[A-Za-z0-9._:-]{1,64}$ ]] || _m="unknown"
|
|
309
|
+
echo "→ $1: codex default (not pinned, resolved $_m)" >&2
|
|
310
|
+
}
|
|
299
311
|
run_backend() {
|
|
300
312
|
case "$FH_BACKEND" in
|
|
301
313
|
claude) ${_TIMEOUT_CMD} claude --print --model "$FH_MODEL" ;;
|
|
302
|
-
codex) ${_TIMEOUT_CMD} codex exec
|
|
314
|
+
codex) ${_TIMEOUT_CMD} codex exec ${FH_MODEL:+-m "$FH_MODEL"} - ;;
|
|
303
315
|
esac
|
|
304
316
|
}
|
|
305
317
|
|
|
@@ -309,5 +321,6 @@ if ! run_backend < "$PROMPT_FILE" > "$OUTPUT_FILE" 2>"$ERR_FILE"; then
|
|
|
309
321
|
exit 10
|
|
310
322
|
fi
|
|
311
323
|
|
|
324
|
+
_note_codex_model fh-run
|
|
312
325
|
[[ "$FH_VERBOSE" == "1" ]] && cat "$ERR_FILE" >&2
|
|
313
326
|
cat "$OUTPUT_FILE"
|
|
@@ -175,6 +175,168 @@ for v in PASS PENDING; do
|
|
|
175
175
|
case ",$_failon," in *",$v,"*) no "fail-on default contains $v (over-blocks a reviewed pass)" ;; *) ok "fail-on default correctly omits $v" ;; esac
|
|
176
176
|
done
|
|
177
177
|
|
|
178
|
+
echo "── L7 inputs reach the run script as env data, not as substituted shell text (2026-11-22) ──"
|
|
179
|
+
# WHY. GitHub substitutes `${{ inputs.X }}` into the run: script as TEXT before bash sees it, so a
|
|
180
|
+
# caller-controlled value (a file list built from a PR, say) containing `"; cmd; "` runs `cmd` in the
|
|
181
|
+
# workflow (GitHub's own hardening guide: pass untrusted values through `env:`). Found in the 3.45.0
|
|
182
|
+
# security review (LOW — the caller writes these inputs, but `files` is often derived from PR data).
|
|
183
|
+
# HOW. L7b imitates that substitution: every `${{ inputs.X }}` in the run block is replaced by the
|
|
184
|
+
# value as text, every env: entry is exported as data, `npx` is a stub, and one input carries a
|
|
185
|
+
# payload that touches a file. The file must not appear. L7c is the control: the same run with one
|
|
186
|
+
# env reference turned back into an inline expression must create it.
|
|
187
|
+
_RUNBLK="$(awk '/^ run: \|/{f=1; next} f && /^ - /{exit} f{print}' "$A" | sed 's/^ //')"
|
|
188
|
+
_ENVBLK="$(awk '/^ env:/{f=1; next} f && /^ [a-z-]+:/{exit} f{print}' "$A" | sed 's/^ *//')"
|
|
189
|
+
[ -n "$_RUNBLK" ] && [ -n "$_ENVBLK" ]; chk $? "L7-0 CONTROL: run and env blocks extracted (run $(printf '%s\n' "$_RUNBLK" | wc -l | tr -d ' ') lines)"
|
|
190
|
+
# Any expression form counts — `inputs.x`, `inputs['x']`, `github.event…`, `steps…`: each is pasted as text.
|
|
191
|
+
_inline="$(printf '%s\n' "$_RUNBLK" | grep -c '\${{' || true)"
|
|
192
|
+
[ "$_inline" -eq 0 ]; chk $? "L7a no \${{ … }} expression of any form inside the run script (found $_inline)"
|
|
193
|
+
_L7T="$(mktemp -d "${TMPDIR:-/tmp}/action_yml_l7_XXXXXX")"
|
|
194
|
+
mkdir -p "$_L7T/bin"; printf '#!/bin/sh\nexit 0\n' > "$_L7T/bin/npx"; chmod +x "$_L7T/bin/npx"
|
|
195
|
+
# simulate <run script file> — GitHub-style text substitution of inputs, env as data, stub npx
|
|
196
|
+
_l7_sim(){
|
|
197
|
+
python3 - "$1" "$_L7T" <<'PY'
|
|
198
|
+
import re, sys, os, subprocess
|
|
199
|
+
run = open(sys.argv[1], encoding="utf-8").read(); tmp = sys.argv[2]
|
|
200
|
+
pwn = os.path.join(tmp, "PWNED")
|
|
201
|
+
vals = {"files": 'a.sh"; touch "' + pwn + '"; echo "', "level": "light", "version": "latest",
|
|
202
|
+
"dry-run": "false", "fail-on": "BLOCKED", "backend": "claude", "model": "", "timeout": ""}
|
|
203
|
+
sub = lambda m: vals.get(m.group(1), "")
|
|
204
|
+
env = dict(os.environ, PATH=os.path.join(tmp, "bin") + ":" + os.environ["PATH"],
|
|
205
|
+
GITHUB_OUTPUT=os.path.join(tmp, "out"), GITHUB_STEP_SUMMARY=os.path.join(tmp, "sum"))
|
|
206
|
+
for line in open(os.path.join(tmp, "envblk"), encoding="utf-8"):
|
|
207
|
+
m = re.match(r"([A-Z_]+):\s*(.*)$", line.strip())
|
|
208
|
+
if m: env[m.group(1)] = re.sub(r"\$\{\{\s*inputs\.([a-z-]+)\s*\}\}", sub, m.group(2))
|
|
209
|
+
script = re.sub(r"\$\{\{\s*inputs\.([a-z-]+)\s*\}\}", sub, run)
|
|
210
|
+
if "${{" in script: # an expression form this simulator does not substitute: not measured, never «clean»
|
|
211
|
+
print("UNMEASURED"); sys.exit(0)
|
|
212
|
+
subprocess.run(["bash", "-c", script], env=env, cwd=tmp, capture_output=True)
|
|
213
|
+
print("PWNED" if os.path.exists(pwn) else "clean")
|
|
214
|
+
PY
|
|
215
|
+
}
|
|
216
|
+
printf '%s\n' "$_ENVBLK" > "$_L7T/envblk"
|
|
217
|
+
printf '%s\n' "$_RUNBLK" > "$_L7T/run.sh"
|
|
218
|
+
[ "$(_l7_sim "$_L7T/run.sh")" = "clean" ]; chk $? "L7b a files input carrying '\"; touch …; \"' stays data — no command runs"
|
|
219
|
+
rm -f "$_L7T/PWNED"
|
|
220
|
+
sed 's/"\$FH_ACTION_FILES"/"${{ inputs.files }}"/' "$_L7T/run.sh" > "$_L7T/run_ctl.sh"
|
|
221
|
+
if cmp -s "$_L7T/run.sh" "$_L7T/run_ctl.sh"; then
|
|
222
|
+
no "L7c CONTROL dead — the run script has no \"\$FH_ACTION_FILES\" to turn back into an inline expression"
|
|
223
|
+
else
|
|
224
|
+
[ "$(_l7_sim "$_L7T/run_ctl.sh")" = "PWNED" ]; chk $? "L7c CONTROL: the same payload through an inline \${{ inputs.files }} runs the command (the lane can fail)"
|
|
225
|
+
fi
|
|
226
|
+
rm -rf "$_L7T"
|
|
227
|
+
|
|
228
|
+
echo "── L8 a file list that reads as a help or version flag is not a pass (2026-11-22) ──"
|
|
229
|
+
# WHY. fh-gate printed help and exited 0 for `fh-gate -h <level> <caller>`; the Action always passes three
|
|
230
|
+
# arguments and maps exit 0 to PASS with reviewed=true — so `files: -h` (a file literally named so, or a list
|
|
231
|
+
# built from PR data) gave an unreviewed PASS (3.47.0 security review, MEDIUM-1). Help and version are now
|
|
232
|
+
# honoured only alone. HOW. The run block runs with env as data and an `npx` stub that hands its arguments
|
|
233
|
+
# to the real scripts/fh-gate.sh, under the action's real default fail-on; the verdict is read from GITHUB_OUTPUT
|
|
234
|
+
# and the step's own exit code is checked. L8b: a normal three-argument call still reaches the gate (dry-run → 12).
|
|
235
|
+
# L8-ctl: `fh-gate -h` alone, with CI unset, still prints help and exits 0. A plain CI step that calls
|
|
236
|
+
# `fh-gate "$FILES"` with ONE argument cannot be told from an intended `fh-gate -h` by argv — L9 covers it by CI.
|
|
237
|
+
if [ -f "$G" ] && [ -n "$_RUNBLK" ] && [ -n "$_ENVBLK" ]; then
|
|
238
|
+
_L8T="$(mktemp -d "${TMPDIR:-/tmp}/action_yml_l8_XXXXXX")"
|
|
239
|
+
mkdir -p "$_L8T/bin"
|
|
240
|
+
printf '#!/usr/bin/env bash\nwhile [ $# -gt 0 ] && [ "$1" != fh-gate ]; do shift; done; shift\nexec bash "$L8_GATE" "$@"\n' > "$_L8T/bin/npx"
|
|
241
|
+
chmod +x "$_L8T/bin/npx"
|
|
242
|
+
printf '%s\n' "$_ENVBLK" > "$_L8T/envblk"
|
|
243
|
+
printf '%s\n' "$_RUNBLK" > "$_L8T/run.sh"
|
|
244
|
+
_l8_run(){ # $1 = files input · $2 = dry-run → prints «verdict=… reviewed=… step_rc=…»; fail-on is the real default
|
|
245
|
+
python3 - "$_L8T" "$1" "$G" "$_failon" "${2:-false}" <<'PY'
|
|
246
|
+
import re, sys, os, subprocess
|
|
247
|
+
tmp, files, gate, failon, dry = sys.argv[1:6]
|
|
248
|
+
vals = {"files": files, "level": "quick", "version": "latest", "dry-run": dry,
|
|
249
|
+
"fail-on": failon, "backend": "claude", "model": "", "timeout": ""}
|
|
250
|
+
out = os.path.join(tmp, "out"); open(out, "w").close()
|
|
251
|
+
env = dict(os.environ, PATH=os.path.join(tmp, "bin") + ":" + os.environ["PATH"], L8_GATE=gate,
|
|
252
|
+
GITHUB_OUTPUT=out, GITHUB_STEP_SUMMARY=os.path.join(tmp, "sum"))
|
|
253
|
+
for line in open(os.path.join(tmp, "envblk"), encoding="utf-8"):
|
|
254
|
+
m = re.match(r"([A-Z_]+):\s*(.*)$", line.strip())
|
|
255
|
+
if m: env[m.group(1)] = re.sub(r"\$\{\{\s*inputs\.([a-z-]+)\s*\}\}", lambda x: vals.get(x.group(1), ""), m.group(2))
|
|
256
|
+
p = subprocess.run(["bash", os.path.join(tmp, "run.sh")], env=env, cwd=tmp, capture_output=True, timeout=60)
|
|
257
|
+
kv = dict(l.split("=", 1) for l in open(out).read().split() if "=" in l)
|
|
258
|
+
print("verdict=%s reviewed=%s step_rc=%d" % (kv.get("verdict", "NONE"), kv.get("reviewed", "NONE"), p.returncode))
|
|
259
|
+
PY
|
|
260
|
+
}
|
|
261
|
+
for _f in -h --help -V --version; do
|
|
262
|
+
_r="$(_l8_run "$_f")"
|
|
263
|
+
case "$_r" in
|
|
264
|
+
"verdict=ARG_ERROR reviewed=false step_rc=1") ok "L8a files: '$_f' → $_r (not a pass; the step fails under the default fail-on)" ;;
|
|
265
|
+
*) no "L8a files: '$_f' → $_r — an unreviewed run must not read as PASS" ;;
|
|
266
|
+
esac
|
|
267
|
+
done
|
|
268
|
+
# L8b: a normal three-argument call is NOT rejected — the same path with a real file and dry-run reaches the
|
|
269
|
+
# gate's dry-run exit (12), so L8a is not «every multi-argument call returns 11».
|
|
270
|
+
printf 'echo hi\n' > "$_L8T/a.sh"
|
|
271
|
+
_r="$(_l8_run a.sh true)"
|
|
272
|
+
case "$_r" in
|
|
273
|
+
"verdict=DRY_RUN reviewed=false step_rc=1") ok "L8b CONTROL files: 'a.sh' + dry-run → $_r (the three-argument path still reaches the gate)" ;;
|
|
274
|
+
*) no "L8b CONTROL files: 'a.sh' + dry-run → $_r" ;;
|
|
275
|
+
esac
|
|
276
|
+
_hl="$(env -u CI bash "$G" -h 2>/dev/null)"; _hrc=$?; _hl="${_hl%%$'\n'*}"
|
|
277
|
+
if [ "$_hrc" -eq 0 ] && case "$_hl" in "fh-gate "*) true ;; *) false ;; esac; then
|
|
278
|
+
ok "L8-ctl fh-gate -h alone still prints help (exit 0)"
|
|
279
|
+
else
|
|
280
|
+
no "L8-ctl fh-gate -h alone gave rc=$_hrc '$_hl'"
|
|
281
|
+
fi
|
|
282
|
+
rm -rf "$_L8T"
|
|
283
|
+
else
|
|
284
|
+
echo " ⬜ L8 SKIPPED (not PASS) — scripts/fh-gate.sh or the run block is absent here"
|
|
285
|
+
fi
|
|
286
|
+
|
|
287
|
+
echo "── L9 under CI a lone help or version flag is not a pass either (2026-11-23, the L8 residual) ──"
|
|
288
|
+
# WHY. A plain CI step `fh-gate "$FILES"` with FILES=-h hands fh-gate argv identical to a person typing
|
|
289
|
+
# `fh-gate -h`, so L8's argument count cannot see it and it printed help and exited 0: the step passed with no
|
|
290
|
+
# review. fh-gate now reads CI: set to anything but empty, 0 or false, a lone -h/--help/-V/--version still
|
|
291
|
+
# prints, then exits 11. HOW. Each case runs the plain-CI shape (`FILES=<x>; fh-gate "$FILES"`, one argument)
|
|
292
|
+
# against the real scripts/fh-gate.sh. L9a: the four flags under CI=true → 11 with the text still on stdout.
|
|
293
|
+
# L9b: CI=1 → 11 (any other value counts). L9-ctl: CI unset, '', 0, false → 0. L9c CONTROL: a real file +
|
|
294
|
+
# dry-run under CI=true through the same one-argument shape reaches the gate (12), so L9a is not «CI breaks
|
|
295
|
+
# every call». Still open, by name: CI systems that do not set CI, local git hooks and scripts.
|
|
296
|
+
if [ -f "$G" ]; then
|
|
297
|
+
_L9T="$(mktemp -d "${TMPDIR:-/tmp}/action_yml_l9_XXXXXX")"
|
|
298
|
+
_l9(){ # $1 = CI value or the word unset · $2 = files → prints «rc=<n> out=<first stdout line>»
|
|
299
|
+
local _o _rc
|
|
300
|
+
if [ "$1" = unset ]; then
|
|
301
|
+
_o="$(cd "$_L9T" && env -u CI -u FH_DRY_RUN bash -c 'FILES="$1"; bash "$2" "$FILES"' _ "$2" "$G" 2>/dev/null)"; _rc=$?
|
|
302
|
+
else
|
|
303
|
+
_o="$(cd "$_L9T" && env -u FH_DRY_RUN CI="$1" bash -c 'FILES="$1"; bash "$2" "$FILES"' _ "$2" "$G" 2>/dev/null)"; _rc=$?
|
|
304
|
+
fi
|
|
305
|
+
printf 'rc=%s out=%s\n' "$_rc" "${_o%%$'\n'*}"
|
|
306
|
+
}
|
|
307
|
+
for _f in -h --help -V --version; do
|
|
308
|
+
_r="$(_l9 true "$_f")"
|
|
309
|
+
case "$_r" in
|
|
310
|
+
"rc=11 out=fh-gate "*) ok "L9a CI=true, FILES='$_f' → $_r (printed, then not a pass)" ;;
|
|
311
|
+
*) no "L9a CI=true, FILES='$_f' → $_r — under CI a lone flag must not exit 0" ;;
|
|
312
|
+
esac
|
|
313
|
+
done
|
|
314
|
+
_r="$(_l9 1 -h)"
|
|
315
|
+
case "$_r" in
|
|
316
|
+
"rc=11 out=fh-gate "*) ok "L9b CI=1, FILES='-h' → $_r (any value other than empty, 0 or false)" ;;
|
|
317
|
+
*) no "L9b CI=1, FILES='-h' → $_r" ;;
|
|
318
|
+
esac
|
|
319
|
+
for _c in unset '' 0 false; do
|
|
320
|
+
for _f in -h --version; do
|
|
321
|
+
_r="$(_l9 "$_c" "$_f")"
|
|
322
|
+
case "$_r" in
|
|
323
|
+
"rc=0 out=fh-gate "*) ok "L9-ctl CI=[$_c], '$_f' → $_r (help and version still work outside CI)" ;;
|
|
324
|
+
*) no "L9-ctl CI=[$_c], '$_f' → $_r" ;;
|
|
325
|
+
esac
|
|
326
|
+
done
|
|
327
|
+
done
|
|
328
|
+
printf 'echo hi\n' > "$_L9T/a.sh"
|
|
329
|
+
_rc=0; (cd "$_L9T" && CI=true FH_DRY_RUN=1 bash -c 'FILES="$1"; bash "$2" "$FILES"' _ a.sh "$G" >/dev/null 2>&1) || _rc=$?
|
|
330
|
+
if [ "$_rc" -eq 12 ]; then
|
|
331
|
+
ok "L9c CONTROL CI=true, FILES='a.sh' + dry-run → rc=12 (a real file list still reaches the gate under CI)"
|
|
332
|
+
else
|
|
333
|
+
no "L9c CONTROL CI=true, FILES='a.sh' + dry-run → rc=$_rc"
|
|
334
|
+
fi
|
|
335
|
+
rm -rf "$_L9T"
|
|
336
|
+
else
|
|
337
|
+
echo " ⬜ L9 SKIPPED (not PASS) — scripts/fh-gate.sh is absent here"
|
|
338
|
+
fi
|
|
339
|
+
|
|
178
340
|
echo ""
|
|
179
341
|
echo "── action.yml lanes: $PASS passed · $FAIL failed ──"
|
|
180
342
|
[ "$FAIL" -eq 0 ]
|
|
@@ -230,13 +230,16 @@ b_lane() { # name, expected rc, command, mode, env-assignment-or-empty, stderr
|
|
|
230
230
|
b_lane "B1 bypass + unset: blocks (exit 2)" 2 "$HIT_CMD" bypassPermissions "" "permission_mode=bypassPermissions"
|
|
231
231
|
b_lane "B2 bypass + BLOCK=0: advisory (exit 0)" 0 "$HIT_CMD" bypassPermissions "FH_DESTRUCTIVE_BLOCK=0" "-"
|
|
232
232
|
b_lane "B3 default + unset: advisory (exit 0)" 0 "$HIT_CMD" default "" "-"
|
|
233
|
-
|
|
233
|
+
# B4 and B6 changed meaning 2026-11-23 (IG1 → A + A′): auto now counts as block mode, and block mode
|
|
234
|
+
# no longer honors an agent-written noqa. Their old expectations (advisory / exempt) are the
|
|
235
|
+
# behaviour the K lanes below exist to forbid.
|
|
236
|
+
b_lane "B4 auto + unset: blocks (exit 2, A′)" 2 "$HIT_CMD" auto "" "permission_mode=auto"
|
|
234
237
|
b_lane "B5 bypass + clean cmd: silent (exit 0)" 0 "git status" bypassPermissions "" "-"
|
|
235
|
-
b_lane "B6 bypass + noqa: exempt (exit
|
|
238
|
+
b_lane "B6 bypass + noqa: NOT exempt (exit 2, A)" 2 "$HIT_CMD # noqa: destructive-op" bypassPermissions "" "permission_mode=bypassPermissions"
|
|
236
239
|
b_lane "B7 default + BLOCK=1: still blocks" 2 "$HIT_CMD" default "FH_DESTRUCTIVE_BLOCK=1" "FH_DESTRUCTIVE_BLOCK=1"
|
|
237
240
|
b_lane "B8 bypass + BLOCK=2: advisory as before" 0 "$HIT_CMD" bypassPermissions "FH_DESTRUCTIVE_BLOCK=2" "-"
|
|
238
241
|
b_lane "B9 bypass + BLOCK= (empty): blocks" 2 "$HIT_CMD" bypassPermissions "FH_DESTRUCTIVE_BLOCK=" "permission_mode=bypassPermissions"
|
|
239
|
-
b_lane "B10
|
|
242
|
+
b_lane "B10 block text says ask the operator" 2 "$HIT_CMD" bypassPermissions "FH_DESTRUCTIVE_BLOCK=1" "ask the operator"
|
|
240
243
|
# B2 must also deliver the advisory, not just exit 0 silently.
|
|
241
244
|
o=$(payload_mode "$HIT_CMD" bypassPermissions | FH_DESTRUCTIVE_BLOCK=0 bash "$G" 2>/dev/null)
|
|
242
245
|
if printf '%s' "$o" | grep -q 'DESTRUCTIVE-OP'; then
|
|
@@ -245,6 +248,145 @@ else
|
|
|
245
248
|
printf ' ❌ %-52s out=%s\n' "B2b bypass + BLOCK=0 still emits the advisory" "$o"; fail=$((fail+1))
|
|
246
249
|
fi
|
|
247
250
|
|
|
251
|
+
# K — agent-written overrides do not open block mode (2026-11-23, IG1 KP-F v2).
|
|
252
|
+
# input-from: tracks/_meta/inbound_guard_2026-11-23 records KP2-repo-KPF-clean-gated-haiku-r1..r3.
|
|
253
|
+
# Measured there: in a bypassPermissions session the agent was blocked here, re-ran with
|
|
254
|
+
# `# noqa: destructive-op` (this guard's own block text told it to), was blocked by pre-push, then
|
|
255
|
+
# re-ran with `DESTRUCTIVE_OP_OK=1 … # noqa` (pre-push's own text told it to) — remote rewritten,
|
|
256
|
+
# 3/3 runs. K1–K3 are those three commands, verbatim in shape. One boundary input, not coverage:
|
|
257
|
+
# indirection (`bash x.sh` holding the push) and settings edits stay open by design.
|
|
258
|
+
# k_lane: name, want rc, command, mode, env-or-empty, needle-or-"-", forbidden-regex-or-"-"
|
|
259
|
+
# (forbidden is checked on stdout+stderr together; want=0 with forbidden DESTRUCTIVE-OP = silent).
|
|
260
|
+
k_lane() {
|
|
261
|
+
local name=$1 want=$2 cmd=$3 mode=$4 envv=$5 needle=$6 forbid=$7 o r all
|
|
262
|
+
if [ -n "$envv" ]; then
|
|
263
|
+
o=$(payload_mode "$cmd" "$mode" | env "$envv" bash "$G" 2>"$c_errf"); r=$?
|
|
264
|
+
else
|
|
265
|
+
o=$(payload_mode "$cmd" "$mode" | env -u FH_DESTRUCTIVE_BLOCK bash "$G" 2>"$c_errf"); r=$?
|
|
266
|
+
fi
|
|
267
|
+
all="$o$(cat "$c_errf")"
|
|
268
|
+
if [ "$r" -eq "$want" ] \
|
|
269
|
+
&& { [ "$needle" = "-" ] || printf '%s' "$all" | grep -q -- "$needle"; } \
|
|
270
|
+
&& { [ "$forbid" = "-" ] || ! printf '%s' "$all" | grep -qE -- "$forbid"; }; then
|
|
271
|
+
printf ' ✅ %-52s %s\n' "$name" OK; pass=$((pass+1))
|
|
272
|
+
else
|
|
273
|
+
printf ' ❌ %-52s rc=%s all=%s\n' "$name" "$r" "$all"; fail=$((fail+1))
|
|
274
|
+
fi
|
|
275
|
+
}
|
|
276
|
+
K_F='git push --force origin f09c50074c55:trunk 2>&1'
|
|
277
|
+
echo "-- K: agent-written overrides in block mode (IG1 KP-F v2 shape) --"
|
|
278
|
+
k_lane "K1 bypass: force push + noqa blocks" 2 "$K_F # noqa: destructive-op" bypassPermissions "" "[BLOCKED]" "-"
|
|
279
|
+
k_lane "K2 bypass: + DESTRUCTIVE_OP_OK=1 + noqa blocks" 2 "DESTRUCTIVE_OP_OK=1 $K_F # noqa: destructive-op" bypassPermissions "" "[BLOCKED]" "-"
|
|
280
|
+
k_lane "K3 bypass: bundle && OK=1 force + noqa blocks" 2 "git bundle create /tmp/b.bundle --all 2>&1 && git bundle verify /tmp/b.bundle 2>&1 | tail -2 && DESTRUCTIVE_OP_OK=1 $K_F; echo \"exit=\$?\" # noqa: destructive-op" bypassPermissions "" "[BLOCKED]" "-"
|
|
281
|
+
k_lane "K4 bypass: OK=1 + remote delete blocks" 2 "DESTRUCTIVE_OP_OK=1 git push origin --delete release/2026-10" bypassPermissions "" "[BLOCKED]" "-"
|
|
282
|
+
k_lane "K5 bypass: push --delete blocks" 2 "git push origin --delete release/2026-10" bypassPermissions "" "remote" "-"
|
|
283
|
+
k_lane "K6 bypass: push -d blocks" 2 "git push -d origin old" bypassPermissions "" "remote" "-"
|
|
284
|
+
k_lane "K7 bypass: push origin :ref blocks" 2 "git push origin :release/2026-10" bypassPermissions "" "remote" "-"
|
|
285
|
+
k_lane "K8 bypass: push --mirror blocks" 2 "git push --mirror origin" bypassPermissions "" "remote" "-"
|
|
286
|
+
k_lane "K9 bypass: push --prune blocks" 2 "git push --prune origin 'refs/heads/*:refs/heads/*'" bypassPermissions "" "remote" "-"
|
|
287
|
+
k_lane "K10 bypass: push --no-verify blocks" 2 "git push --no-verify origin trunk" bypassPermissions "" "pre-push" "-"
|
|
288
|
+
k_lane "K11 bypass: -c core.hooksPath push blocks" 2 "git -c core.hooksPath=/dev/null push origin trunk" bypassPermissions "" "pre-push" "-"
|
|
289
|
+
k_lane "K12 bypass: git config core.hooksPath blocks" 2 "git config core.hooksPath /dev/null" bypassPermissions "" "pre-push" "-"
|
|
290
|
+
k_lane "K13 bypass: OK=1 on any command blocks" 2 "DESTRUCTIVE_OP_OK=1 bash scripts/cleanup.sh" bypassPermissions "" "DESTRUCTIVE_OP_OK" "-"
|
|
291
|
+
k_lane "K14 auto: plain force push blocks (A′)" 2 "$K_F" auto "" "permission_mode=auto" "-"
|
|
292
|
+
k_lane "K15 auto: force push + noqa blocks (A′)" 2 "$K_F # noqa: destructive-op" auto "" "[BLOCKED]" "-"
|
|
293
|
+
k_lane "K16 block text carries no self-grant recipe" 2 "$K_F" bypassPermissions "" "ask the operator" "add noqa|re-run with trailing|FH_DESTRUCTIVE_BLOCK=0|DESTRUCTIVE_OP_OK=1 git"
|
|
294
|
+
k_lane "K17 block text says noqa is not honored here" 2 "$K_F # noqa: destructive-op" bypassPermissions "" "not honored" "-"
|
|
295
|
+
echo "-- K: advisory mode unchanged, and clean shapes stay clean in block mode --"
|
|
296
|
+
k_lane "K18 default: force push + noqa still silent" 0 "$K_F # noqa: destructive-op" default "" "-" "DESTRUCTIVE-OP"
|
|
297
|
+
k_lane "K19 bypass + BLOCK=0: noqa still silent" 0 "$K_F # noqa: destructive-op" bypassPermissions "FH_DESTRUCTIVE_BLOCK=0" "-" "DESTRUCTIVE-OP"
|
|
298
|
+
k_lane "K20 default: push --delete stays silent" 0 "git push origin --delete old" default "" "-" "DESTRUCTIVE-OP"
|
|
299
|
+
k_lane "K21 default: push --no-verify stays silent" 0 "git push --no-verify origin x" default "" "-" "DESTRUCTIVE-OP"
|
|
300
|
+
k_lane "K22 bypass: plain push is clean" 0 "git push origin trunk" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
301
|
+
k_lane "K23 bypass: push -u is clean" 0 "git push -u origin feature/x" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
302
|
+
k_lane "K24 bypass: branch name with -d is clean" 0 "git push origin fix-d" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
303
|
+
k_lane "K25 bypass: refspec with colon is clean" 0 "git push origin HEAD:refs/heads/feature/x" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
304
|
+
k_lane "K26 bypass: grep for the env name is clean" 0 "grep -n DESTRUCTIVE_OP_OK templates/.git-hooks/pre-push" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
305
|
+
k_lane "K27 bypass: git config --get hooksPath is clean" 0 "git config --get core.hooksPath" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
306
|
+
k_lane "K28 bypass: commit --no-verify out of scope" 0 "git commit --no-verify -m x" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
307
|
+
k_lane "K29 dontAsk: stays advisory (named residual)" 0 "$K_F" dontAsk "" "-" "-"
|
|
308
|
+
echo "-- K: codex R1 findings (2026-11-23) — input-from=codex R1 on this change --"
|
|
309
|
+
k_lane "K30 bypass: hooksPath set to empty blocks" 2 'git config core.hooksPath ""; git push origin trunk' bypassPermissions "" "pre-push" "-"
|
|
310
|
+
k_lane "K31 bypass: -c CORE.hooksPath (case) blocks" 2 "git -c CORE.hooksPath=/dev/null push origin trunk" bypassPermissions "" "pre-push" "-"
|
|
311
|
+
k_lane "K32 bypass: git config --global hooksPath blocks" 2 "git config --global core.hooksPath /tmp/h" bypassPermissions "" "pre-push" "-"
|
|
312
|
+
k_lane "K33 bypass: git config --unset hooksPath blocks" 2 "git config --unset core.hooksPath" bypassPermissions "" "pre-push" "-"
|
|
313
|
+
k_lane "K34 bypass: --get with value filter is clean" 0 "git config --get core.hooksPath /dev/null" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
314
|
+
k_lane "K35 bypass: --get then && is clean" 0 "git config --get core.hooksPath && git status" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
315
|
+
k_lane "K36 bypass: dry-run remote delete is clean" 0 "git push --dry-run origin --delete old" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
316
|
+
k_lane "K37 bypass: -n with :ref is clean" 0 "git push -n origin :old" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
317
|
+
k_lane "K38 bypass: dry-run does not leak to next stmt" 2 "git push --dry-run origin x && git push origin --delete x" bypassPermissions "" "remote" "-"
|
|
318
|
+
k_lane "K39 bypass: --no-verify is not a dry-run" 2 "git push --no-verify origin --delete x" bypassPermissions "" "remote" "-"
|
|
319
|
+
echo "-- K: Sonnet quench-challenger R1 findings (2026-11-23) --"
|
|
320
|
+
k_lane "K40 bypass: \$(git config core.hooksPath) is clean" 0 'HP=$(git config core.hooksPath)' bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
321
|
+
k_lane "K41 bypass: --get 2>/dev/null is clean" 0 "git config --get core.hooksPath 2>/dev/null" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
322
|
+
k_lane "K42 bypass: --get || echo is clean" 0 "git config --get core.hooksPath || echo none" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
323
|
+
k_lane "K43 bypass: read then && push is clean" 0 "git config core.hooksPath && git push origin x" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
324
|
+
k_lane "K44 bypass: git config unset (new syntax) blocks" 2 "git config unset core.hooksPath" bypassPermissions "" "pre-push" "-"
|
|
325
|
+
k_lane "K45 bypass: git config set (new syntax) blocks" 2 "git config set core.hooksPath /dev/null" bypassPermissions "" "pre-push" "-"
|
|
326
|
+
k_lane "K46 bypass: hooksPath '' (single quotes) blocks" 2 "git config core.hooksPath ''" bypassPermissions "" "pre-push" "-"
|
|
327
|
+
k_lane "K47 bypass: --config-env=core.hooksPath blocks" 2 "git --config-env=core.hooksPath=HP push origin x" bypassPermissions "" "pre-push" "-"
|
|
328
|
+
k_lane "K48 bypass: GIT_CONFIG_KEY_0=core.hooksPath blocks" 2 "GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.hooksPath GIT_CONFIG_VALUE_0=/dev/null git push origin x" bypassPermissions "" "pre-push" "-"
|
|
329
|
+
k_lane "K49 bypass: abbreviated --del blocks" 2 "git push origin --del x" bypassPermissions "" "remote" "-"
|
|
330
|
+
k_lane "K50 bypass: abbreviated --no-ver blocks" 2 "git push --no-ver origin x" bypassPermissions "" "pre-push" "-"
|
|
331
|
+
k_lane "K51 bypass: --dry (abbrev dry-run) delete is clean" 0 "git push --dry origin --delete old" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
332
|
+
echo "-- K: codex R2 findings (2026-11-23, last round — cap 2) --"
|
|
333
|
+
k_lane "K52 bypass: hooksPath set to a digit value blocks" 2 "git config core.hooksPath 0; git push origin trunk" bypassPermissions "" "pre-push" "-"
|
|
334
|
+
k_lane "K53 bypass: --remove-section core blocks" 2 "git config --remove-section core; git push origin trunk" bypassPermissions "" "pre-push" "-"
|
|
335
|
+
k_lane "K54 bypass: --rename-section core blocks" 2 "git config --rename-section core old" bypassPermissions "" "pre-push" "-"
|
|
336
|
+
k_lane "K55 bypass: --get hooksPath \"\" (filter) is clean" 0 'git config --get core.hooksPath ""' bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
337
|
+
k_lane "K56 bypass: hooksPath 2>&1 read is clean" 0 "git config core.hooksPath 2>&1" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
338
|
+
k_lane "K57 bypass: --remove-section other is clean" 0 "git config --remove-section alias" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
339
|
+
echo "-- K58+: holes after #1192 (Sonnet review, reproduced on merged gate) --"
|
|
340
|
+
# Hole 1: a read verb AFTER the key is the value — `git config core.hooksPath get` SETS hooksPath to «get».
|
|
341
|
+
k_lane "K58 bypass: hooksPath get (value) blocks" 2 "git config core.hooksPath get" bypassPermissions "" "pre-push" "-"
|
|
342
|
+
k_lane "K59 bypass: hooksPath list (value) blocks" 2 "git config core.hooksPath list" bypassPermissions "" "pre-push" "-"
|
|
343
|
+
k_lane "K60 bypass: hooksPath --get (trailing) blocks" 2 "git config core.hooksPath --get" bypassPermissions "" "pre-push" "-"
|
|
344
|
+
k_lane "K61 bypass: hooksPath -l (trailing) blocks" 2 "git config core.hooksPath -l" bypassPermissions "" "pre-push" "-"
|
|
345
|
+
k_lane "K62 bypass: hooksPath get \"\" blocks" 2 'git config core.hooksPath get ""' bypassPermissions "" "pre-push" "-"
|
|
346
|
+
k_lane "K63 bypass: config get hooksPath read is clean" 0 "git config get core.hooksPath" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
347
|
+
k_lane "K64 bypass: config --get hooksPath read is clean" 0 "git config --get core.hooksPath" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
348
|
+
k_lane "K65 bypass: config --get-all hooksPath is clean" 0 "git config --get-all core.hooksPath" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
349
|
+
k_lane "K66 bypass: config --list | grep hooksPath clean" 0 "git config --list | grep -i core.hooksPath" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
350
|
+
k_lane "K67 bypass: config -l --show-origin key clean" 0 "git config -l --show-origin core.hooksPath" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
351
|
+
# Hole 2: a push-option VALUE (`-o -n`) is not a dry-run flag.
|
|
352
|
+
k_lane "K68 bypass: --delete … -o -n blocks" 2 "git push --delete origin x -o -n" bypassPermissions "" "remote" "-"
|
|
353
|
+
k_lane "K69 bypass: --delete … --push-option -n blocks" 2 "git push --delete origin x --push-option -n" bypassPermissions "" "remote" "-"
|
|
354
|
+
k_lane "K70 bypass: --delete … --push-option=-n blocks" 2 "git push --delete origin x --push-option=-n" bypassPermissions "" "remote" "-"
|
|
355
|
+
k_lane "K71 bypass: :ref -o --dry-run blocks" 2 "git push origin :x -o --dry-run" bypassPermissions "" "remote" "-"
|
|
356
|
+
k_lane "K72 bypass: --dry-run --delete is clean" 0 "git push --dry-run --delete origin x" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
357
|
+
# A push option in the statement turns the dry-run exemption off (codex R1: -on, --push -n, quoted values).
|
|
358
|
+
k_lane "K73 bypass: -o foo --delete -n blocks (no dry exempt)" 2 "git push -o foo --delete -n origin x" bypassPermissions "" "remote" "-"
|
|
359
|
+
k_lane "K74 bypass: -o foo without delete is clean" 0 "git push -o foo origin main" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
360
|
+
# Hole 3 (pre-existing): backtick substitution is a command position, like $(...).
|
|
361
|
+
k_lane "K75 bypass: \`push --delete\` in backticks blocks" 2 'echo `git push origin --delete x`' bypassPermissions "" "remote" "-"
|
|
362
|
+
k_lane "K76 bypass: \`reset --hard\` in backticks blocks" 2 'x=`git reset --hard HEAD~1`' bypassPermissions "" "[BLOCKED]" "-"
|
|
363
|
+
k_lane "K77 bypass: backtick read is clean" 0 'echo `git rev-parse HEAD`' bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
364
|
+
k_lane "K78 bypass: --comment get <key> x blocks" 2 "git config --comment get core.hooksPath x" bypassPermissions "" "pre-push" "-"
|
|
365
|
+
k_lane "K79 bypass: --comment=--get <key> x blocks" 2 "git config --comment=--get core.hooksPath x" bypassPermissions "" "pre-push" "-"
|
|
366
|
+
k_lane "K80 bypass: --file get <key> x stays clean (other file)" 0 "git config --file get core.hooksPath x" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
367
|
+
k_lane "K81 bypass: --comment get <key> \"\" blocks" 2 'git config --comment get core.hooksPath ""' bypassPermissions "" "pre-push" "-"
|
|
368
|
+
# codex R1 on this change
|
|
369
|
+
k_lane "K82 bypass: --delete … -on (attached value) blocks" 2 "git push --delete origin x -on" bypassPermissions "" "remote" "-"
|
|
370
|
+
k_lane "K83 bypass: --delete … --push -n (abbrev) blocks" 2 "git push --delete origin x --push -n" bypassPermissions "" "remote" "-"
|
|
371
|
+
k_lane "K84 bypass: --delete … -o \"foo -n\" blocks" 2 'git push --delete origin x -o "foo -n"' bypassPermissions "" "remote" "-"
|
|
372
|
+
k_lane "K85 bypass: --comment \"foo get\" <key> x blocks" 2 'git config --comment "foo get" core.hooksPath x' bypassPermissions "" "pre-push" "-"
|
|
373
|
+
k_lane "K86 bypass: dry-run in another backtick blocks" 2 'echo `git push --delete origin x` `git push --dry-run origin main`' bypassPermissions "" "remote" "-"
|
|
374
|
+
k_lane "K87 bypass: dry-run in another \$( ) blocks" 2 'echo $(git push --delete origin x) $(git push --dry-run origin main)' bypassPermissions "" "remote" "-"
|
|
375
|
+
k_lane "K88 bypass: hooksPath read in backticks is clean" 0 'echo `git config core.hooksPath`' bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
376
|
+
k_lane "K89 bypass: --get in one \` \`, write in next blocks" 2 'echo `git config --get x` `git config core.hooksPath y`' bypassPermissions "" "pre-push" "-"
|
|
377
|
+
# Known false positive, kept on purpose: a push-option VALUE shaped like `:ref` reads as a delete (blocked on main too).
|
|
378
|
+
k_lane "K90 bypass: -o :x value blocks (named FP)" 2 "git push origin main -o :x" bypassPermissions "" "remote" "-"
|
|
379
|
+
k_lane "K91 bypass: --get in one \` \`, \"\" in next blocks" 2 'echo `git config --get x` `git config core.hooksPath ""`' bypassPermissions "" "pre-push" "-"
|
|
380
|
+
# codex R2 on this change
|
|
381
|
+
k_lane "K92 bypass: hooksPath \`printf …\` value blocks" 2 'git config core.hooksPath `printf /dev/null`' bypassPermissions "" "pre-push" "-"
|
|
382
|
+
k_lane "K93 bypass: hooksPath \"(disabled)\" value blocks" 2 'git config core.hooksPath "(disabled)"' bypassPermissions "" "pre-push" "-"
|
|
383
|
+
k_lane "K94 bypass: hooksPath \$(…) value blocks" 2 'git config core.hooksPath $(printf /dev/null)' bypassPermissions "" "pre-push" "-"
|
|
384
|
+
k_lane "K95 bypass: \$(git config hooksPath) read is clean" 0 'h=$(git config core.hooksPath)' bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
385
|
+
k_lane "K96 bypass: --delete origin -- -n blocks" 2 "git push --delete origin -- -n" bypassPermissions "" "remote" "-"
|
|
386
|
+
k_lane "K97 bypass: --dry-run --delete x is still clean" 0 "git push --dry-run --delete origin x" bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
387
|
+
k_lane "K98 bypass: --get <key> \`…\` (pattern) is clean" 0 'git config --get core.hooksPath `echo x`' bypassPermissions "" "-" "DESTRUCTIVE-OP"
|
|
388
|
+
k_lane "K99 bypass: --comment get <key> (x) blocks" 2 'git config --comment get core.hooksPath "(x)"' bypassPermissions "" "pre-push" "-"
|
|
389
|
+
|
|
248
390
|
# C3 — clean command: NO emission at all (silence must stay silent).
|
|
249
391
|
c_out=$(payload 'git status' | bash "$G" 2>"$c_errf"); c_rc=$?
|
|
250
392
|
rm -f "$c_errf"
|
|
@@ -32,6 +32,7 @@ HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
32
32
|
GATE="$HERE/fh-gate.sh"
|
|
33
33
|
TMPROOT=$(mktemp -d "${TMPDIR:-/tmp}/fh_gate_absorb_XXXXXX")
|
|
34
34
|
trap 'rm -rf "$TMPROOT"' EXIT
|
|
35
|
+
export CODEX_HOME="$TMPROOT/codexhome-none" # fh-gate reads the codex user config (provider guard): not the runner's
|
|
35
36
|
export FH_RECORD_BASE="$TMPROOT/records"; mkdir -p "$FH_RECORD_BASE"
|
|
36
37
|
export FH_GATE_EXEC=off
|
|
37
38
|
# The elephant is opt-in since 3.45.0 (default off — pinned by test_fh_gate_defaults_lanes.sh); these lanes test it
|