@chrono-meta/fh-gate 2.8.0 → 2.9.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 +33 -5
- package/.claude-plugin/marketplace.json +2 -2
- package/CLAUDE.md +47 -12
- package/README.ja.md +39 -31
- package/README.ko.md +38 -30
- package/README.md +41 -35
- package/README.zh.md +36 -30
- package/docs/ETHOS.md +13 -8
- package/docs/GATE_DAY.md +235 -0
- package/docs/OUTPUT_EVIDENCE.md +13 -2
- package/docs/codex-compat.md +10 -2
- package/knowledge/shared/harness-core/agents_md_runtime_details.md +10 -3
- package/knowledge/shared/harness-core/fh_three_layer_canon.md +20 -2
- package/knowledge/shared/harness-core/field_verdict_crossfamily_gate.md +23 -5
- package/knowledge/shared/harness-core/harness_incubator_doctrine.md +6 -1
- package/knowledge/shared/harness-core/ship_readiness_gate.md +2 -2
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +31 -0
- package/knowledge/shared/rules/multi_session_close_protocol.md +8 -1
- package/package.json +10 -2
- 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 +70 -0
- package/plugins/fh-meta/skills/cross-ecosystem-synergy-detection/SKILL.md +93 -3
- package/scripts/chamber_candidate_collect.sh +71 -13
- package/scripts/mapped_tracks.sh +113 -0
- package/scripts/package_coverage_check.sh +54 -0
- package/scripts/prior_art_prompt.sh +49 -2
- package/scripts/selfcheck.sh +30 -2
- package/scripts/session_close_check.sh +56 -3
- package/scripts/test_chamber_sig_lanes.sh +151 -0
- package/scripts/test_leak_scan_control_lanes.sh +163 -0
- package/scripts/test_mapped_tracks_lanes.sh +162 -0
- package/scripts/test_peer_worktree_detect_lanes.sh +138 -0
- package/scripts/test_prepush_destructive_lanes.sh +366 -0
- package/scripts/test_prior_art_prompt_lanes.sh +48 -0
- package/scripts/test_regression_guard_ci_lanes.sh +124 -0
- package/templates/predelete_check.test.sh +56 -0
- package/templates/regression_guard.sh +75 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# mapped_tracks.sh — the ONE mechanical answer to "how many field harnesses are mapped in this hub?"
|
|
3
|
+
#
|
|
4
|
+
# WHY THIS EXISTS (measured 2026-08-22, known-pair in one run):
|
|
5
|
+
# main checkout : 11 mapped tracks
|
|
6
|
+
# a worktree : 1
|
|
7
|
+
# The mapping signal is the PRESENCE of `tracks/<name>/`, and that signal cannot survive into a
|
|
8
|
+
# worktree for two independent reasons: (a) `tracks/**` is gitignored, and (b) at least one mapped
|
|
9
|
+
# track (`pmh-dev`) is an EMPTY directory, which git cannot carry even if it were tracked. So a
|
|
10
|
+
# worktree does not have a smaller count — it has a STRUCTURALLY BLIND one.
|
|
11
|
+
#
|
|
12
|
+
# WHY THAT WAS SILENT: the synergy skill's Step 3-b closes as `run(n pairs)` or
|
|
13
|
+
# `skipped(<2 mapped tracks)`, and BOTH are mandatory-pass values. A worktree run therefore closed
|
|
14
|
+
# GREEN while blind — the same shape as the ①-c peer-detection defect fixed the same day, on the
|
|
15
|
+
# instrument that grades identity ④ itself.
|
|
16
|
+
#
|
|
17
|
+
# MECHANIZED AT N=2 BY CLASS, NOT BY COUNT: `operations.md` allows mechanization at "N>=3 **or the
|
|
18
|
+
# same class recurring on another surface**". This class (a count over gitignored, un-committable
|
|
19
|
+
# state read from cwd instead of the repo's common root) hit two distinct surfaces on 2026-08-22 —
|
|
20
|
+
# ①-c peer placement and Step 3-b mapped-track counting. Recorded here so the threshold is not
|
|
21
|
+
# claimed loosely.
|
|
22
|
+
#
|
|
23
|
+
# NOT-FOUND IS NOT ZERO. If the root cannot be resolved or `tracks/` is not there, this exits 3 with
|
|
24
|
+
# status=UNMEASURED. It never prints `count=0` for a question it could not ask.
|
|
25
|
+
#
|
|
26
|
+
# Usage: bash scripts/mapped_tracks.sh [--count-only]
|
|
27
|
+
# Exit: 0 = measured · 3 = UNMEASURED (a NON-PASS; never fold into "0 mapped") · 2 = bad usage
|
|
28
|
+
|
|
29
|
+
set -uo pipefail
|
|
30
|
+
|
|
31
|
+
COUNT_ONLY=0
|
|
32
|
+
case "${1:-}" in
|
|
33
|
+
--count-only) COUNT_ONLY=1 ;;
|
|
34
|
+
"") ;;
|
|
35
|
+
*) echo "usage: $0 [--count-only]" >&2; exit 2 ;;
|
|
36
|
+
esac
|
|
37
|
+
|
|
38
|
+
_die_unmeasured() {
|
|
39
|
+
echo "status=UNMEASURED"
|
|
40
|
+
echo "reason=$1"
|
|
41
|
+
echo "# not-found != zero — do NOT read this as 'no mapped tracks'"
|
|
42
|
+
exit 3
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
command -v git >/dev/null 2>&1 || _die_unmeasured "git-absent"
|
|
46
|
+
|
|
47
|
+
# Resolve the hub root the way this repo already sanctions for worktree-reachable evidence
|
|
48
|
+
# (`templates/.git-hooks/pre-commit` §EVIDENCE_ROOT): `--git-common-dir` returns the MAIN tree's .git
|
|
49
|
+
# from inside any worktree.
|
|
50
|
+
# ⚠️ Deliberately NOT the `$(cmd || echo "")` form used there. Under a `cmd || fallback` the guard
|
|
51
|
+
# depends on the failing command leaving stdout empty; the canonical form separates the value from
|
|
52
|
+
# the status so a command that fails WHILE printing cannot be mistaken for a success.
|
|
53
|
+
_repo_root=$(git rev-parse --show-toplevel 2>/dev/null); _rc_root=$?
|
|
54
|
+
[ "$_rc_root" -eq 0 ] && [ -n "$_repo_root" ] || _die_unmeasured "not-in-a-git-repo"
|
|
55
|
+
|
|
56
|
+
_gcd=$(git rev-parse --git-common-dir 2>/dev/null); _rc_gcd=$?
|
|
57
|
+
if [ "$_rc_gcd" -ne 0 ] || [ -z "$_gcd" ]; then
|
|
58
|
+
HUB_ROOT="$_repo_root" # degraded but named below, not silently
|
|
59
|
+
ROOT_SRC="repo-root(common-dir-unresolved)"
|
|
60
|
+
else
|
|
61
|
+
case "$_gcd" in
|
|
62
|
+
# `--git-common-dir` returns a RELATIVE path ('.git') at a repo root and an ABSOLUTE one inside a
|
|
63
|
+
# worktree. Comparing or using it raw is exactly the bug this script exists to close.
|
|
64
|
+
/*) HUB_ROOT=$(dirname "$_gcd") ;;
|
|
65
|
+
*) HUB_ROOT=$(dirname "$_repo_root/$_gcd") ;;
|
|
66
|
+
esac
|
|
67
|
+
ROOT_SRC="git-common-dir"
|
|
68
|
+
fi
|
|
69
|
+
# Normalise both sides before comparing — a raw string compare would reproduce the defect.
|
|
70
|
+
HUB_ROOT=$(cd "$HUB_ROOT" 2>/dev/null && pwd -P) || _die_unmeasured "hub-root-unreadable"
|
|
71
|
+
CWD_ROOT=$(cd "$_repo_root" 2>/dev/null && pwd -P) || CWD_ROOT="$_repo_root"
|
|
72
|
+
|
|
73
|
+
IN_WORKTREE=no
|
|
74
|
+
[ "$HUB_ROOT" != "$CWD_ROOT" ] && IN_WORKTREE=yes
|
|
75
|
+
|
|
76
|
+
[ -d "$HUB_ROOT/tracks" ] || _die_unmeasured "no-tracks-dir-at:$HUB_ROOT"
|
|
77
|
+
|
|
78
|
+
# 🟥 존재만 보면 부족하다 — «못 읽었다» 가 «없다» 로 접힌다 (2026-08-23 실측, 4케이스).
|
|
79
|
+
# 이 파일 머리가 "not-found != zero" 를 이유로 존재하는데, 초판은 그 규율을 **존재 검사 한 분기에만**
|
|
80
|
+
# 적용했다: 디렉터리가 있는데 읽을 수 없으면 아래 글롭이 조용히 0건을 내고 `status=OK count=0` 이
|
|
81
|
+
# 나간다 — 진짜로 매핑이 0개인 경우와 **출력이 글자 하나 안 다르다.** 그리고 하류(Step 3-b)에서
|
|
82
|
+
# 그 0 은 `skipped(<2 mapped tracks)` = **pass 값**으로 접히므로, 권한 문제가 초록으로 닫힌다.
|
|
83
|
+
# chmod 755 → -r ✓ -x ✓ 글롭 1 chmod 111 → -r ✗ -x ✓ 글롭 0 ← `-x` 만 보면 통과시킨다
|
|
84
|
+
# chmod 500 → -r ✓ -x ✓ 글롭 1 chmod 000 → -r ✗ -x ✗ 글롭 0
|
|
85
|
+
# ⇒ 둘 다 요구한다. 이 조합이 «글롭이 셀 수 있는가» 와 네 케이스 전부에서 일치한다(레인 P-1·P-2).
|
|
86
|
+
{ [ -r "$HUB_ROOT/tracks" ] && [ -x "$HUB_ROOT/tracks" ]; } || _die_unmeasured "tracks-dir-unreadable-at:$HUB_ROOT"
|
|
87
|
+
|
|
88
|
+
# Count. Underscore-prefixed dirs are META (_meta/_audit/_contrib/_chamber…) and are not mapped
|
|
89
|
+
# projects — the test is a LEADING underscore only.
|
|
90
|
+
# ⚠️ Measured slip, kept as a comment because it cost a re-measure: a `case "$n" in *_*)` filter
|
|
91
|
+
# also eats `the_bible`, whose underscore is in the middle. Anchor the pattern.
|
|
92
|
+
NAMES=""; COUNT=0
|
|
93
|
+
for _d in "$HUB_ROOT"/tracks/*/; do
|
|
94
|
+
[ -d "$_d" ] || continue # unmatched glob stays literal in sh
|
|
95
|
+
_n=$(basename "$_d")
|
|
96
|
+
case "$_n" in _*) continue ;; esac
|
|
97
|
+
COUNT=$((COUNT + 1))
|
|
98
|
+
NAMES="$NAMES $_n"
|
|
99
|
+
done
|
|
100
|
+
|
|
101
|
+
if [ "$COUNT_ONLY" = "1" ]; then echo "$COUNT"; exit 0; fi
|
|
102
|
+
|
|
103
|
+
echo "status=OK"
|
|
104
|
+
echo "hub_root=$HUB_ROOT"
|
|
105
|
+
echo "root_source=$ROOT_SRC"
|
|
106
|
+
echo "in_worktree=$IN_WORKTREE"
|
|
107
|
+
echo "count=$COUNT"
|
|
108
|
+
echo "names=${NAMES# }"
|
|
109
|
+
if [ "$IN_WORKTREE" = "yes" ]; then
|
|
110
|
+
echo "# NOTE: running from a worktree; the count above is the MAIN tree's, resolved via"
|
|
111
|
+
echo "# --git-common-dir. The worktree's own tracks/ is NOT the answer to this question."
|
|
112
|
+
fi
|
|
113
|
+
exit 0
|
|
@@ -127,8 +127,62 @@ ACCEPTED_ABSENT=(
|
|
|
127
127
|
# 「출하된 레인의 **주체**가 출하되나」를 안 본다. 그 갭은 아직 안 닫혔다(명시 잔여).
|
|
128
128
|
"scripts/test_satellite_publish_gate_lanes.sh"
|
|
129
129
|
"scripts/test_satellite_profile_schema_lanes.sh"
|
|
130
|
+
# · 2026-08-22, 파괴적-op 앵커 배선이 만든 셋. **같은 선례의 재현이고, 이 검사기가 또 잡았다** —
|
|
131
|
+
# `test_prepush_destructive_lanes.sh` 를 files[] 에 넣고 `selfcheck.sh` 의 pair-표에 전체
|
|
132
|
+
# 경로 두 줄을 쓴 순간, 그 두 파일이 이름 대는 것들이 팬텀이 됐다. 위 블록이 예고한 그대로다.
|
|
133
|
+
# ⓐ test_prepush_destructive_liveness.sh — 일부러 안 싣는다. 7단계 중 둘이 **레포-개발 전용
|
|
134
|
+
# 컨트롤**이라 소비자 install 에서 정직할 수 없다: ⑥ orphan 은 주체
|
|
135
|
+
# `templates/predelete_check.test.sh` 가 미출하라 **부재로 FAIL**(옳지 않은 red), ⑦
|
|
136
|
+
# containment 는 소비자 트리가 보통 git work tree 가 아니라 **잴 게 없다**. 싣게 하려면
|
|
137
|
+
# 패키지-모드 라우팅을 그 두 단계에 심어야 하는데 그건 소비자에게 값이 없는 코드다.
|
|
138
|
+
# ⓑ 🟥 **철회 — 이 자리에 있던 `test_new_code_anchor_lanes.sh` 항목을 뺐다.** 그 항목이
|
|
139
|
+
# 필요했던 유일한 이유는 `test_prepush_destructive_lanes.sh` 의 한 주석이 그 파일을 경로로
|
|
140
|
+
# 인용했기 때문인데, **그 인용이 이번 라운드에 재조준됐다**(추적되는 선례로). 단독 착지
|
|
141
|
+
# 준비 중 발견 — 안 고쳤으면 **커밋되지 않는 파일을 가리키는 팬텀 참조**를 출하할 뻔했다.
|
|
142
|
+
# 인용이 사라지면 예외도 사라져야 한다. **소비되지 않는 예외는 다음 진짜 누락을 삼킨다.**
|
|
143
|
+
# ⓒ templates/predelete_check.test.sh — 주체 `templates/predelete_check.sh` 는 **출하되는데**
|
|
144
|
+
# 이 앵커는 안 나간다. 🟥 위 test_chamber_run_lanes 와 **같은 모양의 빚**이고, 클린한 답이
|
|
145
|
+
# 아니다. 여기 등재하는 이유도 같다: files[] 추가는 소비자-대면 변경이라 false-FAIL 이
|
|
146
|
+
# 없음을 tarball 모드로 따로 증명해야 하는데, 이 델타는 **배선 델타**다. 카드로 이월.
|
|
147
|
+
"scripts/test_prepush_destructive_liveness.sh"
|
|
148
|
+
# 🟥 ⓒ 는 **철회했다 — cross-family R2 지적이 맞았다.** 초판이
|
|
149
|
+
# `templates/predelete_check.test.sh` 를 여기 넣고 «위 chamber 건과 같은 빚» 이라고 적었는데,
|
|
150
|
+
# 그 둘은 같지 않다: chamber 는 «주체가 출하되는데 앵커가 안 나간다» 를 **빚으로 남긴** 것이고,
|
|
151
|
+
# 여기 등재는 그 빚을 **침묵시킨다**. 이 목록의 뜻은 「출하 안 하는 게 옳다」이지
|
|
152
|
+
# 「출하해야 하는데 아직 안 했다」가 아니다. 후자를 여기 넣으면 **다음 사람이 같은 누락을
|
|
153
|
+
# 만나도 이 예외에 걸려 안 보인다** — 지적 원문: *"A future shipped reference to this same
|
|
154
|
+
# missing anchor will also be accepted, not surfaced."*
|
|
155
|
+
# ⇒ `files[]` 에 실었다. 주체 `templates/predelete_check.sh` 가 이미 출하되므로 소비자는
|
|
156
|
+
# 자기 enumerate 도구를 검증할 수 있게 되고, 부수로 liveness stage ⑥ 의 오탐(주체 부재로
|
|
157
|
+
# ORPHANED)도 닫힌다.
|
|
158
|
+
# ⓓ 🟥 **그리고 ⓑ 의 사유를 쓰자 그 사유가 팬텀을 만들었다.** 위 주석이 주체 이름을
|
|
159
|
+
# 경로로 적는데 **이 파일 자신이 shipped 문서**라, 「안 싣는 이유」를 설명한 행위가
|
|
160
|
+
# 곧 「shipped 문서가 미출하 경로를 가리킴」이 됐다. 계기가 자기 수리를 잡은 것이고,
|
|
161
|
+
# 위 블록이 예고한 형태(*전체 경로를 shipped 파일에 쓰면 팬텀이 된다*)의 **3차 재현**이다.
|
|
162
|
+
# 주체 자신도 같은 사유로 등재한다 — 신규 게이트 둘은 **이 레포 전용**이다(추가 파일을
|
|
163
|
+
# 이 레포 레인 코퍼스에 대고 판정한다). 소비자 트리엔 판정 대상이 없다.
|
|
130
164
|
"scripts/residency_closure_scan.py"
|
|
131
165
|
"scripts/test_residency_closure_lanes.sh"
|
|
166
|
+
# ── caller-zero-ratchet, 2026-08-22. 셋 다 **싣는 것이 틀렸다** — 「아직 안 실었다」가 아니다 ──
|
|
167
|
+
# 이 게이트는 「production 스크립트에 디스패처가 있나」를 **이 레포의 러너 표면**에 대고 판정한다.
|
|
168
|
+
# 그 표면의 하나가 `.github/workflows/**` 이고, **워크플로 디렉터리는 files[] 에 없다.** 그러므로
|
|
169
|
+
# 소비자 트리에서 이 검사기를 돌리면 워크플로에서만 디스패치되는 스크립트들이 전부 caller 0 으로
|
|
170
|
+
# 떨어지고, 그것들은 소비자의 `caller_zero_baseline.txt` 에 선언돼 있지 않으므로 **UNDECLARED →
|
|
171
|
+
# exit 1**. 즉 출하하면 **모든 신선한 설치에서 100% 적색**이다 — CLAUDE.md 가 「모든 새 install 을
|
|
172
|
+
# 막는 게이트는 엄격한 게이트가 아니라 우회 훈련기」라고 못박은 그 형태이고, 바로 위
|
|
173
|
+
# outbound_query_guard 블록과 **같은 사유**다.
|
|
174
|
+
# 앵커도 같이 안 나간다. 주체 부재라는 짝 규칙 말고 **자기 자신의 사유가 하나 더 있다**: 마지막
|
|
175
|
+
# 레인(L27)이 `.github/workflows/caller-zero-ratchet.yml` 을 읽어 워크플로가 리졸버를 인라인으로
|
|
176
|
+
# 되돌리지 않았는지 본다. 그 파일이 없는 트리에서 그 레인은 **부재를 결함으로 읽어 적색**이 된다.
|
|
177
|
+
# 🟥 위 ⓒ 의 교훈은 여기 **해당하지 않는다**: 저건 「주체는 출하되는데 앵커만 빠진」 빚이었고,
|
|
178
|
+
# 여기는 주체·앵커·베이스리졸버가 **셋 다** 소비자에게 판정 대상이 없다. 침묵시키는 게 아니라
|
|
179
|
+
# 애초에 그쪽 트리에 질문이 없다.
|
|
180
|
+
# ⚠️ 명시 잔여: 그래서 이 게이트는 **이 레포에서만** 회귀를 막는다. 소비자 설치본의
|
|
181
|
+
# built-but-not-wired 는 이것으로 안 잡히고, 그걸 잡으려면 러너 표면 목록을 패키지 모드로
|
|
182
|
+
# 라우팅하는 별도 설계가 필요하다 — 안 했다.
|
|
183
|
+
"scripts/script_caller_ratchet.sh"
|
|
184
|
+
"scripts/ratchet_base_resolve.sh"
|
|
185
|
+
"scripts/test_script_caller_ratchet_lanes.sh"
|
|
132
186
|
# ── The two settings destinations, surfaced 2026-08-13 by fixing this file's own extractor ────
|
|
133
187
|
# These were invisible until the `js|json` alternation below was corrected: every `.json`
|
|
134
188
|
# reference in every shipped doc was being truncated to `.js`, a path that exists nowhere, so
|
|
@@ -129,9 +129,56 @@ esac
|
|
|
129
129
|
# 날짜로 degrade(침묵이 아니라 «덜 자주» 쪽).
|
|
130
130
|
_SID_SAFE=$(printf '%s' "${SID:-}" | tr -cd 'A-Za-z0-9_-')
|
|
131
131
|
STAMP="${CLAUDE_PROJECT_DIR:-.}/.claude/.prior_art_prompted_${_SID_SAFE:-$(date +%Y%m%d)}"
|
|
132
|
-
|
|
132
|
+
|
|
133
|
+
# ③-b 🟥 **세션당 1회로는 T2 를 구조적으로 못 잡는다** (실측 2026-08-22, 한 세션 전수 재생).
|
|
134
|
+
# 이 훅의 존재 이유는 이 파일 머리가 적어둔 «T2 = 컨텍스트가 길어진 뒤 **또** 새로 빌드업할 때» 인데,
|
|
135
|
+
# 스탬프가 세션 스코프면 그 «또» 가 영원히 억제된다. 한 세션(08:29~13:33)에서 새 메커니즘 3건이
|
|
136
|
+
# 08:38 · 13:06 · 13:07 에 났고, 세션당 1회는 **첫 건만** 띄웠다 — 억제된 둘이 정확히 T2 다.
|
|
137
|
+
# ⇒ 시간 재무장으로 바꾼다. 마지막 **발화** 시각에서 N초가 지나면 다시 무장한다.
|
|
138
|
+
#
|
|
139
|
+
# 🟥 N 은 임의로 골랐다. 이 값은 데이터가 정한 것이 아니다 — 같은 실측에서 **N=1h·2h·4h 가 전부
|
|
140
|
+
# 같은 결과(2 발화)** 를 냈다. 즉 **데이터가 N 을 판별하지 않았다**, n=1 세션이고, 그 세션의
|
|
141
|
+
# 간극이 4.5시간이라 임계에 둔감했을 뿐이다. §Mechanization Boundary 의 «오늘의 판단을 내일의
|
|
142
|
+
# 천장으로 굳히지 마라» 에 걸리는 자리라, 상수를 박는 대신 **아래 로그를 남겨서 다음 세션들이
|
|
143
|
+
# 실제 분포를 쌓게 한다.** N 재정은 그 로그 위에서만 해라 — 이 주석을 지우지 말고.
|
|
144
|
+
# 왜 «대상 파일당 1회» 가 아닌가: 같은 실측에서 13:06 `mapped_tracks.sh` 와 13:07 그 레인 스위트는
|
|
145
|
+
# **한 메커니즘**이다. 파일당이면 13:07 이 같은 메커니즘을 재질문하는 **오발화**가 된다. 이 파일
|
|
146
|
+
# 머리가 «오발화는 미발화보다 훨씬 비싸다(소음 = 자기무력화 경로)» 라고 못박은 방향과 반대다.
|
|
147
|
+
PRIOR_ART_REARM_SECONDS="${PRIOR_ART_REARM_SECONDS:-7200}" # 2h — 위 단락이 이 값의 출처이자 한계다
|
|
148
|
+
|
|
149
|
+
# 시계는 주입 가능하다 — 픽스처가 4.5시간을 실시간으로 기다릴 수는 없다. 테스트 시임일 뿐이고
|
|
150
|
+
# 억제를 **끄지는** 못한다(값을 넣어도 아래 산술을 그대로 통과해야 한다).
|
|
151
|
+
_NOW="${PRIOR_ART_NOW:-$(date +%s)}"
|
|
152
|
+
case "$_NOW" in ''|*[!0-9]*) _NOW=$(date +%s) ;; esac
|
|
153
|
+
|
|
154
|
+
_LAST=""
|
|
155
|
+
if [ -f "$STAMP" ]; then
|
|
156
|
+
_LAST=$(cat "$STAMP" 2>/dev/null | tr -cd '0-9')
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
# 로그. 🟥 발화만이 아니라 **억제도** 남긴다 — 「몇 건 억제」만 세면 그것이 옳은 억제였는지 못
|
|
160
|
+
# 가른다. 그래서 무엇을(파일명) · 직전 발화로부터 얼마나(초) 를 같이 적는다.
|
|
161
|
+
# 실패해도 판정은 안 바뀐다(로깅은 게이트가 아니다).
|
|
162
|
+
_PA_LOG="${CLAUDE_PROJECT_DIR:-.}/.claude/.prior_art_events.tsv"
|
|
163
|
+
_pa_log() { # $1=FIRE|SUPPRESS $2=elapsed-or-dash
|
|
164
|
+
mkdir -p "$(dirname "$_PA_LOG")" 2>/dev/null || true
|
|
165
|
+
printf '%s\t%s\t%s\t%s\t%s\n' \
|
|
166
|
+
"$(date -u +%Y-%m-%dT%H:%M:%SZ 2>/dev/null)" "$1" "${_SID_SAFE:-nosid}" "$2" "$FILE" \
|
|
167
|
+
>> "$_PA_LOG" 2>/dev/null || true
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if [ -n "$_LAST" ]; then
|
|
171
|
+
_ELAPSED=$(( _NOW - _LAST ))
|
|
172
|
+
if [ "$_ELAPSED" -lt "$PRIOR_ART_REARM_SECONDS" ]; then
|
|
173
|
+
_pa_log SUPPRESS "$_ELAPSED"
|
|
174
|
+
exit 0
|
|
175
|
+
fi
|
|
176
|
+
_pa_log FIRE "$_ELAPSED"
|
|
177
|
+
else
|
|
178
|
+
_pa_log FIRE -
|
|
179
|
+
fi
|
|
133
180
|
mkdir -p "$(dirname "$STAMP")" 2>/dev/null || true
|
|
134
|
-
|
|
181
|
+
printf '%s\n' "$_NOW" > "$STAMP" 2>/dev/null || true
|
|
135
182
|
|
|
136
183
|
MSG="🔎 새 메커니즘을 쓰려는 참이다 ($(basename "$FILE")). 짓기 전에 **책장부터, 없으면 도서관** —
|
|
137
184
|
안 했으면 지금 하고, 했으면 이 줄은 무시해라.
|
package/scripts/selfcheck.sh
CHANGED
|
@@ -531,17 +531,30 @@ fi
|
|
|
531
531
|
# test_capability_entrypoint_shipping.sh pins two (degrade_probe_capability.sh and
|
|
532
532
|
# psa_probe_capability.sh); degrade is named here as the sentinel — the suite itself checks both and
|
|
533
533
|
# fails if either is gone, so nothing is lost by not listing both in this table.
|
|
534
|
+
# test_script_caller_ratchet_lanes.sh is the second of that shape: it pins BOTH
|
|
535
|
+
# scripts/script_caller_ratchet.sh (the checker) and scripts/ratchet_base_resolve.sh (the base
|
|
536
|
+
# resolver its L24–L26 lanes execute), and it hard-exits 1 naming the missing file if either is
|
|
537
|
+
# gone. The checker is the sentinel because it is the one whose absence means the gate itself is
|
|
538
|
+
# gone; the resolver's absence is a narrower failure the suite still reports by name. Neither
|
|
539
|
+
# script ships — both, and this anchor, are declared in package_coverage_check.sh ACCEPTED_ABSENT.
|
|
540
|
+
# On a consumer install the SUBJECT arm fires first and `_ships_per_files` returns 1, so the row
|
|
541
|
+
# resolves to "SKIP (subject not in files[], and absent)" — the anchor arm is never reached.
|
|
534
542
|
_LANE_TO=""; command -v timeout >/dev/null 2>&1 && _LANE_TO="timeout 300"
|
|
535
543
|
for _pair in \
|
|
536
544
|
"scripts/degrade_probe_capability.sh|scripts/test_capability_entrypoint_shipping.sh" \
|
|
537
545
|
"scripts/chamber_run.sh|scripts/test_chamber_run_lanes.sh" \
|
|
546
|
+
"scripts/chamber_candidate_collect.sh|scripts/test_chamber_sig_lanes.sh" \
|
|
538
547
|
"scripts/destructive_pre_gate.sh|scripts/test_destructive_pre_gate_lanes.sh" \
|
|
548
|
+
"templates/.git-hooks/pre-push|scripts/test_prepush_destructive_lanes.sh" \
|
|
549
|
+
"templates/.git-hooks/pre-push|scripts/test_prepush_destructive_liveness.sh" \
|
|
550
|
+
"scripts/session_close_check.sh|scripts/test_peer_worktree_detect_lanes.sh" \
|
|
539
551
|
"scripts/env_purity_scan.sh|scripts/test_env_purity_lanes.sh" \
|
|
540
552
|
"scripts/frontier_digest_daily.sh|scripts/test_frontier_digest_retry.sh" \
|
|
541
553
|
"scripts/knowledge_seam_check.sh|scripts/test_knowledge_seam_lanes.sh" \
|
|
542
554
|
"templates/.git-hooks/pre-commit|scripts/test_marker_crossfamily_lanes.sh" \
|
|
543
555
|
"templates/.git-hooks/pre-commit|scripts/test_marker_floor_lanes.sh" \
|
|
544
556
|
".github/workflows/regression-guard.yml|scripts/test_regression_guard_ci_lanes.sh" \
|
|
557
|
+
".github/workflows/validate.yml|scripts/test_leak_scan_control_lanes.sh" \
|
|
545
558
|
"templates/.git-hooks/pre-commit|scripts/test_marker_standpoint_lanes.sh" \
|
|
546
559
|
"templates/.git-hooks/pre-commit|scripts/test_marker_thirdparty_lanes.sh" \
|
|
547
560
|
"templates/.git-hooks/pre-commit|scripts/test_marker_soul_check_lanes.sh" \
|
|
@@ -549,7 +562,9 @@ for _pair in \
|
|
|
549
562
|
"scripts/reviewer_capability_corpus.tsv|scripts/test_reviewer_capability_conformance.sh" \
|
|
550
563
|
"scripts/field_canon_preload.sh|scripts/test_field_canon_lanes.sh" \
|
|
551
564
|
"scripts/stale_clone_guard.sh|scripts/test_stale_clone_guard_lanes.sh" \
|
|
552
|
-
"plugins/fh-commons/skills/ko-tech-writer/SKILL.md|scripts/test_ko_tech_writer_lanes.sh"
|
|
565
|
+
"plugins/fh-commons/skills/ko-tech-writer/SKILL.md|scripts/test_ko_tech_writer_lanes.sh" \
|
|
566
|
+
"scripts/script_caller_ratchet.sh|scripts/test_script_caller_ratchet_lanes.sh" \
|
|
567
|
+
"scripts/mapped_tracks.sh|scripts/test_mapped_tracks_lanes.sh"
|
|
553
568
|
do
|
|
554
569
|
_subj="${_pair%%|*}"; _anc="${_pair##*|}"; _lbl="${_anc##*/}"
|
|
555
570
|
if [ ! -f "$_subj" ]; then
|
|
@@ -1065,8 +1080,19 @@ else
|
|
|
1065
1080
|
fi
|
|
1066
1081
|
|
|
1067
1082
|
# listing_watch — 같은 형태. 🟥 이 블록을 «레인을 짓는 같은 커밋에서» 붙인다: 바로 위 주석이
|
|
1068
|
-
# 기록한 「레인은 지었는데 selfcheck 배선을 안 했다」 재발이
|
|
1083
|
+
# 기록한 「레인은 지었는데 selfcheck 배선을 안 했다」 재발이 **최소 다섯 번**이고, 그 다섯 다 CI 나
|
|
1069
1084
|
# lane-runner 가 뒤늦게 잡았다. 순서를 바꾸는 것이 유일한 처방이라 여기서 그렇게 한다.
|
|
1085
|
+
# 🟥 **2026-08-23 정정 — 「세 번」은 stale 이었다. 그리고 숫자보다 함의가 중요하다**: 네 번째는
|
|
1086
|
+
# 2026-08-22 에 났는데, **이 주석 바로 아래에서** 났다. 처방이 «읽히는 자리»에 있었는데도 재발한
|
|
1087
|
+
# 것이다. ⇒ 「주석을 더 잘 쓰자」가 아니라 **「살리언스로는 이 축이 안 닫힌다」**의 근거다.
|
|
1088
|
+
# (회수 경위: 그 관측은 폐기된 워크트리 사본에만 있었고, peer 세션이 버리기 전에 건져 올렸다.)
|
|
1089
|
+
# 🟥 **다섯 번째 = 바로 이 주석을 「네 번」으로 고친 그 커밋 자신이다** (2026-08-23, CI 적발).
|
|
1090
|
+
# 그 델타가 `:546` 의 `chamber_candidate_collect.sh|test_chamber_sig_lanes.sh` 배선 한 줄을
|
|
1091
|
+
# **의도 없이 지웠고**, 레인 파일은 그대로 남아 lane-runner 가 「돌리는 게 없는 스위트」로
|
|
1092
|
+
# 잡았다. 즉 **이 축을 서술하는 행위가 이 축의 다음 사례를 생산했다.** 자력 적발 0.
|
|
1093
|
+
# ⚠️ 이번 것은 앞의 넷과 형태가 하나 다르다 — 앞의 넷은 «배선을 안 붙였다»(누락)인데
|
|
1094
|
+
# 이건 «있던 배선을 지웠다»(회귀)다. 같은 계기(lane-runner)가 둘 다 잡았으므로 한 카운터에
|
|
1095
|
+
# 두지만, 처방이 갈릴 수 있다는 뜻이므로 접지 말고 여기 적어 둔다.
|
|
1070
1096
|
if [ ! -f scripts/listing_watch.sh ]; then
|
|
1071
1097
|
echo "FAIL scripts/listing_watch.sh is in package.json files[] but absent — a deleted subject, not a skip"
|
|
1072
1098
|
fail=1
|
|
@@ -1083,6 +1109,8 @@ fi
|
|
|
1083
1109
|
# 지으면서 여기 배선을 안 했고, `lane-runner` 가 «돌리는 게 없는 스위트는 산문이다» 로 CI 에서
|
|
1084
1110
|
# 잡았다. 아래 target_freeze 주석이 기록한 그 형태의 **최소 세 번째**다 — 즉 이건 개인 부주의가
|
|
1085
1111
|
# 아니라 «레인을 짓는 사람이 배선 지점을 안 본다» 는 구조적 순서 문제다.
|
|
1112
|
+
# ⚠️ 2026-08-23: 그 뒤 **네 번째**가 났다(위 listing_watch 주석 참조). 이 «세 번째»는 시점 기록이라
|
|
1113
|
+
# 그대로 두고, 누계는 위 주석이 갱신본이다 — 두 곳에 같은 카운터를 두면 하나는 반드시 낡는다.
|
|
1086
1114
|
if [ ! -f scripts/residency_admission_check.sh ]; then
|
|
1087
1115
|
echo "FAIL scripts/residency_admission_check.sh is wired into pre-commit but absent — a deleted subject, not a skip"
|
|
1088
1116
|
fail=1
|
|
@@ -139,6 +139,12 @@ if [ -z "${CLAUDE_CODE_CHILD_SESSION:-}${CLAUDE_CODE_AGENT:-}" ] && [ "${FH_PEER
|
|
|
139
139
|
: # solo/top-level surface — ①-c is out of scope here, and silence is the correct output
|
|
140
140
|
else
|
|
141
141
|
PEER_LIVE=0; PEER_UNKNOWN=0; PEER_STALE=0; PEER_SPARE=0; PEER_IDS=""
|
|
142
|
+
# Two more counters, added 2026-08-22. WHY they are SEPARATE values and not one bucket: a peer whose
|
|
143
|
+
# cwd resolves to a DIFFERENT repo has been placed — excluding it is a measurement. A peer whose cwd
|
|
144
|
+
# resolves to no repo at all has NOT been placed, and folding that into the same number would render
|
|
145
|
+
# an unmeasured thing as a decided one (not-found != zero, one level up from line 170's case).
|
|
146
|
+
PEER_OTHERREPO=0 # placed, and it is somebody else's repo → correctly excluded, stays quiet
|
|
147
|
+
PEER_OFFTREE=0 # cwd READ but placeable in neither this repo nor any repo → must not read as 0
|
|
142
148
|
SOCK_DIR="${FH_PEER_SOCK_DIR:-/tmp/cc-socks}"
|
|
143
149
|
# Self-exclusion must walk the ANCESTOR chain, not compare `$$`. This script is a grandchild of the
|
|
144
150
|
# session process that owns the socket, so `$$` never matches it — measured: the first run counted
|
|
@@ -155,6 +161,27 @@ _peer_cwd() { # $1=pid → cwd on stdout, empty if unresolvable
|
|
|
155
161
|
command -v lsof >/dev/null 2>&1 || return 0
|
|
156
162
|
lsof -a -p "$1" -d cwd -Fn 2>/dev/null | sed -n 's/^n//p' | head -1
|
|
157
163
|
}
|
|
164
|
+
# Repo identity, NOT directory prefix. Measured 2026-08-22 (probe_2026-08-22_A2_replication.md):
|
|
165
|
+
# `--show-toplevel` yields the WORKTREE's own path, and a worktree by definition lives outside the
|
|
166
|
+
# main tree — so `"$FH"/*` prefix matching fails STRUCTURALLY for every worktree of this repo, in
|
|
167
|
+
# both directions. From the main tree it silently dropped the worktree peer (no counter moved at
|
|
168
|
+
# all); from a worktree it printed a confident "✅ no live peer" with three live same-repo sessions
|
|
169
|
+
# running. `git rev-parse --git-common-dir` returns the MAIN tree's .git from inside any worktree,
|
|
170
|
+
# which is exactly the equality this question needs — the same property templates/.git-hooks/pre-commit
|
|
171
|
+
# already relies on to reach evidence from a worktree.
|
|
172
|
+
# ⚠️ It can return a RELATIVE path (plain '.git' when run at a repo root — measured here, git 2.50),
|
|
173
|
+
# so the raw output of the main tree and of its own worktree DIFFER as strings. Normalising to an
|
|
174
|
+
# absolute real path is not tidiness; comparing raw output would reproduce the very bug being fixed.
|
|
175
|
+
_repo_id() { # $1=dir → absolute real path of the repo's COMMON .git, empty if not placeable in a repo
|
|
176
|
+
( cd "$1" 2>/dev/null || exit 0
|
|
177
|
+
_c=$(git rev-parse --git-common-dir 2>/dev/null) || exit 0
|
|
178
|
+
[ -n "$_c" ] || exit 0
|
|
179
|
+
cd "$_c" 2>/dev/null || exit 0
|
|
180
|
+
pwd -P )
|
|
181
|
+
}
|
|
182
|
+
# Computed once. Empty = $FH itself is not inside a git repo; then repo-identity cannot decide
|
|
183
|
+
# anything and every off-prefix peer falls through to PEER_OFFTREE (unplaceable), never to "absent".
|
|
184
|
+
FH_REPO_ID="$(_repo_id "$FH")"
|
|
158
185
|
if [ -d "$SOCK_DIR" ]; then
|
|
159
186
|
for _s in "$SOCK_DIR"/*.sock; do
|
|
160
187
|
[ -e "$_s" ] || continue
|
|
@@ -174,6 +201,26 @@ if [ -d "$SOCK_DIR" ]; then
|
|
|
174
201
|
fi
|
|
175
202
|
case "$_pcwd" in
|
|
176
203
|
"$FH"|"$FH"/*) PEER_LIVE=$((PEER_LIVE+1)); PEER_IDS="$PEER_IDS $_pid" ;;
|
|
204
|
+
*)
|
|
205
|
+
# The `default` arm that was missing until 2026-08-22. Every peer that reaches here has a
|
|
206
|
+
# READ cwd that is not under $FH, and previously left the loop without touching a single
|
|
207
|
+
# counter — so the ladder below could not tell it from "there was nobody". Three outcomes,
|
|
208
|
+
# and the point is that they are three, not two.
|
|
209
|
+
_prepo="$(_repo_id "$_pcwd")"
|
|
210
|
+
if [ -n "$FH_REPO_ID" ] && [ "$_prepo" = "$FH_REPO_ID" ]; then
|
|
211
|
+
# Same repo, different worktree — a real peer of THIS harness. The case this fix exists for.
|
|
212
|
+
PEER_LIVE=$((PEER_LIVE+1)); PEER_IDS="$PEER_IDS $_pid"
|
|
213
|
+
elif [ -n "$_prepo" ]; then
|
|
214
|
+
# Placed in a DIFFERENT repo. Excluding it is a measurement, so it stays quiet on purpose:
|
|
215
|
+
# warning here would nag every close about unrelated projects, and an advisory that fires
|
|
216
|
+
# on every close trains skimming past the lines that matter.
|
|
217
|
+
PEER_OTHERREPO=$((PEER_OTHERREPO+1))
|
|
218
|
+
else
|
|
219
|
+
# cwd read, but it belongs to no repo we can name (or $FH is not in a repo). UNPLACEABLE —
|
|
220
|
+
# routed to the existing UNPLACEABLE branch below rather than to a new verdict of its own.
|
|
221
|
+
PEER_OFFTREE=$((PEER_OFFTREE+1))
|
|
222
|
+
fi
|
|
223
|
+
;;
|
|
177
224
|
esac
|
|
178
225
|
done
|
|
179
226
|
else
|
|
@@ -207,11 +254,17 @@ elif [ "$PEER_LIVE" -gt 0 ]; then
|
|
|
207
254
|
echo " 2026-08-09: 2 of 5 notices were held while the card already claimed all 5 informed."
|
|
208
255
|
echo " Record ANSWERS, not sends, and put the unanswered count in the card."
|
|
209
256
|
[ "$PEER_UNKNOWN" -gt 0 ] && echo " + $PEER_UNKNOWN live session(s) whose directory is UNKNOWN (counted, not dismissed)"
|
|
210
|
-
|
|
211
|
-
|
|
257
|
+
[ "$PEER_OFFTREE" -gt 0 ] && echo " + $PEER_OFFTREE live session(s) whose directory belongs to NO repo (counted, not dismissed)"
|
|
258
|
+
elif [ "$PEER_UNKNOWN" -gt 0 ] || [ "$PEER_OFFTREE" -gt 0 ]; then
|
|
259
|
+
echo "⚠️ ①-c 0 peers placed in this harness, but $((PEER_UNKNOWN+PEER_OFFTREE)) live session(s) are UNPLACEABLE"
|
|
260
|
+
echo " ($PEER_UNKNOWN with no readable cwd · $PEER_OFFTREE whose cwd belongs to no repo)"
|
|
212
261
|
echo " — treat as possible peers and ask; do not read this as 'closing alone'."
|
|
213
262
|
else
|
|
214
|
-
|
|
263
|
+
# The parenthetical must account for EVERY kind that was dropped, not only the flattering ones.
|
|
264
|
+
# Before 2026-08-22 it listed stale+spare while silently discarding same-repo worktree peers, so
|
|
265
|
+
# "0 stale · 0 spare" read as "three kinds swept, all empty" at the exact moment three real peers
|
|
266
|
+
# had been thrown away. A green line is only allowed to be green about what it actually counted.
|
|
267
|
+
echo "✅ ①-c no live peer in this harness (${PEER_STALE} stale · ${PEER_SPARE} pre-warmed spare(s) · ${PEER_OTHERREPO} in other repo(s) — all placed)"
|
|
215
268
|
fi
|
|
216
269
|
|
|
217
270
|
fi
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_chamber_sig_lanes.sh — known-pair calibration for chamber_candidate_collect.sh's LAYER-2
|
|
3
|
+
# dedup signature (`_sig`/`_ksig`) on a NON-ASCII corpus.
|
|
4
|
+
#
|
|
5
|
+
# WHY (measured 2026-08-22, live corpus, this repo):
|
|
6
|
+
# A freshly-registered candidate was grepped correctly by LAYER 1 and then VANISHED from the
|
|
7
|
+
# ranked queue. The loss was LAYER 2. Root cause = **locale-dependent collation**, and it is not
|
|
8
|
+
# one bug but a family, all in the same pipeline:
|
|
9
|
+
# · `sort -u` in en_US.UTF-8 treats Hangul syllables as EQUAL to one another. Measured on
|
|
10
|
+
# macOS/BSD sort: 8 distinct Korean tokens → 2 survivors (grouped by syllable count, first
|
|
11
|
+
# one wins, input-order dependent). Measured on GNU coreutils 9.7 sort: same 8 → **1**.
|
|
12
|
+
# · `comm -12` inherits that collation, so it reports two COMPLETELY DIFFERENT Korean tokens
|
|
13
|
+
# as a common line. Measured: comm -12 <(레인) <(발주) → prints a line. The jaccard
|
|
14
|
+
# numerator is therefore computed against a collation, not against the tokens.
|
|
15
|
+
# · `awk 'length()>=4'` counts BYTES on BSD awk and CHARACTERS on gawk in a UTF-8 locale. The
|
|
16
|
+
# same 2-syllable Korean token passes on macOS (6 bytes) and is DROPPED on Linux (2 chars),
|
|
17
|
+
# so the two platforms disagree about the signature before any comparison happens.
|
|
18
|
+
# Net effect on the live corpus (64 raw markers): unrelated candidates were folded into clusters
|
|
19
|
+
# of 11, 7, 7, 4 and 3, and only each cluster's FIRST member reached the output. Everything else
|
|
20
|
+
# was silently deleted from the queue while the run reported a healthy "deduped candidates: 31".
|
|
21
|
+
#
|
|
22
|
+
# That is the [[feedback_not_found_is_not_zero_family]] shape — a silent fold rendered as a clean
|
|
23
|
+
# number — which is why it needs a mechanical anchor rather than a note.
|
|
24
|
+
#
|
|
25
|
+
# WHAT IT PINS (the lanes below, in pairs, because a merge check with only one direction is not a
|
|
26
|
+
# measurement — over-merging and never-merging both produce a "correct" number on half the corpus):
|
|
27
|
+
# L1 Korean, DIFFERENT → must NOT merge (known-positive: the actual live mis-merge)
|
|
28
|
+
# L2 Korean, SAME → must merge (known-negative: the fix must not kill real dedup)
|
|
29
|
+
# L3 English, DIFFERENT → must NOT merge (control: the defect is Hangul-only; if this lane ever
|
|
30
|
+
# goes red the diagnosis above is wrong)
|
|
31
|
+
# L4 English, SAME → must merge (control, other direction)
|
|
32
|
+
# L5 Korean ×3 unrelated → must stay 3 ("does it collapse a set, not just a pair")
|
|
33
|
+
# L6 Korean vs English → must NOT merge (mixed-script pair)
|
|
34
|
+
#
|
|
35
|
+
# 🟥 EVERY LANE DRIVES THE REAL SCRIPT. Nothing here re-implements `_sig`. A lane suite that carries
|
|
36
|
+
# its own copy of the logic grades the copy ([[feedback_adversarial_review_not_substitute_for_first_use]]
|
|
37
|
+
# — "초록의 출처를 물어라: 사본이 통과시키고 있었다").
|
|
38
|
+
#
|
|
39
|
+
# 🟥 FIXTURES ARE SELF-BUILT under mktemp, never this repo's own tracks/ — a suite that reads
|
|
40
|
+
# repo-specific paths FAILs wholesale once the script is ported (portability_lint P9).
|
|
41
|
+
#
|
|
42
|
+
# Usage: bash scripts/test_chamber_sig_lanes.sh
|
|
43
|
+
# Exit: 0 = all lanes pass · 1 = a lane failed · 10 = harness error (could not measure)
|
|
44
|
+
|
|
45
|
+
set -uo pipefail
|
|
46
|
+
|
|
47
|
+
REPO="$(cd "$(dirname "$0")/.." && pwd)"
|
|
48
|
+
SUBJ="$REPO/scripts/chamber_candidate_collect.sh"
|
|
49
|
+
[ -f "$SUBJ" ] || { echo "HARNESS ERROR: subject missing: $SUBJ"; exit 10; }
|
|
50
|
+
|
|
51
|
+
TMP="$(mktemp -d 2>/dev/null)" || { echo "HARNESS ERROR: mktemp failed"; exit 10; }
|
|
52
|
+
trap 'rm -rf "$TMP"' EXIT
|
|
53
|
+
|
|
54
|
+
fail=0
|
|
55
|
+
lane=0
|
|
56
|
+
|
|
57
|
+
# Build a throwaway FH root holding exactly the given marker lines, run the REAL collector inside
|
|
58
|
+
# it, and echo "NRAW NDEDUP". The collector locates its own FH root from its dirname, so the copy
|
|
59
|
+
# has to live in <root>/scripts/ — that is also why this cannot be done by calling the repo copy
|
|
60
|
+
# with an env var: the script offers no such knob and inventing one for the test would move the
|
|
61
|
+
# measurement off the shipped path.
|
|
62
|
+
_run() { # $@ = marker descriptions
|
|
63
|
+
local root="$TMP/fx.$lane"
|
|
64
|
+
rm -rf "$root"
|
|
65
|
+
mkdir -p "$root/scripts" "$root/tracks/_meta" "$root/plugins" || return 10
|
|
66
|
+
cp "$SUBJ" "$root/scripts/" || return 10
|
|
67
|
+
# NOTE: chamber_candidate_screen.sh is deliberately NOT copied. Its verdict column is irrelevant
|
|
68
|
+
# here and its absence keeps the fixture independent of this repo's asset tree.
|
|
69
|
+
local f="$root/tracks/_meta/fh_signal_2000-01-01_fixture.md"
|
|
70
|
+
: > "$f"
|
|
71
|
+
local d
|
|
72
|
+
for d in "$@"; do printf 'CHAMBER-CANDIDATE: %s\n' "$d" >> "$f"; done
|
|
73
|
+
local out
|
|
74
|
+
out=$(bash "$root/scripts/chamber_candidate_collect.sh" 2>&1) || true
|
|
75
|
+
local nraw ndedup
|
|
76
|
+
nraw=$(printf '%s\n' "$out" | sed -n 's/.*raw candidate markers found: \([0-9][0-9]*\).*/\1/p' | head -1)
|
|
77
|
+
ndedup=$(printf '%s\n' "$out" | sed -n 's/^deduped candidates: \([0-9][0-9]*\) .*/\1/p' | head -1)
|
|
78
|
+
printf '%s %s\n' "${nraw:-X}" "${ndedup:-X}"
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# $1=label $2=expected dedup count $3..=descriptions
|
|
82
|
+
_lane() {
|
|
83
|
+
lane=$((lane+1))
|
|
84
|
+
local label="$1" want="$2"; shift 2
|
|
85
|
+
local got nraw ndedup
|
|
86
|
+
got=$(_run "$@")
|
|
87
|
+
nraw="${got%% *}"; ndedup="${got##* }"
|
|
88
|
+
# Instrument control BEFORE the verdict: if LAYER 1 did not even see the markers, a "correct"
|
|
89
|
+
# dedup number would be an accident. `not found` is not a zero.
|
|
90
|
+
if [ "$nraw" != "$#" ]; then
|
|
91
|
+
echo "HARNESS ERROR $label: collector saw $nraw raw markers, fixture planted $# — instrument dead, verdict void"
|
|
92
|
+
fail=1; return
|
|
93
|
+
fi
|
|
94
|
+
if [ "$ndedup" = "$want" ]; then
|
|
95
|
+
echo "PASS $label (deduped=$ndedup, expected $want)"
|
|
96
|
+
else
|
|
97
|
+
echo "FAIL $label: deduped=$ndedup, expected $want ($nraw raw markers)"
|
|
98
|
+
fail=1
|
|
99
|
+
fi
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
echo "── chamber signature lanes (LAYER-2 dedup, non-ASCII corpus) ──"
|
|
103
|
+
|
|
104
|
+
# L1 — KNOWN-POSITIVE. Both strings are lifted VERBATIM from this repo's live corpus, and this is
|
|
105
|
+
# the exact pair that folded on 2026-08-22: the second was swallowed by the first and never reached
|
|
106
|
+
# the queue. Deliberately NOT a synthetic minimal pair — the punctuation soup («」·—/+()) is the
|
|
107
|
+
# "뚫리는 표기" that a clean two-word fixture would step over.
|
|
108
|
+
# ⚠️ The strings must stay VERBATIM. A first draft of this lane paraphrased six characters of the
|
|
109
|
+
# second string's tail ("행위로 굳힌다" for "행위자가 읽는 곳에.") and the pair stopped folding —
|
|
110
|
+
# the lane went green against the very code it was written to indict. Do not "tidy" these.
|
|
111
|
+
_lane "L1 ko/different (live mis-merge pair)" 2 \
|
|
112
|
+
'「미사용 자산의 원인 3분할(값어치·배선·계기)」을 tier 전에 강제하는 렌즈 — 처분 tier 가 원인 판정을 앞서지 못하게 한다' \
|
|
113
|
+
'병렬 레인 발주 계약 — 보고 의무 3줄 + 취향/판정/승인 3축 라우팅 + idle 구독을 카드 안에 박은 형태. 별도 규칙 파일 없이 행위자가 읽는 곳에.'
|
|
114
|
+
|
|
115
|
+
# L2 — KNOWN-NEGATIVE. Real duplicates must still collapse; a fix that merely stops merging would
|
|
116
|
+
# pass L1 and destroy the feature. Same candidate, re-listed with a trailing qualifier.
|
|
117
|
+
_lane "L2 ko/same (true duplicate must still merge)" 1 \
|
|
118
|
+
'session-token-ledger — 세션 및 서브에이전트 토큰 실사용을 기계 출처에서 수집해 원장화하고 추정기가 역참조하는 계기' \
|
|
119
|
+
'session-token-ledger — 세션 및 서브에이전트 토큰 실사용을 기계 출처에서 수집해 원장화하고 추정기가 역참조하는 계기 (동일 건 재등재, 앵커 보강만)'
|
|
120
|
+
|
|
121
|
+
# L3/L4 — ENGLISH CONTROL. These pin the diagnosis, not the feature: the defect is a Hangul
|
|
122
|
+
# collation defect, so both English lanes must be green BEFORE and AFTER the repair. If L3 or L4
|
|
123
|
+
# is ever red, the cause is somewhere other than where this header says it is.
|
|
124
|
+
_lane "L3 en/different (control)" 2 \
|
|
125
|
+
'parallel lane dispatch contract — reporting duty condensed into three lines plus an idle subscription card' \
|
|
126
|
+
'unused asset triage lens — forces value versus wiring versus instrument before any disposal tier is assigned'
|
|
127
|
+
|
|
128
|
+
_lane "L4 en/same (control)" 1 \
|
|
129
|
+
'session token ledger — collect subagent token usage from a mechanical source and let the estimator dereference it' \
|
|
130
|
+
'session token ledger — collect subagent token usage from a mechanical source and let the estimator dereference it, relisted'
|
|
131
|
+
|
|
132
|
+
# L5 — SET COLLAPSE, not just a pair. The live failure produced clusters of 11; a pairwise-only
|
|
133
|
+
# suite would have called a 3→1 fold "one merge" and moved on.
|
|
134
|
+
_lane "L5 ko/three unrelated" 3 \
|
|
135
|
+
'낭독 렌즈 — 「소리 내어 읽히는가」를 재는 계기. 문서 린터가 구조적으로 못 보는 축이다' \
|
|
136
|
+
'fh-router-demotion — salience 상시부하를 플랫폼 네이티브 메커니즘으로 이관하는 대수술' \
|
|
137
|
+
'인물 시뮬레이터 하네스 — 닫힌 코퍼스 + 그라운딩 게이트 + 페르소나 캐스트를 한 틀로 묶는다'
|
|
138
|
+
|
|
139
|
+
# L6 — MIXED SCRIPT. A Korean signature that collapses to near-nothing can also collide with an
|
|
140
|
+
# unrelated ASCII one, which is a different failure path from ko↔ko.
|
|
141
|
+
_lane "L6 ko vs en" 2 \
|
|
142
|
+
'원정 수련 — 세계 강력 레포에서 배워오는 반복 루틴. 탐색 판별 흡수 3단이다' \
|
|
143
|
+
'entrypoint wiring generator — emit runtime-native hook settings from a single event manifest'
|
|
144
|
+
|
|
145
|
+
echo ""
|
|
146
|
+
if [ "$fail" -eq 0 ]; then
|
|
147
|
+
echo "chamber signature lanes: ALL PASS ($lane lanes)"
|
|
148
|
+
else
|
|
149
|
+
echo "chamber signature lanes: FAILURES PRESENT ($lane lanes run)"
|
|
150
|
+
fi
|
|
151
|
+
exit "$fail"
|