@chrono-meta/fh-gate 2.12.1 → 2.13.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrono-meta/fh-gate",
3
- "version": "2.12.1",
3
+ "version": "2.13.0",
4
4
  "description": "FH runtime adapters — run FH governance, skills, and agents via Claude or Codex with machine-parseable gates.",
5
5
  "homepage": "https://github.com/chrono-meta/forge-harness#readme",
6
6
  "bugs": {
@@ -103,6 +103,7 @@
103
103
  "docs/ETHOS.md",
104
104
  "docs/WHY.md",
105
105
  "docs/OUTPUT_EVIDENCE.md",
106
+ "docs/MODEL_SETUP.md",
106
107
  "docs/GATE_DAY.md",
107
108
  "docs/platform_sustainability.md",
108
109
  "knowledge/shared/GLOSSARY.md",
@@ -146,6 +147,7 @@
146
147
  "scripts/test_chamber_sig_lanes.sh",
147
148
  "scripts/chamber_witness.sh",
148
149
  "scripts/digest_landing_check.sh",
150
+ "scripts/activity_log.sh",
149
151
  "scripts/relay_channel.sh",
150
152
  "scripts/test_relay_channel_lanes.sh",
151
153
  "scripts/fh_session_load.sh",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-commons",
3
- "version": "2.12.1",
3
+ "version": "2.13.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-meta",
3
- "version": "2.12.1",
3
+ "version": "2.13.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -8,6 +8,78 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
8
8
 
9
9
  ---
10
10
 
11
+ ### [2.13.0] — 2026-08-29
12
+
13
+ > **추가 (발행 전 보완)** — 아래 두 항목은 릴리스 커밋 이후, **발행 전에** 같은 2.13.0 으로
14
+ > 들어왔다. 미발행 상태라 노트를 보완하는 것이 태그·타르볼·문서를 일치시키는 정직한 방향이다.
15
+ >
16
+ > - **새 게이트 행 + 필드 렌즈 — `measurement-reps`.** 측정을 기록했는데 `reps` 가 바(3) 미달
17
+ > 이고 그 결론이 **하중을 지면**(판정·등급·교리·비가역 처방) 한 줄 제안이 뜬다. 지금까지는
18
+ > 「바 미달」이라고 **적고 넘어가는 것**이 기본값이었다 — 라벨은 측정이 아니다. §Field-Harness
19
+ > Diagnostic 도 8렌즈 → **9렌즈**. 🟥 필드 하네스에 돌리기 전에
20
+ > `knowledge/shared/harness-core/field_harness_diagnostic.md` 의 **Step 0(provenance 분리)**
21
+ > 를 읽어라 — FH 파생 하네스를 그냥 스캔하면 FH 자기 텍스트를 필드 발견으로 되읽는다
22
+ > (실측: 어느 필드 레포 원시 히트의 2/3).
23
+ > - **인사말 번역 조항** — 문장은 어느 언어로든 자연스럽게 옮기되 이름 「FH」는 움직이지 않는다.
24
+ > 🟥 **측정했고 안 닫혔다**(컨트롤 1/3 · 조항 2/3, n=3 에서 차이 1). 조항은 옳고 싸서 남겼지
25
+ > 효과가 측정돼서가 아니다. 이 축엔 기계 floor 가 없다.
26
+ > - 🟥 **fail-open 수리 — `templates/regression_guard.sh` F1(frontmatter).** 발행 직전 보안 패스가
27
+ > 찾았다: 검사기(`python3`)가 없거나 안 도는 머신에서 F1 이 **「✅ frontmatter intact」로 렌더**
28
+ > 됐다 — 출력에 `FAIL` 토큰이 없다는 이유만으로. **macOS 는 python3 를 기본 탑재하지 않으므로**
29
+ > 상당수 소비자에게 이 레인은 늘 초록이었고, 그 초록은 「검사했다」가 아니라 「검사기가 없었다」였다.
30
+ > 이제 **종료코드**로 판정한다(0=정상 · 1=FAIL · 그 외=`⚠️ F1 UNMEASURED`). 🟥 **차단하지 않는다**
31
+ > — 가역 표면이고, 과차단은 이 파일 자신이 경고한 대로 `--no-verify` 를 근육에 새긴다.
32
+ > ⚠️ **행동 변화**: 그런 머신에서 이제 경고 줄이 뜬다. 통과/차단 판정은 안 바뀐다.
33
+ > - `scripts/activity_log.sh` 가 **files[] 에 진입**했다 — 배포되는 digest 생산자
34
+ > (`frontier_digest_autopilot.sh`)가 언더스코어 날짜 파일을 만드는데 그 판독기가 안 실려 있었다.
35
+
36
+ > **BREAKING (gate)**: `templates/regression_guard.sh` 의 Axis 1 pathspec 이 이제
37
+ > `README*.md` · `CHEATSHEET.md` · `CATALOG.md` · `.github/workflows/*.yml` · `scripts/*.py` ·
38
+ > `.claude/registry/*.md` · `package.json` 을 **본다**. **FH 클론에 4축 pre-commit 훅을
39
+ > opt-in 한 경우**, 그 파일들만 바꾼 커밋이 이전엔 `SKIP (not-checked)` 이었는데 이제 검사되고,
40
+ > 대규모 삭제 시 `REVIEW`(S-tier) 또는 `BLOCK`(M-tier)이 될 수 있다.
41
+ > **처방**: 의도된 감량이면 마커에 근거를 적고 진행한다 — S-tier 는 머지를 막지 않는다.
42
+ > 영향 범위는 **FH 클론 + 훅 opt-in** 에 한정된다(그 게이트는 필드 프로젝트에 설치되지 않는다).
43
+
44
+ **Added**
45
+ - `docs/MODEL_SETUP.md` — 모델 교리의 정본 신설. `/model` 선택 표 · `opusplan` 측정 캐비앗
46
+ (10턴 중 Opus 0턴) · 하드웨어 티어 · **두 구조 법칙** · Multi-Model Sidecar.
47
+ `docs/OUTPUT_EVIDENCE.md` 가 「README §Model setup」을 역참조하던 것을 이 파일로 고쳤다
48
+ (그대로 뒀으면 README 감량 후 팬텀 참조가 된다).
49
+ - `scripts/gate_pathspec_check.sh` — 새로 커버된 클래스에 **앵커 6쌍 추가**. 되돌림 프로브 확인:
50
+ `README*.md` 항만 제거하면 FAIL, 복원하면 PASS(30쌍).
51
+
52
+ **Changed**
53
+ - **README 4판 감량 3,443 → 1,535줄 (−55%)**. EN 896→382 · ko 880→387 · ja 861→396 · zh 806→370.
54
+ 가장 설득력 있는 증거(OpenCode 실측 · 8홀 5/8→6/8→8/8)가 **72% 지점**에 묻혀 있던 것을
55
+ **40% 지점**으로 올렸다. 지운 것은 전부 착지처를 열어서 확인하고 옮겼다.
56
+ 🟥 판마다 보존 경계가 다르다(EN L1~100 · ko L1~96 · ja L1~111 · zh L1~106) — 「100줄」을
57
+ 일괄 적용했으면 ja·zh 는 두 문(door) 구조를 잘라먹었다.
58
+ - `CHEATSHEET.md` — `FH_BACKEND=cross` 행 신설(기존 `FH_BACKEND` 행에 「one leg」 명시:
59
+ `auto` 는 폴백 *선택*이라 레그를 하나만 돈다) · PyYAML 요구사항 착지(§6).
60
+ - `fh_three_layer_canon.md` — 「'4'가 셋이다」 3자 구분표를 `README.ko.md` 에서 정본으로 이관
61
+ (4개 언어판 중 ko 에만 있던 비대칭 해소).
62
+
63
+ **Fixed**
64
+ - **온보딩 분기** — 뭔가 하고 **마감 없이 끈 사용자에게 「완전 신규」 인사가 뜰 수 있었다.**
65
+ 정본(`fh_detail_protocols.md`)은 원래 옳았고(`tracks/_meta/*.md` 도 세션 파일로 센다),
66
+ 상주 요약이 「밑줄 디렉터리는 안 센다」를 어디에 거는지 안 정해 놓은 것이 원인이었다.
67
+ 인사는 세션 첫 턴이라 detail 을 안 읽고 판정하는 경로가 실재한다 — 두 조건을 갈라 적었다.
68
+ 같이: 재방문 문 **아래** 마감 권고 한 줄(문 개수·환영문 리터럴 불변) ·
69
+ 🟥 **마감 트리거를 「어느 언어든」으로 명시** — 인사말 트리거는 이미 그런데 마감은 아니어서,
70
+ 세션이 「마무리하자」라고 가르쳐도 그 말이 목록에 없었다. 블라인드 sim 이 잡았다.
71
+ 검증: 플로어 티어(sonnet) known-pair **reps=3** — ARM 마감줄 3/3 · CONTROL 0/3.
72
+ - `ship_readiness_gate.md` — §6 「확인된 stale 2건」이 그 자체로 stale 이었다. 1건은 stale 이
73
+ 맞고 1건은 **수리완료를 미수리로 가리키는 오보**였다. 둘 다 철회·정정.
74
+ - `scripts/activity_log.sh` — digest 날짜 정규식이 대시 표기만 봐서 언더스코어 파일 **70건을
75
+ 무음 드롭**했다. `emit_line` 에 정규화가 있는데 호출부가 그 앞에서 죽여 도달하지 못한 형태.
76
+ 실측 1 → 71.
77
+ - README 4판의 stale 사실 2건 — 버전 셀(`2.8.0` vs 실제 2.12.1)과 정체성 등급(② 는 2026-08-21
78
+ 부로 🟢). **고쳐 적지 않고 복제를 지웠다** — 그 문단이 스스로 «두 파일에 나눠 두면 썩는다»고
79
+ 적어놓고 복제한 자리였다.
80
+
81
+ ---
82
+
11
83
  ### [2.12.1] — 2026-08-28
12
84
 
13
85
  **코드 무변경.** 2.12.0 이 **정정 전 리드미**로 발행됐다 — v2.12.0 태그(19:48)가 리드미 정정
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/env bash
2
+ # activity_log.sh — on-demand chronological assembler (the portable LLM-Wiki `log.md`).
3
+ #
4
+ # WHY: the LLM-Wiki pattern (Karpathy; wikidocs book/19830) pairs an index (FH already has =
5
+ # CATALOG.md + MEMORY.md) with a `log.md` — a single time-ordered trail of every ingest/check the
6
+ # agent performed. FH's activity is scattered across 5+ record stores (edit_manifest, fh_signal,
7
+ # _audit, gate markers, subagent log). Rather than add a 6th always-write file, this ASSEMBLES the
8
+ # chronological view on demand from what already exists. Honest trade (not a free lunch): this MOVES
9
+ # the maintenance cost from "every writer must remember to append" (drift-prone — the fh_completed
10
+ # card-bug class) to "one parser branch per store format, here" (centralized, but silent on format
11
+ # drift). Mitigation: dates are pulled by regex after a prefix-strip, not by hardcoded character
12
+ # offsets, so a renamed prefix degrades toward an empty date (which emit_line drops) rather than
13
+ # silently slicing garbage. Zero new write obligation; backend-agnostic (plain stdout — runs in a
14
+ # bare terminal / air-gapped / ephemeral cloud, no Obsidian or any app required).
15
+ #
16
+ # Obsidian/gbrain are OPTIONAL frontends: `--emit <path>` writes the same view as a markdown file
17
+ # (e.g. a companion store's log.md) only when such a frontend exists. The portable core is the stdout default.
18
+ #
19
+ # Usage:
20
+ # bash scripts/activity_log.sh # full chronological view (newest first) to stdout
21
+ # bash scripts/activity_log.sh --since 2026-06-15
22
+ # bash scripts/activity_log.sh --emit /path/to/store/log.md # also write a markdown frontend file
23
+ # bash scripts/activity_log.sh --asc # oldest first
24
+ #
25
+ # NOTE: this is a best-effort assembler — many greps legitimately return no-match (a record store
26
+ # without a `date:` frontmatter line falls back to the filename date). So NO `set -e`: a non-matching
27
+ # grep must not abort the assembly. `set -u` (unset-var guard) is kept.
28
+ set -uo pipefail
29
+
30
+ HUB="$(cd "$(dirname "$0")/.." && pwd)"
31
+ cd "$HUB"
32
+
33
+ SINCE=""
34
+ EMIT=""
35
+ ORDER="-r" # newest first by default
36
+ while [[ $# -gt 0 ]]; do
37
+ case "$1" in
38
+ --since) SINCE="$2"; shift 2 ;;
39
+ --emit) EMIT="$2"; shift 2 ;;
40
+ --asc) ORDER=""; shift ;;
41
+ *) echo "unknown arg: $1" >&2; exit 2 ;;
42
+ esac
43
+ done
44
+
45
+ TMP="$(mktemp)"
46
+ trap 'rm -f "$TMP"' EXIT
47
+
48
+ emit_line() { # date type label source
49
+ local d="${1//_/-}" # normalize _ date-separators -> -
50
+ [[ "$d" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] || return 0 # skip empty / malformed dates
51
+ printf '%s\t%-7s %s\t[%s]\n' "$d" "$2" "$3" "$4" >> "$TMP"
52
+ }
53
+
54
+ # 1. edit_manifest.yaml — pair each "- id:" with its following " date:"
55
+ if [[ -f tracks/_meta/edit_manifest.yaml ]]; then
56
+ awk '
57
+ /^- id:/ { id=$3 }
58
+ /^ date:/ { if (id!="") { print $2 "\t" id; id="" } }
59
+ ' tracks/_meta/edit_manifest.yaml | while IFS=$'\t' read -r d id; do
60
+ emit_line "$d" "edit" "${id#em-}" "manifest"
61
+ done
62
+ fi
63
+
64
+ # 2. fh_signal_<date>_<slug>.md
65
+ for f in tracks/_meta/fh_signal_*.md; do
66
+ [[ -e "$f" ]] || continue
67
+ base="$(basename "$f" .md)"; rest="${base#fh_signal_}" # strip prefix (no hardcoded offset)
68
+ d="$(printf '%s' "$rest" | grep -oE '^[0-9]{4}[-_][0-9]{2}[-_][0-9]{2}' | head -1)"
69
+ slug="${rest:11}"
70
+ emit_line "$d" "signal" "$slug" "fh_signal"
71
+ done
72
+
73
+ # 3. fh_completed_<date>.md
74
+ for f in tracks/_meta/fh_completed_*.md; do
75
+ [[ -e "$f" ]] || continue
76
+ base="$(basename "$f" .md)"; rest="${base#fh_completed_}" # strip prefix (no hardcoded offset)
77
+ d="$(printf '%s' "$rest" | grep -oE '^[0-9]{4}[-_][0-9]{2}[-_][0-9]{2}' | head -1)"
78
+ emit_line "$d" "done" "session completions" "fh_completed"
79
+ done
80
+
81
+ # 4. gate markers (.axes_*_<date>.marker)
82
+ for f in tracks/_meta/.axes_*.marker; do
83
+ [[ -e "$f" ]] || continue
84
+ base="$(basename "$f")"; d="$(printf '%s' "$base" | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}' | head -1)"
85
+ [[ -n "$d" ]] && emit_line "$d" "gate" "4-axis marker" "axes_marker"
86
+ done
87
+
88
+ # 5. _audit/*.md — date from frontmatter; weekly_audit tagged distinctly
89
+ for f in tracks/_audit/*.md; do
90
+ [[ -e "$f" ]] || continue
91
+ d="$(grep -m1 '^date:' "$f" | awk '{print $2}')"
92
+ [[ -z "$d" ]] && d="$(basename "$f" | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}' | head -1)"
93
+ [[ -z "$d" ]] && continue
94
+ name="$(grep -m1 '^name:' "$f" | sed 's/^name:[[:space:]]*//')"
95
+ [[ -z "$name" ]] && name="$(basename "$f" .md)"
96
+ case "$(basename "$f")" in
97
+ weekly_audit_*) emit_line "$d" "weekly" "$name" "_audit" ;;
98
+ *) emit_line "$d" "audit" "$name" "_audit" ;;
99
+ esac
100
+ done
101
+
102
+ # 6. subagent_invocations_log.yaml — dispatch events (date: field per entry)
103
+ # 전환 설계: 레거시 단일 파일 ∪ 세션별 디렉터리를 둘 다 읽는다 (session_close_check.sh 와 동일)
104
+ _SAL=knowledge/shared/learnings/subagent_invocations_log.yaml
105
+ _SAD=knowledge/shared/learnings/subagent_invocations
106
+ if [[ -f "$_SAL" || -d "$_SAD" ]]; then
107
+ { [[ -f "$_SAL" ]] && cat "$_SAL"; [[ -d "$_SAD" ]] && cat "$_SAD"/*.yaml; } 2>/dev/null \
108
+ | grep -E '^[[:space:]]*-?[[:space:]]*date:' \
109
+ | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}' | sort | uniq -c | while read -r n d; do
110
+ emit_line "$d" "dispatch" "$n agent invocation(s)" "subagent_log"
111
+ done
112
+ fi
113
+
114
+ # 7. cadence artifacts (harness_doctor / frontier_digest in _meta)
115
+ for f in tracks/_meta/harness_doctor_*.md tracks/_meta/frontier_digest_*.md; do
116
+ [[ -e "$f" ]] || continue
117
+ # 🟥 2026-08-29 — 초판은 대시 표기만 봤다(`[0-9]{4}-[0-9]{2}-[0-9]{2}`). 실파일 71개 중
118
+ # 대시 표기는 **1개**뿐이고 나머지 70개는 언더스코어라, `d=""` → emit_line 이 malformed 로
119
+ # 조용히 return 0 → **70건 무음 드롭**. emit_line:49 에 `${1//_/-}` 정규화가 **있는데도**
120
+ # 호출부가 그 앞에서 죽여서 도달하지 못했다([[feedback_not_found_is_not_zero_family]]).
121
+ d="$(basename "$f" | grep -oE '[0-9]{4}[-_][0-9]{2}[-_][0-9]{2}' | head -1)"
122
+ case "$(basename "$f")" in
123
+ harness_doctor_*) emit_line "$d" "doctor" "harness-doctor run" "_meta" ;;
124
+ frontier_*) emit_line "$d" "digest" "frontier-digest" "_meta" ;;
125
+ esac
126
+ done
127
+
128
+ # --- assemble: filter by --since, sort chronologically ---
129
+ OUT="$(sort $ORDER "$TMP" | { [[ -n "$SINCE" ]] && awk -v s="$SINCE" '$1 >= s' || cat; })"
130
+
131
+ render() {
132
+ echo "# FH Activity Log — assembled $(date +%Y-%m-%d) (portable LLM-Wiki core, on-demand)"
133
+ echo "# index = CATALOG.md + MEMORY.md | this = chronological log over 5 record stores"
134
+ [[ -n "$SINCE" ]] && echo "# since: $SINCE"
135
+ echo
136
+ echo "$OUT"
137
+ }
138
+
139
+ if [[ -n "$EMIT" ]]; then
140
+ render > "$EMIT"
141
+ echo "emitted $(printf '%s\n' "$OUT" | grep -c . ) events → $EMIT"
142
+ else
143
+ render
144
+ fi
@@ -86,11 +86,38 @@ if [ -d "$BE/.git" ]; then
86
86
  _deadline() { shift; "$@"; }
87
87
  fi
88
88
  PULL_NOTE=""
89
+ DIVERGED="" # non-empty ⇒ the local tree is NOT the newest state (see §Diverged below)
90
+ DIVERGE_BEHIND="" # commits the companion remote has that this clone does not
91
+ DIVERGE_AHEAD="" # commits this clone has that the remote does not
89
92
  if _deadline "${FH_FETCH_DEADLINE:-8}" git -C "$BE" fetch --quiet >/dev/null 2>&1; then
90
93
  if git -C "$BE" merge --ff-only --quiet >/dev/null 2>&1; then
91
94
  PULL_NOTE="fetched + fast-forwarded"
92
95
  else
93
- PULL_NOTE="fetched but NOT fast-forward (companion diverged — read local + newest remote)"
96
+ # §Diverged — WHY THIS IS LOUD AND COUNTED (2026-08-28, measured on this repo).
97
+ # The old line said only "companion diverged — read local + newest remote". A session read it,
98
+ # did NOT read the newest remote, counted the LOCAL tree, and reported an artifact as absent
99
+ # that the remote had had for two days (deck v6.3 vs the actual v12.4; 338 commits behind).
100
+ # Two separate defects, and the second is the dangerous one:
101
+ # 1) the note carried no MAGNITUDE and no COMMAND — "diverged" reads like a footnote
102
+ # 2) every downstream freshness check in this script (§NEWER THAN SESSION CARD, the STATUS
103
+ # map, INDEX head) is computed over the STALE local tree, so it under-reports and an
104
+ # un-pulled file renders as a non-existent one — `not found` ≠ `0`
105
+ # ([[feedback_not_found_is_not_zero_family]]).
106
+ # This is a CHANNEL fix, not a judgment one (§Mechanization Boundary): it reports what the
107
+ # record IS (how far behind, computed) and never decides whether to merge. The hook still
108
+ # does NOT auto-rebase — mutating a diverged tree from SessionStart is exactly the
109
+ # irreversible-shaped act the --ff-only design refuses, and a parallel session may hold it.
110
+ _UP="$(git -C "$BE" rev-parse --abbrev-ref --symbolic-full-name '@{u}' 2>/dev/null)"
111
+ [ -n "$_UP" ] || _UP="origin/$(git -C "$BE" rev-parse --abbrev-ref HEAD 2>/dev/null)"
112
+ # Counts: a failure must leave these EMPTY, never 0 — an unmeasured gap rendered as zero is
113
+ # the same defect this block exists to stop. `git rev-list` prints nothing to stdout on error.
114
+ _CNT="$(git -C "$BE" rev-list --left-right --count "HEAD...$_UP" 2>/dev/null)"
115
+ if [ -n "$_CNT" ]; then
116
+ DIVERGE_AHEAD="$(printf '%s' "$_CNT" | awk '{print $1}')"
117
+ DIVERGE_BEHIND="$(printf '%s' "$_CNT" | awk '{print $2}')"
118
+ fi
119
+ DIVERGED="1"
120
+ PULL_NOTE="fetched but NOT fast-forward (companion DIVERGED — local tree is stale)"
94
121
  fi
95
122
  else
96
123
  PULL_NOTE="fetch skipped (offline or deadline hit — read local state)"
@@ -501,11 +528,34 @@ fi
501
528
  # So: no new hook, no new line, no nag — the node name is appended to a banner that already
502
529
  # prints every single session. `hostname -s`, the same source fh_node_check.sh uses.
503
530
  echo "🔄 [FH SessionStart] companion-store freshness — $PULL_NOTE. · node: $(hostname -s 2>/dev/null || echo unknown)"
531
+ # §Diverged banner. Loud, counted, and it names the ONE command — see the §Diverged comment at the
532
+ # fetch site for the 2026-08-28 measurement that made this necessary. The magnitude line and the
533
+ # "everything below is stale" line are separate on purpose: the first says the tree is behind, the
534
+ # second says this script's OWN downstream findings under-report while it is.
535
+ if [ -n "$DIVERGED" ]; then
536
+ if [ -n "$DIVERGE_BEHIND" ]; then
537
+ echo "🟥 COMPANION DIVERGED — this clone is $DIVERGE_BEHIND commit(s) BEHIND the companion remote (and $DIVERGE_AHEAD ahead)."
538
+ else
539
+ # UNMEASURED, never 0: rev-list failed (no upstream configured, unreadable ref). Say so.
540
+ echo "🟥 COMPANION DIVERGED — magnitude UNMEASURED (could not count against upstream; do NOT read that as 'small')."
541
+ fi
542
+ echo " → PULL BEFORE YOU TRUST ANY FRESHNESS ANSWER: git -C \"$BE\" pull --rebase"
543
+ echo " 🟥 Everything printed BELOW this line is computed over the STALE local tree, so it"
544
+ echo " UNDER-REPORTS. A file the remote already has renders here as absent — \`not found\`"
545
+ echo " is not \`0\`. Answering \"what is the newest X\" from this list while diverged has"
546
+ echo " already produced a wrong answer once (2026-08-28: reported a 2-day-old artifact as"
547
+ echo " the latest). Pull first, or label the answer LOCAL-ONLY."
548
+ fi
504
549
  if [ -n "$NEWER" ]; then
505
550
  echo "⚠️ NEWER THAN SESSION CARD — READ THESE BEFORE ACTING (card may be stale):"
506
551
  printf "%b" "$NEWER"
507
552
  else
508
- echo " (no companion files newer than the session card)"
553
+ if [ -n "$DIVERGED" ]; then
554
+ echo " (no companion files newer than the session card — 🟥 but the tree is STALE, so this is"
555
+ echo " NOT evidence of 'nothing new'. It is an unmeasured surface. Pull, then re-read.)"
556
+ else
557
+ echo " (no companion files newer than the session card)"
558
+ fi
509
559
  fi
510
560
  if [ -n "$STATUS_MAP" ]; then
511
561
  echo "── handoff/signal STATUS map (mtime-independent — closed items) ──"
@@ -106,13 +106,19 @@ spec_matches() { # $1 = path
106
106
  }
107
107
  for pair in \
108
108
  "plugins/fh-meta/skills/frontier-digest/SKILL_detail.md|tracks/_meta/x.md|PATHSPEC covers SKILL_detail.md" \
109
- "plugins/fh-meta/skills/frontier-digest/SKILL.md|README.md|PATHSPEC still covers SKILL.md" \
109
+ "plugins/fh-meta/skills/frontier-digest/SKILL.md|docs/demo/gate-block.tape|PATHSPEC still covers SKILL.md" \
110
110
  "CLAUDE.md|CLAUDE.local.md|PATHSPEC covers CLAUDE.md but not the local override" \
111
- "scripts/selfcheck.sh|README.md|PATHSPEC covers scripts/*.sh (seam #1 — the HEAVY term already gated it, this array did not)" \
112
- "scripts/sub/nested.sh|package.json|PATHSPEC covers scripts/ recursively (git/bash globs cross '/')" \
111
+ "scripts/selfcheck.sh|scripts/fixtures/data.txt|PATHSPEC covers scripts/*.sh (seam #1 — the HEAVY term already gated it, this array did not)" \
112
+ "scripts/sub/nested.sh|scripts/README.txt|PATHSPEC covers scripts/ recursively (git/bash globs cross '/')" \
113
113
  "templates/regression_guard.sh|package-lock.json|PATHSPEC covers templates/*.sh — i.e. the guard can guard ITSELF" \
114
114
  "templates/.git-hooks/pre-commit|.gitignore|PATHSPEC covers the git-hook floor (the hook that hard-blocks commits)" \
115
- "plugins/fh-meta/agents/challenger.md|tracks/_meta/y.md|PATHSPEC covers agent definitions (seam #3)"
115
+ "plugins/fh-meta/agents/challenger.md|tracks/_meta/y.md|PATHSPEC covers agent definitions (seam #3)" \
116
+ "README.ko.md|README.txt|PATHSPEC covers README 4종 — PR #550 이 Axis 1 무검사로 나간 자리 (2026-08-29)" \
117
+ "CHEATSHEET.md|CONTRIBUTING.md|PATHSPEC covers CHEATSHEET (루트 CONTRIBUTING 은 대상 아님)" \
118
+ "CATALOG.md|CHANGELOG.md|PATHSPEC covers CATALOG" \
119
+ ".github/workflows/validate.yml|.github/dependabot.yml|PATHSPEC covers workflow 정의 (yml 만)" \
120
+ "scripts/index_sync.py|scripts/notes.txt|PATHSPEC covers scripts/*.py" \
121
+ "package.json|package-lock.json|PATHSPEC covers package.json 이되 «리터럴» — lock 파일까지 삼키지 않는다"
116
122
  do
117
123
  IFS='|' read -r pos neg label <<< "$pair"
118
124
  ok=1
@@ -77,17 +77,15 @@ ACCEPTED_ABSENT=(
77
77
  # sibling directly above: it exercises scripts/sync-to-be.sh, itself ACCEPTED_ABSENT — a lane
78
78
  # suite for a script that never ships has nothing to verify on a consumer's machine either.
79
79
  "scripts/sync_to_be_lanes.sh"
80
- # Shared identity resolver for the two transports directly above (added to files[] by #368,
81
- # REMOVED from it 2026-08-15). It was the odd one out: its own callers — sync-to-be.sh and
82
- # sync-from-be.sh — are ACCEPTED_ABSENT here for a reason that applies to it verbatim (the
83
- # namespacing it computes only means anything on a machine that HAS the operator's companion
84
- # store), yet it alone was listed for shipping. The pre-publish confidentiality scan is what
85
- # surfaced the misclassification: it carries the companion store's own directory vocabulary,
86
- # which would have reached the registry for the first time in 1.4.98. The one shipped caller,
87
- # fh_session_load.sh, sources it behind `[ -f ]` and documents its own degrade ("an unresolved
88
- # identity degrades to the historical unsuffixed tracks-meta rather than erroring — that is the
89
- # pre-fix behavior, not a new failure mode"), so a consumer loses nothing that consumer ever had.
90
- "scripts/fh_hub_identity.sh"
80
+ # NOTE (2026-08-29): `scripts/fh_hub_identity.sh` USED to sit here, with a comment saying it had
81
+ # been removed from files[] on 2026-08-15 as a confidentiality misclassification. Both halves are
82
+ # now stale: #484 deliberately put it BACK in files[] (without it, `fh_session_load.sh`'s hub-
83
+ # identity resolution is dead on every consumer install), and a known-pair-calibrated PSA scan on
84
+ # 2026-08-29 found the file clean (known-positive rc=1 with three hits · known-negative rc=0 ·
85
+ # subject rc=0; the only private-looking word in it is "companion-store", which is public FH
86
+ # vocabulary). A shipped path can never exercise an ACCEPTED_ABSENT entry, so the entry was a dead
87
+ # exception — exactly the kind this check's own advisory warns a future real omission can land on
88
+ # and be silenced by. Removed rather than re-justified.
91
89
  # ── The three lane suites selfcheck.sh's DEBT-12 pair-loop names but does not ship ────────────
92
90
  # Added 2026-08-13, and the way they got here is the point: this check CAUGHT them. Before that
93
91
  # loop existed, these names lived in lane_runner_check.sh's DEBT array as bare basenames
@@ -99,7 +99,10 @@ check light "tracks/_meta/fh_completed.md" "session record"
99
99
  check light "tracks/qasp/NEXT_ACTION.md" "field track record"
100
100
 
101
101
  echo " ── honestly UNCOVERED — pinned so the residual cannot be believed closed ──"
102
- check uncovered "README.md" "🟥 a README-only commit takes NO 4-axis path"
102
+ check carveout "README.md" "npm-shipped surface — first-screen edits promote to HEAVY (2026-08-28)"
103
+ check carveout "README.ko.md" "language variants route the same way"
104
+ check carveout "README.zh-CN.md" "🟥 5-char locale forms too — cross-family caught [a-z]{2} missing these"
105
+ check uncovered ".claude/registry/README.md" "🟥 STILL UNCOVERED — in files[] but not root; named, not closed"
103
106
  check uncovered "package.json" "files[] / version changes are unclassified"
104
107
  check uncovered ".github/workflows/validate.yml" "🟥 CI definition — changing what CI runs is unclassified"
105
108
  check uncovered "scripts/memory_link_check.py" "🟥 .py is not .sh — shipped python is unclassified"
@@ -135,17 +135,23 @@ run_case() {
135
135
  echo "[universal-guard] known-pair anchor (throwaway repo: $SANDBOX)"
136
136
 
137
137
  # ── Pair 1: the closed hole. Same private token, asset vs non-asset path. ──
138
- # README.md is NOT in the 4-axis classifier's pathspec; before the 2026-07-26 fix this case
139
- # produced zero output and exit 0. If the guards are ever moved back below the early exit,
140
- # THIS is the case that goes clean and fails the anchor.
138
+ # The non-asset case must use a path the 4-axis classifier does NOT claim — the pair's whole
139
+ # point is that the universal guards fire on BOTH classes, so if both sides are assets the
140
+ # contrast is gone and the pair stops discriminating.
141
+ # 🟥 It was README.md until 2026-08-28, which worked only while README matched no bucket. When
142
+ # README became a CARVEOUT that day the pair silently lost its non-asset half — and it stayed
143
+ # GREEN, because run_case scores the leak dimension (`hasleak`), not the exit code. A pair can
144
+ # keep passing after it has stopped measuring what it was built to measure.
145
+ # Before the 2026-07-26 fix this case produced zero output and exit 0. If the guards are ever
146
+ # moved back below the early exit, THIS is the case that goes clean and fails the anchor.
141
147
  run_case "non-asset path, private token → BLOCK" \
142
- "README.md" "see zzsynthoperator/home" "leak"
148
+ "notes.md" "see zzsynthoperator/home" "leak"
143
149
  run_case "asset path, private token → BLOCK" \
144
150
  "CATALOG.md" "see zzsynthoperator/home" "leak"
145
151
 
146
152
  # ── Pair 2: no over-blocking. Ordinary content on both path classes stays clean. ──
147
153
  run_case "non-asset path, clean content → PASS " \
148
- "README.md" "ordinary documentation, nothing private" "clean"
154
+ "notes.md" "ordinary documentation, nothing private" "clean"
149
155
  run_case "asset path, clean content → PASS " \
150
156
  "CATALOG.md" "ordinary catalog entry, nothing private" "clean"
151
157
 
@@ -202,15 +208,21 @@ run_state_case() { # <name> <override-content|__NONE__> <defaults:keep|drop> <e
202
208
  # every layer ran. Identical verdicts for different amounts of measurement is the fail-open —
203
209
  # so the anchor has to read the verdict LINE, not just the status.
204
210
  local name="$1" ovc="$2" defmode="$3" expect="$4" want="${5:-}" out rc got
205
- printf 'operator literal zzsynthoperator\n' > "$SANDBOX/README.md"
206
- git -C "$SANDBOX" add -- README.md >/dev/null 2>&1
211
+ # 🟥 The carrier file must be a path the 4-axis gate does NOT classify — this lane is testing
212
+ # the public-surface scan, not the gate, so a HEAVY/CARVEOUT path would make every case here
213
+ # demand an Axes-2+3 marker and report "expected pass, got block".
214
+ # It used to be README.md, and that worked ONLY because README matched none of the gate's
215
+ # three buckets — i.e. this lane was green *because of* the blind spot closed on 2026-08-28.
216
+ # `notes.md` is deliberately unclassified: same extension (scan behaviour identical), no bucket.
217
+ printf 'operator literal zzsynthoperator\n' > "$SANDBOX/notes.md"
218
+ git -C "$SANDBOX" add -- notes.md >/dev/null 2>&1
207
219
  local ov="$SANDBOX/.psa_state_override"
208
220
  if [ "$ovc" = "__NONE__" ]; then rm -f "$ov"; else printf '%s\n' "$ovc" > "$ov"; fi
209
221
  local defbak="$SANDBOX/.defaults.bak"
210
222
  if [ "$defmode" = drop ]; then mv "$SANDBOX/.claude/rules/.public-surface-patterns.defaults" "$defbak" 2>/dev/null; fi
211
223
  out=$(cd "$SANDBOX" && PSA_PATTERNS="$ov" bash "$HOOK" 2>&1); rc=$?
212
224
  if [ "$defmode" = drop ]; then mv "$defbak" "$SANDBOX/.claude/rules/.public-surface-patterns.defaults" 2>/dev/null; fi
213
- git -C "$SANDBOX" rm -q --cached -- README.md >/dev/null 2>&1; rm -f "$SANDBOX/README.md" "$ov"
225
+ git -C "$SANDBOX" rm -q --cached -- notes.md >/dev/null 2>&1; rm -f "$SANDBOX/notes.md" "$ov"
214
226
  if [ "$rc" -ne 0 ]; then got=block; else got=pass; fi
215
227
  if [ "$got" != "$expect" ]; then
216
228
  echo " ❌ $name — expected $expect, got $got (exit $rc)"
@@ -83,6 +83,63 @@ is_carveout_path() {
83
83
  # challenger S1). Filtering by the new path alone also breaks rename pairing, which
84
84
  # was the original false positive on pure within-scope moves.
85
85
  # Fails CLOSED (returns substantive) on any git error — a gate must not fail open.
86
+ # ── README first-screen rule (2026-08-28) ────────────────────────────────────────
87
+ # WHY: README*.md matched NONE of HEAVY/CARVEOUT/LIGHT — a measured blind spot. Three
88
+ # paths, all reproduced in a scratch repo before this was written:
89
+ # ⓐ README alone → "no FH asset staged; 4-axis gate not applicable" — Axes 1/2+3/4 ALL skipped
90
+ # ⓑ README + a prose-only docs/*.md → that file's LIGHT verdict pulls the WHOLE commit to
91
+ # lightweight, so the README's real content change rides along (this is
92
+ # what actually happened on commits 8b982e9 / 73c1e4a)
93
+ # ⓒ README + a HEAVY file → full mode, but Axis 1 still never scans README (regression_guard.sh
94
+ # has no README in its own pathspec — NOT closed here, named as residual)
95
+ # The READMEs are npm-shipped, so a consumer-visible surface was changing with no axis enforced.
96
+ #
97
+ # WHY NOT "README is always HEAVY": a typo or badge fix would then demand a marker. Over-blocking
98
+ # trains `--no-verify`, which disarms the Destructive-Op gate living in this same hook — the repo
99
+ # has already reasoned that trade once and it holds here.
100
+ #
101
+ # WHY THIS PREDICATE: `diff_is_substantive` keys on fenced code / citation / version tokens. A
102
+ # README's load-bearing change is often none of those — today's was a first-line rewrite with no
103
+ # fence, no URL, no version, and it read as prose-only. So README additionally asks WHERE the
104
+ # change landed: above the first `---` is the first screen, the part a reader decides on. That is
105
+ # a property of the record (which lines moved), not a judgement about whether the copy is good —
106
+ # a channel check, per CLAUDE.md §Mechanization Boundary.
107
+ # Fails CLOSED on any git error, same as diff_is_substantive.
108
+ readme_first_screen_touched() { # $1 = staged README path
109
+ local file="$1" fold hunks body first_screen_cap=60
110
+ body=$(git show ":$file" 2>/dev/null) || return 0 # unreadable → fail closed
111
+ # 🟥 YAML front matter: a README that opens with `---` would set fold=1 and then EVERY real
112
+ # first-screen edit reads as below-the-fold — fail-OPEN, and both cross-family auditors found
113
+ # it independently (2026-08-28). So the fold search starts AFTER a leading front-matter block.
114
+ local skip=0
115
+ if printf '%s\n' "$body" | head -1 | grep -qE '^---[[:space:]]*$'; then
116
+ skip=$(printf '%s\n' "$body" | awk 'NR>1 && /^---[[:space:]]*$/ {print NR; exit}')
117
+ [ -n "$skip" ] || skip=1
118
+ fi
119
+ fold=$(printf '%s\n' "$body" | awk -v s="$skip" 'NR>s && /^---[[:space:]]*$/ {print NR; exit}')
120
+ # 🟥 No horizontal rule at all: do NOT treat the whole file as first screen. That was the first
121
+ # draft and it is an over-block mine — a typo on line 800 of a rule-less README would demand a
122
+ # marker, which is exactly the `--no-verify` training this rule's own comment forbids. Both
123
+ # auditors named the self-contradiction. Bound it instead: the first screen is what a reader
124
+ # sees before scrolling, and 60 lines is the same window the cold-read fixture used.
125
+ [ -n "$fold" ] || fold="$first_screen_cap"
126
+ hunks=$(git diff --cached -U0 -- "$file" 2>/dev/null | grep -E '^@@')
127
+ if [ -z "$hunks" ]; then
128
+ # 🟥 No hunks is NOT "nothing changed above the fold". `git diff -U0` prints no @@ for a
129
+ # binary blob or a pure rename, so returning false here renders UNMEASURED as none — the
130
+ # exact family this repo keeps closing. Measure whether the file is staged at all first.
131
+ git diff --cached --name-only -- "$file" 2>/dev/null | grep -q . || return 1 # genuinely unstaged
132
+ return 0 # staged but unreadable → fail closed
133
+ fi
134
+ while IFS= read -r h; do
135
+ local start
136
+ start=$(printf '%s' "$h" | sed -E 's/^@@ [^+]*\+([0-9]+).*/\1/')
137
+ case "$start" in ''|*[!0-9]*) return 0 ;; esac # unparseable → fail closed
138
+ [ "$start" -le "$fold" ] && return 0
139
+ done <<< "$hunks"
140
+ return 1
141
+ }
142
+
86
143
  diff_is_substantive() {
87
144
  local file="$1" body rc oldpath mode
88
145
  oldpath=$(git diff --cached -M --name-status 2>/dev/null \
@@ -185,7 +242,7 @@ HEAVY=$(echo "$STAGED" \
185
242
 
186
243
  # Carve-out candidates: knowledge/ docs, docs/*.md, AGENTS.md. Heavy only if substantive.
187
244
  CARVEOUT=$(echo "$STAGED" \
188
- | grep -E "(^knowledge/.*\.md$|^docs/.*\.md$|(^|/)AGENTS\.md$)" | grep -v "^knowledge/shared/rules/" || true)
245
+ | grep -E "(^knowledge/.*\.md$|^docs/.*\.md$|(^|/)AGENTS\.md$|^README(\.[A-Za-z]{2,3}([-_][A-Za-z]{2,4})?)?\.md$)" | grep -v "^knowledge/shared/rules/" || true)
189
246
 
190
247
  # Always-light by path.
191
248
  LIGHT=$(echo "$STAGED" \
@@ -197,6 +254,8 @@ if [ -n "$CARVEOUT" ]; then
197
254
  [ -z "$f" ] && continue
198
255
  if diff_is_substantive "$f"; then
199
256
  HEAVY="$HEAVY"$'\n'"$f (substantive: code/claim added)"
257
+ elif case "$f" in README.md|README.*.md) true ;; *) false ;; esac && readme_first_screen_touched "$f"; then
258
+ HEAVY="$HEAVY"$'\n'"$f (substantive: first screen — the part a reader decides on)"
200
259
  else
201
260
  LIGHT="$LIGHT"$'\n'"$f (prose-only)"
202
261
  fi
@@ -170,6 +170,25 @@ GUARD_PATHSPEC=(
170
170
  'templates/.git-hooks/*'
171
171
  'plugins/*/agents/*.md'
172
172
  '.claude/agents/*.md'
173
+ # ── Added 2026-08-29 — 세 번의 SKIP 을 추적해 보니 «진짜 갭 1 · 계기 오용 2» 였다.
174
+ # 계기 오용: `--pr` 는 커밋된 ref 를 비교하는데 커밋 «전에» 불렀다 → merge-base==HEAD → 빈 diff
175
+ # → skip. (--staged 가 그 자리에 있는 이유이고, 위 --staged 주석이 이미 그렇게 적고 있었다.)
176
+ # 진짜 갭: README 4종. 공개 첫 화면인데 Axis 1 이 구조적으로 안 돌았다 — PR #550 이 실물이다.
177
+ # 같이 들어온 나머지는 4축 자산 목록과 이 배열을 기계로 대조해 나온 미커버분이다.
178
+ # 캘리브레이션(양방향, 넓힌 사본으로 실제 이력에 실행):
179
+ # · 이력 20 커밋(README·CHEATSHEET·package.json 등을 건드린 것) → M=0 S=0, 전부 pass.
180
+ # 오탐 폭풍 없음. 그리고 SKIP 이 아니라 pass 라는 것이 «파일이 실제로 선택됐다»의 컨트롤이다
181
+ # (무기력한 pathspec 에서 오는 깨끗한 0 을 배제한다 — 2026-08-04 항목과 같은 규율).
182
+ # · known-positive: README.md 를 60% 절단 → ❌ BLOCK (M-tier 2, 'BLOCK' 토큰 66% 소실, rc=2).
183
+ # package.json 은 md/sh 형 검사 대부분이 무력하지만 F6 줄-감소가 살아 있다 — files[] 항목이
184
+ # 대량 삭제되는 회귀가 이 저장소에서 실제로 있었던 클래스다.
185
+ 'README*.md'
186
+ 'CHEATSHEET.md'
187
+ 'CATALOG.md'
188
+ '.github/workflows/*.yml'
189
+ 'scripts/*.py'
190
+ '.claude/registry/*.md'
191
+ 'package.json'
173
192
  )
174
193
 
175
194
  # 계기 무결: base ref 가 안 풀리면 diff 실패가 2>/dev/null 로 삼켜져 CHANGED 공백 →
@@ -364,7 +383,27 @@ for req in ('name:', 'description:'):
364
383
  sys.exit(1)
365
384
  print('OK')
366
385
  " 2>&1)
367
- if echo "$fm_check" | grep -q FAIL; then
386
+ fm_rc=$?
387
+ # 🟥 An ABSENT instrument is not a clean result. Before 2026-08-29 this `else` printed
388
+ # "✅ frontmatter intact" whenever `$fm_check` merely lacked the token FAIL — and
389
+ # `python3: command not found` lacks it. macOS ships no python3 by default, so on a stock
390
+ # consumer machine F1 was ALWAYS green, and that green meant "no checker", not "no defect".
391
+ # Measured by execution, not reading: same broken content, python3 present → `❌ M-TIER`,
392
+ # python3 shadowed with a 127 stub → `✅ frontmatter intact`.
393
+ # Degrade direction: this is the REVERSIBLE commit surface, so it degrades to a LOUD
394
+ # ADVISORY and deliberately does NOT touch S_TIER — bumping it would exit 1 and redden every
395
+ # such consumer's CI on any SKILL.md edit, and this file's own line 659 warns that
396
+ # over-blocking is what trains `--no-verify` into muscle memory. Not-silent and not-blocking
397
+ # are different properties; only the first is mandatory here.
398
+ # 🟥 The discriminator is the EXIT CODE, not `command -v`. A first pass at this fix asked
399
+ # "is python3 available?" and a three-way known-pair immediately broke it: a 127-stub IS on
400
+ # PATH, so `command -v` succeeded and the fail-open survived. The checker contract is
401
+ # rc 0 = intact · rc 1 = a FAIL line was printed · anything else = the instrument did not run
402
+ # (127 absent, 126 not-executable, a broken interpreter), which covers absent AND broken with
403
+ # one branch instead of enumerating causes.
404
+ if [ "$fm_rc" -ne 0 ] && [ "$fm_rc" -ne 1 ]; then
405
+ echo " ⚠️ F1 UNMEASURED — frontmatter checker did not run (rc=$fm_rc): $fm_check"
406
+ elif echo "$fm_check" | grep -q FAIL; then
368
407
  echo " ❌ M-TIER frontmatter: $fm_check"
369
408
  M_TIER=$((M_TIER + 1))
370
409
  else