@chrono-meta/fh-gate 3.16.0 โ 3.17.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 +4 -4
- package/AGENTS.md +27 -0
- package/CATALOG.md +60 -0
- package/CLAUDE.md +5 -0
- package/README.ja.md +2 -2
- package/README.ko.md +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/docs/OUTPUT_EVIDENCE.md +1 -1
- package/docs/codex-compat.md +24 -0
- package/knowledge/shared/harness-core/checkout_layer_drift.md +301 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +25 -0
- package/package.json +11 -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 +42 -0
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-preprep/skills/preprep/SKILL.md +5 -0
- package/plugins/fh-preprep/skills/preprep/lane_font_embed.py +235 -0
- package/plugins/fh-preprep/skills/preprep/ooxml/gate.py +67 -5
- package/plugins/fh-preprep/skills/preprep/ooxml/test_gate_exitcodes.py +136 -0
- package/plugins/fh-preprep/skills/preprep/preprep.py +16 -1
- package/plugins/fh-preprep/skills/preprep/presentation_checklist.md +108 -6
- package/plugins/fh-preprep/skills/preprep/safe_install.py +22 -3
- package/plugins/fh-preprep/skills/preprep/surfaces.example.yaml +11 -0
- package/plugins/fh-preprep/skills/preprep/test_lane_font_embed.py +117 -0
- package/plugins/fh-preprep/skills/preprep/test_safe_install_app_xml.py +77 -0
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/count_check.sh +46 -14
- package/scripts/daily_report.sh +17 -1
- package/scripts/env_layer_fingerprint.sh +309 -0
- package/scripts/gate_bootstrap_ephemeral.sh +248 -0
- package/scripts/governor_board.sh +841 -0
- package/scripts/map_postprocess.py +89 -4
- package/scripts/multibyte_bracket_lint.sh +135 -0
- package/scripts/outbound_pr_gate.sh +12 -0
- package/scripts/package_coverage_check.sh +34 -0
- package/scripts/selfcheck.sh +245 -0
- package/scripts/session_close_check.sh +96 -1
- package/scripts/stale_ref_scan.py +2 -1
- package/scripts/test_count_check_decl_lanes.sh +176 -0
- package/scripts/test_env_layer_fingerprint_lanes.sh +192 -0
- package/scripts/test_gate_bootstrap_ephemeral_lanes.sh +262 -0
- package/scripts/test_locale_invariance_lanes.sh +581 -0
- package/scripts/test_map_postprocess_lanes.sh +84 -4
- package/scripts/test_marker_crossfamily_lanes.sh +5 -1
- package/scripts/test_marker_defense_lanes.sh +5 -1
- package/scripts/test_marker_standpoint_lanes.sh +5 -1
- package/scripts/test_marker_thirdparty_lanes.sh +5 -1
- package/scripts/test_multibyte_bracket_lint_lanes.sh +107 -0
- package/scripts/test_outbound_pr_gate_lanes.sh +133 -0
- package/scripts/test_preprep_drift_anchor.sh +34 -9
- package/scripts/test_preprep_drift_anchor_lanes.sh +64 -2
- package/scripts/test_session_close_chain_lanes.sh +45 -0
- package/scripts/test_stale_ref_close_lanes.sh +197 -0
- package/scripts/test_stale_ref_scan_lanes.sh +6 -1
- package/scripts/test_worktree_reclaim_lanes.sh +267 -1
- package/scripts/worktree_reclaim.sh +246 -11
- package/templates/.git-hooks/pre-commit +108 -27
- package/templates/settings.PreToolUse.snippet.json +54 -1
|
@@ -90,7 +90,35 @@ if command -v gh >/dev/null 2>&1; then
|
|
|
90
90
|
# why an environment with zero open PRs can never surface this, and why the 0-case alone is not a
|
|
91
91
|
# calibration. Observed live the same day: 2 open PRs reported as 1.
|
|
92
92
|
# Anchored by scripts/test_session_close_chain_lanes.sh lane โ -b-P3.
|
|
93
|
-
|
|
93
|
+
# ๐ฅ `--author "@me"` ALONE counted ZERO for every cloud-session PR. Those are authored by the
|
|
94
|
+
# GitHub App `app/claude`, not by the local user (`chrono-meta`), so the sweep reported 0 while
|
|
95
|
+
# cloud PRs were open and a close passed silently as "no open PRs" โ the same class of silence
|
|
96
|
+
# the occurrence-count fix above was written to end, one layer up. Measured 2026-09-21 with a
|
|
97
|
+
# known pair on MERGED PRs (the open set was empty, so the 0-case could not calibrate it):
|
|
98
|
+
# `--author app/claude` -> #785 #784 #783 #782 #781
|
|
99
|
+
# `--author @me` -> #779 #773 #772 ...
|
|
100
|
+
# The two sets are DISJOINT, and the recent merges are almost all bot-authored โ so this line had
|
|
101
|
+
# been blind for a long time, not just on the day it was noticed.
|
|
102
|
+
# Union the two authors and dedup by NUMBER (not by line count: the same PR must never be counted
|
|
103
|
+
# twice if the author filters ever overlap). `--author` is deliberately NOT dropped โ dropping it
|
|
104
|
+
# counts other contributors' PRs in a shared repo, which over-blocks and trains the override.
|
|
105
|
+
# Anchored by scripts/test_session_close_chain_lanes.sh lane (1)-b-P4.
|
|
106
|
+
# ๐ฅ The number extractor tolerates whitespace after the colon ON PURPOSE. The line this replaced
|
|
107
|
+
# counted occurrences of the bare token `"number"`, which is spacing-insensitive; a naive
|
|
108
|
+
# `'"number":[0-9]*'` is NOT โ on `{"number": 782}` the `[0-9]*` matches ZERO digits, `cut` yields
|
|
109
|
+
# an empty field, and the later `sed '/^$/d'` deletes it, so the sweep silently reports 0 for a
|
|
110
|
+
# pretty-printed body. Measured 2026-09-21 (cross-family codex finding, then hand-verified):
|
|
111
|
+
# spaced JSON -> naive 0 / this 2 <- the silent-wrong-count the fix would have introduced
|
|
112
|
+
# compact JSON -> naive 2 / this 2
|
|
113
|
+
# empty array -> naive 0 / this 0 <- over-fire control, unchanged
|
|
114
|
+
# gh currently emits compact JSON when piped, so this is hardening against a formatting change,
|
|
115
|
+
# not a live break โ recorded because a count that degrades toward 0 is the same fail-open
|
|
116
|
+
# direction this whole fix exists to close.
|
|
117
|
+
_open_pr_numbers() {
|
|
118
|
+
gh pr list --author "$1" --state open --json number 2>/dev/null \
|
|
119
|
+
| grep -oE '"number":[[:space:]]*[0-9]+' | grep -oE '[0-9]+$'
|
|
120
|
+
}
|
|
121
|
+
PRS=$( { _open_pr_numbers "@me"; _open_pr_numbers "app/claude"; } | sort -u | sed '/^$/d' | wc -l | tr -d ' ')
|
|
94
122
|
[ "${PRS:-0}" -gt 0 ] && echo "โ ๏ธ โ -b $PRS open PR(s) by you โ classify: self-mergeable vs awaiting-external"
|
|
95
123
|
fi
|
|
96
124
|
|
|
@@ -804,5 +832,72 @@ else
|
|
|
804
832
|
echo "โญ๏ธ โ -f push-zone UNCALIBRATED โ script or owner-account list absent"
|
|
805
833
|
fi
|
|
806
834
|
|
|
835
|
+
# โโ โ -g STALE REF (advisory) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
836
|
+
# WHY THIS IS HERE AND NOT AT COMMIT TIME. `scripts/stale_ref_scan.py` (#770) exists because the
|
|
837
|
+
# three sibling instruments โ halffix_propagation_scan ยท claim_propagation_scan ยท doc_claim_triad_scan
|
|
838
|
+
# โ all presuppose that SOMEONE TOUCHED SOMETHING. An aging reference satisfies no such trigger:
|
|
839
|
+
# nobody edits a DOI on the day it stops being the latest version. #773 then shipped the tool with
|
|
840
|
+
# its own residual: ยซ๋ฐฐ์ ์ ํจ โ ์ด ๊ณ๊ธฐ๋ ์ง๊ธ ์๋ฌด๋ ์ ๋ถ๋ฅธ๋คยป. Measured 2026-09-21: its only
|
|
841
|
+
# call sites were its own lane suite and that suite's selfcheck wiring, BOTH `--offline-fixture`.
|
|
842
|
+
# So nothing had ever asked the question of the real corpus.
|
|
843
|
+
#
|
|
844
|
+
# ๐ฅ A commit-time trigger would rebuild the exact blind spot โ it would fire only when someone
|
|
845
|
+
# touches the file. A close-time sweep has no touch precondition, which is the whole point.
|
|
846
|
+
# ๐ฅ **advisory โ it never blocks.** #773 states the corpus false-positive rate is UNMEASURED and
|
|
847
|
+
# some stale citations are deliberate pins; blocking a reversible surface on an unmeasured
|
|
848
|
+
# instrument trains `--no-verify` and disarms the Destructive-Op gate in the same hook
|
|
849
|
+
# (CLAUDE.md ยงSurface-Class Degrade Invariant, reversible half).
|
|
850
|
+
# ๐ฅ **๋ชป ์ฝ์ โ ๊นจ๋ํจ.** The scanner folds SUPERSEDED and UNRESOLVED into one rc (its own header
|
|
851
|
+
# says so), so this block reads the VERDICT LINE's counters instead of the exit code โ the #767
|
|
852
|
+
# lesson about scanners reporting "could not read" as "clean" applies to the caller too.
|
|
853
|
+
# SCOPE: tracked files only, `tracks/**` excluded โ those are past local records that must not be
|
|
854
|
+
# edited, and #770 measured most corpus hits landing there. Including them would be pure noise.
|
|
855
|
+
_SR_SCAN="$FH/scripts/stale_ref_scan.py"
|
|
856
|
+
if [ ! -f "$_SR_SCAN" ]; then
|
|
857
|
+
echo "โญ๏ธ โ -g stale-ref: stale_ref_scan.py ์์ โ skipped, not passed (UNMEASURED)"
|
|
858
|
+
elif ! command -v python3 >/dev/null 2>&1; then
|
|
859
|
+
echo "โญ๏ธ โ -g stale-ref: python3 ์์ โ skipped, not passed (UNMEASURED)"
|
|
860
|
+
elif ! command -v git >/dev/null 2>&1 || ! ( cd "$FH" && git rev-parse --git-dir >/dev/null 2>&1 ); then
|
|
861
|
+
# ๐ฅ ๋์ ๋ชฉ๋ก์ `git grep` ์ผ๋ก ๋ง๋ ๋ค. git ์ด ์์ผ๋ฉด ๋ชฉ๋ก์ด **๋น๋ค** โ ๊ทธ๋ฆฌ๊ณ ๋น ๋ชฉ๋ก์
|
|
862
|
+
# ์๋์์ ใ์ฐธ์กฐ ์์ใ์ผ๋ก ์ฝํ๋ค. ใ๋ชป ์ธ์๋คใ์ ใ0 ์ด๋คใ๋ฅผ ๊ฐ์ ์นจ๋ฌต์ผ๋ก ๋์ง ์๋๋ค.
|
|
863
|
+
echo "โ ๏ธ โ -g stale-ref: git ์์/๋น-๋ ํฌ โ ๋์ ๋ชฉ๋ก์ ๋ชป ๋ง๋ค์๋ค. UNMEASURED ์ง ใ์ฐธ์กฐ ์์ใ์ด ์๋๋ค"
|
|
864
|
+
else
|
|
865
|
+
_sr_files=$( cd "$FH" && git grep -lI -e 'zenodo' -- '*.md' '*.cff' '*.html' '*.json' 2>/dev/null \
|
|
866
|
+
| grep -v '^tracks/' || true )
|
|
867
|
+
if [ -z "$_sr_files" ]; then
|
|
868
|
+
echo "โญ๏ธ โ -g stale-ref: ์ค์บํ Zenodo ์ฐธ์กฐ๊ฐ ์ถ์ ํ์ผ์ ์๋ค โ ๋์ ์์"
|
|
869
|
+
else
|
|
870
|
+
# ๐ฅ ์ ์ฒด ์ํ์ ๊ฑด๋ค. per-request 8์ด ร ์๋ก ๋ค๋ฅธ id ์๊ฐ ์ํ์ด๋ผ, ๋งค๋ฌ๋ฆฌ๋ ๋คํธ์ํฌ์์
|
|
871
|
+
# ๋ง๊ฐ์ด 1๋ถ ๊ฐ๊น์ด ๋ฉ์ถ ์ ์๋ค โ ๊ทธ๊ฒ์ด `--no-verify` ๋ฅผ ํ์ต์ํค๋ ๋ชจ์์ด๋ค. ์ํ์
|
|
872
|
+
# ๊ฑธ๋ฆฌ๋ฉด ํ์ ์ค์ด ์ ๋์ค๊ณ , ๊ทธ ๊ฒฝ๋ก๋ ์๋์์ UNMEASURED ๋ก ๋จ์ด์ง๋ค(๋ ์ธ L4).
|
|
873
|
+
# ์ค์ธก(๋คํธ์ํฌ ์ฐจ๋จ, 22ํ์ผ ยท ์๋ก ๋ค๋ฅธ id 7): 1์ด.
|
|
874
|
+
# shellcheck disable=SC2086
|
|
875
|
+
if command -v timeout >/dev/null 2>&1; then
|
|
876
|
+
_sr_out=$( cd "$FH" && timeout 45 python3 scripts/stale_ref_scan.py --timeout 8 --body $_sr_files 2>&1 )
|
|
877
|
+
else
|
|
878
|
+
_sr_out=$( cd "$FH" && python3 scripts/stale_ref_scan.py --timeout 8 --body $_sr_files 2>&1 )
|
|
879
|
+
fi
|
|
880
|
+
_sr_v=$(printf '%s\n' "$_sr_out" | grep -E '^stale-ref verdict:' | tail -1)
|
|
881
|
+
if [ -z "$_sr_v" ]; then
|
|
882
|
+
echo "โ ๏ธ โ -g stale-ref: UNMEASURED โ ์ค์บ๋๊ฐ ํ์ ์ค์ ์ ๋๋ค (0 ์ผ๋ก ์ฝ์ง ๋ง๋ผ)"
|
|
883
|
+
else
|
|
884
|
+
_sr_sup=$(printf '%s' "$_sr_v" | sed -n 's/.*SUPERSEDED=\([0-9]*\).*/\1/p')
|
|
885
|
+
_sr_unr=$(printf '%s' "$_sr_v" | sed -n 's/.*UNRESOLVED=\([0-9]*\).*/\1/p')
|
|
886
|
+
_sr_uns=$(printf '%s' "$_sr_v" | sed -n 's/.*UNSCANNABLE=\([0-9]*\).*/\1/p')
|
|
887
|
+
if [ "${_sr_sup:-0}" -gt 0 ] 2>/dev/null; then
|
|
888
|
+
echo "โ ๏ธ โ -g stale-ref: ${_sr_sup} ๊ฐ id ๊ฐ ํ๊ธฐ๋ ๋ฒ์ ์ ๊ฐ๋ฆฌํจ๋ค โ advisory, ๋ง์ง ์๋๋ค."
|
|
889
|
+
echo " ๐ฅ ์๋ํ pin ์ผ ์ ์๋ค โ ๋์ผ๋ก ํ์ธํ๊ณ ๊ณ ์ณ๋ผ(๊ณ ์ ์ด๋ฉด ํ์ผ์ 'stale-ref: pinned')."
|
|
890
|
+
printf '%s\n' "$_sr_out" | grep -E '^ +๐ฅ SUPERSEDED' | sed 's/^/ /'
|
|
891
|
+
fi
|
|
892
|
+
if [ "${_sr_unr:-0}" -gt 0 ] 2>/dev/null || [ "${_sr_uns:-0}" -gt 0 ] 2>/dev/null; then
|
|
893
|
+
echo "โ ๏ธ โ -g stale-ref: UNRESOLVED=${_sr_unr:-?} UNSCANNABLE=${_sr_uns:-?} โ ๋ชป ์ฝ์ ๊ฒ์ด ์๋ค. UNMEASURED ์ง ๊นจ๋ํจ์ด ์๋๋ค"
|
|
894
|
+
fi
|
|
895
|
+
if [ "${_sr_sup:-0}" = "0" ] && [ "${_sr_unr:-0}" = "0" ] && [ "${_sr_uns:-0}" = "0" ]; then
|
|
896
|
+
echo "โ
โ -g stale-ref: ์ด์์๋ Zenodo ์ธ์ฉ์ด ์ ๋ถ ์ต์ ์ ๊ฐ๋ฆฌํจ๋ค"
|
|
897
|
+
fi
|
|
898
|
+
fi
|
|
899
|
+
fi
|
|
900
|
+
fi
|
|
901
|
+
|
|
807
902
|
echo "โโ close check: $([ "$FAIL" -eq 0 ] && echo CONSISTENT || echo VIOLATIONS) โโ"
|
|
808
903
|
exit "$FAIL"
|
|
@@ -328,7 +328,8 @@ def run_self_check():
|
|
|
328
328
|
got = [r for _, r, _, _ in scan_body("x.html", wbr)]
|
|
329
329
|
lane("extract: <wbr>-split DOI", got == ["20397566"], str(got))
|
|
330
330
|
|
|
331
|
-
# โ URL ํํ โ README.md:418 ์ ์ค๋ฌผ ํํ
|
|
331
|
+
# โ URL ํํ โ README.md:418 ์ ์ค๋ฌผ ํํ (as of c4b4ffa; ๊ทธ ์ค์ ์ดํ v1.0.2 id
|
|
332
|
+
# 22843702 ๋ก ์ฎ๊ฒจ๊ฐ๋ค. ํฝ์ค์ฒ๋ ยซ๋ก์ idยป ๋ฅผ ์ผ๋ถ๋ฌ ์ ์งํ๋ค โ stale-ref ๋ ์ธ์ด๋ผ์๋ค)
|
|
332
333
|
url = ['> **FH papers**: v1.0.1 methodology ยท [Zenodo](https://zenodo.org/records/22542168)']
|
|
333
334
|
got = [r for _, r, _, _ in scan_body("x.md", url)]
|
|
334
335
|
lane("extract: zenodo.org/records/<id> URL", got == ["22542168"], str(got))
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_count_check_decl_lanes.sh โ known pairs + revert probes for the COUNT DECLARATION parser
|
|
3
|
+
# in `scripts/count_check.sh` (the `_DECL_PY` helper and the sweep's AMBIG branches).
|
|
4
|
+
#
|
|
5
|
+
# WHY THIS EXISTS
|
|
6
|
+
# #768 widened the sweep to every plugin on disk and then wrote its own residual down:
|
|
7
|
+
# ยซ์ํ๋ description ์ **์ฒซ** `N skills` ํจํด๋ง ์ฝ๋๋ค โ ๊ณผํ/๋ฏธํ ๋ฐฉํฅ ๋ฏธ์ธก์ ยป
|
|
8
|
+
# Both directions were then measured (2026-09-21) and both were real:
|
|
9
|
+
# ยท ๋ฏธํ / FALSE PASS โ a stale declaration ("3 skills", disk 4) goes GREEN when any earlier
|
|
10
|
+
# prose number ("roughly 4 skills worth of") is picked up instead. The same defect the
|
|
11
|
+
# control arm catches as FAIL. This is the #763/#768 substring-collision class, third time.
|
|
12
|
+
# ยท ๊ณผํ / FALSE FAIL โ the pattern `(\d+)\s+skills?` matches the "3 skill" inside
|
|
13
|
+
# `M1/M2/M3 skill tier map`, which is live in `.claude-plugin/marketplace.json` today.
|
|
14
|
+
# Fix: count EVERY match, fail on more than one DISTINCT value ("๋ชจํธโ ํต๊ณผ", one step beyond
|
|
15
|
+
# #768's "๋ถ์ฌโ ํต๊ณผ"), and require a non-alphanumeric boundary before the digits.
|
|
16
|
+
#
|
|
17
|
+
# SCOPE, stated honestly: these lanes run the REAL `count_check.sh` against a REAL tree
|
|
18
|
+
# (`git archive HEAD` into a temp dir, with the working-tree script copied over), because the
|
|
19
|
+
# sibling README-format suite already recorded what happens when you fixture a skeleton tree:
|
|
20
|
+
# every arm fails for the same unrelated reason ("0 active fh-meta skills") and the suite
|
|
21
|
+
# certifies nothing. L0 is the dead-control guard for exactly that โ if the baseline fixture
|
|
22
|
+
# does not come back GREEN, no later verdict in this file means anything.
|
|
23
|
+
#
|
|
24
|
+
# ๐ฅ The real repository is never mutated. L8 asserts that.
|
|
25
|
+
set -uo pipefail
|
|
26
|
+
|
|
27
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
28
|
+
cd "$REPO_ROOT" || exit 10
|
|
29
|
+
pass=0; fail=0
|
|
30
|
+
ok() { printf ' \342\234\205 %s\n' "$1"; pass=$((pass+1)); }
|
|
31
|
+
bad() { printf ' \342\235\214 %s\n' "$1"; fail=$((fail+1)); }
|
|
32
|
+
|
|
33
|
+
if [ ! -f scripts/count_check.sh ]; then
|
|
34
|
+
printf '\360\237\237\245 HARNESS ERROR โ scripts/count_check.sh ๊ฐ ์๋ค. ใ0 ์คํจใ๊ฐ ์๋๋ผ ๊ณ๊ธฐ ๋ถ์ฌ๋ค.\n'
|
|
35
|
+
exit 10
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT
|
|
39
|
+
FX="$TMP/tree"; mkdir -p "$FX"
|
|
40
|
+
# containment baseline (L8) โ byte snapshots, NOT `git diff`: a consumer install has no history,
|
|
41
|
+
# and a containment claim that cannot be evaluated there is a containment claim nobody checks.
|
|
42
|
+
mkdir -p "$TMP/base"
|
|
43
|
+
cp "$REPO_ROOT/plugins/fh-qp/.claude-plugin/plugin.json" "$TMP/base/qp.json" 2>/dev/null || true
|
|
44
|
+
cp "$REPO_ROOT/.claude-plugin/marketplace.json" "$TMP/base/mp.json" 2>/dev/null || true
|
|
45
|
+
# ๐ฅ **git ์ ๊ธฐ๋์ง ์๋๋ค.** ์ดํ์ `git archive HEAD` ๋ก ํฝ์ค์ฒ๋ฅผ ๋ด๋๋ฐ, ์๋น์ install ์
|
|
46
|
+
# arm ์์ ์ค์ธก์ผ๋ก ์ฃฝ์๋ค: npm ์ผ๋ก ํผ ํจํค์ง์๋ ํ์คํ ๋ฆฌ๊ฐ ์์ด `not a valid object name:
|
|
47
|
+
# HEAD` ๋ก rc=10 ์ด ๋ฌ๋ค. ๋ฌด์ ์ด๋ก์ด ์๋์์ผ๋ ์ ํ ๋ฐฉํฅ์ ์ณ์์ง๋ง, ๋ ์ธ์ด ์๋น์์๊ฒ
|
|
48
|
+
# **๊ตฌ์กฐ์ ์ผ๋ก ์คํ ๋ถ๊ฐ**๋ผ๋ ๋ป์ด๋ค(#770 ์ด ๋คํธ์ํฌ๋ฅผ ๋บ ๊ฒ๊ณผ ๊ฐ์ ์ด์ ). ๊ทธ๋์ ์ํน
|
|
49
|
+
# ํธ๋ฆฌ๋ฅผ ๊ทธ๋๋ก ๋ณต์ฌํ๋ค โ count_check ๋ worktree ๋ชจ๋์์ git ์ ์ ์ด๋ค(`git ls-files` ๋
|
|
50
|
+
# `--staged` ๋ถ๊ธฐ ์์๋ง ์๋ค).
|
|
51
|
+
if ! ( cd "$REPO_ROOT" && tar cf - --exclude=.git --exclude=node_modules --exclude=tracks . ) \
|
|
52
|
+
| ( cd "$FX" && tar xf - ) 2>/dev/null; then
|
|
53
|
+
printf '\360\237\237\245 HARNESS ERROR โ ํฝ์ค์ฒ ํธ๋ฆฌ ๋ณต์ฌ ์คํจ. ใ0 ์คํจใ๊ฐ ์๋๋ผ ๊ณ๊ธฐ ๋ถ์ฌ๋ค.\n'
|
|
54
|
+
exit 10
|
|
55
|
+
fi
|
|
56
|
+
if [ ! -f "$FX/scripts/count_check.sh" ]; then
|
|
57
|
+
printf '\360\237\237\245 HARNESS ERROR โ ํฝ์ค์ฒ์ count_check.sh ๊ฐ ์๋ค.\n'; exit 10
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
QP="$FX/plugins/fh-qp/.claude-plugin/plugin.json"
|
|
61
|
+
if [ ! -f "$QP" ]; then
|
|
62
|
+
printf '\360\237\237\245 HARNESS ERROR โ ํฝ์ค์ฒ์ fh-qp plugin.json ์ด ์๋ค.\n'; exit 10
|
|
63
|
+
fi
|
|
64
|
+
cp "$QP" "$TMP/qp.orig.json"
|
|
65
|
+
|
|
66
|
+
# set_desc <description> โ rewrite ONLY fh-qp's description in the fixture tree
|
|
67
|
+
set_desc() {
|
|
68
|
+
python3 - "$QP" "$TMP/qp.orig.json" "$1" <<'PY'
|
|
69
|
+
import json,sys
|
|
70
|
+
d=json.load(open(sys.argv[2],encoding="utf-8"))
|
|
71
|
+
d["description"]=sys.argv[3]
|
|
72
|
+
json.dump(d,open(sys.argv[1],"w",encoding="utf-8"),ensure_ascii=False,indent=2)
|
|
73
|
+
PY
|
|
74
|
+
}
|
|
75
|
+
# verdict โ echoes the single fh-qp skills sweep line from a real count_check run
|
|
76
|
+
verdict() { ( cd "$FX" && bash scripts/count_check.sh 2>&1 ) | grep -E "sweep: fh-qp skills" | head -1; }
|
|
77
|
+
|
|
78
|
+
DECL_OK="QP (Quality Platform) โ 4 skills (qp ยท qp-plan ยท qp-run ยท qp-regress)."
|
|
79
|
+
DECL_STALE="QP (Quality Platform) โ 3 skills (qp ยท qp-plan ยท qp-run ยท qp-regress)."
|
|
80
|
+
DECL_STALE_MASKED="QP โ replaces roughly 4 skills worth of hand-rolled tooling. 3 skills (qp ยท qp-plan ยท qp-run ยท qp-regress)."
|
|
81
|
+
DECL_TIERMAP="QP (Quality Platform) โ 4 skills (qp ยท qp-plan ยท qp-run ยท qp-regress). Reads the M1/M2/M3 skill tier map."
|
|
82
|
+
DECL_REPEAT="QP โ a 4 skills bundle. 4 skills (qp ยท qp-plan ยท qp-run ยท qp-regress)."
|
|
83
|
+
|
|
84
|
+
# โโ L0 dead-control: the untouched fixture must be GREEN โโโโโโโโโโโโโโโโโโโโโโ
|
|
85
|
+
base=$( ( cd "$FX" && bash scripts/count_check.sh 2>&1 ) | tail -1 )
|
|
86
|
+
case "$base" in
|
|
87
|
+
*"COUNT-CHECK: PASS"*) ok "L0 dead-control โ ํฝ์ค์ฒ ๊ธฐ์ค์ ์ด ์ด๋ก ($base)" ;;
|
|
88
|
+
*) bad "L0 dead-control โ ๊ธฐ์ค์ ์ด ์ด๋ฏธ ๋นจ๊ฐ๋ค ($base). ์ด ์๋ ํ์ ์ ์ ๋ถ ๋ฌด์๋ฏธํ๋ค"
|
|
89
|
+
echo "----"; echo "count_check declaration lanes: $pass passed, $fail failed"; exit 1 ;;
|
|
90
|
+
esac
|
|
91
|
+
|
|
92
|
+
# โโ L1 known-NEG: stale declaration, nothing masking it โ FAIL โโโโโโโโโโโโโโโ
|
|
93
|
+
set_desc "$DECL_STALE"; v=$(verdict)
|
|
94
|
+
case "$v" in
|
|
95
|
+
FAIL*"์ ์ธ 3 โ ๋์คํฌ 4"*) ok "L1 known-NEG ๋ก์ ์ ์ธ์ ์ก๋๋ค โ ๊ณ๊ธฐ๊ฐ ์ด์ ์๋ค" ;;
|
|
96
|
+
*) bad "L1 known-NEG ๋ก์ ์ ์ธ(3 vs 4)์ ๋ชป ์ก์๋ค: $v" ;;
|
|
97
|
+
esac
|
|
98
|
+
|
|
99
|
+
# โโ L2 known-POS: same stale declaration, masked by earlier prose โ ๋ชจํธ FAIL โ
|
|
100
|
+
set_desc "$DECL_STALE_MASKED"; v=$(verdict)
|
|
101
|
+
case "$v" in
|
|
102
|
+
FAIL*"๋ชจํธ"*) ok "L2 known-POS ์ฐ๋ฌธ ์ซ์์ ๊ฐ๋ ค์ง ๋ก์ ์ ์ธ โ ๋ชจํธ๋ก ์ก๋๋ค (์๋ฆฌ ์ ์ PASS)" ;;
|
|
103
|
+
PASS*) bad "L2 known-POS ๊ฑฐ์ง PASS ๊ฐ ์ด์ ์๋ค โ ์ด ๋ ์ธ์ด ์กด์ฌํ๋ ์ด์ ๋ค: $v" ;;
|
|
104
|
+
*) bad "L2 known-POS ์์ ๋ฐ ํ์ : $v" ;;
|
|
105
|
+
esac
|
|
106
|
+
|
|
107
|
+
# โโ L3 ๊ณผํ control: a correct declaration beside `M3 skill` prose โ PASS โโโโโ
|
|
108
|
+
set_desc "$DECL_TIERMAP"; v=$(verdict)
|
|
109
|
+
case "$v" in
|
|
110
|
+
PASS*) ok "L3 ๊ณผํ control โ M3 skill tier map ์ \"3 skill\" ์ ์ ์ธ์ด ์๋๋ค, ๋ง์ง ์๋๋ค" ;;
|
|
111
|
+
*) bad "L3 ๊ณผํ โ ์ ์ ์ ์ธ์ ๋ง์๋ค. ๊ณผ์ฐจ๋จ์ --no-verify ๋ฅผ ํ์ต์ํจ๋ค: $v" ;;
|
|
112
|
+
esac
|
|
113
|
+
|
|
114
|
+
# โโ L4 ๊ฐ์ ๊ฐ ๋ฐ๋ณต์ ๋ชจํธ๊ฐ ์๋๋ค โ PASS โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
115
|
+
set_desc "$DECL_REPEAT"; v=$(verdict)
|
|
116
|
+
case "$v" in
|
|
117
|
+
PASS*) ok "L4 ๊ฐ์ ๊ฐ ๋ฐ๋ณต(4 ยท 4)์ ๋ชจํธ๊ฐ ์๋๋ค โ ํต๊ณผ" ;;
|
|
118
|
+
*) bad "L4 ๊ฐ์ ๊ฐ ๋ฐ๋ณต์ ๋ชจํธ๋ก ๋ง์๋ค: $v" ;;
|
|
119
|
+
esac
|
|
120
|
+
|
|
121
|
+
# โโ L5 ๋ถ์ฌโ ํต๊ณผ ํ๊ท (#768 ์ด ์ธ์ด ๊ท์น์ด ์ด์ ์๋) โโโโโโโโโโโโโโโโโโโโโโโโ
|
|
122
|
+
set_desc "QP (Quality Platform) โ plan, automate, regress. No count declared here."; v=$(verdict)
|
|
123
|
+
case "$v" in
|
|
124
|
+
FAIL*"๋ถ์ฌโ ํต๊ณผ"*) ok "L5 ์ ์ธ ๋ถ์ฌ๋ ์ฌ์ ํ FAIL โ #768 ์ ๊ท์น์ด ์ด์ ์๋ค" ;;
|
|
125
|
+
*) bad "L5 ์ ์ธ ๋ถ์ฌ๋ฅผ ๋์ณค๋ค: $v" ;;
|
|
126
|
+
esac
|
|
127
|
+
|
|
128
|
+
# โโ L6 revert probe: AMBIG ๋ถ๊ธฐ๋ฅผ ์ฃฝ์ด๋ฉด L2 ๊ฐ ์ด๋ก์ผ๋ก ๋์๊ฐ์ผ ํ๋ค โโโโโโโโ
|
|
129
|
+
cp "$FX/scripts/count_check.sh" "$TMP/mut6.sh"
|
|
130
|
+
# ๐ฅ ์ถฉ์คํ ๋๋๋ฆผ์ ยซ์ฒซ ๋งค์น๋ฅผ ํ
์คํธ ์์๋กยป ๋ค โ ์ ๋ ฌ ์ต์๊ฐ์ด ์๋๋ค.
|
|
131
|
+
# sorted(set(...)) ๋ฅผ vals[:1] ๋ก ๋ฐ๊พธ๋ฉด ์๋ฆฌ ์ `re.search` ์๋ฏธ๊ฐ ๊ทธ๋๋ก ๋ณต์๋๋ค.
|
|
132
|
+
if ! sed -i.bak 's/uniq=sorted(set(vals), key=int)/uniq=vals[:1]/' "$TMP/mut6.sh"; then
|
|
133
|
+
bad "L6 HARNESS ERROR โ ๋ฎคํดํธ ์์ฑ ์คํจ (์นํ ๋์ ์์). ใ์ ๋นจ๊ฐ์ก๋คใ์ ๊ตฌ๋ณ์ด ์ ๋๋ค"
|
|
134
|
+
elif ! grep -q 'uniq=vals\[:1\]' "$TMP/mut6.sh"; then
|
|
135
|
+
bad "L6 HARNESS ERROR โ ๋ฎคํดํธ์ ์นํ์ด ๋ฐ์๋์ง ์์๋ค"
|
|
136
|
+
else
|
|
137
|
+
cp "$TMP/mut6.sh" "$FX/scripts/count_check.sh"
|
|
138
|
+
set_desc "$DECL_STALE_MASKED"; v=$(verdict)
|
|
139
|
+
case "$v" in
|
|
140
|
+
PASS*) ok "L6 ๋๋๋ฆผ โ AMBIG ๋ถ๊ธฐ๋ฅผ ์ฃฝ์ด์ L2 ๊ฐ ๊ฑฐ์ง PASS ๋ก ๋๋์๊ฐ๋ค (์ต์ปค๊ฐ ์ฅ์์ด ์๋๋ค)" ;;
|
|
141
|
+
*) bad "L6 ๋๋๋ฆผ โ ๋ฎคํดํธ๊ฐ ๋นจ๊ฐ ์ฑ๋ค. L2 ๋ AMBIG ๋ถ๊ธฐ ๋๋ถ์ด ์๋ ์ ์๋ค: $v" ;;
|
|
142
|
+
esac
|
|
143
|
+
cp scripts/count_check.sh "$FX/scripts/count_check.sh"
|
|
144
|
+
fi
|
|
145
|
+
rm -f "$TMP/mut6.sh.bak"
|
|
146
|
+
|
|
147
|
+
# โโ L7 revert probe: ๊ฒฝ๊ณ๋ฅผ ๋นผ๋ฉด L3 ์ด ๋นจ๊ฐ์ ธ์ผ ํ๋ค โโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
148
|
+
cp "$FX/scripts/count_check.sh" "$TMP/mut7.sh"
|
|
149
|
+
if ! sed -i.bak 's/(?<!\[A-Za-z0-9_\/.-\])//' "$TMP/mut7.sh"; then
|
|
150
|
+
bad "L7 HARNESS ERROR โ ๋ฎคํดํธ ์์ฑ ์คํจ (์นํ ๋์ ์์)"
|
|
151
|
+
elif grep -q '(?<!' "$TMP/mut7.sh"; then
|
|
152
|
+
bad "L7 HARNESS ERROR โ ๊ฒฝ๊ณ๊ฐ ๋ฎคํดํธ์ ๊ทธ๋๋ก ๋จ์ ์๋ค"
|
|
153
|
+
else
|
|
154
|
+
cp "$TMP/mut7.sh" "$FX/scripts/count_check.sh"
|
|
155
|
+
set_desc "$DECL_TIERMAP"; v=$(verdict)
|
|
156
|
+
case "$v" in
|
|
157
|
+
FAIL*) ok "L7 ๋๋๋ฆผ โ ๊ฒฝ๊ณ๋ฅผ ๋นผ์ M3 ์ \"3 skill\" ์ด ๋ค์ ์ ์ธ์ผ๋ก ์ฝํ๋ค (๊ณผํ ์ค์ฌ ํ์ธ)" ;;
|
|
158
|
+
*) bad "L7 ๋๋๋ฆผ โ ๋ฎคํดํธ๊ฐ ์ด๋ก์ด๋ค. L3 ์ ๊ฒฝ๊ณ ๋๋ถ์ด ์๋ ์ ์๋ค: $v" ;;
|
|
159
|
+
esac
|
|
160
|
+
cp scripts/count_check.sh "$FX/scripts/count_check.sh"
|
|
161
|
+
fi
|
|
162
|
+
rm -f "$TMP/mut7.sh.bak"
|
|
163
|
+
|
|
164
|
+
# โโ L8 containment: ์ค์ ๋ ํฌ๋ ๊ฑด๋๋ฆฌ์ง ์์๋ค โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
165
|
+
if [ ! -s "$TMP/base/qp.json" ] || [ ! -s "$TMP/base/mp.json" ]; then
|
|
166
|
+
bad "L8 containment โ ๊ธฐ์ค ์ค๋
์ท์ ๋ชป ๋ด๋ค. ๊ฒฉ๋ฆฌ๋ฅผ ยซ์ฐ ์ ์ด ์๋คยป (UNMEASURED, ํต๊ณผ ์๋)"
|
|
167
|
+
elif cmp -s "$TMP/base/qp.json" "$REPO_ROOT/plugins/fh-qp/.claude-plugin/plugin.json" \
|
|
168
|
+
&& cmp -s "$TMP/base/mp.json" "$REPO_ROOT/.claude-plugin/marketplace.json"; then
|
|
169
|
+
ok "L8 containment โ ์ค์ ํธ๋ฆฌ์ plugin/marketplace ์ ์ธ byte-identical (์ฌ๋ณธ๋ง ๊ฑด๋๋ ธ๋ค)"
|
|
170
|
+
else
|
|
171
|
+
bad "L8 containment โ ์ค์ ํธ๋ฆฌ๊ฐ ๋ฐ๋์๋ค. ์ด ๋ฐ์ ๊ฒฉ๋ฆฌ ์ฃผ์ฅ์ ๋ฌดํจ๋ค"
|
|
172
|
+
fi
|
|
173
|
+
|
|
174
|
+
echo "----"
|
|
175
|
+
echo "count_check declaration lanes: $pass passed, $fail failed"
|
|
176
|
+
[ "$fail" -eq 0 ]
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_env_layer_fingerprint_lanes.sh โ scripts/env_layer_fingerprint.sh ์ ์ต์ปค.
|
|
3
|
+
#
|
|
4
|
+
# ์ด ๊ณ๊ธฐ๊ฐ ์ฃผ์ฅํ๋ ๊ฒ์ ยซ๋ ์ฒดํฌ์์์ ๋์กฐํ ์ ์๋คยป ํ๋๋ค. ๊ทธ๋ฌ๋ ๋ ์ธ์ด ๋ฐ์์ผ ํ๋ ๊ฒ๋
|
|
5
|
+
# ๊ทธ ํ๋๋ค: **์ธต์ด ์๊ณ ์์์ ๋ฐ๋ผ ํ์ ๊ณผ ์ง๋ฌธ์ด ์ค์ ๋ก ๊ฐ๋ฆฌ๋๊ฐ.** ใ๋๊ธด ๋๋คใ๋ ์ต์ปค๊ฐ ์๋๋ค.
|
|
6
|
+
#
|
|
7
|
+
# ๐ฅ ๊ณ๊ธฐ-์ค๋ฅ ํ(L6)์ด ์ด ๋ฌถ์์ ํต์ฌ์ด๋ค โ ํ๋ธ๊ฐ ์๋ ๊ณณ์ ๊ฒจ๋๋ฉด ยซ๋๋ฆฌํํธ 11๊ฑดยป์ด ์๋๋ผ
|
|
8
|
+
# rc=2 ๊ฐ ๋์์ผ ํ๋ค. ๊ทธ ํ์ด ์์ผ๋ฉด ์ด ๊ณ๊ธฐ์ ๊ฐ์ฅ ๊ทธ๋ด๋ฏํ ์คํจ(์๋ฑํ cwd ์์ ์ ๋ถ
|
|
9
|
+
# ABSENT ๋ฅผ ์ฐ๊ณ ๋ณด๊ณ )๊ฐ ์ด๋ก์ผ๋ก ์ง๋๊ฐ๋ค.
|
|
10
|
+
set -uo pipefail
|
|
11
|
+
cd "$(dirname "$0")/.." || exit 2
|
|
12
|
+
S=scripts/env_layer_fingerprint.sh
|
|
13
|
+
fail=0
|
|
14
|
+
_t() { printf ' %-58s' "$1"; }
|
|
15
|
+
_ok() { echo "ok"; }
|
|
16
|
+
_no() { echo "FAIL โ $1"; fail=1; }
|
|
17
|
+
|
|
18
|
+
echo "โโ env-layer-fingerprint lanes โโ"
|
|
19
|
+
|
|
20
|
+
[ -x "$S" ] || { echo "FAIL $S ๊ฐ ์๊ฑฐ๋ ์คํ ๋ถ๊ฐ"; exit 1; }
|
|
21
|
+
|
|
22
|
+
TMP="$(mktemp -d)" || exit 2
|
|
23
|
+
trap 'rm -rf "$TMP"' EXIT
|
|
24
|
+
|
|
25
|
+
mk_hub() { # mk_hub DIR [full] โ READ ์ธต๋ง(=์ ํด๋ก ) ๋๋ ๋ก์ปฌ ์ธต๊น์ง ์ฑ์ด ํ๋ธ
|
|
26
|
+
local d="$1"
|
|
27
|
+
mkdir -p "$d/.claude/rules" "$d/.claude/registry" "$d/templates/.git-hooks" "$d/scripts" "$d/tracks/_meta"
|
|
28
|
+
: > "$d/CLAUDE.md"; : > "$d/.claude/rules/fh_4axis_gate.md"
|
|
29
|
+
: > "$d/templates/.git-hooks/pre-commit"; : > "$d/scripts/x.sh"
|
|
30
|
+
git -C "$d" init -q 2>/dev/null
|
|
31
|
+
if [ "${2:-}" = full ]; then
|
|
32
|
+
: > "$d/.claude/rules/.public-surface-patterns"
|
|
33
|
+
: > "$d/.claude/rules/.residency-patterns"
|
|
34
|
+
: > "$d/.claude/registry/LOCAL_SKILL_REGISTRY.md"
|
|
35
|
+
: > "$d/CLAUDE.local.md"
|
|
36
|
+
: > "$d/tracks/_meta/edit_manifest.yaml"
|
|
37
|
+
: > "$d/tracks/_meta/.axes_23_passed_fixture.marker"
|
|
38
|
+
: > "$d/tracks/_meta/reference_next_session_starter.md"
|
|
39
|
+
: > "$d/tracks/_meta/session_fixture.md"
|
|
40
|
+
fi
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# L1 โ ์คํฌ๋ฆฝํธ๊ฐ ์๊ธฐ known-pair ๋ฅผ ํต๊ณผํ๋ค (๊ณ๊ธฐ๊ฐ ๊ต์ ๋ผ ์๋)
|
|
44
|
+
_t "L1 selftest (known-pair ๋ถ๋ฆฌ๋ฅ)"
|
|
45
|
+
if bash "$S" --selftest >/dev/null 2>&1; then _ok; else _no "selftest ์คํจ โ ๊ณ๊ธฐ๊ฐ ๊ต์ ์ ๋จ"; fi
|
|
46
|
+
|
|
47
|
+
# L2 โ known-negative: ์ ํด๋ก ๋ชจ์์ด๋ฉด ENFORCEยทPATTERN ์ด ABSENT ์ด๊ณ rc=1
|
|
48
|
+
mk_hub "$TMP/bare"
|
|
49
|
+
_t "L2 ์ ํด๋ก โ ๋ก์ปฌ ์ธต ABSENT, rc=1"
|
|
50
|
+
out="$(FH_HUB="$TMP/bare" bash "$S" --tsv 2>/dev/null)"; rc=$?
|
|
51
|
+
if [ "$rc" -eq 1 ] \
|
|
52
|
+
&& printf '%s' "$out" | grep -q '^pattern.psa PATTERN ABSENT' \
|
|
53
|
+
&& printf '%s' "$out" | grep -q '^hook.pre-commit ENFORCE ABSENT'; then _ok
|
|
54
|
+
else _no "rc=$rc ์ด๊ฑฐ๋ ABSENT ํ์ ์ด ์ ๋์ด"; fi
|
|
55
|
+
|
|
56
|
+
# L3 โ known-positive: ๋ก์ปฌ ์ธต์ ์ฑ์ฐ๋ฉด ๊ทธ ์นธ๋ค์ด PRESENT ๋ก ๋ค์งํ๋ค
|
|
57
|
+
mk_hub "$TMP/full" full
|
|
58
|
+
_t "L3 ๋ก์ปฌ ์ธต ์ฑ์ โ ๊ฐ์ ์นธ์ด PRESENT ๋ก ๋ค์งํ"
|
|
59
|
+
out="$(FH_HUB="$TMP/full" bash "$S" --tsv 2>/dev/null)"
|
|
60
|
+
if printf '%s' "$out" | grep -q '^pattern.psa PATTERN PRESENT' \
|
|
61
|
+
&& printf '%s' "$out" | grep -q '^evidence.marker EVIDENCE PRESENT' \
|
|
62
|
+
&& printf '%s' "$out" | grep -q '^evidence.card EVIDENCE PRESENT'; then _ok
|
|
63
|
+
else _no "์ธต์ ๋ง๋ค์๋๋ฐ PRESENT ๋ก ์ ๋ฐ๋ โ ๋ถ๋ฆฌ ์ ๋จ"; fi
|
|
64
|
+
|
|
65
|
+
# L4 โ ์ง๋ฌธ์ด ์ํ๋ฅผ ๋๋ฅธ๋ค: ๋ ํฝ์ค์ฒ์ digest ๊ฐ ๋ฌ๋ผ์ผ ํ๋ค
|
|
66
|
+
_t "L4 digest ๊ฐ ๋ ์ํ๋ฅผ ๊ตฌ๋ถํ๋ค"
|
|
67
|
+
d1="$(FH_HUB="$TMP/bare" bash "$S" --digest 2>/dev/null)"
|
|
68
|
+
d2="$(FH_HUB="$TMP/full" bash "$S" --digest 2>/dev/null)"
|
|
69
|
+
if [ -n "$d1" ] && [ -n "$d2" ] && [ "$d1" != "$d2" ]; then _ok
|
|
70
|
+
else _no "digest ๊ฐ ๊ฐ๊ฑฐ๋ ๋น์๋ค โ ๋์กฐ์ ๋ชป ์ด๋ค"; fi
|
|
71
|
+
|
|
72
|
+
# L5 โ ๊ฐ ์ ์ถ ๊ธ์ง: ์ถ๋ ฅ์ ํ์ผ ยซ๋ด์ฉยป์ด ์ค๋ฆฌ๋ฉด ์ ๋๋ค (PRยท์ค๋ ๋์ ๋ถ์ด๋ ์ฐ์ถ๋ฌผ์ด๋ค)
|
|
73
|
+
_t "L5 ์ถ๋ ฅ์ ํ์ผ ๋ด์ฉ์ด ์ ์ค๋ฆฐ๋ค"
|
|
74
|
+
printf 'SECRET_TOKEN_DO_NOT_LEAK\n' > "$TMP/full/.claude/rules/.public-surface-patterns"
|
|
75
|
+
printf 'ANOTHER_SECRET_LITERAL\n' > "$TMP/full/CLAUDE.local.md"
|
|
76
|
+
out="$(FH_HUB="$TMP/full" bash "$S" 2>&1; FH_HUB="$TMP/full" bash "$S" --digest 2>&1; FH_HUB="$TMP/full" bash "$S" --tsv 2>&1)"
|
|
77
|
+
if printf '%s' "$out" | grep -q 'SECRET_TOKEN_DO_NOT_LEAK\|ANOTHER_SECRET_LITERAL'; then
|
|
78
|
+
_no "gitignored ํ์ผ์ ๋ด์ฉ์ด ์ถ๋ ฅ์ ์ค๋ ธ๋ค โ ์ ์ถ"
|
|
79
|
+
else _ok; fi
|
|
80
|
+
|
|
81
|
+
# L6 โ ๊ณ๊ธฐ-์ค๋ฅ ํ: ํ๋ธ๊ฐ ์๋ ๊ณณ์ ๊ฒจ๋๋ฉด rc=2 (๋๋ฆฌํํธ๋ก ๋ณด๊ณ ํ๋ฉด ์ ๋๋ค)
|
|
82
|
+
_t "L6 ํ๋ธ ์๋ ๊ณณ โ rc=2 (๋๋ฆฌํํธ ์๋)"
|
|
83
|
+
mkdir -p "$TMP/nothub"
|
|
84
|
+
FH_HUB="$TMP/nothub" bash "$S" >/dev/null 2>&1; rc=$?
|
|
85
|
+
if [ "$rc" -eq 2 ]; then _ok; else _no "rc=$rc โ ์๋ฑํ ๋๋ ํฐ๋ฆฌ๋ฅผ ๋๋ฆฌํํธ๋ก ๋ณด๊ณ ํ๋ค"; fi
|
|
86
|
+
|
|
87
|
+
# L7 โ ๋๋๋ฆผ ํ๋ก๋ธ: READ ํ ํ๋๋ฅผ ์ง์ฐ๋ฉด L6 ๊ณผ ๊ฐ์ ๊ณ๊ธฐ-์ค๋ฅ๋ก ๋จ์ด์ ธ์ผ ํ๋ค
|
|
88
|
+
# (ยซ์ด ํ์ ์ด ์ ๋ง READ ์ธต์ ๋ณด๊ณ ๋์ค๋ยป๋ฅผ ๋ณด์ด๋ ํ โ ์์ผ๋ฉด L6 ์ด ์ฐ์ฐํ ๋ง์ ์ ์๋ค)
|
|
89
|
+
_t "L7 ๋๋๋ฆผ โ READ ์์ฐ ์ญ์ ์ rc=2 ๋ก ์ ํ"
|
|
90
|
+
rm -f "$TMP/full/CLAUDE.md"
|
|
91
|
+
FH_HUB="$TMP/full" bash "$S" >/dev/null 2>&1; rc=$?
|
|
92
|
+
if [ "$rc" -eq 2 ]; then _ok; else _no "rc=$rc โ READ ์ธต ๋ฌด๊ฒฐ์ฑ์ด ํ์ ์ ์ ๊ฑธ๋ ค ์๋ค"; fi
|
|
93
|
+
|
|
94
|
+
# L8 โ tracked ํ์ผ FP ์ต์ปค: tracks/ ์ **tracked** ํ์ผ๋ง ์์ผ๋ฉด evidence.tracks ๋ ABSENT.
|
|
95
|
+
# (2026-08-30 ์จ๋ณด๋ฉ ๋ถ๊ธฐ FP ์ ๊ฐ์ ํด๋์ค โ ๋๋ด ํ์ผ์ ยซ๊ธฐ๋ก ์์ยป์ผ๋ก ์ฝ์ผ๋ฉด ์ ๋๋ค)
|
|
96
|
+
_t "L8 tracked-only tracks/ โ evidence.tracks ABSENT"
|
|
97
|
+
mk_hub "$TMP/tracked"
|
|
98
|
+
mkdir -p "$TMP/tracked/tracks/_contrib"
|
|
99
|
+
: > "$TMP/tracked/tracks/_contrib/shipped.md"
|
|
100
|
+
git -C "$TMP/tracked" add -A >/dev/null 2>&1
|
|
101
|
+
out="$(FH_HUB="$TMP/tracked" bash "$S" --tsv 2>/dev/null)"
|
|
102
|
+
if printf '%s' "$out" | grep -q '^evidence.tracks EVIDENCE ABSENT'; then _ok
|
|
103
|
+
else _no "๋๋ด๋ tracked ํ์ผ์ ์ธ์
๊ธฐ๋ก์ผ๋ก ์ฝ๋๋ค โ FP"; fi
|
|
104
|
+
|
|
105
|
+
# โโ L9 โ ์ง๋ฌธ์ ์
ธ ์์ค๋ฅผ ๋ด์ง ์๋๋ค. **์ค์น๋ ๋ชจ๋ bash ์์** โโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
106
|
+
# ์ค์ฌ๊ณ 2026-09-21: `$(case โฆ esac)` ๊ฐ bash 3.2(macOS ๊ธฐ๋ณธ /bin/bash)์์ ๋ฐํ์์ ๊นจ์ ธ
|
|
107
|
+
# ๊ฐ ์๋ฆฌ๋ก ์
ธ ์์ค๊ฐ ์์ด ๋ค์ด๊ฐ๊ณ , **rc=0 ์ผ๋ก ๋๋ฌ๋ค.** ๊ฐ์ ์ปค๋ฐ์ด ๋งฅ์์ fa28bfdfb139,
|
|
108
|
+
# ์ปจํ
์ด๋(5.3)์์ ab16518d1dc4 โ ์ฆ ์ด ๊ณ๊ธฐ๊ฐ ์กด์ฌ ์ด์ ์ธ ์ง๋ฌธ ๋์กฐ์์ **์๋ ๋๋ฆฌํํธ๋ฅผ
|
|
109
|
+
# ๋ง๋ ๋ค.** ์ข
๋ฃ์ฝ๋๋ก๋ ์ ์กํ๋ฏ๋ก **๋ด์ฉ**์ ๋ณธ๋ค. bash ํ๋ณธ๋ง๋ค ๋ฐ๋ก ๋๋ค: ํ ํ๋ณธ๋ง
|
|
110
|
+
# ๋๋ฆฌ๋ฉด ๊ทธ ํ๋ณธ์์๋ง ๋๋ ๊ฒฐํจ์ด ๊ตฌ์กฐ์ ์ผ๋ก ์ ๋ณด์ธ๋ค(๊ทธ๊ฒ ์ด ์ฌ๊ณ ์ ํํ์๋ค).
|
|
111
|
+
for _b in /bin/bash /opt/homebrew/bin/bash /usr/local/bin/bash; do
|
|
112
|
+
[ -x "$_b" ] || continue
|
|
113
|
+
_bv="$("$_b" -c 'echo "${BASH_VERSINFO[0]}.${BASH_VERSINFO[1]}"' 2>/dev/null)"
|
|
114
|
+
_t "L9 ๋ชจ๋ ์ธต ์ํ๊ฐ ๋ซํ ์งํฉ ์ (bash $_bv)"
|
|
115
|
+
# ๐ฅ ยซ์
ธ ์์ค์ฒ๋ผ ๋ณด์ด๋ ๋ฑ๋งยป์ ๊ธ์ง์ด๋ก ์ธ์ง ์๋๋ค โ ๊ธ์ง์ด ๋ชฉ๋ก์ ๋ฏธ๋์ ์ ๋นํ ๋ฌธ๊ตฌ์
|
|
116
|
+
# ์คํํ๊ณ , ์์ด ๋์ค๋ ํํ๊ฐ ๋ฐ๋๋ฉด ์กฐ์ฉํ ๋์น๋ค. ๋์ **๊ธ์ ๋จ์ธ**์ ํ๋ค:
|
|
117
|
+
# ๋ชจ๋ ํ์ ์ํ ์นธ์ PRESENTยทABSENTยทUNMEASURED ์
์ค ํ๋์ฌ์ผ ํ๋ค. ์
ธ ์์ค๊ฐ ๊ฐ ์๋ฆฌ๋ก
|
|
118
|
+
# ๋ค์ด์ค๋ฉด ๊ทธ ์งํฉ ๋ฐ์ด๋ผ ๋ฐ๋์ ๊ฑธ๋ฆฐ๋ค.
|
|
119
|
+
_tsv="$("$_b" "$S" --tsv 2>/dev/null)"
|
|
120
|
+
if [ -z "$_tsv" ]; then
|
|
121
|
+
_no "bash $_bv ์์ --tsv ๊ฐ ๋น์๋ค โ ํ์ ๋ถ๊ฐ(๊ณ๊ธฐ ์ค๋ฅ)"
|
|
122
|
+
else
|
|
123
|
+
# ์ฒซ ํ์ ํค๋(`id / layer / verdict`)๋ค โ ์ํ ์นธ์ด ์๋๋ฏ๋ก ์ ์ธํ๋ค. ์ ๋นผ๋ฉด
|
|
124
|
+
# ๊นจ๋ํ ํธ๋ฆฌ๊ฐ ์์ํ ๋นจ๊ฐ, ๊ทธ๋ฅ ๊ณผ์ฐจ๋จ์ด๋ค(์ดํ์ด ๊ทธ๋ ๊ฒ ํ๋ ธ๋ค).
|
|
125
|
+
_bad="$(printf '%s\n' "$_tsv" | awk -F'\t' 'NR>1 && NF>=3 && $3!="PRESENT" && $3!="ABSENT" && $3!="UNMEASURED" {print $1"="$3}')"
|
|
126
|
+
_rows="$(printf '%s\n' "$_tsv" | awk -F'\t' 'NR>1 && NF>=3' | grep -c . || true)"
|
|
127
|
+
if [ "${_rows:-0}" -lt 10 ]; then
|
|
128
|
+
_no "bash $_bv ์์ ํ์ด $_rows ๊ฐ๋ฟ โ ์ธต ํ๊ฐ ๊นจ์ก๋ค(๊ณ๊ธฐ ์ค๋ฅ)"
|
|
129
|
+
elif [ -n "$_bad" ]; then
|
|
130
|
+
_no "bash $_bv ์ํ ์นธ์ด ๋ซํ ์งํฉ ๋ฐ: $(printf '%s' "$_bad" | head -2 | tr '\n' ' ')"
|
|
131
|
+
else
|
|
132
|
+
_ok
|
|
133
|
+
fi
|
|
134
|
+
fi
|
|
135
|
+
done
|
|
136
|
+
|
|
137
|
+
# โโ L9b โ ๋๋๋ฆผ ํ๋ก๋ธ: ๊นจ์ง๋ ํํ๋ฅผ ๋๋๋ฆฌ๋ฉด L9 ์ด ์ค์ ๋ก ๋นจ๊ฐ์ง๋ โโโโโโโโโโโโโโโโโโ
|
|
138
|
+
# L9 ์ด ยซ์ด๋ค ์ด์ ๋ก๋ ์ด๋กยป์ด ๋๋ ๊ฒ์ ๋ง๋ ํ์ด๋ค. bash 3.x ๊ฐ ์๋ ํ๊ฒฝ(๋ฆฌ๋
์ค CI)์์๋
|
|
139
|
+
# ์ด ๊ฒฐํจ์ ์ฌํํ ์ ์์ผ๋ฏ๋ก **UNMEASURED ๋ก ๋งํ๊ณ ํต๊ณผ์ํจ๋ค** โ ใ๋ชป ์๋คใ๋ฅผ ใ๊นจ๋ํ๋คใ๋ก
|
|
140
|
+
# ์ ์ง ์๋๋ค(๋ถ์ฌโ 0). 3.x ๊ฐ ์์ผ๋ฉด ๋ฐ๋์ ์ ์์ด์ด์ผ ํ๋ค.
|
|
141
|
+
# ๐ฅ **์ด๋ฆ์ผ๋ก ๋จ๊ธฐ๋ ์์ฌ (cross-family ์ง์ , 2026-09-21)**: ๊ทธ๋์ ์ด ํ๊ท ํ์ ๊ฐ์ ๋ ฅ์
|
|
142
|
+
# **bash 3.x ๊ฐ ์๋ ํธ์คํธ์๋ง** ์๋ค. CI ๋ ๋ฆฌ๋
์ค/bash 5 ๋ผ L9b ๊ฐ ๊ฑฐ๊ธฐ์ ์์ํ
|
|
143
|
+
# UNMEASURED ์ด๊ณ , L9 ๋ ๊ทธ ํธ์คํธ์์๋ ์ ์ด์ ์ ๊นจ์ง๋ ํ๋ณธ๋ง ์ฐ๋ค. ์ฆ ์ด ๊ฒฐํจ ํด๋์ค์
|
|
144
|
+
# ์ค์ง ๊ฒ์ดํธ๋ **์ด์์ ๋งฅ์ ๋ก์ปฌ ์คํ**์ด์ง CI ๊ฐ ์๋๋ค. ๋ซ์ผ๋ ค๋ฉด CI ์ macOS ์ก์ด๋
|
|
145
|
+
# bash-3 ์ปจํ
์ด๋๊ฐ ํ์ํ๊ณ , ๊ทธ๊ฑด ์ด PR ๋ฒ์ ๋ฐ์ด๋ผ ์ ํ๋ค.
|
|
146
|
+
_t "L9b ๋๋๋ฆผ โ \$(case) ๋ณต์ ์ bash 3.x ์์ ์ ์"
|
|
147
|
+
_B3=""
|
|
148
|
+
for _b in /bin/bash /usr/bin/bash; do
|
|
149
|
+
[ -x "$_b" ] || continue
|
|
150
|
+
[ "$("$_b" -c 'echo ${BASH_VERSINFO[0]}' 2>/dev/null)" = "3" ] && { _B3="$_b"; break; }
|
|
151
|
+
done
|
|
152
|
+
if [ -z "$_B3" ]; then
|
|
153
|
+
echo "UNMEASURED โ bash 3.x ์์(์ด ๊ฒฐํจ์ ์ฌ๊ธฐ์ ์ฌํ ๋ถ๊ฐ). PASS ์๋"
|
|
154
|
+
else
|
|
155
|
+
MUT="$TMP/mutant.sh"
|
|
156
|
+
python3 - "$S" "$MUT" <<'PY'
|
|
157
|
+
import io,sys,re
|
|
158
|
+
src=io.open(sys.argv[1],encoding='utf-8').read()
|
|
159
|
+
new,_n=re.subn(
|
|
160
|
+
r' local _tracks_state\n case "\$untracked_tracks" in\n.*?\n esac\n'
|
|
161
|
+
r' add_row evidence\.tracks EVIDENCE "\$_tracks_state" \\\n',
|
|
162
|
+
' add_row evidence.tracks EVIDENCE \\\\\n'
|
|
163
|
+
' "$(case "$untracked_tracks" in\n'
|
|
164
|
+
" UNMEASURABLE) printf 'UNMEASURED' ;;\n"
|
|
165
|
+
" 0) printf 'ABSENT' ;;\n"
|
|
166
|
+
" *) printf 'PRESENT' ;;\n"
|
|
167
|
+
' esac)" \\\n',
|
|
168
|
+
src, flags=re.S)
|
|
169
|
+
# ๐ฅ ์นํ์ด ยซ์ ํํ ํ ๋ฒยป ์ผ์ด๋ฌ๋์ง ๋ชป๋ฐ๋๋ค. ํ์๋ฅผ ์ ๋ณด๋ฉด, ํ์์ด ์กฐ๊ธ ๋ฐ๋์ด ์ ๊ท์์ด
|
|
170
|
+
# ๋น๋๊ฐ๋ ์๋ณธ์ด ๊ทธ๋๋ก ๋ฎคํดํธ๋ก ๋ณต์ฌ๋๊ณ ๋ ์ธ์ ์๋ฑํ ์ฐ์ถ๋ฌผ์ ์ฐ๋ค.
|
|
171
|
+
if _n != 1:
|
|
172
|
+
sys.stderr.write("SUBN=%d\n" % _n); sys.exit(3)
|
|
173
|
+
io.open(sys.argv[2],'w',encoding='utf-8').write(new)
|
|
174
|
+
PY
|
|
175
|
+
_mutrc=$?
|
|
176
|
+
if [ "$_mutrc" -ne 0 ]; then
|
|
177
|
+
_no "๊ณ๊ธฐ ์ค๋ฅ โ ๋ฎคํดํธ ์นํ์ด ์ ํํ 1ํ๊ฐ ์๋์๋ค(rc=$_mutrc). ์ด ํ์ ๊ณตํํ์ ๊ฒ"
|
|
178
|
+
elif ! grep -q '\$(case' "$MUT" 2>/dev/null; then
|
|
179
|
+
_no "๊ณ๊ธฐ ์ค๋ฅ โ ๋ฎคํดํธ์ \$(case) ๊ฐ ์ ๋ค์ด๊ฐ๋ค. ์ด ํ์ ๊ณตํํ๊ฒ ํต๊ณผํ์ ๊ฒ"
|
|
180
|
+
elif ! "$_B3" -n "$MUT" 2>/dev/null; then
|
|
181
|
+
_no "๊ณ๊ธฐ ์ค๋ฅ โ ๋ฎคํดํธ๊ฐ ํ์ฑ์กฐ์ฐจ ์ ๋๋ค. ๊ทธ ์นจ๋ฌต์ ์๋ฌด ๋ป์ด ์๋ค"
|
|
182
|
+
else
|
|
183
|
+
# L9 ๊ณผ **๊ฐ์ ํ์ ์**์ ์ด๋ค โ ํ๋ก๋ธ๊ฐ ๋ค๋ฅธ ์ฃ๋๋ก ์ฌ๋ฉด L9 ์ ์ต์ปคํ ๊ฒ ์๋๋ค.
|
|
184
|
+
_tm="$("$_B3" "$MUT" --tsv 2>/dev/null)"
|
|
185
|
+
_badm="$(printf '%s\n' "$_tm" | awk -F'\t' 'NR>1 && NF>=3 && $3!="PRESENT" && $3!="ABSENT" && $3!="UNMEASURED" {print $1}')"
|
|
186
|
+
if [ -n "$_badm" ]; then _ok
|
|
187
|
+
else _no "๋ฎคํดํธ๊ฐ ๋ซํ ์งํฉ ์์ ์ํ๋ง ๋๋ค โ L9 ์ด ์ด ๊ฒฐํจ์ ๊ฒฐ๋ฐ๋ผ ์์ง ์๋ค"; fi
|
|
188
|
+
fi
|
|
189
|
+
fi
|
|
190
|
+
|
|
191
|
+
echo "โโ $([ "$fail" -eq 0 ] && echo 'all lanes ok' || echo 'FAILURES above') โโ"
|
|
192
|
+
exit "$fail"
|