@chrono-meta/fh-gate 2.13.0 → 2.14.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 +35 -1
- package/.claude-plugin/marketplace.json +2 -2
- package/AGENTS.md +17 -0
- package/CLAUDE.md +14 -1
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +4 -4
- package/README.zh.md +3 -3
- package/docs/ETHOS.md +21 -0
- package/docs/IDENTITIES.md +83 -0
- package/knowledge/shared/harness-core/fh_detail_protocols.md +77 -1
- package/knowledge/shared/harness-core/measurement-integrity-checklist.md +80 -0
- package/knowledge/shared/harness-core/ship_readiness_gate.md +70 -4
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +82 -0
- package/knowledge/shared/rules/multi_session_close_protocol.md +7 -1
- package/package.json +20 -2
- package/plugins/fh-commons/.claude-plugin/plugin.json +2 -2
- package/plugins/fh-commons/skills/preprep/README.md +45 -0
- package/plugins/fh-commons/skills/preprep/SKILL.md +214 -0
- package/plugins/fh-commons/skills/preprep/canon_terms.example.yaml +36 -0
- package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_negative.md +7 -0
- package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_positive.md +8 -0
- package/plugins/fh-commons/skills/preprep/fixtures/progression_known_negative.md +13 -0
- package/plugins/fh-commons/skills/preprep/fixtures/progression_known_positive.md +13 -0
- package/plugins/fh-commons/skills/preprep/fixtures/promise_known_negative.md +9 -0
- package/plugins/fh-commons/skills/preprep/fixtures/promise_known_positive.md +7 -0
- package/plugins/fh-commons/skills/preprep/interslide_deps.py +223 -0
- package/plugins/fh-commons/skills/preprep/jargon_terms.example.yaml +40 -0
- package/plugins/fh-commons/skills/preprep/lane_adjacent_dup.py +86 -0
- package/plugins/fh-commons/skills/preprep/lane_progression.py +81 -0
- package/plugins/fh-commons/skills/preprep/lane_promise.py +121 -0
- package/plugins/fh-commons/skills/preprep/ooxml/c1_baseline.txt +12 -0
- package/plugins/fh-commons/skills/preprep/ooxml/gate.py +164 -0
- package/plugins/fh-commons/skills/preprep/preprep.py +776 -0
- package/plugins/fh-commons/skills/preprep/presentation_checklist.md +310 -0
- package/plugins/fh-commons/skills/preprep/surfaces.example.yaml +148 -0
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +78 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL.md +39 -0
- package/scripts/com.forge-harness.daily-report.plist +44 -0
- package/scripts/context_continuity_score.sh +435 -0
- package/scripts/daily_report.sh +208 -0
- package/scripts/digest_landing_check.sh +71 -0
- package/scripts/fh_session_load.sh +19 -0
- package/scripts/field_canon_preload.sh +44 -0
- package/scripts/lane_runner_check.sh +34 -1
- package/scripts/launchd_wiring_check.sh +182 -0
- package/scripts/mapped_tracks.sh +69 -0
- package/scripts/package_coverage_check.sh +19 -0
- package/scripts/portability_lint.sh +30 -0
- package/scripts/selfcheck.sh +98 -1
- package/scripts/sim_isolated_run.sh +339 -0
- package/scripts/test_lane_runner_lanes.sh +75 -0
- package/scripts/test_mapped_tracks_lanes.sh +58 -0
- package/scripts/test_marker_address_lanes.sh +78 -0
- package/scripts/test_marker_soul_check_lanes.sh +36 -0
- package/scripts/test_precommit_staged_drift_lanes.sh +91 -0
- package/scripts/test_preprep_adjacent_dup_lanes.sh +57 -0
- package/scripts/test_preprep_drift_anchor.sh +65 -0
- package/scripts/test_preprep_progression_lanes.sh +53 -0
- package/scripts/test_preprep_promise_lanes.sh +56 -0
- package/scripts/test_preprep_retired_lanes.sh +54 -0
- package/scripts/test_sim_isolated_run_lanes.sh +219 -0
- package/scripts/test_skill_canon_preload_lanes.sh +58 -0
- package/templates/.git-hooks/pre-commit +405 -7
package/scripts/mapped_tracks.sh
CHANGED
|
@@ -38,6 +38,12 @@ esac
|
|
|
38
38
|
_die_unmeasured() {
|
|
39
39
|
echo "status=UNMEASURED"
|
|
40
40
|
echo "reason=$1"
|
|
41
|
+
# 🟥 EMIT THE BRANCH KEY ON EVERY PATH, including this one. A consumer greps
|
|
42
|
+
# `onboarding_branch=` and must get an ANSWER in every state — silence is the shape a reader
|
|
43
|
+
# fills in with the friendlier value, and «looks like you're new here» to a returning user is
|
|
44
|
+
# exactly the defect the branch test exists to prevent.
|
|
45
|
+
echo "onboarding_branch=UNKNOWN"
|
|
46
|
+
echo "branch_why=$1 — UNKNOWN is not 'new'"
|
|
41
47
|
echo "# not-found != zero — do NOT read this as 'no mapped tracks'"
|
|
42
48
|
exit 3
|
|
43
49
|
}
|
|
@@ -100,12 +106,75 @@ done
|
|
|
100
106
|
|
|
101
107
|
if [ "$COUNT_ONLY" = "1" ]; then echo "$COUNT"; exit 0; fi
|
|
102
108
|
|
|
109
|
+
# ── ⓐ SESSION FILES, and the branch verdict ───────────────────────────────────────────────────
|
|
110
|
+
# WHY THIS IS HERE AND NOT IN PROSE. The onboarding branch test has two halves: ⓑ (mapped tracks,
|
|
111
|
+
# counted above) and ⓐ (session files). ⓑ has been mechanical since 2026-08-22; ⓐ was left to the
|
|
112
|
+
# session to judge from a sentence — and the sentence was wrong.
|
|
113
|
+
#
|
|
114
|
+
# 🟥 THE DEFECT, measured 2026-08-30 with a control. ⓐ read «any `tracks/**/session_*.md` or
|
|
115
|
+
# `tracks/_meta/*.md` beyond .gitkeep», and TWO files that SHIP WITH THE REPO satisfy it:
|
|
116
|
+
# tracks/_contrib/session_2026_06_27_….md (a sister-asset cross-audit; only the NAME is
|
|
117
|
+
# session-shaped)
|
|
118
|
+
# tracks/_meta/harness_bench_issue_monitor.md (an issue-monitor artifact)
|
|
119
|
+
# So `git clone` alone rendered the RETURNING menu, and the NEW-USER branch was unreachable for
|
|
120
|
+
# anyone who clones. The canon warns two lines away that «a fresh clone is a NEW install — never
|
|
121
|
+
# infer the branch from git log»; the same misreading arrived through tracked FILES instead.
|
|
122
|
+
# (Control: the nonsense pattern `tracks/**/zzz_*.md` matched 0, so the probe discriminates.)
|
|
123
|
+
#
|
|
124
|
+
# THE RULE, one sentence: **ⓐ counts only files that did NOT ship with the repo.** Content that
|
|
125
|
+
# arrived with the checkout is not evidence that this person has worked here. `git ls-files` is the
|
|
126
|
+
# mechanical discriminator, and it degrades honestly: an npm install ships no `tracks/` at all
|
|
127
|
+
# (verified against package.json `files[]`), so both worlds agree.
|
|
128
|
+
#
|
|
129
|
+
# 🟥 THREE-VALUED. "cannot tell shipped from user-made" is UNKNOWN, never `new` — rendering an
|
|
130
|
+
# unmeasured state as the friendlier branch is how a returning user gets told they look new
|
|
131
|
+
# ([[feedback_not_found_is_not_zero_family]]).
|
|
132
|
+
_TRACKED=""
|
|
133
|
+
_TRACKED_OK=0
|
|
134
|
+
if command -v git >/dev/null 2>&1 && [ -d "$HUB_ROOT/.git" ] || { command -v git >/dev/null 2>&1 && git -C "$HUB_ROOT" rev-parse --git-dir >/dev/null 2>&1; }; then
|
|
135
|
+
_TRACKED=$(git -C "$HUB_ROOT" ls-files tracks/ 2>/dev/null)
|
|
136
|
+
# An EMPTY tracked list is a real state (a hub whose tracks/ is fully gitignored) — distinguish it
|
|
137
|
+
# from "git failed" by asking git a question it always answers.
|
|
138
|
+
if git -C "$HUB_ROOT" rev-parse --git-dir >/dev/null 2>&1; then _TRACKED_OK=1; fi
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
_SESS=0
|
|
142
|
+
_SESS_NAMES=""
|
|
143
|
+
_is_shipped() { # $1 = path relative to HUB_ROOT
|
|
144
|
+
[ "$_TRACKED_OK" = "1" ] || return 1
|
|
145
|
+
printf '%s\n' "$_TRACKED" | grep -qxF "$1"
|
|
146
|
+
}
|
|
147
|
+
for _f in "$HUB_ROOT"/tracks/*/session_*.md "$HUB_ROOT"/tracks/_meta/*.md; do
|
|
148
|
+
[ -f "$_f" ] || continue
|
|
149
|
+
_rel="tracks/${_f#"$HUB_ROOT"/tracks/}"
|
|
150
|
+
case "$(basename "$_f")" in .gitkeep) continue ;; esac
|
|
151
|
+
_is_shipped "$_rel" && continue
|
|
152
|
+
_SESS=$((_SESS + 1))
|
|
153
|
+
# Cap the sample. The COUNT is the answer; the names are a debugging aid, and an operator hub
|
|
154
|
+
# has hundreds — dumping them turns a one-line verdict into a screenful nobody reads.
|
|
155
|
+
[ "$_SESS" -le 3 ] && _SESS_NAMES="$_SESS_NAMES $(basename "$_f")"
|
|
156
|
+
done
|
|
157
|
+
|
|
158
|
+
if [ "$_TRACKED_OK" = "1" ]; then
|
|
159
|
+
if [ "$_SESS" -gt 0 ] || [ "$COUNT" -gt 0 ]; then _BRANCH=returning; else _BRANCH=new; fi
|
|
160
|
+
_BRANCH_WHY="session_files=$_SESS mapped=$COUNT (shipped files excluded via git ls-files)"
|
|
161
|
+
else
|
|
162
|
+
_BRANCH=UNKNOWN
|
|
163
|
+
_BRANCH_WHY="cannot separate shipped from user-made files (git unavailable here) — UNKNOWN is not new"
|
|
164
|
+
fi
|
|
165
|
+
|
|
103
166
|
echo "status=OK"
|
|
104
167
|
echo "hub_root=$HUB_ROOT"
|
|
105
168
|
echo "root_source=$ROOT_SRC"
|
|
106
169
|
echo "in_worktree=$IN_WORKTREE"
|
|
107
170
|
echo "count=$COUNT"
|
|
108
171
|
echo "names=${NAMES# }"
|
|
172
|
+
echo "session_files=$_SESS"
|
|
173
|
+
_SESS_SHOWN="${_SESS_NAMES# }"
|
|
174
|
+
[ "$_SESS" -gt 3 ] && _SESS_SHOWN="$_SESS_SHOWN … (+$((_SESS - 3)) more)"
|
|
175
|
+
echo "session_sample=$_SESS_SHOWN"
|
|
176
|
+
echo "onboarding_branch=$_BRANCH"
|
|
177
|
+
echo "branch_why=$_BRANCH_WHY"
|
|
109
178
|
if [ "$IN_WORKTREE" = "yes" ]; then
|
|
110
179
|
echo "# NOTE: running from a worktree; the count above is the MAIN tree's, resolved via"
|
|
111
180
|
echo "# --git-common-dir. The worktree's own tracks/ is NOT the answer to this question."
|
|
@@ -47,6 +47,25 @@ ACCEPTED_ABSENT=(
|
|
|
47
47
|
# `selfcheck.sh` 는 대상 부재 시 `_absent_subject_verdict` 로 빠지므로 패키지 모드에서 옳게 degrade 한다.
|
|
48
48
|
"scripts/outbound_query_guard.sh"
|
|
49
49
|
"scripts/test_outbound_query_lanes.sh"
|
|
50
|
+
# 🟥 영혼(judgment-circuit) 3종 — **일부러 출하하지 않는다.** 위 outbound 가드와 같은 이유다.
|
|
51
|
+
# 이 셋은 `.claude/soul_tenets.txt`(=**이 레포의** 심지 원칙 등록부)를 전제로 하는데, 그 파일은
|
|
52
|
+
# 소비자에게 안 나간다 — 소비자의 tenet 은 소비자가 쓰는 것이지 우리가 주는 것이 아니다
|
|
53
|
+
# (`.claude/regression/probes.md` 가 이미 같은 논리로 미출하다).
|
|
54
|
+
# 🟥 측정하고 결정했다(2026-08-30): 등록부를 치우고 셋을 돌리니 rc=1·1·10 — 즉 그대로 출하하면
|
|
55
|
+
# **신선 설치가 100% 실패**한다. CLAUDE.md 가 «모든 새 install 을 막는 게이트는 엄격한 게이트가
|
|
56
|
+
# 아니라 우회 훈련기»(→ `--no-verify` 훈련 → 같은 훅의 Destructive-Op 게이트 무장해제)라 못박은
|
|
57
|
+
# 그 형태다. 훅 자체(`templates/.git-hooks/pre-commit`)는 나가고, 인용이 없는 마커는 통과하므로
|
|
58
|
+
# 소비자 게이트는 열린 채로 남는다.
|
|
59
|
+
# ⚠️ **남은 갭을 이름으로**: 소비자는 자기 install 의 soul 다리를 검증할 레인을 못 받는다.
|
|
60
|
+
# `test_hook_leg_wiring_lanes.sh` 는 원리상 등록부 없이도 돌 수 있어야 하고(호출부만 보므로),
|
|
61
|
+
# 그렇게 고치면 이 목록에서 빼는 것이 맞다. 오늘은 안 고쳤다 — 미측정이 아니라 미착수다.
|
|
62
|
+
"scripts/test_marker_soul_tenet_lanes.sh"
|
|
63
|
+
"scripts/test_hook_leg_wiring_lanes.sh"
|
|
64
|
+
"scripts/soul_trace.sh"
|
|
65
|
+
# 🟥 sim 경로격리 레인 — 출하 안 한다. `sim_isolated_run.sh` 는 이 레포의 측정 도구이고
|
|
66
|
+
# 이 레인은 «그 러너가 클론에 무엇을 써넣는가»를 본다. 소비자에게 그 러너가 없으면
|
|
67
|
+
# 레인이 HARNESS-ERROR 로 죽고, 그건 신선 설치를 막는 형태가 된다(위 outbound 와 동일 논리).
|
|
68
|
+
"scripts/test_sim_path_isolation_lanes.sh"
|
|
50
69
|
".claude/registry/LOCAL_SKILL_REGISTRY.md"
|
|
51
70
|
".claude/regression/probes.md"
|
|
52
71
|
# Its sibling, and absent for the same reason one layer up: this file records which sections of
|
|
@@ -141,6 +141,26 @@ lint_file() {
|
|
|
141
141
|
_emit " → 루프 첫 줄에 \`[ -e \"\$f\" ] || continue\`, 또는 shopt -s nullglob"
|
|
142
142
|
_hits=$((_hits+1))
|
|
143
143
|
done < <(grep -nE 'for [A-Za-z_][A-Za-z0-9_]* in [^;]*\*[^;)]*; *do' "$f" 2>/dev/null)
|
|
144
|
+
|
|
145
|
+
# ── [P10] `tr` 집합 안의 «범위로 읽힐 수 있는» 하이픈 ────────────────────────────
|
|
146
|
+
# 🟥 2026-08-30 실측, N=3 로 기계화. (번호: 초판이 이미 쓰인 P9 를 재사용해 충돌했다 — 실행해서 잡았다.) `tr -d '[:space:].·—-]'` 의 `—-]` 를 **범위**로 읽는
|
|
147
|
+
# 구현이 있다(GNU tr). 그러면 그 범위에 든 바이트가 전부 삭제되고 — 한글 코퍼스에서는
|
|
148
|
+
# 낱말 자체가 사라진다. macOS 는 리터럴로 읽어 통과하므로 **로컬만 초록이고 CI 에서 적색**이다.
|
|
149
|
+
# 실제 피해: `defeater: 없음` 이 「1 낱말 공허」로 차단됐다(D6 레인, CI 전용 실패).
|
|
150
|
+
# 판별: `tr` 인자 안에서 **양쪽에 문자가 있는 `-`**. 맨 앞/맨 뒤 하이픈은 리터럴이라 안전하고,
|
|
151
|
+
# `a-z`·`0-9` 같은 **의도된 범위**는 오탐이므로 뺀다.
|
|
152
|
+
while IFS= read -r line; do
|
|
153
|
+
n="${line%%:*}"; body="${line#*:}"
|
|
154
|
+
printf '%s' "$body" | grep -qE '#[[:space:]]*portability-noqa:[[:space:]]*[^[:space:]]' && continue
|
|
155
|
+
case "$(printf '%s' "$body" | sed 's/^[[:space:]]*//')" in '#'*) continue ;; esac
|
|
156
|
+
# 의도된 ASCII 범위만 쓰는 줄은 통과
|
|
157
|
+
printf '%s' "$body" | grep -qE "tr[^|]*'[^']*[a-zA-Z0-9]-[a-zA-Z0-9][^']*'" && continue
|
|
158
|
+
_emit " [P10] $f:$n"
|
|
159
|
+
_emit " \`tr\` 집합 안의 하이픈이 **범위**로 읽힐 수 있다(구현마다 다르다)."
|
|
160
|
+
_emit " 비-ASCII 가 섞인 집합에서는 낱말이 통째로 지워진다 — 로컬만 초록이 된다."
|
|
161
|
+
_emit " → 하이픈을 **맨 뒤**로 옮기거나, \`tr\` 대신 셸 파라미터 확장을 써라."
|
|
162
|
+
_hits=$((_hits+1))
|
|
163
|
+
done < <(grep -nE "tr +-[a-z]* *'[^']*[^-'][-][^-'][^']*'" "$f" 2>/dev/null)
|
|
144
164
|
}
|
|
145
165
|
|
|
146
166
|
# ── self-test (known-pair) ────────────────────────────────────────────────────
|
|
@@ -194,6 +214,16 @@ if [ "$SELFTEST" = 1 ]; then
|
|
|
194
214
|
printf 'd=$(date +%%s)\n' > "$t/p7_neg.sh"; _ck "P7 known-negative (date +%s)" 0 "$t/p7_neg.sh" # portability-noqa: self-test 픽스처 — 일부러 위반형을 쓴다
|
|
195
215
|
printf 'run_review "package.json"\n' > "$t/p9_pos.sh"; _ck "P9 known-positive (레포고유 픽스처)" 1 "$t/p9_pos.sh" # portability-noqa: self-test 픽스처 — 일부러 위반형을 쓴다
|
|
196
216
|
printf 'run_review "$t/fixture.json"\n' > "$t/p9_neg.sh"; _ck "P9 known-negative (자기 픽스처)" 0 "$t/p9_neg.sh" # portability-noqa: self-test 픽스처 — 일부러 위반형을 쓴다
|
|
217
|
+
# 🟥 P10 — `tr` 집합 안의 «범위로 읽힐 수 있는» 하이픈. 2026-08-30 CI 전용 실패에서 나왔다:
|
|
218
|
+
# `tr -d '[:space:].·—-]'` 가 GNU 에서 범위로 읽혀 한글이 지워졌고 `defeater: 없음` 이
|
|
219
|
+
# 「1 낱말 공허」로 차단됐다. macOS 는 리터럴로 읽어 **로컬만 초록**이었다.
|
|
220
|
+
printf 'x=$(printf %%s "$b" | tr -d \x27[:space:].\xc2\xb7\xe2\x80\x94-]\x27)\n' > "$t/p10_pos.sh" # portability-noqa: self-test 픽스처 — 일부러 위반형을 쓴다
|
|
221
|
+
_ck "P10 known-positive (하이픈이 범위로 읽힌다)" 1 "$t/p10_pos.sh"
|
|
222
|
+
printf 'y=$(printf %%s "$b" | tr -d \x27[:space:].\xc2\xb7]\x27)\n' > "$t/p10_neg.sh" # portability-noqa: self-test 픽스처 — 일부러 위반형을 쓴다
|
|
223
|
+
_ck "P10 known-negative (하이픈 없음 = 리터럴)" 0 "$t/p10_neg.sh"
|
|
224
|
+
# 🟥 컨트롤 — 의도된 ASCII 범위(a-z)는 오탐이면 안 된다. 없으면 «전부 잡는 계기»와 구분 안 된다.
|
|
225
|
+
printf 'z=$(printf %%s "$b" | tr \x27a-z\x27 \x27A-Z\x27)\n' > "$t/p10_ctl.sh" # portability-noqa: self-test 픽스처 — 일부러 위반형을 쓴다
|
|
226
|
+
_ck "P10 control (의도된 a-z 범위는 오탐 아님)" 0 "$t/p10_ctl.sh"
|
|
197
227
|
|
|
198
228
|
# 🟥 로케일 fail-open — cross-family 가 실측으로 잡은 것. 비-UTF8 바이트가 섞인 줄을
|
|
199
229
|
# UTF-8 로케일에서 돌려도 검출돼야 한다(lint_file 이 LC_ALL=C 로 고정하므로).
|
package/scripts/selfcheck.sh
CHANGED
|
@@ -586,6 +586,12 @@ for _pair in \
|
|
|
586
586
|
"templates/.git-hooks/pre-commit|scripts/test_marker_standpoint_lanes.sh" \
|
|
587
587
|
"templates/.git-hooks/pre-commit|scripts/test_marker_thirdparty_lanes.sh" \
|
|
588
588
|
"templates/.git-hooks/pre-commit|scripts/test_marker_soul_check_lanes.sh" \
|
|
589
|
+
"templates/.git-hooks/pre-commit|scripts/test_marker_soul_tenet_lanes.sh" \
|
|
590
|
+
"scripts/sim_isolated_run.sh|scripts/test_sim_path_isolation_lanes.sh" \
|
|
591
|
+
"templates/.git-hooks/pre-commit|scripts/test_hook_leg_wiring_lanes.sh" \
|
|
592
|
+
".claude/soul_tenets.txt|scripts/test_marker_soul_tenet_lanes.sh" \
|
|
593
|
+
"templates/.git-hooks/pre-commit|scripts/test_precommit_staged_drift_lanes.sh" \
|
|
594
|
+
"templates/.git-hooks/pre-commit|scripts/test_marker_address_lanes.sh" \
|
|
589
595
|
"scripts/residency_closure_scan.py|scripts/test_residency_closure_lanes.sh" \
|
|
590
596
|
"scripts/reviewer_capability_corpus.tsv|scripts/test_reviewer_capability_conformance.sh" \
|
|
591
597
|
"scripts/field_canon_preload.sh|scripts/test_field_canon_lanes.sh" \
|
|
@@ -595,7 +601,14 @@ for _pair in \
|
|
|
595
601
|
"scripts/script_caller_ratchet.sh|scripts/test_runner_surface_index_lanes.sh" \
|
|
596
602
|
"scripts/mapped_tracks.sh|scripts/test_mapped_tracks_lanes.sh" \
|
|
597
603
|
"scripts/fh-goal.sh|scripts/test_fh_goal_change_detection_lanes.sh" \
|
|
598
|
-
"scripts/utterance_skill_probe.sh|scripts/test_utterance_skill_probe_lanes.sh"
|
|
604
|
+
"scripts/utterance_skill_probe.sh|scripts/test_utterance_skill_probe_lanes.sh" \
|
|
605
|
+
`# ── preprep 스킬(2026-08-29). 주체는 스킬 안의 모듈이라 scripts/ 밖이다 ──` \
|
|
606
|
+
"plugins/fh-commons/skills/preprep/preprep.py|scripts/test_preprep_retired_lanes.sh" \
|
|
607
|
+
"plugins/fh-commons/skills/preprep/lane_progression.py|scripts/test_preprep_progression_lanes.sh" \
|
|
608
|
+
"plugins/fh-commons/skills/preprep/lane_adjacent_dup.py|scripts/test_preprep_adjacent_dup_lanes.sh" \
|
|
609
|
+
"plugins/fh-commons/skills/preprep/lane_promise.py|scripts/test_preprep_promise_lanes.sh" \
|
|
610
|
+
"plugins/fh-commons/skills/preprep/SKILL.md|scripts/test_preprep_drift_anchor.sh" \
|
|
611
|
+
"scripts/field_canon_preload.sh|scripts/test_skill_canon_preload_lanes.sh"
|
|
599
612
|
do
|
|
600
613
|
_subj="${_pair%%|*}"; _anc="${_pair##*|}"; _lbl="${_anc##*/}"
|
|
601
614
|
if [ ! -f "$_subj" ]; then
|
|
@@ -749,6 +762,25 @@ for _subj in compaction_probe judgment_circuit_lint novelty_claim_check chamber_
|
|
|
749
762
|
fi
|
|
750
763
|
done
|
|
751
764
|
|
|
765
|
+
# 🟥 `soul_trace.sh` 는 위 루프에 넣지 않고 **명시 호출**한다 (2026-08-30).
|
|
766
|
+
# 루프는 `scripts/$_subj.sh` 로 경로를 조립하므로 **리터럴 grep 에 안 잡힌다** —
|
|
767
|
+
# CI 의 caller-zero ratchet 이 그것을 «호출부 0» 으로 잡았고, 그 판정이 옳다:
|
|
768
|
+
# 「호출된다」를 사람 눈으로만 확인할 수 있으면 그건 배선의 증거가 아니다.
|
|
769
|
+
# 오늘 아침 `digest_landing_check` 에서 본 것과 같은 형태다.
|
|
770
|
+
# 🟥 그리고 이 블록의 초판은 이 파일에 없는 변수(`$ROOT`·`$RC`)를 써서 **selfcheck 자체를
|
|
771
|
+
# 죽였다**(`ROOT: unbound variable`, 770줄). 관행은 상대경로 + `fail=1` 이다.
|
|
772
|
+
if [ ! -f "scripts/soul_trace.sh" ]; then
|
|
773
|
+
_absent_subject_verdict "soul_trace --self-test" "scripts/soul_trace.sh" || fail=1
|
|
774
|
+
else
|
|
775
|
+
if _st_out=$(bash scripts/soul_trace.sh --self-test 2>&1); then
|
|
776
|
+
echo "PASS soul_trace --self-test ($(printf '%s' "$_st_out" | grep -c '✅') lanes)"
|
|
777
|
+
else
|
|
778
|
+
echo "FAIL soul_trace --self-test"
|
|
779
|
+
printf '%s\n' "$_st_out" | grep '❌' | head -5
|
|
780
|
+
fail=1
|
|
781
|
+
fi
|
|
782
|
+
fi
|
|
783
|
+
|
|
752
784
|
# capability_registry_check — one of the 4 embedded --self-test subjects lane_runner_check.sh
|
|
753
785
|
# flagged (2026-08-15), kept out of the loop above (see that loop's comment) because its own
|
|
754
786
|
# terminal line is `통과 N · 실패 N`, never 캘리브레이션 — gate on exit code instead, same shape
|
|
@@ -1065,6 +1097,71 @@ else
|
|
|
1065
1097
|
fail=1
|
|
1066
1098
|
fi
|
|
1067
1099
|
|
|
1100
|
+
# The isolated sim runner gets the same treatment, and it earned it in one session. Its lanes are
|
|
1101
|
+
# hermetic (the `claude` CLI is stubbed), so running them is free — and L8a is the lane that caught
|
|
1102
|
+
# a FALSE FINDING already published into CLAUDE.md: the runner still passed `--restricted` at the
|
|
1103
|
+
# call site after the flag had been "made opt-in" in the tools array, so every arm ran with the
|
|
1104
|
+
# project CLAUDE.md removed, and a two-variable comparison was written up as one. Without this
|
|
1105
|
+
# suite that retraction does not happen. Subject-present-but-anchor-absent is a FAIL, not a skip.
|
|
1106
|
+
if [ ! -f scripts/sim_isolated_run.sh ]; then
|
|
1107
|
+
_absent_subject_verdict "test_sim_isolated_run_lanes.sh" "scripts/sim_isolated_run.sh" || fail=1
|
|
1108
|
+
elif [ -f scripts/test_sim_isolated_run_lanes.sh ]; then
|
|
1109
|
+
if ! bash scripts/test_sim_isolated_run_lanes.sh; then
|
|
1110
|
+
fail=1
|
|
1111
|
+
fi
|
|
1112
|
+
else
|
|
1113
|
+
echo "FAIL test_sim_isolated_run_lanes.sh: sim_isolated_run.sh present but its anchor is missing"
|
|
1114
|
+
fail=1
|
|
1115
|
+
fi
|
|
1116
|
+
|
|
1117
|
+
# daily_report — 어제 커밋 집계. 자기검사 10 레인(known-pair · 멱등 · 부재 표기).
|
|
1118
|
+
# 🟥 이 파일은 «한 번 존재했다가 사라진» 이력이 있다 — 2026-08-29 에 산출물 1건을 내고
|
|
1119
|
+
# git 에 커밋된 적 없이 없어졌고, 로컬 바인딩만 「설치됨」이라 적고 있었다. 배선이
|
|
1120
|
+
# 그 재발을 막는 층이다. subject 있는데 anchor 없으면 FAIL 이지 skip 이 아니다.
|
|
1121
|
+
if [ ! -f scripts/daily_report.sh ]; then
|
|
1122
|
+
_absent_subject_verdict "daily_report --self-test" "scripts/daily_report.sh" || fail=1
|
|
1123
|
+
else
|
|
1124
|
+
if ! bash scripts/daily_report.sh --self-test >/dev/null 2>&1; then
|
|
1125
|
+
echo "FAIL daily_report --self-test"
|
|
1126
|
+
bash scripts/daily_report.sh --self-test 2>&1 | grep '❌' | head -5
|
|
1127
|
+
fail=1
|
|
1128
|
+
else
|
|
1129
|
+
echo "PASS daily_report --self-test (10 lanes)"
|
|
1130
|
+
fi
|
|
1131
|
+
fi
|
|
1132
|
+
|
|
1133
|
+
# launchd_wiring_check — 주기 실행(frontier-digest)이 실제로 배선됐나. 자기검사 10 레인.
|
|
1134
|
+
# 🟥 이 검사가 없던 동안, 추적본 plist 는 «템플릿»(/path/to/ 플레이스홀더)인데 «바꿨는지»도
|
|
1135
|
+
# «걸렸는지»도 보는 것이 0개였다. 소비자는 digest 가 돈다고 믿으면서 한 번도 안 도는 상태로
|
|
1136
|
+
# 지낼 수 있었고 그 부재는 아무 신호도 안 냈다. subject 있는데 anchor 없으면 FAIL 이다.
|
|
1137
|
+
if [ ! -f scripts/launchd_wiring_check.sh ]; then
|
|
1138
|
+
_absent_subject_verdict "launchd_wiring_check --self-test" "scripts/launchd_wiring_check.sh" || fail=1
|
|
1139
|
+
else
|
|
1140
|
+
if ! bash scripts/launchd_wiring_check.sh --self-test >/dev/null 2>&1; then
|
|
1141
|
+
echo "FAIL launchd_wiring_check --self-test"
|
|
1142
|
+
bash scripts/launchd_wiring_check.sh --self-test 2>&1 | grep '❌' | head -5
|
|
1143
|
+
fail=1
|
|
1144
|
+
else
|
|
1145
|
+
echo "PASS launchd_wiring_check --self-test (10 lanes)"
|
|
1146
|
+
fi
|
|
1147
|
+
fi
|
|
1148
|
+
|
|
1149
|
+
# context_continuity_score — 「압축 후 모델이 여전히 답하나」의 격리 채점기. 자기검사 12 레인.
|
|
1150
|
+
# 🟥 이 배선이 없으면 채점 규칙이 조용히 썩는다. 실제로 이 스크립트는 만든 당일에 세 번 틀렸고
|
|
1151
|
+
# (positive 오채점 · 거절 어휘 누락 · negative 게이트 구멍) 셋 다 이 레인들이 잡는 형태다.
|
|
1152
|
+
# subject 는 있는데 anchor 가 없으면 FAIL 이지 skip 이 아니다.
|
|
1153
|
+
if [ ! -f scripts/context_continuity_score.sh ]; then
|
|
1154
|
+
_absent_subject_verdict "context_continuity_score --self-test" "scripts/context_continuity_score.sh" || fail=1
|
|
1155
|
+
else
|
|
1156
|
+
if ! bash scripts/context_continuity_score.sh --self-test >/dev/null 2>&1; then
|
|
1157
|
+
echo "FAIL context_continuity_score --self-test"
|
|
1158
|
+
bash scripts/context_continuity_score.sh --self-test 2>&1 | grep '❌' | head -5
|
|
1159
|
+
fail=1
|
|
1160
|
+
else
|
|
1161
|
+
echo "PASS context_continuity_score --self-test (12 lanes)"
|
|
1162
|
+
fi
|
|
1163
|
+
fi
|
|
1164
|
+
|
|
1068
1165
|
# marker axes-run lanes — 훅의 축 자기대조 형식 검사(§CLAUDE.md 3층 자기 대조)의 앵커.
|
|
1069
1166
|
# ⚠️ 「4축」이라고 적혀 있었는데 2026-08-17 부로 **6축 분기가 생겼다**(마커 날짜 >= 그 날이면
|
|
1070
1167
|
# 기호 키 ⓐ~ⓕ 요구, 미만이면 옛 ASCII 넷). 산문 층이라 레인은 안 깨지고 조용히 stale 이었다.
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# sim_isolated_run.sh — run a blind floor-tier sim WITHOUT letting it become an agent fleet.
|
|
3
|
+
#
|
|
4
|
+
# WHY THIS EXISTS (measured 2026-08-29, twice):
|
|
5
|
+
# A blind sim of identity ④ was launched as 12 parallel `claude -p` calls in the LIVE repo cwd.
|
|
6
|
+
# Three things went wrong, and the third is the one that matters:
|
|
7
|
+
# 1. the arms wrote 6 files into the working tree and read each other's output — corpus
|
|
8
|
+
# self-contamination, the same defect as the 2026-08-23 probe's invalidated arm A3;
|
|
9
|
+
# 2. one arm registered a **launchd agent** in ~/Library/LaunchAgents — an unrequested,
|
|
10
|
+
# persistent change to the operator's machine, made by something called "a measurement";
|
|
11
|
+
# 3. 🟥 the contamination produced a FALSE POSITIVE POINTING AT THE DESIRED CONCLUSION.
|
|
12
|
+
# An arm answered "이미 돼있어" — found prior art, declined to rebuild — which is the
|
|
13
|
+
# textbook success scene for identity ④. The "prior art" was a file another arm had
|
|
14
|
+
# created two minutes earlier. Scored naively, ④ would have looked GREEN, on the same
|
|
15
|
+
# day the operator asked for ④ to be shown green.
|
|
16
|
+
# Isolation is therefore not "keep the answer word out of the prompt". It is "put the target
|
|
17
|
+
# where the arms cannot reach it".
|
|
18
|
+
#
|
|
19
|
+
# WHAT THIS GIVES YOU, and what it does NOT:
|
|
20
|
+
# ✅ PREVENTS repo-tree contamination — each arm gets its own disposable clone
|
|
21
|
+
# ✅ PREVENTS settings inheritance — `--restricted` ignores user/project/local settings
|
|
22
|
+
# ✅ DETECTS machine-level side effects — LaunchAgents / crontab / ~/.claude snapshot diff
|
|
23
|
+
# 🟥 DOES NOT PREVENT machine-level side effects in `act` mode. Full containment needs an OS
|
|
24
|
+
# sandbox, which this script does not provide. `observe` mode prevents them by removing the
|
|
25
|
+
# tools that could cause them; `act` mode trades that for behavioural fidelity and reports
|
|
26
|
+
# what happened. Saying "isolated" without this paragraph would be the lie this file exists
|
|
27
|
+
# to stop. A detector is not a gate (CLAUDE.md §Surface-Class Degrade Invariant).
|
|
28
|
+
#
|
|
29
|
+
# MODES
|
|
30
|
+
# observe (default) --tools "Read,Grep,Glob" → read-only. No writes possible.
|
|
31
|
+
# act write tools, inside a disposable clone. Machine surfaces are snapshotted
|
|
32
|
+
# before and after; any delta is printed LOUDLY and the run is CONTAMINATED.
|
|
33
|
+
# --no-harness adds `--restricted`, which DROPS the project CLAUDE.md. See below — this is
|
|
34
|
+
# a CONTROL arm generator, never the default.
|
|
35
|
+
#
|
|
36
|
+
# 🟥 WHY `--restricted` IS NOT THE DEFAULT — measured, one variable at a time, 2026-08-29.
|
|
37
|
+
# `--restricted` reads like the isolation flag you want ("ignores user, project and local
|
|
38
|
+
# settings files"). It also drops the project memory, so the harness under test is not loaded.
|
|
39
|
+
# The first build of this script used it, and the very first smoke run returned a bare
|
|
40
|
+
# "안녕하세요! 무엇을 도와드릴까요?" to a greeting — which would have been written up as
|
|
41
|
+
# **"the onboarding menu does not fire at floor tier"**, a large and false claim about FH.
|
|
42
|
+
# Worse, the first known-positive PASSED and hid it: the arm answered a CLAUDE.md question
|
|
43
|
+
# correctly *by grepping a file*, so "the harness is loaded" and "the model can search" were
|
|
44
|
+
# never separated. The discriminating pair needs `--tools ""` so search is impossible:
|
|
45
|
+
# same clone, --tools "", --restricted → "그런 규칙이 없어요" (memory ABSENT)
|
|
46
|
+
# same clone, --tools "", no --restricted → "🐿️" (memory PRESENT)
|
|
47
|
+
# One variable, opposite answers. ([[feedback_instrument_cannot_discriminate_hypotheses]])
|
|
48
|
+
#
|
|
49
|
+
# 🟢 AND THE DEFECT IS REUSABLE AS AN INSTRUMENT. `--no-harness` answers a question this repo
|
|
50
|
+
# asks constantly and usually by eye: **does this behaviour come from FH, or would the base
|
|
51
|
+
# model have done it anyway?** Run the same prompt with and without the flag; a behaviour that
|
|
52
|
+
# survives `--no-harness` was never the harness's doing. That is a control arm, and it is the
|
|
53
|
+
# cheapest honest one available here.
|
|
54
|
+
#
|
|
55
|
+
# USAGE
|
|
56
|
+
# bash scripts/sim_isolated_run.sh --arm cluster --reps 3 --prompt "이 프로젝트 가속화하고 싶어"
|
|
57
|
+
# bash scripts/sim_isolated_run.sh --arm build --mode act --reps 3 --prompt "..." --model sonnet
|
|
58
|
+
# bash scripts/sim_isolated_run.sh --arm door3 --reps 3 --prompt "..." \
|
|
59
|
+
# --setup 'mkdir -p tracks/demoproj' # build the precondition inside the clone
|
|
60
|
+
# Outputs land in a run dir printed at the end; each arm/rep is its own file.
|
|
61
|
+
#
|
|
62
|
+
# 🟥 OBSERVE MODE CANNOT SEE AN EMPTY DIRECTORY — and FH has machine signals that ARE empty
|
|
63
|
+
# directories. `fh_detail_protocols.md` §Branch test defines a mapped project as a
|
|
64
|
+
# `tracks/{name}/` **dir**, which is routinely empty; `Glob` matches files, so a read-only arm
|
|
65
|
+
# reports "no mapped projects" no matter what you created. Measured 2026-08-29: a `--setup` that
|
|
66
|
+
# ran `mkdir -p tracks/demoproj` succeeded, the directory existed in the clone, and all three
|
|
67
|
+
# arms still answered "매핑된 프로젝트가 하나도 없다". The fixture was real and invisible.
|
|
68
|
+
# ⇒ **A fixture for observe mode must contain a FILE.** This is an instrument constraint, not an
|
|
69
|
+
# FH defect (a normal session has Bash and can `ls`) — but scoring an arm without knowing it
|
|
70
|
+
# produces a confident zero from a fixture that was never observable.
|
|
71
|
+
#
|
|
72
|
+
# 🟥 PROJECT HOOKS DO NOT RUN IN A DISPOSABLE CLONE — so this runner cannot measure anything
|
|
73
|
+
# that depends on one. Measured 2026-08-30: an arm copied `.claude/settings.json` into its clone
|
|
74
|
+
# to make the PreToolUse PriorArt hook live; not one of the three clones grew
|
|
75
|
+
# `.claude/.prior_art_events.tsv`, while the live repo's copy carries entries from the same hour.
|
|
76
|
+
# The hook never fired, so the "hook vs no-hook" contrast was HOOK ≡ NOHOOK and either verdict
|
|
77
|
+
# would have been false. ⇒ Before claiming a hook-dependent result, check the hook's own
|
|
78
|
+
# evidence file INSIDE the clone; absence of that file invalidates the arm, not the hypothesis.
|
|
79
|
+
#
|
|
80
|
+
# 🟥 CONTROL IS NOT OPTIONAL. Always run at least one arm whose correct answer is "the thing
|
|
81
|
+
# being measured should NOT fire". An instrument that fires on everything measures nothing
|
|
82
|
+
# ([[feedback_control_presence_is_not_discrimination]]).
|
|
83
|
+
|
|
84
|
+
set -uo pipefail
|
|
85
|
+
|
|
86
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
87
|
+
# ── 경로 격리 계산 (함수로 꺼냈다 — 레인이 «실행»해서 검증할 수 있게) ──────────────
|
|
88
|
+
# 🟥 처음엔 인라인이었고 레인이 `grep` 으로만 확인했다. new-code-anchor 게이트가 그것을
|
|
89
|
+
# **MENTION_ONLY** 로 잡았다: 「레인이 파일을 이름만 대고 실행하지 않는다」.
|
|
90
|
+
# 옳은 지적이다 — 그래서 함수로 꺼내 레인이 진짜로 부르게 한다.
|
|
91
|
+
fh_sim_write_path_isolation() { # $1=WORK $2=OUTDIR $3=REPO_ROOT $4=HOME → 0=썼다 1=격리없음(차단)
|
|
92
|
+
local _w="$1" _out="$2" _repo="$3" _home="$4"
|
|
93
|
+
# ── 🟥 경로 격리 (2026-08-30 — 이 러너는 이날까지 «격리»가 아니었다) ──────────────
|
|
94
|
+
# 헤더가 *"disposable clone 이라 오염 없음"* 이라 적어왔는데, **클론은 cwd 일 뿐이고
|
|
95
|
+
# 읽기는 어디든 갔다.** `--tools "Read,Grep,Glob"` 는 «쓰기»만 막지 «경로»를 안 막는다.
|
|
96
|
+
# 실측(같은 날, known-pair): observe 팔이 `/tmp` 파일을 출력했고, **채점용 qset 을
|
|
97
|
+
# 정답 토큰까지 통째로** 읽었고, 앞선 팔의 답변 디렉터리를 나열했다(159,050 파일).
|
|
98
|
+
# ⇒ 맥락유지 3개 회차가 전부 무효. 세 번의 VOID 는 «다른 증상 셋»이 아니라 **근인 하나**였다.
|
|
99
|
+
#
|
|
100
|
+
# 🟥 **첫 수리는 과차단이었다 — 클론 자신을 막았다.** `Read(//tmp/**)` 로 통째로 막았는데
|
|
101
|
+
# `WRAP="$_out/..."` 라서 `--out /tmp/...` 이면 **클론이 그 아래 산다.** ARM 이
|
|
102
|
+
# *"working directory 에 대한 read 권한이 모든 도구에서 거부"* 라고 답했다.
|
|
103
|
+
# ⇒ 광범위 차단 대신 **위험한 곳만 이름으로** 막는다: 실제 레포 · 홈 · 이 회차의 out 디렉터리.
|
|
104
|
+
# 그 셋이 «이 실험이 자기 답을 볼 수 있는» 전부다(소스·qset·앞선 팔의 답변).
|
|
105
|
+
# ⚠️ 완전 격리가 아니다 — 열거 안 한 절대경로는 여전히 읽힌다. 그렇게 적는다.
|
|
106
|
+
# 형태도 실측으로 골랐다: `Read(/x/**)`(슬래시 하나)는 **안 막힌다**. `Read(//x/**)` 라야 한다.
|
|
107
|
+
# `Glob(...)`/`Grep(...)` 을 섞으면 클론 안까지 과차단됐다 — 그래서 **Read 만** 둔다.
|
|
108
|
+
mkdir -p "$_w/.claude"
|
|
109
|
+
# 🟥 cross-family(agy #4): 여기가 **명백한 fail-open** 이었다 — 격리 규칙이 없는
|
|
110
|
+
# `settings.local.json` 이 클론에 있으면 주입을 건너뛰고 **비격리 상태로 측정을 강행**한다.
|
|
111
|
+
# 「SKIPPED 라고 알렸다」는 변명이 안 된다: 이 회차의 산출은 그래도 숫자로 쓰인다.
|
|
112
|
+
# ⇒ 격리 없이는 **회차를 시작하지 않는다**. 강행은 명시 플래그로만.
|
|
113
|
+
if [ -f "$_w/.claude/settings.local.json" ] && ! grep -q '"deny"' "$_w/.claude/settings.local.json" 2>/dev/null; then
|
|
114
|
+
if [ "${FH_SIM_NO_ISOLATION_OK:-}" = 1 ]; then
|
|
115
|
+
echo " ⚠️ arm 격리 없이 강행됨(FH_SIM_NO_ISOLATION_OK=1) — 이 회차는 오염 가능하다고 기록해라." >&2
|
|
116
|
+
else
|
|
117
|
+
echo " ❌ arm settings.local.json 이 이미 있는데 deny 규칙이 없다 — **격리 없이 재지 않는다.**" >&2
|
|
118
|
+
echo " 강행: FH_SIM_NO_ISOLATION_OK=1 (그러면 그 회차는 오염 가능으로 기록해라)" >&2
|
|
119
|
+
: # 오염 표기는 호출부가 한다(함수는 rc 로만 말한다)
|
|
120
|
+
return 1
|
|
121
|
+
fi
|
|
122
|
+
fi
|
|
123
|
+
if [ -f "$_w/.claude/settings.local.json" ]; then
|
|
124
|
+
:
|
|
125
|
+
else
|
|
126
|
+
# 🟥 **물리경로로 계산한다** (2026-08-30, 세 번째 수리). macOS 에서 `/tmp` 는
|
|
127
|
+
# `/private/tmp` 심링크라 **같은 자리가 두 이름**을 갖는다. 논리경로만 적으면
|
|
128
|
+
# 어떤 회차는 클론을 막고(과차단) 어떤 회차는 레포를 못 막는다(누출) — 즉 격리가
|
|
129
|
+
# **비결정적**이 된다. 실측: 같은 설정에서 한 팔은 «working directory 거부», 다른 팔은
|
|
130
|
+
# 레포의 qset 을 읽었다. 비결정적 격리는 격리가 아니다.
|
|
131
|
+
_phys(){ ( cd "$1" 2>/dev/null && pwd -P ) || printf '%s' "$1"; }
|
|
132
|
+
_p_repo=$(_phys "$_repo"); _p_home=$(_phys "$_home")
|
|
133
|
+
_p_out=$(_phys "$_out"); _p_work=$(_phys "$_w")
|
|
134
|
+
_deny_repo="//${_p_repo#/}"
|
|
135
|
+
_deny_home="//${_p_home#/}"
|
|
136
|
+
_deny_out="//${_p_out#/}"; _extra_out=""
|
|
137
|
+
# 🟥 클론이 out 아래 살면 out 을 통째로 막을 수 없다. 그 경우 «앞선 팔의 답변 파일»만 막는다.
|
|
138
|
+
# 클론이 out 아래 살면 out 을 통째로 못 막는다. 그때는 «다른 팔의 산출»만 막는다 —
|
|
139
|
+
# 🟥 `*.txt` 만으로는 부족했다: 다른 팔의 **클론 트리**(`w_*/repo/**`)에 주입된 봉인 원장을
|
|
140
|
+
# 읽을 수 있었다. 그것도 막고, **내 클론은 예외로 둔다**.
|
|
141
|
+
case "$_p_work" in
|
|
142
|
+
"$_p_out"/*) _deny_out="//${_p_out#/}/*.txt"; _extra_out=",\"Read(//${_p_out#/}/w_*/repo/tracks/**)\"" ;;
|
|
143
|
+
esac
|
|
144
|
+
# 🟥 cross-family(agy #1): 기본 `$TMPDIR`(macOS `/var/folders/**`)·공유 경로·마운트 볼륨이
|
|
145
|
+
# 빠져 있었다. 산출물이 기본 TMPDIR 에 생기면 앞선 팔의 결과가 그대로 읽힌다.
|
|
146
|
+
# 🟥 단 **클론이 사는 경로는 막으면 안 된다**(첫 수리가 그렇게 자기 발을 쐈다) —
|
|
147
|
+
# 그래서 `$_w` 를 품는 접두사는 목록에서 뺀다. 계산으로 하지, 손으로 고르지 않는다.
|
|
148
|
+
_extra=""
|
|
149
|
+
for d in /var/folders /private/var/folders /Users/Shared /Volumes /var/tmp /private/tmp /tmp; do
|
|
150
|
+
_pd=$(_phys "$d"); [ -n "$_pd" ] || continue
|
|
151
|
+
case "$_p_work" in "$_pd"/*) continue ;; esac # 내 클론이 그 아래면 막지 않는다(물리경로 비교)
|
|
152
|
+
case "$_p_out" in "$_pd"/*) continue ;; esac # out 도 마찬가지 — 위에서 정밀하게 다룬다
|
|
153
|
+
d="$_pd"
|
|
154
|
+
case "$_extra" in *"Read(//${d#/}/**)"*) continue ;; esac # 중복 금지(실행으로 드러났다)
|
|
155
|
+
_extra="$_extra,\"Read(//${d#/}/**)\""
|
|
156
|
+
done
|
|
157
|
+
# 🟥 함수로 꺼내 «실행»해보자마자 JSON 결함이 드러났다: 종전엔 `_deny_out` 안에 따옴표·괄호를
|
|
158
|
+
# 끼워넣어 `Read(...*.txt` 가 안 닫히고 `tracks/**))` 로 두 번 닫혔다. **grep 레인이었으면
|
|
159
|
+
# 영영 못 봤다** — new-code-anchor 게이트가 MENTION_ONLY 를 막은 것이 이걸 잡았다.
|
|
160
|
+
# ⇒ 조각을 문자열로 조립하지 말고 **필드별로 분리**한다. 그리고 중복도 제거한다.
|
|
161
|
+
printf '{"permissions":{"deny":["Read(%s/**)","Read(%s/**)","Read(%s)"%s%s]}}' \
|
|
162
|
+
"$_deny_repo" "$_deny_home" "$_deny_out" "$_extra_out" "$_extra" > "$_w/.claude/settings.local.json"
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
return 0
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
ARM=""; REPS=1; PROMPT=""; MODE="observe"; MODEL="sonnet"; TIMEOUT=900; OUTDIR=""; NOHARNESS=0; SETUP=""; EXTRA=""
|
|
169
|
+
while [ $# -gt 0 ]; do
|
|
170
|
+
case "$1" in
|
|
171
|
+
--arm) ARM="${2:-}"; shift 2 ;;
|
|
172
|
+
--reps) REPS="${2:-1}"; shift 2 ;;
|
|
173
|
+
--prompt) PROMPT="${2:-}"; shift 2 ;;
|
|
174
|
+
--mode) MODE="${2:-observe}"; shift 2 ;;
|
|
175
|
+
--model) MODEL="${2:-sonnet}"; shift 2 ;;
|
|
176
|
+
--timeout) TIMEOUT="${2:-900}"; shift 2 ;;
|
|
177
|
+
--out) OUTDIR="${2:-}"; shift 2 ;;
|
|
178
|
+
--no-harness) NOHARNESS=1; shift ;; # CONTROL arm: drops project CLAUDE.md. Not isolation.
|
|
179
|
+
--setup) SETUP="${2:-}"; shift 2 ;; # shell run INSIDE each clone before the sim. See below.
|
|
180
|
+
--extra-tools) EXTRA="${2:-}"; shift 2 ;; # append tools to the mode's set. See TOOL VISIBILITY.
|
|
181
|
+
*) echo "unknown flag: $1" >&2; exit 2 ;;
|
|
182
|
+
esac
|
|
183
|
+
done
|
|
184
|
+
[ -n "$ARM" ] || { echo "FAIL: --arm required" >&2; exit 2; }
|
|
185
|
+
[ -n "$PROMPT" ] || { echo "FAIL: --prompt required" >&2; exit 2; }
|
|
186
|
+
case "$MODE" in observe|act) ;; *) echo "FAIL: --mode must be observe|act" >&2; exit 2 ;; esac
|
|
187
|
+
|
|
188
|
+
command -v claude >/dev/null 2>&1 || { echo "FAIL: claude CLI not on PATH" >&2; exit 2; }
|
|
189
|
+
|
|
190
|
+
OUTDIR="${OUTDIR:-$(mktemp -d "${TMPDIR:-/tmp}/fh-sim-XXXXXX")}"
|
|
191
|
+
mkdir -p "$OUTDIR"
|
|
192
|
+
|
|
193
|
+
# ── machine-surface snapshot ──────────────────────────────────────────────────────────────────
|
|
194
|
+
# Enumerated, not guessed. Each line is a surface a past run actually touched or plausibly could.
|
|
195
|
+
# `not found` is written as `ABSENT`, never as an empty string — an unreadable surface and an
|
|
196
|
+
# empty one must not collapse ([[feedback_not_found_is_not_zero_family]]).
|
|
197
|
+
snapshot() {
|
|
198
|
+
local f="$1"
|
|
199
|
+
{
|
|
200
|
+
echo "## LaunchAgents"
|
|
201
|
+
ls -1 "$HOME/Library/LaunchAgents" 2>/dev/null || echo "ABSENT"
|
|
202
|
+
echo "## crontab"
|
|
203
|
+
crontab -l 2>/dev/null || echo "ABSENT"
|
|
204
|
+
echo "## claude settings mtime"
|
|
205
|
+
# GNU-first on purpose: `stat -f` on GNU coreutils means "filesystem info" and SUCCEEDS,
|
|
206
|
+
# so a BSD-first chain never reaches the fallback and silently reports the wrong thing.
|
|
207
|
+
# Caught by this repo's own portability lint on the first commit attempt of this file.
|
|
208
|
+
stat -c '%Y %n' "$HOME/.claude/settings.json" 2>/dev/null \
|
|
209
|
+
|| stat -f '%m %N' "$HOME/.claude/settings.json" 2>/dev/null || echo "ABSENT"
|
|
210
|
+
} > "$f"
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
echo "── sim_isolated_run ──────────────────────────────────────────────"
|
|
214
|
+
echo "arm=$ARM mode=$MODE model=$MODEL reps=$REPS timeout=${TIMEOUT}s"
|
|
215
|
+
echo "out=$OUTDIR"
|
|
216
|
+
|
|
217
|
+
snapshot "$OUTDIR/_machine_before.txt"
|
|
218
|
+
|
|
219
|
+
CONTAMINATED=0
|
|
220
|
+
for r in $(seq 1 "$REPS"); do
|
|
221
|
+
# Each clone gets its OWN parent directory. Siblings under one parent are visible to `../`,
|
|
222
|
+
# and that is not hypothetical: an arm measured 2026-08-29 scanned its parent for mappable
|
|
223
|
+
# projects and reported finding "iso_A, door_CTRL" — the other arms' work dirs. Content stayed
|
|
224
|
+
# isolated, but their EXISTENCE leaked into the arm's reasoning, which is enough to change an
|
|
225
|
+
# answer about "what projects are around". Isolation has to hold for the parent too.
|
|
226
|
+
WRAP="$OUTDIR/w_${ARM}_r${r}"; mkdir -p "$WRAP"
|
|
227
|
+
WORK="$WRAP/repo"
|
|
228
|
+
# A disposable clone per REP, not per arm: two reps of the same arm contaminate each other
|
|
229
|
+
# exactly as two different arms do. That was the measured failure — reps 1 and 2 of build_cron.
|
|
230
|
+
if ! git clone --quiet --local --no-hardlinks "$REPO_ROOT" "$WORK" 2>"$OUTDIR/_clone_${ARM}_r${r}.err"; then
|
|
231
|
+
echo " ❌ r$r CLONE FAILED — see $OUTDIR/_clone_${ARM}_r${r}.err"
|
|
232
|
+
continue
|
|
233
|
+
fi
|
|
234
|
+
|
|
235
|
+
# --setup: build the PRECONDITION the measurement needs, inside the clone, before the sim.
|
|
236
|
+
# WHY THIS EXISTS: the first door-③ measurement (2026-08-29) scored 0/3 on both arms and the
|
|
237
|
+
# number meant nothing — a fresh clone has no mapped project tracks, so door ③ can never reach
|
|
238
|
+
# the follow-up proposal that was under test. Both arms correctly answered "there is nothing to
|
|
239
|
+
# accelerate" and the instrument never entered the state it was built to observe. A run whose
|
|
240
|
+
# precondition is unmet does not produce a negative result; it produces no result. Setting the
|
|
241
|
+
# fixture up INSIDE the disposable clone keeps that from being a reason to touch the live tree.
|
|
242
|
+
if [ -n "$SETUP" ]; then
|
|
243
|
+
if ! ( cd "$WORK" && eval "$SETUP" ) >"$WRAP/_setup.log" 2>&1; then
|
|
244
|
+
echo " ❌ r$r SETUP FAILED — precondition not built, arm is VOID (see $WRAP/_setup.log)"
|
|
245
|
+
CONTAMINATED=1
|
|
246
|
+
continue
|
|
247
|
+
fi
|
|
248
|
+
fi
|
|
249
|
+
# 🟥 기준선은 «클론 직후»가 아니라 «--setup 직후»다 (2026-08-30, 첫 실사용이 잡았다).
|
|
250
|
+
# 아래 :treediff 는 `git status --porcelain` 을 클론 시점 기준으로 읽었다. 그러면
|
|
251
|
+
# `--setup` 이 추적 파일을 건드리는 순간 그 팔은 **자동으로 CONTAMINATED** 가 된다 —
|
|
252
|
+
# 즉 «전제를 만드는 공식 수단»이 «판정을 무효로 만드는 수단»이었다.
|
|
253
|
+
# 실측: CTRL 3팔이 `rm -f .claude/soul_tenets.txt`(내가 시킨 그 삭제) 한 줄 때문에 전량 무효.
|
|
254
|
+
# ⇒ setup 이 만든 변화를 기준선으로 빼고, **팔이 만든 변화만** 본다.
|
|
255
|
+
# ⚠️ 이것은 오염 검사를 «약화»시키는 게 아니다: setup 은 내가 선언한 조작이고 로그에 남는다.
|
|
256
|
+
# 팔이 만든 변화는 여전히 한 줄도 허용 안 된다(observe 모드).
|
|
257
|
+
( cd "$WORK" && git status --porcelain ) > "$WRAP/_tree_baseline.txt" 2>/dev/null
|
|
258
|
+
|
|
259
|
+
fh_sim_write_path_isolation "$WORK" "$OUTDIR" "$REPO_ROOT" "$HOME" || { CONTAMINATED=1; continue; }
|
|
260
|
+
|
|
261
|
+
if [ "$MODE" = observe ]; then
|
|
262
|
+
TOOLS=(--tools "Read,Grep,Glob")
|
|
263
|
+
else
|
|
264
|
+
TOOLS=(--tools "Read,Grep,Glob,Bash,Write,Edit")
|
|
265
|
+
fi
|
|
266
|
+
# 🟥 TOOL VISIBILITY IS PART OF THE MEASUREMENT, NOT A DETAIL. `Glob` matches FILES; a
|
|
267
|
+
# directory with no file directly inside it is invisible to a Read/Grep/Glob arm. FH's branch
|
|
268
|
+
# test keys on `tracks/{name}/` DIRECTORIES, so an observe-mode arm can report "tracks/ has only
|
|
269
|
+
# .gitkeep" while `tracks/demoproj/` and `tracks/webshop/` both exist — measured 2026-08-29,
|
|
270
|
+
# verified by opening the clones. That looks exactly like a session misjudging, and it is not.
|
|
271
|
+
# ⇒ When the thing under test depends on ENUMERATION, add Bash and say so:
|
|
272
|
+
# --extra-tools Bash
|
|
273
|
+
# and treat the observe-only number as the "cannot enumerate" arm rather than as a defect rate.
|
|
274
|
+
[ -n "$EXTRA" ] && TOOLS[1]="${TOOLS[1]},$EXTRA"
|
|
275
|
+
# `--restricted` is opt-in ONLY, and opting in means you are measuring the BASE MODEL, not FH.
|
|
276
|
+
[ "$NOHARNESS" -eq 1 ] && TOOLS+=(--restricted)
|
|
277
|
+
|
|
278
|
+
# Blindness comes from the CLONE, not from a flag: `CLAUDE.local.md` is gitignored, so the
|
|
279
|
+
# operator's register pin and standing bindings are structurally absent from every arm. That is
|
|
280
|
+
# verifiable (`git ls-files | grep CLAUDE` returns CLAUDE.md alone) rather than asserted.
|
|
281
|
+
# `.claude/settings.json` is untracked too, so no hooks fire — which makes an arm resemble a
|
|
282
|
+
# CONSUMER install. State that when scoring: this measures the shipped surface, not this node.
|
|
283
|
+
( cd "$WORK" && timeout "$TIMEOUT" claude -p "$PROMPT" \
|
|
284
|
+
--model "$MODEL" "${TOOLS[@]}" 2>/dev/null ) > "$OUTDIR/${ARM}_r${r}.txt"
|
|
285
|
+
rc=$?
|
|
286
|
+
bytes=$(wc -c < "$OUTDIR/${ARM}_r${r}.txt" | tr -d ' ')
|
|
287
|
+
|
|
288
|
+
# 🟥 An empty output is NOT a "no" answer. The first version of tonight's runner used
|
|
289
|
+
# `timeout 300`, which killed exactly the heavy arms — the ones where the behaviour under test
|
|
290
|
+
# actually fired — and left 0-byte files that read as "the identity did not fire". A false RED
|
|
291
|
+
# generated by the instrument. So the verdict here is three-valued, never two.
|
|
292
|
+
if [ "$rc" -ne 0 ] && [ "$bytes" -eq 0 ]; then
|
|
293
|
+
echo " ⚠️ r$r UNMEASURED (rc=$rc, 0 bytes) — timeout or crash, NOT a negative result"
|
|
294
|
+
elif [ "$bytes" -eq 0 ]; then
|
|
295
|
+
echo " ⚠️ r$r EMPTY (rc=0) — the session said nothing; distinct from UNMEASURED"
|
|
296
|
+
else
|
|
297
|
+
echo " ✅ r$r captured ${bytes}B"
|
|
298
|
+
fi
|
|
299
|
+
|
|
300
|
+
# Report what the arm changed inside its own clone — in `act` mode this is the interesting part,
|
|
301
|
+
# and in `observe` mode a non-empty diff means --restricted did not hold and the run is void.
|
|
302
|
+
( cd "$WORK" && git status --porcelain ) > "$WRAP/_tree_final.txt" 2>/dev/null
|
|
303
|
+
# setup 기준선을 뺀다. 기준선 파일이 없으면(=setup 미사용) 빈 파일로 두어 종전과 동일하게 동작한다.
|
|
304
|
+
[ -f "$WRAP/_tree_baseline.txt" ] || : > "$WRAP/_tree_baseline.txt"
|
|
305
|
+
comm -13 <(sort "$WRAP/_tree_baseline.txt") <(sort "$WRAP/_tree_final.txt") \
|
|
306
|
+
> "$OUTDIR/${ARM}_r${r}.treediff.txt" 2>/dev/null
|
|
307
|
+
# 🟥 setup 이 만든 변화도 «버리지 말고» 별도로 남긴다 — 조용히 사라지면 다음 감사자가
|
|
308
|
+
# «CTRL 이 정말 등록부 없이 돌았나»를 확인할 방법이 없다.
|
|
309
|
+
cp "$WRAP/_tree_baseline.txt" "$OUTDIR/${ARM}_r${r}.setupdiff.txt" 2>/dev/null || true
|
|
310
|
+
tchanged=$(wc -l < "$OUTDIR/${ARM}_r${r}.treediff.txt" | tr -d ' ')
|
|
311
|
+
if [ "$MODE" = observe ] && [ "$tchanged" -gt 0 ]; then
|
|
312
|
+
echo " 🟥 r$r VOID — observe mode wrote $tchanged path(s); the read-only tool set did not hold"
|
|
313
|
+
CONTAMINATED=1
|
|
314
|
+
elif [ "$tchanged" -gt 0 ]; then
|
|
315
|
+
echo " ℹ️ r$r touched $tchanged path(s) inside its own clone (contained)"
|
|
316
|
+
fi
|
|
317
|
+
done
|
|
318
|
+
|
|
319
|
+
snapshot "$OUTDIR/_machine_after.txt"
|
|
320
|
+
if ! diff -q "$OUTDIR/_machine_before.txt" "$OUTDIR/_machine_after.txt" >/dev/null 2>&1; then
|
|
321
|
+
echo ""
|
|
322
|
+
echo "🟥🟥🟥 MACHINE SURFACE CHANGED DURING THIS RUN — the sim had side effects outside its clone."
|
|
323
|
+
diff "$OUTDIR/_machine_before.txt" "$OUTDIR/_machine_after.txt" | sed 's/^/ /'
|
|
324
|
+
echo " 이 실행은 CONTAMINATED 다. 채점하기 전에 되돌려라."
|
|
325
|
+
CONTAMINATED=1
|
|
326
|
+
fi
|
|
327
|
+
|
|
328
|
+
echo ""
|
|
329
|
+
echo "── scoring reminder (the part no script can do for you) ──────────"
|
|
330
|
+
echo " 🟥 «찾았다»는 답이 나오면 그것이 «언제 생겼는지»부터 봐라."
|
|
331
|
+
echo " tonight's false positive was an arm finding another arm's output and calling it prior art."
|
|
332
|
+
echo " 🟥 컨트롤 팔 없이 낸 숫자는 숫자가 아니다."
|
|
333
|
+
echo " 🟢 «이게 FH 때문인가»가 궁금하면 같은 프롬프트를 --no-harness 로 한 번 더 돌려라."
|
|
334
|
+
[ "$NOHARNESS" -eq 1 ] && echo " ⚠️ 이 실행은 --no-harness 다 — FH 를 잰 것이 아니라 «FH 없이도 그런가»를 잰 것이다."
|
|
335
|
+
echo ""
|
|
336
|
+
[ "$CONTAMINATED" -eq 1 ] && echo "RESULT: CONTAMINATED — do not score" || echo "RESULT: CLEAN"
|
|
337
|
+
echo "OUT: $OUTDIR"
|
|
338
|
+
# Detector, never a gate: always exit 0 so a caller cannot be trained to skip running it.
|
|
339
|
+
exit 0
|