@chrono-meta/fh-gate 2.10.0 β 2.12.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-plugin/marketplace.json +2 -2
- package/README.ja.md +58 -28
- package/README.ko.md +201 -184
- package/README.md +59 -43
- package/README.zh.md +74 -47
- package/docs/USER_GUIDE.md +6 -6
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +179 -0
- package/package.json +2 -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 +32 -0
- package/plugins/fh-meta/skills/phantom-quench/SKILL.md +8 -0
- package/plugins/fh-meta/skills/phantom-quench/SKILL_detail.md +1 -0
- package/plugins/fh-meta/skills/salience-splitter/SKILL.md +26 -0
- package/plugins/fh-meta/skills/steel-quench/SKILL.md +10 -0
- package/scripts/degrade_direction_scan.sh +118 -0
- package/scripts/fh-goal.sh +22 -2
- package/scripts/fh_session_load.sh +14 -1
- package/scripts/package_coverage_check.sh +7 -4
- package/scripts/selfcheck.sh +3 -1
- package/scripts/session_close_check.sh +124 -3
- package/scripts/test_card_drift_probe.sh +27 -0
- package/scripts/test_degrade_scan_shell_probes.sh +130 -1
- package/scripts/test_dispatch_log_lanes.sh +54 -2
- package/scripts/test_fh_goal_change_detection_lanes.sh +89 -0
- package/scripts/test_session_close_chain_lanes.sh +27 -0
- package/scripts/test_session_close_lanes.sh +128 -1
- package/templates/.git-hooks/pre-commit +19 -3
- package/templates/degrade_direction_scan.sh +118 -0
|
@@ -392,7 +392,31 @@ fi
|
|
|
392
392
|
# Fix = no `|| echo`, plus integer sanitation. This is the documented prescription for this class
|
|
393
393
|
# ([[feedback_pipefail_fallback_disarms_guard]]) applied to the checker that cited it.
|
|
394
394
|
_int() { case "${1:-}" in (''|*[!0-9]*) echo 0 ;; (*) echo "$1" ;; esac; }
|
|
395
|
-
|
|
395
|
+
# π₯ 2026-08-26 (cross-family/codex) β the fix above closed the `0\n0` half and left the OTHER
|
|
396
|
+
# half open: `|| true` + `_int` folded a READ FAILURE into the same 0 as a genuine no-match, so an
|
|
397
|
+
# unreadable tally rendered as "β
no sub-agent dispatches tallied today" β a green nobody measured.
|
|
398
|
+
# `grep -c` separates the three cleanly: rc 0 = matched, rc 1 = no match (a REAL zero), rc >= 2 =
|
|
399
|
+
# grep itself failed. Only the first two are counts; the third is UNMEASURED and must not be 0.
|
|
400
|
+
# ([[feedback_not_found_is_not_zero_family]] β `not found` != `0`, applied to this checker.)
|
|
401
|
+
# π₯ Kept as a HELPER + a ONE-LINE assignment on purpose: test_dispatch_log_lanes.sh lifts the
|
|
402
|
+
# subject's own `^DISPATCHED=` / `^LOGGED=` line and evaluates it, precisely so the lane cannot go
|
|
403
|
+
# green on a needle that no longer matches real behaviour. A multi-line if/else defeats that lift.
|
|
404
|
+
_cnt() { # $1 = a path that must EXIST (or "" to skip that test); rest = the reader command.
|
|
405
|
+
# Three states, not two β the lane below pins all three:
|
|
406
|
+
# path absent -> 0 a tally that was never written IS zero dispatches;
|
|
407
|
+
# calling that UNMEASURED false-blocks every clean
|
|
408
|
+
# close on a fresh install, and an over-blocking close
|
|
409
|
+
# gate trains the --no-verify reflex that disarms the
|
|
410
|
+
# Destructive-Op gate sharing that hook.
|
|
411
|
+
# reader rc 0 or 1 -> the count (rc 1 = grep's honest "no match")
|
|
412
|
+
# reader rc >= 2 -> UNMEASURED the reader ITSELF failed; folding that into 0 printed
|
|
413
|
+
# "no dispatches tallied today" on something nobody read.
|
|
414
|
+
_c_f="$1"; shift
|
|
415
|
+
if [ -n "$_c_f" ] && [ ! -e "$_c_f" ]; then echo 0; return; fi
|
|
416
|
+
_c_out=$("$@" 2>/dev/null); _c_rc=$?
|
|
417
|
+
if [ "$_c_rc" -ge 2 ]; then echo UNMEASURED; else _int "$(printf '%s' "$_c_out" | tr -d ' ')"; fi
|
|
418
|
+
}
|
|
419
|
+
DISPATCHED=$(_cnt "$TALLY" grep -c "^$TODAY$" "$TALLY")
|
|
396
420
|
# Both quotings, because the file carries both: hand-written entries use `- date: 2026-08-02`
|
|
397
421
|
# while anything appended via yaml.dump renders `- date: '"'"'2026-08-02'"'"'`. Matching one form counted
|
|
398
422
|
# half the entries as absent β a divergent-normalizer miss inside the check that exists to catch
|
|
@@ -408,8 +432,17 @@ LOGDIR="$FH/knowledge/shared/learnings/subagent_invocations"
|
|
|
408
432
|
_cat_logs() { # λ€μ€ νμΌμ grep -c λ₯Ό μ§μ κ±Έλ©΄ νμΌλ³ `κ²½λ‘:κ°μ` λ₯Ό μ°μ΄ ν©μ°μ΄ κΉ¨μ§λ€(μ€μΈ‘).
|
|
409
433
|
{ [ -f "$LOG" ] && cat "$LOG"; [ -d "$LOGDIR" ] && cat "$LOGDIR"/*.yaml; } 2>/dev/null
|
|
410
434
|
}
|
|
411
|
-
|
|
412
|
-
|
|
435
|
+
_log_grep() { # π₯ MUST stay multi-line: the lane lifts defs with /^_name\(\) \{/,/^\}/ and a
|
|
436
|
+
# one-liner has no `}` at column 0, so the range never closes and the extraction
|
|
437
|
+
# silently swallows the rest of the file (measured 2026-08-26).
|
|
438
|
+
_cat_logs | grep -cE "^- date: *'?$TODAY'?"
|
|
439
|
+
}
|
|
440
|
+
LOGGED=$(_cnt "" _log_grep) # _cat_logs already renders absence as empty, not as an error
|
|
441
|
+
if [ "$DISPATCHED" = UNMEASURED ] || [ "$LOGGED" = UNMEASURED ]; then
|
|
442
|
+
echo "β β£-e dispatch log: COULD NOT MEASURE (tally=$DISPATCHED, log=$LOGGED) β a read error is"
|
|
443
|
+
echo " not a count of zero. Fix the read before closing; do not treat this as 'no dispatches'."
|
|
444
|
+
FAIL=1
|
|
445
|
+
elif [ "${DISPATCHED:-0}" -gt 0 ] && [ "${LOGGED:-0}" -eq 0 ]; then
|
|
413
446
|
echo "β β£-e $DISPATCHED sub-agent dispatch(es) today and ZERO invocation-log entries β the 60/40"
|
|
414
447
|
echo " promotion gate and the UAP loop both read that file; an unlogged session is invisible to"
|
|
415
448
|
echo " them. Append to knowledge/shared/learnings/subagent_invocations_log.yaml (consolidated"
|
|
@@ -566,5 +599,93 @@ CARD_LINE_EOF
|
|
|
566
599
|
[ "$DRIFT_HITS" -eq 0 ] && echo "β
β€-b no card absence-claim contradicted by on-disk artifacts"
|
|
567
600
|
fi
|
|
568
601
|
|
|
602
|
+
# β€-C CARRY-OVER probe β μΉ΄λ μ¬μμ±μ΄ Β«μμ§ μ μ¨ κΈ°νΒ» μ λ λ Έλκ°.
|
|
603
|
+
# WHY (2026-08-24, μ€μΈ‘ μμ€ 1건): β€ μ¬μμ±μ΄ delta update κ° μλλΌ μλ‘ μ°κΈ°κ° λμ΄ λ―ΈμΒ·
|
|
604
|
+
# μκ°λ°ν νλͺ©μ΄ ν΅μ§Έλ‘ μ¬λΌμ‘λ€ β κ·Έλ μ λ
19:00 κ²μ, λ€μλ GeekNews, 14μΌ referrer μΈ‘μ ,
|
|
605
|
+
# 08-26 λ―Έν
. μΈμ
μ "BEFORE 172 β AFTER 101" μ΄λΌλ diff λ₯Ό μΆλ ₯νκ³ λ Β«μ€μλ€Β» λ§ λ§νκ³
|
|
606
|
+
# «무μμ΄ λΉ μ‘λΒ» λ λ³΄μ§ μμλ€. μ΄μμκ° λ¬Όμ΄μ λ°κ²¬ β μλ ₯ μλλ€.
|
|
607
|
+
# π₯ μ΄κ²μ tier λ¬Έμ κ° μλλΌ WIRING λ¬Έμ λ€. μΉ΄λ κ·μ¨(Β§Session Wrap-up)μ γμλ£ νλͺ©μ΄
|
|
608
|
+
# λ¨λ κ² λ²κ·ΈγλΌκ³ ν λ°©ν₯λ§ μ κ³ μκ³ , κ·Έ μλ°©ν₯(λ―Έμμ΄ μ¬λΌμ§λ κ²)μ κ²μ¬κ° 0μ€μ΄μλ€.
|
|
609
|
+
# κ·μ¨μ΄ ν λ°©ν₯λ§ μ ν μμΌλ©΄ κ·Έ λ°λλ μ 보μΈλ€. base op μ΄ μ΄λ¦¬μΈμ€μλ§ μΉν μμμΌλ―λ‘
|
|
610
|
+
# sonnet_floor_doctrine Β§tier-gated base op = defect μ ν΄λΉνλ€ β N μ μΈκΈ° μ μ λ«λλ€.
|
|
611
|
+
#
|
|
612
|
+
# WHAT IT ASSERTS (μ±λμ΄μ§ κ²°λ‘ μ΄ μλλ€ β CLAUDE.md Β§Mechanization Boundary):
|
|
613
|
+
# γμ΄μ μΉ΄λμ μλ **λ―Έλ λ μ§**κ° μ€λ μΉ΄λλ μ€λ fh_completed μ μ¬μ ν λνλλκ°γ
|
|
614
|
+
# = κΈ°λ‘μ μ±μ§(μ‘΄μ¬Β·κ·μ). γμ΄ νλͺ©μ μ§μλ λλκ°γλ **νμ νμ§ μλλ€** β 그건 νλ¨μ΄κ³
|
|
615
|
+
# μΌλ¦¬λ©΄ μ€λμ νλ¨μ΄ λ΄μΌμ μ²μ₯μ΄ λλ€. μλ£ μ²λ¦¬νμΌλ©΄ fh_completed μ λ μ§κ° λ¨μΌλ―λ‘
|
|
616
|
+
# κ·Έ κ²½λ‘λ‘ ν΅κ³Όνλ€.
|
|
617
|
+
#
|
|
618
|
+
# HONEST SCOPE:
|
|
619
|
+
# Β· νλ³μλ `YYYY-MM-DD` / `MM-DD` ν ν°λΏμ΄λ€. λ μ§ μμ΄ μ ν λ―Έμ(Β«4090 λΆν
UNKNOWNΒ»)μ
|
|
620
|
+
# ꡬ쑰μ μΌλ‘ λͺ» μ‘λλ€ β μ΅μ»€μ§ floor κ° μλλ€.
|
|
621
|
+
# Β· μ΄μ μΉ΄λλ companion store μ git μ΄λ ₯μμ μ¨λ€. κ·Έκ² μλ install(λλΆλΆμ μλΉμ)μμλ
|
|
622
|
+
# **SKIP μ΄κ³ PASS κ° μλλ€** β λ―ΈμΈ‘μ μ μ΄λ‘μΌλ‘ μ μ§ μλλ€.
|
|
623
|
+
# Β· ASCII ν΄λμ€λ§ μ΄λ€. λ€κ΅μ΄ RANGE λ₯Ό bracket μμ λ£μΌλ©΄ C λ‘μΌμΌ GNU grep μ΄
|
|
624
|
+
# `Invalid collation character` λ‘ exit 2 νκ³ **μ무κ²λ μ λ±λλ€** β no-match μ κ΅¬λΆ λΆκ°
|
|
625
|
+
# (β€-b κ° 2026-07-31 μ μ νν κ·Έλ κ² λ¬΄μ ν΅κ³Όνλ€).
|
|
626
|
+
# DEGRADE: μ΄μ μΉ΄λ λͺ» κ΅¬ν¨ β SKIP(λ―ΈμΈ‘μ νκΈ°) Β· ꡬνλλ° λ―Έλλ μ§ μ μ€ β FAIL=1.
|
|
627
|
+
# FAIL μ FH_SESSION_CLOSE=1 μΈ close push λ§ λ§κ³ μΌλ° push λ surface νλ€(κ°μ νλ©΄ κ·μ¨).
|
|
628
|
+
# κ³Όμ°¨λ¨ μ override: FH_CARRYOVER_OK=1 (무μμ μ°ννλμ§ μΆλ ₯μ λ¨λλ€).
|
|
629
|
+
# κΈ°λ³Έκ°μ λμ§ μλλ€ β companion store μ μ΄λ¦μ install λ§λ€ λ€λ₯΄κ³ , νΉμ μ΄λ¦μ 곡κ°
|
|
630
|
+
# νμΌμ λ°μΌλ©΄ κ·Έ μμ²΄κ° operator-private ν ν°μ΄λ€(μ΄ μ€μ μ€μ λ‘ κ·Έλ κ² ν λ² μ°¨λ¨λλ€).
|
|
631
|
+
# μ€μ μ κ°μμ λ‘컬 λ°μΈλ©μμ FH_COMPANION_STORE λ‘ μ€λ€.
|
|
632
|
+
_CARRY_STORE="${FH_COMPANION_STORE:-}"
|
|
633
|
+
_CARRY_MIRROR="tracks-meta/reference_next_session_starter.md"
|
|
634
|
+
if [ ! -f "$CARD" ]; then
|
|
635
|
+
: # β€ κ° μ΄λ―Έ μΉ΄λ λΆμ¬λ₯Ό FAIL λ‘ λ³΄κ³ νλ€ β μ¬κΈ°μ μ€λ³΅ λ³΄κ³ νμ§ μλλ€
|
|
636
|
+
elif [ "${FH_CARRYOVER_OK:-0}" = "1" ]; then
|
|
637
|
+
echo "β οΈ β€-C SKIPPED by FH_CARRYOVER_OK=1 β μ΄μ μΉ΄λμ λ―Έλ-λ μ§ μ μ€ κ²μ¬λ₯Ό μ°ννλ€"
|
|
638
|
+
elif [ -z "$_CARRY_STORE" ] || [ ! -d "$_CARRY_STORE/.git" ]; then
|
|
639
|
+
echo "β¬ β€-C SKIPPED (not PASS) β companion store λ―Έμ€μ /λΆμ¬ (FH_COMPANION_STORE). μ΄μ μΉ΄λλ₯Ό λͺ» κ΅¬ν΄ UNMEASURED"
|
|
640
|
+
else
|
|
641
|
+
_TODAY_YMD=$(date +%Y-%m-%d)
|
|
642
|
+
# μ€λ μ΄μ μ κΈ°λ‘λ λ§μ§λ§ μΉ΄λ λ²μ . μ€λμ sync 컀λ°λ€μ μ΄λ―Έ μ¬μμ±λ³Έμ΄λΌ μ μΈνλ€.
|
|
643
|
+
_PRIOR_SHA=$(git -C "$_CARRY_STORE" log --before="${_TODAY_YMD}T00:00:00" -1 --format=%H -- "$_CARRY_MIRROR" 2>/dev/null || true)
|
|
644
|
+
if [ -z "$_PRIOR_SHA" ]; then
|
|
645
|
+
echo "β¬ β€-C SKIPPED (not PASS) β μ€λ μ΄μ μΉ΄λ λ²μ μ΄ μ΄λ ₯μ μλ€ (첫 μΈμ
?) β UNMEASURED"
|
|
646
|
+
else
|
|
647
|
+
_PRIOR_CARD=$(git -C "$_CARRY_STORE" show "$_PRIOR_SHA:$_CARRY_MIRROR" 2>/dev/null || true)
|
|
648
|
+
if [ -z "$_PRIOR_CARD" ]; then
|
|
649
|
+
echo "β¬ β€-C SKIPPED (not PASS) β μ΄μ μΉ΄λλ₯Ό μ½μ§ λͺ»νλ€ ($_PRIOR_SHA) β UNMEASURED"
|
|
650
|
+
else
|
|
651
|
+
# μ΄μ μΉ΄λμ λ μ§ ν ν° μ€ Β«μ€λ μ΄μΒ» μΈ κ²λ§. YYYY-MM-DD μ MM-DD λ λ€ λ³Έλ€.
|
|
652
|
+
_TODAY_MD=$(date +%m-%d)
|
|
653
|
+
_FUTURE_DATES=$(printf '%s\n' "$_PRIOR_CARD" \
|
|
654
|
+
| grep -oE '20[0-9]{2}-[0-9]{2}-[0-9]{2}|(^|[^0-9])[01][0-9]-[0-3][0-9]([^0-9]|$)' 2>/dev/null \
|
|
655
|
+
| grep -oE '20[0-9]{2}-[0-9]{2}-[0-9]{2}|[01][0-9]-[0-3][0-9]' 2>/dev/null \
|
|
656
|
+
| sort -u | while IFS= read -r d; do
|
|
657
|
+
# bash 3.2(macOS)λ $( ) μμ case ν¨ν΄ ')' λ₯Ό μ€νμ±νλ€ β κΈΈμ΄λ‘ κ°λ₯Έλ€
|
|
658
|
+
_ref="$_TODAY_MD"
|
|
659
|
+
if [ ${#d} -eq 10 ]; then _ref="$_TODAY_YMD"; fi
|
|
660
|
+
if [ "$d" = "$_ref" ]; then printf '%s\n' "$d"
|
|
661
|
+
elif [ "$d" \> "$_ref" ]; then printf '%s\n' "$d"
|
|
662
|
+
fi
|
|
663
|
+
done)
|
|
664
|
+
_LOST=0
|
|
665
|
+
if [ -n "$_FUTURE_DATES" ]; then
|
|
666
|
+
_TODAY_LOG="$FH/tracks/_meta/fh_completed_${_TODAY_YMD}.md"
|
|
667
|
+
while IFS= read -r d; do
|
|
668
|
+
[ -z "$d" ] && continue
|
|
669
|
+
if grep -qF "$d" "$CARD" 2>/dev/null; then continue; fi
|
|
670
|
+
if [ -f "$_TODAY_LOG" ] && grep -qF "$d" "$_TODAY_LOG" 2>/dev/null; then continue; fi
|
|
671
|
+
_CTX=$(printf '%s\n' "$_PRIOR_CARD" | grep -F "$d" | head -1 | cut -c1-90)
|
|
672
|
+
echo "β β€-C carry-over μ μ€: μ΄μ μΉ΄λμ λ―Έλ κΈ°ν '$d' κ° μ€λ μΉ΄λμλ fh_completed μλ μλ€"
|
|
673
|
+
echo " μ΄μ μΉ΄λ μλ¬Έ: $_CTX"
|
|
674
|
+
_LOST=$((_LOST+1))
|
|
675
|
+
done <<CARRY_EOF
|
|
676
|
+
$_FUTURE_DATES
|
|
677
|
+
CARRY_EOF
|
|
678
|
+
fi
|
|
679
|
+
if [ "$_LOST" -gt 0 ]; then
|
|
680
|
+
echo " β β€ λ delta update λ€. μλ£λ©΄ fh_completed μ μ κ³ , μ΄μμ΄λ©΄ μΉ΄λμ λ¨κ²¨λΌ."
|
|
681
|
+
echo " μ λΉνκ² μ·¨μλ νλͺ©μ΄λ©΄: FH_CARRYOVER_OK=1 FH_SESSION_CLOSE=1 git push"
|
|
682
|
+
FAIL=1
|
|
683
|
+
else
|
|
684
|
+
echo "β
β€-C μ΄μ μΉ΄λμ λ―Έλ κΈ°νμ΄ μ λΆ μΉ΄λ/μλ£λ‘κ·Έμ μ΄μ μλ€ (prior=${_PRIOR_SHA%%??????????????????????????????????})"
|
|
685
|
+
fi
|
|
686
|
+
fi
|
|
687
|
+
fi
|
|
688
|
+
fi
|
|
689
|
+
|
|
569
690
|
echo "ββ close check: $([ "$FAIL" -eq 0 ] && echo CONSISTENT || echo VIOLATIONS) ββ"
|
|
570
691
|
exit "$FAIL"
|
|
@@ -16,6 +16,33 @@
|
|
|
16
16
|
|
|
17
17
|
set -uo pipefail
|
|
18
18
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
|
+
# π₯ ENVIRONMENT ISOLATION (2026-08-27). `CLAUDE.local.md` INSTRUCTS this operator to export
|
|
20
|
+
# FH_COMPANION_STORE, so the suite inherited a REAL companion store and β€-C compared each FIXTURE
|
|
21
|
+
# card against the operator's actual prior card β reporting a carry-over loss that belongs to
|
|
22
|
+
# neither. Measured A/B on this file: exported β rc 1 with 6 exit-code lanes red Β· unset β rc 0.
|
|
23
|
+
# The verdict CONTENT was right every time (every `_line` assertion passed); only the exit code
|
|
24
|
+
# moved, which is what made it read like an over-blocking script rather than an ambient leak.
|
|
25
|
+
# π₯ THIS IS THE SECOND FILE WITH THIS LEAK. The sibling test_session_close_lanes.sh was fixed
|
|
26
|
+
# earlier the same day and this one was not β a half-fix propagation boundary created by the same
|
|
27
|
+
# author who had just named that class. Fixed together now; the sweep that found it is
|
|
28
|
+
# grep -l session_close_check scripts/test_*.sh β check each for an FH_COMPANION_STORE guard.
|
|
29
|
+
# Lanes that genuinely exercise β€-C set their own fixture store ON the invocation and still win.
|
|
30
|
+
# π₯ CLASS, NOT INSTANCE. The first draft of this guard unset FH_COMPANION_STORE alone β the one
|
|
31
|
+
# variable that had actually bitten. That is the same shape as the half-fix that put this guard in
|
|
32
|
+
# only ONE of two sibling lane files hours earlier. Every operator-settable override the subject
|
|
33
|
+
# reads is the same window, so all of them are closed here rather than one at a time:
|
|
34
|
+
# FH_COMPANION_STORE β€-C reads a REAL prior card and reports a carry-over loss on a fixture
|
|
35
|
+
# FH_SESSION_CLOSE flips advisory into blocking β every `expect exit 0` lane would go red
|
|
36
|
+
# FH_CARRYOVER_OK SKIPs β€-C β a lane asserting β€-C FIRES would go green for the wrong reason
|
|
37
|
+
# (note the direction: this one fails OPEN, which is the worse half)
|
|
38
|
+
# FH_PEER_SCAN_FORCE forces the β -c peer scan on regardless of session shape
|
|
39
|
+
# FH_PEER_SOCK_DIR / FH_REPO_ID repoint peer discovery at the ambient machine
|
|
40
|
+
# CLAUDE_CODE_AGENT / CLAUDE_CODE_CHILD_SESSION are deliberately NOT in this list: the subject uses
|
|
41
|
+
# them to detect session shape and the lanes that care unset them per-case on purpose (see the
|
|
42
|
+
# subject's own "NEGATIVE ARM UNVERIFIED" note). Blanket-clearing them here would silently change
|
|
43
|
+
# which branch those lanes exercise.
|
|
44
|
+
unset FH_COMPANION_STORE FH_SESSION_CLOSE FH_CARRYOVER_OK FH_PEER_SCAN_FORCE FH_PEER_SOCK_DIR FH_REPO_ID
|
|
45
|
+
export FH_COMPANION_STORE=""
|
|
19
46
|
CHECK="$SCRIPT_DIR/session_close_check.sh"
|
|
20
47
|
FAILED=0
|
|
21
48
|
|
|
@@ -705,6 +705,135 @@ else
|
|
|
705
705
|
fi
|
|
706
706
|
fi
|
|
707
707
|
|
|
708
|
+
|
|
709
|
+
# ββ S1b known pair β `|| true` INSIDE a command substitution ββββββββββββββββββββββββ
|
|
710
|
+
# Added 2026-08-26 after a full hand-census of the 132 `|| true)` sites in this repo
|
|
711
|
+
# (tracks/_meta/s1_true_paren_census_2026-08-26.md). 11 sat on a verdict path and S1 saw ZERO of
|
|
712
|
+
# them: its regex closes on `(#|;|$)` after the permissive value, and in this shape the next
|
|
713
|
+
# character is `)`. Both directions are pinned, and so are the two deliberate NON-detections that
|
|
714
|
+
# keep the probe from becoming the 122-hit noise machine the census warned about.
|
|
715
|
+
s1b_hits() { bash "$SCAN" "$@" 2>&1 | grep -cE '\[S1b:'; }
|
|
716
|
+
|
|
717
|
+
# POSITIVE β the four census-A shapes, verbatim in structure:
|
|
718
|
+
# origin git read Β· multi-line continuation Β· process substitution feeding a detector loop Β·
|
|
719
|
+
# here-string feeding the npm-publish leak loop.
|
|
720
|
+
cat > "$TMP/s1b_positive.sh" <<'EOF'
|
|
721
|
+
#!/usr/bin/env bash
|
|
722
|
+
STAGED=$(git -c core.quotePath=false diff --cached --name-only -z 2>/dev/null | tr '\0' '\n' || true)
|
|
723
|
+
HEAVY=$(echo "$STAGED" | grep -E 'SKILL\.md' || true)
|
|
724
|
+
SKILL_CHANGE=$(git diff --cached --name-status --diff-filter=ADR 2>/dev/null \
|
|
725
|
+
| grep -E 'skills/[^/]+/SKILL\.md' || true)
|
|
726
|
+
if [ -n "$SKILL_CHANGE" ]; then echo "count check"; fi
|
|
727
|
+
while IFS= read -r p; do _bad=1; done < <(git diff --cached --name-only -z 2>/dev/null || true)
|
|
728
|
+
while IFS= read -r h; do echo "$h"; done <<< "$(grep -aoiE "$re" "$path" 2>/dev/null | sort -u || true)"
|
|
729
|
+
EOF
|
|
730
|
+
|
|
731
|
+
# NEGATIVE β the same logic written so that "the command failed" and "the command matched nothing"
|
|
732
|
+
# are different values. Must stay silent or the probe is noise.
|
|
733
|
+
cat > "$TMP/s1b_negative.sh" <<'EOF'
|
|
734
|
+
#!/usr/bin/env bash
|
|
735
|
+
STAGED=$(git -c core.quotePath=false diff --cached --name-only -z 2>&1 | tr '\0' '\n'); _rc=$?
|
|
736
|
+
[ "$_rc" -ne 0 ] && { echo "git diff failed"; exit 1; }
|
|
737
|
+
HEAVY=$(echo "$STAGED" | grep -E 'SKILL\.md' || true)
|
|
738
|
+
_paths=$(git diff --cached --name-only -z 2>/dev/null || true)
|
|
739
|
+
if [ -z "$_paths" ]; then echo "ERROR: no path stream"; exit 1; fi
|
|
740
|
+
while IFS= read -r p; do _bad=1; done <<< "$_paths"
|
|
741
|
+
EOF
|
|
742
|
+
|
|
743
|
+
# NON-DETECTIONS, each pinned for a distinct reason:
|
|
744
|
+
# (a) a DERIVED filter over a value already in a shell variable β its only failure mode is
|
|
745
|
+
# grep-no-match, which is what `|| true` is for. The census counted the risk once, at the
|
|
746
|
+
# origin; flagging derivations turns 11 findings into 122 and buries the origin.
|
|
747
|
+
# (b) stderr NOT discarded β a real failure is still visible, so the conjunction is incomplete.
|
|
748
|
+
# (c) a COUNTER pipeline β `grep -c` always emits and exits 1 on no-match; that class is S5's.
|
|
749
|
+
# (d) `git rev-parse`/`config` β identity/config reads, not index/worktree state.
|
|
750
|
+
cat > "$TMP/s1b_nondetect.sh" <<'EOF'
|
|
751
|
+
#!/usr/bin/env bash
|
|
752
|
+
LIGHT=$(echo "$STAGED" | grep -E '^knowledge/' 2>/dev/null || true)
|
|
753
|
+
BODY=$(printf '%s\n' "$body" | grep -E '^\+' 2>/dev/null || true)
|
|
754
|
+
VISIBLE=$(git diff --cached --name-only || true)
|
|
755
|
+
N=$(git -C "$FH" ls-files -v 2>/dev/null | grep -c '^[a-z]' || true)
|
|
756
|
+
ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true)
|
|
757
|
+
EOF
|
|
758
|
+
|
|
759
|
+
n=$(s1b_hits "$TMP/s1b_positive.sh")
|
|
760
|
+
[ "$n" -eq 4 ] && ok "S1b-KP 4/4 census-A shapes detected (origin Β· continuation Β· <(β¦) Β· <<<)" \
|
|
761
|
+
|| bad "S1b-KP expected 4 S1b hits, got $n"
|
|
762
|
+
|
|
763
|
+
n=$(s1b_hits "$TMP/s1b_negative.sh")
|
|
764
|
+
[ "$n" -eq 0 ] && ok "S1b-KN fail-closed spelling stays silent (the probe discriminates)" \
|
|
765
|
+
|| bad "S1b-KN expected 0 S1b hits, got $n"
|
|
766
|
+
|
|
767
|
+
n=$(s1b_hits "$TMP/s1b_nondetect.sh")
|
|
768
|
+
[ "$n" -eq 0 ] && ok "S1b-ND derived filters / visible stderr / counters / rev-parse stay silent (5/5)" \
|
|
769
|
+
|| bad "S1b-ND expected 0 S1b hits, got $n (the SCOPE narrowing regressed)"
|
|
770
|
+
|
|
771
|
+
# The 2>/dev/null conjunct is LOAD-BEARING, not decoration: removing it from the fixture must flip
|
|
772
|
+
# the verdict. Without this, "the probe fires" could be true for the wrong reason.
|
|
773
|
+
printf '#!/usr/bin/env bash\nS=$(git diff --cached --name-only 2>/dev/null || true)\n' > "$TMP/s1b_conj.sh"
|
|
774
|
+
a=$(s1b_hits "$TMP/s1b_conj.sh")
|
|
775
|
+
printf '#!/usr/bin/env bash\nS=$(git diff --cached --name-only || true)\n' > "$TMP/s1b_conj.sh"
|
|
776
|
+
b=$(s1b_hits "$TMP/s1b_conj.sh")
|
|
777
|
+
if [ "$a" -eq 1 ] && [ "$b" -eq 0 ]; then
|
|
778
|
+
ok "S1b-CONJ the 2>/dev/null half is load-bearing (1 with, 0 without)"
|
|
779
|
+
else
|
|
780
|
+
bad "S1b-CONJ expected 1/0 across the mutant, got $a/$b β the conjunct proves nothing"
|
|
781
|
+
fi
|
|
782
|
+
|
|
783
|
+
# The fail-closed suppression must SUPPRESS, and must not suppress the `-n` skip direction.
|
|
784
|
+
printf '#!/usr/bin/env bash\nV=$(git diff --cached --name-only 2>/dev/null || true)\nif [ -z "$V" ]; then echo ERROR; exit 1; fi\n' > "$TMP/s1b_supp.sh"
|
|
785
|
+
a=$(s1b_hits "$TMP/s1b_supp.sh")
|
|
786
|
+
printf '#!/usr/bin/env bash\nV=$(git diff --cached --name-only 2>/dev/null || true)\nif [ -n "$V" ]; then run_the_check; fi\n' > "$TMP/s1b_supp.sh"
|
|
787
|
+
b=$(s1b_hits "$TMP/s1b_supp.sh")
|
|
788
|
+
if [ "$a" -eq 0 ] && [ "$b" -eq 1 ]; then
|
|
789
|
+
ok "S1b-SUPP [-z]βexit 1 suppresses; [-n]βrun-the-check (empty β silent skip) still fires"
|
|
790
|
+
else
|
|
791
|
+
bad "S1b-SUPP expected 0/1, got $a/$b β the suppression lost its direction"
|
|
792
|
+
fi
|
|
793
|
+
|
|
708
794
|
echo "----"
|
|
709
|
-
echo "degrade-scan shell probes: $pass passed, $fail failed"
|
|
710
795
|
[ "$fail" -eq 0 ] || exit 1
|
|
796
|
+
# ββ S1b-SUPP-COMMENT β the suppression must not be fooled by a COMMENT (2026-08-26) ββββββββββ
|
|
797
|
+
# Cross-family (codex) finding: the `-z`-branch remedy search was raw proximity, so the word
|
|
798
|
+
# ERROR sitting in a COMMENT (or in an unrelated later branch) within 6 lines suppressed a REAL
|
|
799
|
+
# fail-open. That is a false NEGATIVE β strictly worse than the unmeasured distance constant.
|
|
800
|
+
# π₯ POS arm is mandatory: without it, "0 firings" cannot be told apart from "S1b is dead".
|
|
801
|
+
_s1bc=$(mktemp -d)
|
|
802
|
+
cat > "$_s1bc/pos.sh" <<'P1'
|
|
803
|
+
#!/usr/bin/env bash
|
|
804
|
+
STAGED=$(git diff --cached --name-only 2>/dev/null | tr '\n' ' ' || true)
|
|
805
|
+
echo "proceeding with $STAGED"
|
|
806
|
+
P1
|
|
807
|
+
cat > "$_s1bc/mut.sh" <<'P2'
|
|
808
|
+
#!/usr/bin/env bash
|
|
809
|
+
STAGED=$(git diff --cached --name-only 2>/dev/null | tr '\n' ' ' || true)
|
|
810
|
+
if [ -z "$STAGED" ]; then
|
|
811
|
+
# ERROR appears only in this comment; nothing is actually blocked
|
|
812
|
+
:
|
|
813
|
+
fi
|
|
814
|
+
echo "proceeding"
|
|
815
|
+
P2
|
|
816
|
+
cat > "$_s1bc/ctl.sh" <<'P3'
|
|
817
|
+
#!/usr/bin/env bash
|
|
818
|
+
STAGED=$(git diff --cached --name-only 2>/dev/null | tr '\n' ' ' || true)
|
|
819
|
+
if [ -z "$STAGED" ]; then
|
|
820
|
+
echo "ERROR: cannot read index" >&2
|
|
821
|
+
exit 1
|
|
822
|
+
fi
|
|
823
|
+
echo "proceeding"
|
|
824
|
+
P3
|
|
825
|
+
_s1bc_n(){ bash "$SCAN" "$1" 2>/dev/null | grep -c 'S1b' || true; }
|
|
826
|
+
_p=$(_s1bc_n "$_s1bc/pos.sh"); _m=$(_s1bc_n "$_s1bc/mut.sh"); _c=$(_s1bc_n "$_s1bc/ctl.sh")
|
|
827
|
+
if [ "$_p" -ge 1 ]; then
|
|
828
|
+
ok "S1b-SUPP-COMMENT POS: probe is ALIVE on a bare origin ($_p hit) β 0-results below are readable"
|
|
829
|
+
if [ "$_m" -ge 1 ]; then ok "S1b-SUPP-COMMENT MUT: a comment does not suppress a real fail-open"
|
|
830
|
+
else bad "S1b-SUPP-COMMENT MUT: comment-only ERROR suppressed a real fail-open (false negative)"; fi
|
|
831
|
+
if [ "$_c" -eq 0 ]; then ok "S1b-SUPP-COMMENT CTL: a genuine fail-closed branch is still suppressed"
|
|
832
|
+
else bad "S1b-SUPP-COMMENT CTL: over-blocked a legitimate fail-closed remedy ($_c)"; fi
|
|
833
|
+
else
|
|
834
|
+
bad "S1b-SUPP-COMMENT: POS arm dead (probe fired 0 on a bare origin) β MUT/CTL UNINTERPRETABLE"
|
|
835
|
+
fi
|
|
836
|
+
rm -rf "$_s1bc"
|
|
837
|
+
|
|
838
|
+
echo "degrade-scan shell probes: $pass passed, $fail failed"
|
|
839
|
+
|
|
@@ -39,10 +39,37 @@ if [ -z "$CATLOGS_DEF" ]; then
|
|
|
39
39
|
echo "FAIL subject μ _cat_logs κ° μλ€ β μ ν μ€κ³(λ κ±°μ βͺ λλ ν°λ¦¬)κ° μ¬λΌμ‘κ±°λ μ΄λ¦μ΄ λ°λμλ€."
|
|
40
40
|
exit 1
|
|
41
41
|
fi
|
|
42
|
+
# π₯ 2026-08-26 β μ£Όμ΄κ° read-error λ₯Ό UNMEASURED λ‘ κ°λ₯΄κΈ° μμνκ³ κ·Έ λ‘μ§μ΄ `_cnt` μ μ°λ€.
|
|
43
|
+
# μ΄κ±Έ μ λ€μ¬μ€λ©΄ λμ
μ€ νκ°κ° Β«command not found β rc 127 β UNMEASUREDΒ» λ‘ **νλ¦° μ΄μ λ‘**
|
|
44
|
+
# λ΅μ λΈλ€. μ΄ νμΌμ΄ μ΄λ―Έ _cat_logs μ λν΄ κ²½κ³ ν μ₯μ-μ΅μ»€ ν¨μ μ κ°μ μΌκ΅΄μ΄λ€.
|
|
45
|
+
CNT_DEF=$(awk '/^_cnt\(\) \{/,/^\}/' "$CHECK")
|
|
46
|
+
LOGGREP_DEF=$(awk '/^_log_grep\(\) \{/,/^\}/' "$CHECK")
|
|
47
|
+
if [ -z "$CNT_DEF" ]; then
|
|
48
|
+
echo "FAIL subject μ _cnt κ° μλ€ β read-errorβzero λΆλ¦¬(UNMEASURED)κ° μ¬λΌμ‘κ±°λ μ΄λ¦μ΄ λ°λμλ€."
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
if [ -z "$LOGGREP_DEF" ]; then
|
|
52
|
+
echo "FAIL subject μ _log_grep κ° μλ€ β LOGGED μ 리λκ° μ¬λΌμ‘κ±°λ μ΄λ¦μ΄ λ°λμλ€."
|
|
53
|
+
exit 1
|
|
54
|
+
fi
|
|
42
55
|
echo "ββ matcher located in the subject"
|
|
43
56
|
echo "ββ _cat_logs lifted from the subject ($(printf '%s' "$CATLOGS_DEF" | grep -c '') lines)"
|
|
44
57
|
|
|
45
58
|
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
|
|
59
|
+
# π₯ μ μλ₯Ό `bash -c "..."` μμ μΈλΌμΈνλ©΄ **λ°κΉ₯ μ
Έμ΄ λ¨Όμ νμ₯**νλ€ β `_cnt` λ³Έλ¬Έμ `"$@"` κ°
|
|
60
|
+
# λΉ λ¬Έμμ΄λ‘ μΉνλΌ λ¦¬λκ° μ‘°μ©ν μ£½κ³ , λ μΈμ Β«νλ¦° μ΄μ λ‘Β» νμ μ λΈλ€(2026-08-26 μ€μΈ‘).
|
|
61
|
+
# νμΌλ‘ λ¨κΆ source νλ©΄ κ·Έ μ°½μ΄ μμ μλ€.
|
|
62
|
+
SUBJ_DEFS="$T/subject_defs.sh"
|
|
63
|
+
printf '%s\n%s\n%s\n' "$CATLOGS_DEF" "$CNT_DEF" "$LOGGREP_DEF" > "$SUBJ_DEFS"
|
|
64
|
+
bash -n "$SUBJ_DEFS" || { echo "FAIL subject μ μ 3μ’
μ λ€μ΄μμΌλ κ΅¬λ¬Έμ΄ κΉ¨μ§λ€"; exit 1; }
|
|
65
|
+
# π₯ ν¬κΈ° κ°λ β awk λ²μκ° μ λ«νλ©΄(ν μ€ ν¨μλΌ `}` κ° column 0 μ μμΌλ©΄) νμΌ λλ¨Έμ§λ₯Ό
|
|
66
|
+
# ν΅μ§Έλ‘ λκ³ μ€κ³ , κ·Έλλ `bash -n` μ ν΅κ³Όνλ€. κ·Έλ¬λ©΄ μ μκ° μλλΌ μ€ν¬λ¦½νΈλ₯Ό source νκ²
|
|
67
|
+
# λμ΄ Β«unbound variableΒ» κ°μ μλ±ν μ΄μ λ‘ νμ μ΄ λλ€(2026-08-26 μ€μΈ‘).
|
|
68
|
+
_SD_LINES=$(grep -c '' "$SUBJ_DEFS")
|
|
69
|
+
if [ "$_SD_LINES" -gt 40 ]; then
|
|
70
|
+
echo "FAIL λ€μ΄μ¨ μ μκ° ${_SD_LINES}μ€ β awk λ²μκ° μ λ«νλ€(ν μ€ ν¨μ?). μ μλ§ μμΌ νλ€."
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
46
73
|
D=2026-08-02
|
|
47
74
|
|
|
48
75
|
echo "ββ date-spelling lanes (the shipped miscount) ββ"
|
|
@@ -132,7 +159,7 @@ _eval_subject_assign() { # $1 = variable name; echoes what the SUBJECT computes
|
|
|
132
159
|
_int() { case \"\${1:-}\" in (''|*[!0-9]*) echo 0 ;; (*) echo \"\$1\" ;; esac; }
|
|
133
160
|
# β
LOGGED λ μ£Όμ΄μ _cat_logs μ μμ‘΄νλ€. μ΄κ±Έ μ λ€μ¬μ€λ©΄ Β«ν¨μ μμ β λΉ μ
λ ₯ β 0Β»
|
|
134
161
|
# μΌλ‘ **νλ¦° μ΄μ λ‘ ν΅κ³Ό**νλ€ β μ΄ νμΌμ΄ κ²½κ³ νλ μ₯μ μ΅μ»€ κ·Έ μ체λ€.
|
|
135
|
-
$
|
|
162
|
+
. '$SUBJ_DEFS'
|
|
136
163
|
TODAY=NOSUCHDATE; TALLY='$CHECK'; LOG='$CHECK'; LOGDIR='$CHECK.nodir'
|
|
137
164
|
$line
|
|
138
165
|
printf %s \"\$$var\"" 2>/dev/null
|
|
@@ -150,7 +177,7 @@ LOGGED_LINE=$(grep -E "^LOGGED=" "$CHECK" | head -1)
|
|
|
150
177
|
_count_in() { # $1=LOG κ²½λ‘(μμΌλ©΄ λΉλ¬Έμ) $2=LOGDIR κ²½λ‘(μμΌλ©΄ λΉλ¬Έμ)
|
|
151
178
|
bash -c "set -uo pipefail
|
|
152
179
|
_int() { case \"\${1:-}\" in (''|*[!0-9]*) echo 0 ;; (*) echo \"\$1\" ;; esac; }
|
|
153
|
-
$
|
|
180
|
+
. '$SUBJ_DEFS'
|
|
154
181
|
TODAY='$D'; LOG='$1'; LOGDIR='$2'
|
|
155
182
|
$LOGGED_LINE
|
|
156
183
|
printf %s \"\$LOGGED\"" 2>/dev/null
|
|
@@ -167,6 +194,31 @@ printf -- "- date: %s\n" "$D" > "$LT/dir/b.yaml" # 1건
|
|
|
167
194
|
_naive=$(grep -cE "^- date: *'?$D'?" "$LT/dir"/*.yaml 2>/dev/null | tr -d ' \n')
|
|
168
195
|
[ "$_naive" != 3 ] ; chk $? "컨νΈλ‘€: naive grep -c λ€μ€νμΌμ 3μ λͺ» λΈλ€ (μ€μ ='$_naive' β κ²½λ‘:κ°μ νν)"
|
|
169
196
|
|
|
197
|
+
echo ""
|
|
198
|
+
echo "ββ read-error β zero λ μΈ (2026-08-26, cross-family/codex) ββ"
|
|
199
|
+
# μ£Όμ΄κ° Β«0건» κ³Ό Β«λͺ» μ½μλ€Β» λ₯Ό κ°λ₯΄λκ°. κ°λ₯΄κΈ° μ μλ μ½κΈ° μ€ν¨κ° 0 μΌλ‘ μ ν
|
|
200
|
+
# "β
β£-e no sub-agent dispatches tallied today" λΌλ **μ μ° μ΄λ‘**μ΄ λκ°λ€.
|
|
201
|
+
DISP_LINE=$(grep -E "^DISPATCHED=" "$CHECK" | head -1)
|
|
202
|
+
_disp_with() { # $1 = TALLY λ‘ μΈ κ²½λ‘
|
|
203
|
+
bash -c "set -uo pipefail
|
|
204
|
+
_int() { case \"\${1:-}\" in (''|*[!0-9]*) echo 0 ;; (*) echo \"\$1\" ;; esac; }
|
|
205
|
+
. '$SUBJ_DEFS'
|
|
206
|
+
TODAY='$D'; TALLY='$1'
|
|
207
|
+
$DISP_LINE
|
|
208
|
+
printf %s \"\$DISPATCHED\"" 2>/dev/null
|
|
209
|
+
}
|
|
210
|
+
RE="$T/readerr"; mkdir -p "$RE/as_dir"
|
|
211
|
+
printf '%s\n' "$D" > "$RE/real_hit" # μ€λ 1건
|
|
212
|
+
: > "$RE/real_zero" # μ§μ§ 0건
|
|
213
|
+
_p=$(_disp_with "$RE/real_hit")
|
|
214
|
+
[ "$_p" = "1" ] ; chk $? "POS κ³κΈ° μμ‘΄: μ μ tally 1건 β '$_p' (1 μ΄μ΄μΌ μλ νμ μ΄ μ½νλ€)"
|
|
215
|
+
_z=$(_disp_with "$RE/real_zero")
|
|
216
|
+
[ "$_z" = "0" ] ; chk $? "μ§μ§ 0건 β '$_z' (UNMEASURED μλ β λΆμ¬κ° μλλΌ μ€μΈ‘λ 0)"
|
|
217
|
+
_u=$(_disp_with "$RE/as_dir")
|
|
218
|
+
[ "$_u" = "UNMEASURED" ] ; chk $? "μ½κΈ° μ€ν¨(λλ ν°λ¦¬) β '$_u' (0 μΌλ‘ μ νλ©΄ μ μ° μ΄λ‘μ΄ λκ°λ€)"
|
|
219
|
+
_n=$(_disp_with "$RE/nosuchfile")
|
|
220
|
+
[ "$_n" = "0" ] ; chk $? "νμΌ λΆμ¬ β '$_n' β μΈ λ²μ§Έ μνλ€. μ μ°μΈ tally λ Β«0 λμ€ν¨μΉΒ»μ΄μ§ Β«λͺ» μ½μΒ»μ΄ μλλ€. UNMEASURED λ‘ λλ©΄ μ install μ κΉ¨λν λ§κ°μ μ λΆ false-block νκ³ , κ³Όμ°¨λ¨ close κ²μ΄νΈλ κ°μ ν
μ Destructive-Op κ²μ΄νΈκΉμ§ 무μ₯ν΄μ μν€λ --no-verify λ°μ¬λ₯Ό νλ ¨μν¨λ€"
|
|
221
|
+
|
|
170
222
|
echo ""
|
|
171
223
|
if [ "$FAILED" -ne 0 ]; then echo "DISPATCH-LOG LANES: FAIL"; exit 1; fi
|
|
172
224
|
echo "DISPATCH-LOG LANES: PASS ($PASS/$PASS)"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Known-pair lane for fh-goal's change detection.
|
|
3
|
+
#
|
|
4
|
+
# π₯ WHAT THIS EXISTS TO STOP (2026-08-26, cross-family/codex finding):
|
|
5
|
+
# `git` present + a real repo does NOT mean `diff`/`status` SUCCEEDS. Before this lane,
|
|
6
|
+
# a FAILING `git status` produced an empty TARGET_FILES, which the skip-branch could not
|
|
7
|
+
# tell apart from "nothing changed" β `exit 0` β **fh-gate never ran, caller read it as a
|
|
8
|
+
# clean run**. fh-goal.sh already named that exact class in a comment and had closed it for
|
|
9
|
+
# the "no git at all" branch only.
|
|
10
|
+
#
|
|
11
|
+
# The pair:
|
|
12
|
+
# ARM A (known-positive) git status FAILS β MUST exit 10 β red before the fix
|
|
13
|
+
# ARM B (known-negative) git status OK, no output β MUST exit 0 (genuinely nothing changed)
|
|
14
|
+
# ARM C (control) git status OK, one file β MUST reach fh-gate (proves A/B are not
|
|
15
|
+
# just "everything exits early")
|
|
16
|
+
# Without ARM C, A and B both pass on a script that never gets to the gate at all.
|
|
17
|
+
set -uo pipefail
|
|
18
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
19
|
+
TARGET="${FH_GOAL_UNDER_TEST:-$ROOT/scripts/fh-goal.sh}"
|
|
20
|
+
PASS=0; FAIL=0
|
|
21
|
+
ok(){ printf ' β
%s\n' "$1"; PASS=$((PASS+1)); }
|
|
22
|
+
no(){ printf ' β %s\n' "$1"; FAIL=$((FAIL+1)); }
|
|
23
|
+
|
|
24
|
+
FIX=$(mktemp -d); trap 'rm -rf "$FIX"' EXIT
|
|
25
|
+
mkdir -p "$FIX/bin" "$FIX/work"
|
|
26
|
+
|
|
27
|
+
# --- git shim: real enough to pass the GIT_OK probe, scriptable for diff/status -------------
|
|
28
|
+
cat > "$FIX/bin/git" <<'GIT'
|
|
29
|
+
#!/usr/bin/env bash
|
|
30
|
+
# args may be prefixed with -C <dir>
|
|
31
|
+
while [[ "${1:-}" == "-C" ]]; do shift 2; done
|
|
32
|
+
case "${1:-}" in
|
|
33
|
+
rev-parse)
|
|
34
|
+
case "${2:-}" in
|
|
35
|
+
--git-dir) echo ".git"; exit 0 ;;
|
|
36
|
+
HEAD) echo "0000000000000000000000000000000000000000"; exit 0 ;;
|
|
37
|
+
esac
|
|
38
|
+
exit 0 ;;
|
|
39
|
+
diff) exit "${FAKE_GIT_DIFF_RC:-0}" ;;
|
|
40
|
+
status)
|
|
41
|
+
if [[ "${FAKE_GIT_STATUS_RC:-0}" -ne 0 ]]; then exit "${FAKE_GIT_STATUS_RC}"; fi
|
|
42
|
+
[[ -n "${FAKE_GIT_STATUS_OUT:-}" ]] && printf '%s\n' "$FAKE_GIT_STATUS_OUT"
|
|
43
|
+
exit 0 ;;
|
|
44
|
+
esac
|
|
45
|
+
exit 0
|
|
46
|
+
GIT
|
|
47
|
+
chmod +x "$FIX/bin/git"
|
|
48
|
+
|
|
49
|
+
# --- backend stub: fh-goal requires the CLI on PATH and pipes a prompt into it --------------
|
|
50
|
+
printf '#!/usr/bin/env bash\ncat >/dev/null\necho "stub backend output"\nexit 0\n' > "$FIX/bin/codex"
|
|
51
|
+
chmod +x "$FIX/bin/codex"
|
|
52
|
+
|
|
53
|
+
run_arm() { # $1=label $2..=env assignments ; prints rc
|
|
54
|
+
env PATH="$FIX/bin:$PATH" FH_BACKEND=codex FH_TIMEOUT=20 "${@:2}" \
|
|
55
|
+
bash "$TARGET" --prompt "noop" --root "$FIX/work" >"$FIX/out" 2>"$FIX/err"
|
|
56
|
+
echo $?
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
echo "fh-goal change-detection known-pair (target: $TARGET)"
|
|
60
|
+
|
|
61
|
+
# ARM A β the defect
|
|
62
|
+
RC=$(run_arm A FAKE_GIT_STATUS_RC=128 FAKE_GIT_DIFF_RC=128)
|
|
63
|
+
if [[ "$RC" == "10" ]] && grep -q "cannot detect changed files" "$FIX/err"; then
|
|
64
|
+
ok "ARM A known-positive: git failure β exit 10, fail-closed"
|
|
65
|
+
else
|
|
66
|
+
no "ARM A known-positive: expected rc=10 + 'cannot detect changed files', got rc=$RC"
|
|
67
|
+
sed -n 1,6p "$FIX/err" | sed 's/^/ /'
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
# ARM B β genuinely clean
|
|
71
|
+
RC=$(run_arm B FAKE_GIT_STATUS_RC=0 FAKE_GIT_STATUS_OUT=)
|
|
72
|
+
if [[ "$RC" == "0" ]] && grep -q "no changed files detected" "$FIX/err"; then
|
|
73
|
+
ok "ARM B known-negative: clean tree β exit 0 (skip is legitimate here)"
|
|
74
|
+
else
|
|
75
|
+
no "ARM B known-negative: expected rc=0 + 'no changed files detected', got rc=$RC"
|
|
76
|
+
sed -n 1,6p "$FIX/err" | sed 's/^/ /'
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
# ARM C β control: proves the script can actually REACH the gate
|
|
80
|
+
RC=$(run_arm C FAKE_GIT_STATUS_RC=0 FAKE_GIT_STATUS_OUT=" M probe_file.txt")
|
|
81
|
+
if grep -q "running fh-gate on" "$FIX/err"; then
|
|
82
|
+
ok "ARM C control: changed file β reaches fh-gate (instrument is alive)"
|
|
83
|
+
else
|
|
84
|
+
no "ARM C control: never reached fh-gate β ARM A/B results are UNINTERPRETABLE (rc=$RC)"
|
|
85
|
+
sed -n 1,6p "$FIX/err" | sed 's/^/ /'
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
echo "fh-goal change-detection: $PASS passed, $FAIL failed"
|
|
89
|
+
[[ "$FAIL" -eq 0 ]] || exit 1
|
|
@@ -26,6 +26,33 @@
|
|
|
26
26
|
set -uo pipefail
|
|
27
27
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
28
28
|
ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
29
|
+
# π₯ ENVIRONMENT ISOLATION (2026-08-27). `CLAUDE.local.md` INSTRUCTS this operator to export
|
|
30
|
+
# FH_COMPANION_STORE, so the suite inherited a REAL companion store and β€-C compared each FIXTURE
|
|
31
|
+
# card against the operator's actual prior card β reporting a carry-over loss that belongs to
|
|
32
|
+
# neither. Measured A/B on this file: exported β rc 1 with 6 exit-code lanes red Β· unset β rc 0.
|
|
33
|
+
# The verdict CONTENT was right every time (every `_line` assertion passed); only the exit code
|
|
34
|
+
# moved, which is what made it read like an over-blocking script rather than an ambient leak.
|
|
35
|
+
# π₯ THIS IS THE SECOND FILE WITH THIS LEAK. The sibling test_session_close_lanes.sh was fixed
|
|
36
|
+
# earlier the same day and this one was not β a half-fix propagation boundary created by the same
|
|
37
|
+
# author who had just named that class. Fixed together now; the sweep that found it is
|
|
38
|
+
# grep -l session_close_check scripts/test_*.sh β check each for an FH_COMPANION_STORE guard.
|
|
39
|
+
# Lanes that genuinely exercise β€-C set their own fixture store ON the invocation and still win.
|
|
40
|
+
# π₯ CLASS, NOT INSTANCE. The first draft of this guard unset FH_COMPANION_STORE alone β the one
|
|
41
|
+
# variable that had actually bitten. That is the same shape as the half-fix that put this guard in
|
|
42
|
+
# only ONE of two sibling lane files hours earlier. Every operator-settable override the subject
|
|
43
|
+
# reads is the same window, so all of them are closed here rather than one at a time:
|
|
44
|
+
# FH_COMPANION_STORE β€-C reads a REAL prior card and reports a carry-over loss on a fixture
|
|
45
|
+
# FH_SESSION_CLOSE flips advisory into blocking β every `expect exit 0` lane would go red
|
|
46
|
+
# FH_CARRYOVER_OK SKIPs β€-C β a lane asserting β€-C FIRES would go green for the wrong reason
|
|
47
|
+
# (note the direction: this one fails OPEN, which is the worse half)
|
|
48
|
+
# FH_PEER_SCAN_FORCE forces the β -c peer scan on regardless of session shape
|
|
49
|
+
# FH_PEER_SOCK_DIR / FH_REPO_ID repoint peer discovery at the ambient machine
|
|
50
|
+
# CLAUDE_CODE_AGENT / CLAUDE_CODE_CHILD_SESSION are deliberately NOT in this list: the subject uses
|
|
51
|
+
# them to detect session shape and the lanes that care unset them per-case on purpose (see the
|
|
52
|
+
# subject's own "NEGATIVE ARM UNVERIFIED" note). Blanket-clearing them here would silently change
|
|
53
|
+
# which branch those lanes exercise.
|
|
54
|
+
unset FH_COMPANION_STORE FH_SESSION_CLOSE FH_CARRYOVER_OK FH_PEER_SCAN_FORCE FH_PEER_SOCK_DIR FH_REPO_ID
|
|
55
|
+
export FH_COMPANION_STORE=""
|
|
29
56
|
CHECK="$SCRIPT_DIR/session_close_check.sh"
|
|
30
57
|
HOOK="$ROOT/templates/.git-hooks/pre-push"
|
|
31
58
|
TODAY=$(date +%Y-%m-%d)
|