@chrono-meta/fh-gate 3.21.0 → 3.22.1

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.
@@ -953,3 +953,32 @@ review, not fed in externally, and a second live demonstration the same day when
953
953
  standpoint review of this very section caught real residency and citation defects in the first
954
954
  draft (fixed in the same commit that added this line).
955
955
 
956
+ ---
957
+
958
+ ## §CM-Unmapped-Pilot-Evidence — Unmapped-file trigger — pilot evidence and the cue condition (moved from CLAUDE.md)
959
+
960
+ > Relocated **verbatim** from `CLAUDE.md` (§Field-Harness Load-Bearing Change Gate) on 2026-09-26 — resident-size diet. The resident text kept the rule and a pointer here; this section keeps the why / evidence layer. Nothing was reworded.
961
+
962
+ 🟥 **Pilot evidence, below bar, and CUE-DEPENDENT** (floor tier, blind, one
963
+ variable — this paragraph injected): **before 0/1** — *"FH 자산도 매핑된 필드 하네스도 아니라서 …
964
+ 적용 대상이 아닙니다"*, reviewed bare; **after 2/3** ran the gate. Both arms' prompt ended with *"네가
965
+ 설치된 리뷰 절차가 있으면 그것을 따라라"*. 🟥 **Without that cue the gate fired 0/51** (same day, 17
966
+ unmapped gate-shaped files × 3, same doctrine in the clone, task sentence only). So this paragraph is
967
+ muscle, not skeleton: a session must be *reminded* to run its own procedure, and no hook supplies the
968
+ reminder yet (`fh_signal_2026-09-08_gate-needs-cue.md`). Do not cite 2/3 without the cue condition.
969
+
970
+
971
+ ---
972
+
973
+ ## §CM-Crossfamily-Typing-History — Why `crossfamily:` became typed — the 2026-08-08 marker count (moved from CLAUDE.md)
974
+
975
+ > Relocated **verbatim** from `CLAUDE.md` (§Field-Harness Gate) on 2026-09-26 — resident-size diet. The resident text kept the rule and a pointer here; this section keeps the why / evidence layer. Nothing was reworded.
976
+
977
+ Before 2026-08-08
978
+ this axis was convention-only — measured on this repo, 140 markers carried the tier verdict 129
979
+ times and any decorrelation verdict **4** times.
980
+
981
+ (🟥 the "two blind Sonnet sims graded a cold-read
982
+ `tier2`" citation that stood here is **RETRACTED** — dead instrument, `tool_uses: 0`; the live re-run
983
+ inverted it at reps=1, below bar. The **rule** stands on its own wording, not on that sim)
984
+
@@ -35,6 +35,30 @@ gitignored)이고, 이 문서는 그 판정만 옮긴다. 모델은 전부 sonne
35
35
  - 이 사실이 고친 문서: `templates/.claude/rules/mcp_tool_gating.md` §2 주석 · CLAUDE.md
36
36
  §Irreversibility Gates · goal-quench rung ②.
37
37
 
38
+ ## 1-b. 관측 — 제한 시간을 넘긴 PreToolUse 훅 뒤에 도구가 **실행됐다** (표면 미확인 · 한 조건)
39
+
40
+ > **적용 범위를 먼저 읽어라**: CLI 2.1.283 · sonnet · Bash 도구 한 명령(원장에 명령 원문·권한 모드·표면이
41
+ > 안 적혔다) · 팔당 reps=3. **대화형 pty 인지 헤드리스 `-p` 인지 모른다.** 공식 문서의 제한 시간 계약과
42
+ > 대조하지 않았다. PermissionRequest 훅 · 자동승인 훅이 있는 조합은 **이 표로 말할 수 없다**.
43
+
44
+ | 팔 (위 조건 그대로) | reps | 착지 |
45
+ |---|---|---|
46
+ | PreToolUse 훅이 30초 잔 뒤 deny / exit 2, 훅 제한 시간 3초 | 3 | **3/3 실행됨** |
47
+ | 훅 없음 (대조) | 3 | 3/3 실행됨 |
48
+ | 즉시 deny (대조) | 3 | 0/3 — 멈췄다 |
49
+ | 2초 잔 뒤 deny, 제한 시간 15초 (대조) | 3 | 0/3 — 제한 안쪽의 느린 deny 는 멈췄다 |
50
+
51
+ - **설계 가정(안전한 쪽)**: 훅이 제한 시간 안에 판정을 못 내면 **도구가 실행될 수 있다**고 가정하고 게이트를
52
+ 지어라. 이 표는 그 가정을 **반박하지 않는다** — 반대 가정(«시간 초과면 막힌다»)은 이 표로 정당화되지 않는다.
53
+ - 같은 위험을 만들 수 있는 것(**미측정 가설**): 판정 경로의 막히는 읽기(FIFO · 네트워크 · 잠긴 파일) ·
54
+ 인터프리터 콜드 스타트. 재지 않았다 — 예시이지 결과가 아니다.
55
+ - 처방 후보(**미검증**): 제한 시간보다 먼저 스스로 끝나는 워치독, 막히지 않는 읽기. 워치독 자신이 늦거나
56
+ 죽을 때 deny 가 보장되는지는 따로 재야 한다 — 워치독을 두었다고 닫힌 것이 아니다.
57
+ - §1 과 같은 방향의 관측이다: 이 조건에서 멈춘 것은 **제한 안에 도착한** deny 뿐이었다.
58
+ - **미측정**: ⓐ 표면(대화형 / 헤드리스) ⓑ 제한 시간 경계 ⓒ PermissionRequest 훅의 시간 초과 ⓓ 자동승인
59
+ 훅이 있을 때 ⓔ 다른 도구(Edit · MCP) ⓕ 다른 CLI 버전. 출처: 필드 하네스(데스크톱 펫 게이트) 세션 원장
60
+ 2026-09-27(로컬, gitignored).
61
+
38
62
  ## 2. 채널 × 표면 × 시점
39
63
 
40
64
  «앞» = 사람이 고르기(답·승인) **전**에 화면/알림에 나타남 · «뒤» = 고른 **뒤**에만 · «없음» = 끝까지 안 그려짐.
@@ -4416,3 +4416,102 @@
4416
4416
  팔의 «실제 홈 영향 없음» 보고는 두 번 틀렸다(스크립트 시드 · 원인 모름) — 거버너가 mtime·heal 로그로 직접 대조해야 했다.
4417
4417
  같은 체크아웃 팔은 직렬로, 읽기 전용 조사·임시 폴더 실험만 병렬로 — 충돌 0. «앱 설치» 와 «게이트 사본 갱신» 은 다른
4418
4418
  사건이었다(설치본이 16:11 옛 판) — 설치 검증은 번들 cmp 가 아니라 **실행 중 훅의 판정** 을 찔러 봐야 했다.
4419
+
4420
+ - date: 2026-09-26
4421
+ session: 16a11bc6 (FH 로컬 거버너 · Opus 5.5 · 이월 과제 전량 → FH 답습 → 로컬 LLM)
4422
+ agent: general-purpose ×13 · Explore ×2
4423
+ task: >-
4424
+ FoD PR 팔 — #127 계획 승인 부스트 · #128 dock 간헐 · #129~#131 이월 시리즈(G31 핀 트리 · 게이트 구멍 · 계획 전문/질문 알림)
4425
+ · #132 칸 이름+설계 이관 · 칸 3 설계 초안 · 2.1.283 가시성 재측정 · FH 답습 조사(Explore) · FH #811 답습 5건 구현
4426
+ · FH #813 sidecar 판정 수리 · 로컬 LLM 어려운 픽스처 실측(234 호출)
4427
+ count: 15
4428
+ outcome: partial
4429
+ evidence: >-
4430
+ PR 10건 머지(FoD #127~#133 · FH #811 · #813) + v3.21.0 발행 · 실측 결과 파일 3. 🟥 partial 인 이유: 재측정 팔이 빈 작업경로(`cd ""`)로
4431
+ 이 레포 CLAUDE.md·.claude/settings.json 을 덮어씀(전날 거버너 백업으로 회수, 운영자 /permissions 2줄 유실) · 설계 팔이 원 목록을
4432
+ 못 찾아 재구성(거버너 보유분으로 대조) · 이월 팔이 낡은 로컬 main 에서 분기(거버너가 #128 머지 뒤 pull 누락) · 긴 실측 두 팔이
4433
+ 중간 알림만 반복하며 오래 대기.
4434
+ learning: >-
4435
+ 🟥 같은 계열 팔이 짠 판정 코드에서 codex 가 실제 fail-open 을 네 번 새로 찾았다(#811 중복 설치 CURRENT · #813 비Ollama 200 · 부분 본문).
4436
+ 판정 코드는 교차 계열 한 번이 사실상 필수. 격리 규칙을 첫 줄에 넣어도 스크립트 결함(zsh 가 낱말을 안 쪼갬 → 빈 경로)은 못 막는다 —
4437
+ 거버너가 팔 결과마다 레포 상태 + gitignored 설정 mtime 을 대조하는 절차가 유일하게 잡았다(→ FH #811 ④-f 로 기계화).
4438
+ 머지 직후 로컬 main pull 은 설치 여부와 무관하게 항상.
4439
+
4440
+ - date: 2026-09-27
4441
+ session: 9d093859 (FH 로컬 거버너 · Opus 5.5 · 야간 자율 — 칸 3 S0 · FH 자체개발 병렬 · 로컬 LLM System One)
4442
+ agent: general-purpose ×11 (재개 SendMessage 4회 별도)
4443
+ task: >-
4444
+ FoD S0 그림자 판정기(#134) · 실행기 미탐(#135) · 기밀 스캔(#136) · S0 두 번째 판정자=로컬 모델(#137) · 콜드 적재(#138)
4445
+ · FH 신선도 미러 오탐(#815) · CLAUDE.md 150k 이관 스테이징(#816) · 터미널 감사 배너(#817) 스테이징
4446
+ · 메타하네스 공존 측정(옥토·warp·gstack·cmux) · 로컬 System One 판정기 설계·기준선(두 노드 17쌍, 2,737 판정)
4447
+ count: 11
4448
+ outcome: accepted
4449
+ evidence: >-
4450
+ PR 8건 머지(FoD #134~#138 · FH #815~#817) + v3.22.0 릴리스 PR · FoD 앱 3회 재빌드·교체(매회 실제 홈 gate_hook==출하 대조)
4451
+ · S0 그림자 + 로컬 판정자 운영자 머신에서 켬 · 결과 파일 2(공존 · 로컬 판정기). 교차 계열(codex) 검토 5회 — 채택 합 12건
4452
+ (S0 모호 조인 · 실행기 fail-open 4 · 기밀 스캔 3 · CLAUDE.md 의미 5 중 일부 · 배너 KSH_ARRAYS), 전부 거버너가 원문/실행으로 확증.
4453
+ learning: >-
4454
+ 🟥 같은 계열 팔이 «게이트 FAIL 0» 으로 올린 판정 코드에서 codex 가 실제 fail-open 을 또 찾았다 — 실행기 PR 은
4455
+ 거버너가 재현 명령을 실제 훅에 넣어 4/4 무응답을 확증(붙여 쓴 옵션 `--command=` · `-c'…'`). 판정 코드는 교차 계열 +
4456
+ «재현 명령을 실행» 이 한 쌍이다. 팔 셋이 FoD 게이트의 비가역 거부(강제 푸시·브랜치 강제 삭제)에 막혔고 셋 다 우회 대신
4457
+ 병합 경로로 돌았다 — 게이트가 자기 저자를 막는 게 정상 동작이다. 로컬 판정기는 따뜻한 4090 에서 `git push -uf` 를
4458
+ reversible p=1.0 로 판정 — 그림자 전용 근거가 실사용 경로에서 재현.
4459
+
4460
+ - date: 2026-09-27
4461
+ session: 9d093859 (FH 로컬 거버너 · Opus 5.5 · 저녁~야간 — forge-gate 챔버 v2·v3 · FoD 게이트 활동 창/지도 · 칸 3 백테스트)
4462
+ agent: fh-meta:beginner ×1 · fh-meta:main-player ×1 · fh-meta:challenger ×2 (v2 challenger 1 + v3 페르소나 3 중 합산)
4463
+ task: >-
4464
+ 챔버 forge-gate-v2 페르소나(challenger) · forge-gate-v3 블라인드 페르소나 3(beginner · main-player · challenger)
4465
+ count: 4
4466
+ outcome: accepted
4467
+ evidence: >-
4468
+ v2 challenger S5/A20/B8 → v2 KILL(운영자 HITL) · v3 beginner HARD2/SOFT11 · main-player PARTIAL · challenger S6/A11/B4
4469
+ → 판정 보류 → 판정표 PREREG 로 매체 전환(codex r1 S11 → r2 S11 → r3 S0 · r4 diff-only S0).
4470
+ learning: >-
4471
+ 🟥 같은 계열 페르소나로 산문 INTENT 를 두 바퀴 돌리면 S 가 안 줄었다(5→6). 매체를 판정표로 바꾸고 다른 계열이 읽자 3라운드에 0.
4472
+ 그런데 **판정표의 결함(«비가역 ≠ 막아야 할 것」)은 페르소나 3 + codex 4라운드 누구도 못 봤고 실물 자연층 추출이 처음 드러냈다** —
4473
+ 봉인 전에 실물 분포를 한 번 뽑아라.
4474
+
4475
+ - date: 2026-09-27
4476
+ session: 9d093859 (같은 세션, 저녁~야간)
4477
+ agent: general-purpose ×9
4478
+ task: >-
4479
+ forge-gate-v3 첫 슬라이스 3(격리 러너+카나리 · 선행 가드 분류+비교군+P 층 · 자연층 H-N 추출) ·
4480
+ FoD 격리 가드 API 전수+다이얼 끔=원장 끔(#146) · 게이트 활동 창 v0(#148) · 게이트 지도 모델(#149)·레이아웃(#150)·보기(#152, 둘 대체) ·
4481
+ 칸 3 S0 역사 백테스트(PREREG r3)
4482
+ count: 9
4483
+ outcome: accepted
4484
+ evidence: >-
4485
+ forge-gate-v3 KILL(판정표 행 ① — 보존 30일로 세션 조건·W2 불가) · FoD PR 머지 #146 #148 #152(+ #147 #151 #153 거버너 직접) ·
4486
+ 설치본 교체 4회(매회 asar==빌드 · 옛≠새 · 실제 홈 gate_hook==출하) · 백테스트 NOT-CONVERGED(비가역 allow 0 · 뒤집음 15/17 전부 거절한 가역 명령).
4487
+ learning: >-
4488
+ 🟥 판정표 봉인 후 첫 슬라이스가 dcg 라이선스 라이더(AI 사용 금지)를 찾았다 — 비교군은 라이선스부터. 팔 둘이 같은 레인(module_wired)에
4489
+ 서로 다른 미배선 예외를 넣었다 — 병렬 조각은 «배선될 때 합쳐 한 PR」로 머지해 예외를 걷어라. 에이전트 하나가 거버너 대기 루프의
4490
+ pgrep 자기 매칭을 지목했다(자력 0) — 대기 패턴은 `[b]ash` 식으로 자기 명령줄을 피한다. 역사 백테스트는 «거절 = 조종 신호」를 드러냈다.
4491
+
4492
+ - date: 2026-09-27
4493
+ session: 9d093859 (같은 세션, 야간)
4494
+ agent: general-purpose ×1 (재개 SendMessage 1회 — 교차 계열 지적 수리)
4495
+ task: >-
4496
+ FoD 카드 사람 답 → 원장(human.answer) + 활동 창 «FH 답 검토」(human.review) — 칸 3 전향 확인 계기(#154)
4497
+ count: 1
4498
+ outcome: accepted
4499
+ evidence: >-
4500
+ #154 머지(dc7be36) · 레인 69/0 · 패치 self-check 16길 · 라이브 6/0 · gate 313/0. 거버너 codex R1 S3(세션 신뢰·창 닫힘 문자열 폴백과
4501
+ 원격 승인이 표지 없이 human) → 재개 수리 → R2 r1 8/8 CLOSED, 새 «S」 3 은 거버너가 원문 대조로 판정(2 = 방어층 중복 → B, 1 = 소스 반증).
4502
+ learning: >-
4503
+ 🟥 «사람이 답했다」를 코드 길이 아니라 문자열로 추정하는 폴백이 셋이었다 — 게이트 FAIL 0 · 레인 57 인 PR 이었다. 승격 근거가 될
4504
+ 기록은 «사람」을 기본값·폴백으로 절대 만들지 않는 불변식을 세 겹(길 표 · 분류 안전망 · 스키마)으로 둬야 하고, 그걸 잡은 것은 또 교차 계열이었다.
4505
+ 교차 계열의 2라운드 «S」도 전부 옳지는 않다 — 원문 대조가 절반을 강등·반증했다(판정은 거버너가 원문으로).
4506
+
4507
+ - date: 2026-09-28
4508
+ session: 9d093859 (자정 이후 — 2026-09-27 야간 이어짐)
4509
+ agent: general-purpose ×1 (SendMessage 재개 — 2026-09-27 «FoD 카드 사람 답」 에이전트)
4510
+ task: >-
4511
+ #154 교차 계열 지적(S1~S3 · A4~A6 · B9 · B10) 수리 — human 은 사람 UI 표지에서만
4512
+ count: 1
4513
+ outcome: accepted
4514
+ evidence: >-
4515
+ 커밋 94dd0d4 · 레인 69/0 · 패치 self-check 16길 · 라이브 6/0 · gate 313/0 → 머지 dc7be36. 2026-09-27 엔트리(«카드 사람 답」)의 재개분을 날짜별로 분리 기록.
4516
+ learning: >-
4517
+ 재개 디스패치는 날짜가 바뀌면 그 날짜 원장에 따로 남는다(④-e 는 날짜로 센다) — 한 엔트리로 묶어 적으면 다음 날 마감이 «원장 0」으로 막는다.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrono-meta/fh-gate",
3
- "version": "3.21.0",
3
+ "version": "3.22.1",
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": {
@@ -175,6 +175,8 @@
175
175
  "scripts/gate_anchor_check.sh",
176
176
  "scripts/gate_pathspec_check.sh",
177
177
  "scripts/prless_delta_scan.sh",
178
+ "scripts/test_claude_md_size_lanes.sh",
179
+ "scripts/test_fh_audit_check_lanes.sh",
178
180
  "scripts/test_prless_delta_scan_lanes.sh",
179
181
  "scripts/gate_bootstrap_ephemeral.sh",
180
182
  "scripts/gate_shape_scan.sh",
@@ -332,6 +334,7 @@
332
334
  "scripts/test_session_checklist_lanes.sh",
333
335
  "scripts/test_session_close_chain_lanes.sh",
334
336
  "scripts/test_session_close_lanes.sh",
337
+ "scripts/test_session_load_mirror_fp_lanes.sh",
335
338
  "scripts/test_sidecar_calibrate_lanes.sh",
336
339
  "scripts/test_sidecar_wait_stdin.sh",
337
340
  "scripts/test_sim_isolated_run_lanes.sh",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-commons",
3
- "version": "3.21.0",
3
+ "version": "3.22.1",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-meta",
3
- "version": "3.21.0",
3
+ "version": "3.22.1",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -1,5 +1,34 @@
1
1
  # forge-harness (fh-meta) Changelog
2
2
 
3
+ ### [3.22.1] — 2026-09-28 — 동반 저장소 미러가 서드파티 클론을 안 싣고, 훅 제한 시간 관측을 싣는다
4
+
5
+ **patch — 수정 하나 + 문서.** 소비자의 게이트 수용은 안 깬다(막는 쪽으로 바뀐 것 없음).
6
+
7
+ - **`scripts/sync-to-be.sh` 가 `vendor/` 를 동반 저장소로 안 싣는다** — 측정용으로 받은 서드파티 클론이
8
+ 비공개 동반 저장소에 실린 사고(726 파일) 수리. rsync·tar 폴백 둘 다 같은 제외 배열이고, 제외되는 경로는
9
+ `--quiet` 에서도 stderr 로 한 줄씩 알린다(우리 것인 vendor 가 조용히 빠지지 않게). 레인 L4c·L4d, 178/0.
10
+ - **`knowledge/shared/harness-core/hook_channel_visibility.md` §1-b** — 제한 시간을 넘긴 PreToolUse 훅 뒤에
11
+ 도구가 실행된 관측(2.1.283 · sonnet · Bash 1건 · 팔당 3판)을 «안전한 쪽 설계 가정」으로만 싣는다. 표면
12
+ (대화형/헤드리스) · 다른 도구 · PermissionRequest · 자동승인 조합 · 버전은 미측정으로 명시.
13
+ - 챔버 순서 증인 원장(forge-gate v1~v3) · 서브에이전트 디스패치 원장 갱신.
14
+
15
+ ### [3.22.0] — 2026-09-27 — clone 사용자의 세션 시작 경고·터미널 거짓 알림을 걷고, 사이드카 판정 어휘를 가른다
16
+
17
+ **minor — 새 레인 셋 + 출하 스크립트 동작 변경.** 소비자의 게이트 수용은 안 깬다(막는 쪽으로 바뀐 것 없음).
18
+
19
+ - **CLAUDE.md 150k 경고 수리** — `git clone` 사용자가 v3.16.0 무렵부터 세션마다 보던
20
+ «CLAUDE.md is over the 150.0k-char limit» 를 없앴다(154,149 → 136,889자). 이유층 57블록을 상세 파일 6개로
21
+ **원문 그대로** 옮기고 포인터를 남겼다 — 규칙·트리거·문 리터럴·비가역 게이트 문장은 상주 그대로.
22
+ 옛 문장 1,562 중 누락 0 · 보호 리터럴 133 · 격리 클론 플로어 티어 실사용 평가 12/12.
23
+ 크기 가드 레인 `scripts/test_claude_md_size_lanes.sh`(145,000자, 문자 단위).
24
+ - **터미널 감사 배너(`templates/fh_audit_check.zsh`) 거짓 경보 수리** — 끌 수 없던 «No harvest history found» ·
25
+ 상태 표시 센티널(`_wizard_done` 등)을 90일 감사로 읽던 줄 · 새 설치의 zsh NOMATCH 로 배너 통째 소멸 ·
26
+ 호출 셸 KSH_ARRAYS 누출. 진짜 밀린 주간감사·frontier·Area B·커스텀 센티널은 그대로 뜬다. 레인 27/0.
27
+ - **세션 시작 «카드보다 새 파일» 미러 오탐 수리**(`scripts/fh_session_load.sh`) — 싱크가 mtime 만 새로 찍은
28
+ 미러 사본(허브 원본과 바이트 동일 · 카드 이전 커밋 · 깨끗한 트리)은 목록에서 빼고 이름만 한 줄로. 레인 14/0.
29
+ - **`scripts/sidecar_calibrate.sh` 판정 어휘** — «모델 없음» 을 «도달 불가» 로 말하지 않고, 가짜 호스트·끊긴 전송이
30
+ 패널에 못 든다.
31
+
3
32
  ### [3.21.0] — 2026-09-26 — 마감 게이트가 옛 훅과 세션 중 설정 덮어쓰기를 이름으로 말한다
4
33
 
5
34
  **minor — 새 출하 스크립트 둘 + 마감 체인 동작 변경.** 소비자의 게이트 수용은 안 깬다
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-preprep",
3
- "version": "3.21.0",
3
+ "version": "3.22.1",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-qp",
3
- "version": "3.21.0",
3
+ "version": "3.22.1",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -468,7 +468,42 @@ CARD_EPOCH=0
468
468
  # ★ "$TM" (not the literal "tracks-meta") — paper-signals/handoff/digests are FH-exclusive areas
469
469
  # sync-to-be.sh never namespaces (it does not write them for any hub), only tracks-meta needs the
470
470
  # suffix here (pmh-dev#68 PR #368 review).
471
+ #
472
+ # 🟥 Mirror-copy false positive (fixed 2026-09-26): `sync-to-be.sh` REWRITES every tracks/_meta
473
+ # mirror it touches, so a mirror's mtime is «when the sync last ran», not «when its content was
474
+ # new». Measured: two result files the card had already absorbed were listed as NEWER because a
475
+ # 22:28 sync restamped them — git had last committed them the day BEFORE the card, and the hub
476
+ # copies carried the same 22:28 stamp, so no mtime anywhere could tell. A `$TM` mirror is DEMOTED
477
+ # (to a one-line note that names it — never silently dropped) only when ALL of these hold:
478
+ # ① line 1 is EXACTLY the sync banner (not a substring — a file merely mentioning it stays listed)
479
+ # ② the rest is byte-identical to the hub's canonical `tracks/_meta/<same path>` (cmp rc 0 only;
480
+ # differ = 1 and error = 2 both stay listed)
481
+ # ③ the companion git records that content as committed AT OR BEFORE the card, and the file is
482
+ # clean in the companion tree. Identity alone is not enough (cross-family [high], codex
483
+ # 2026-09-26): a result written to the hub TODAY and synced is identical too, yet the card has
484
+ # never seen it — its first commit lands after the card, so ③ keeps it listed.
485
+ # git unavailable / no commit found / dirty → NOT demoted, and the git-unavailable case says so.
486
+ # Named residual: content another machine committed before this card was written, pulled later and
487
+ # copied into the hub by sync-from-be, satisfies ①②③ while still unseen here. Narrow (needs the
488
+ # reverse sync to have run) and the note still names the file.
489
+ _MIRROR_BANNER="<!-- MIRROR COPY — synced from the ${HUB_NAME:-forge-harness} hub. Do NOT edit here; the next sync overwrites it. Edit the canonical file under the hub instead. -->"
490
+ MIRROR_GIT_UNAVAIL=""
491
+ command -v git >/dev/null 2>&1 || MIRROR_GIT_UNAVAIL=1
492
+ _is_absorbed_mirror() { # $1 = companion file, $2 = hub canonical path → 0 only when ①②③ all hold
493
+ case "$1" in *.md) ;; *) return 1 ;; esac
494
+ [ -f "$2" ] || return 1
495
+ [ "$(head -1 "$1" 2>/dev/null)" = "$_MIRROR_BANNER" ] || return 1
496
+ tail -n +2 "$1" 2>/dev/null | cmp -s - "$2" || return 1
497
+ [ -z "$MIRROR_GIT_UNAVAIL" ] || return 1
498
+ local rel="${1#$BE/}" ct st
499
+ ct="$(git -C "$BE" log -1 --format=%ct -- "$rel" 2>/dev/null)" || return 1
500
+ case "$ct" in ''|*[!0-9]*) return 1 ;; esac
501
+ [ "$ct" -le "${CARD_EPOCH:-0}" ] || return 1
502
+ st="$(git -C "$BE" status --porcelain -- "$rel" 2>/dev/null)" || return 1
503
+ [ -z "$st" ]
504
+ }
471
505
  NEWER=""
506
+ MIRROR_REFRESH=""; MIRROR_REFRESH_N=0
472
507
  for sub in paper-signals handoff "$TM" digests; do
473
508
  d="$BE/$sub"
474
509
  [ -d "$d" ] || continue
@@ -476,6 +511,10 @@ for sub in paper-signals handoff "$TM" digests; do
476
511
  [ -n "$f" ] || continue
477
512
  fe="$(_mtime "$f")"
478
513
  if [ "${fe:-0}" -gt "${CARD_EPOCH:-0}" ]; then
514
+ if [ "$sub" = "$TM" ] && _is_absorbed_mirror "$f" "$FH/tracks/_meta/${f#$d/}"; then
515
+ MIRROR_REFRESH="${MIRROR_REFRESH} ${f#$d/}"; MIRROR_REFRESH_N=$((MIRROR_REFRESH_N + 1))
516
+ continue
517
+ fi
479
518
  NEWER="${NEWER} - ${f#$BE/}\n"
480
519
  fi
481
520
  done <<EOF
@@ -566,6 +605,13 @@ fi
566
605
  echo " (no companion files newer than the session card)"
567
606
  fi
568
607
  fi
608
+ if [ "$MIRROR_REFRESH_N" -gt 0 ]; then
609
+ echo " ⓘ ${MIRROR_REFRESH_N} mirror cop(y/ies) newer than the card by mtime only — byte-identical to the hub's"
610
+ echo " tracks/_meta copy and committed before the card (sync restamped them):${MIRROR_REFRESH}"
611
+ fi
612
+ if [ -n "$MIRROR_GIT_UNAVAIL" ]; then
613
+ echo " ⚠️ git unavailable — mirror-copy demotion is OFF; sync-restamped mirrors are listed above by mtime."
614
+ fi
569
615
  if [ -n "$STATUS_MAP" ]; then
570
616
  echo "── handoff/signal STATUS map (mtime-independent — closed items) ──"
571
617
  printf "%b" "$STATUS_MAP"
@@ -451,6 +451,47 @@ else
451
451
  fail=1
452
452
  fi
453
453
 
454
+ # session-load mirror FP — fh_session_load.sh listed sync-restamped mirror copies (byte-identical to
455
+ # the hub canonical) as «NEWER THAN SESSION CARD». Lane = FP stays quiet + every not-provably-same
456
+ # case (genuine · differs · no hub copy · lookalike banner · outside $TM) still listed.
457
+ if [ ! -f scripts/fh_session_load.sh ]; then
458
+ _absent_subject_verdict "session-load mirror FP lanes" "scripts/fh_session_load.sh" || fail=1
459
+ elif [ -f scripts/test_session_load_mirror_fp_lanes.sh ]; then
460
+ if ! bash scripts/test_session_load_mirror_fp_lanes.sh; then
461
+ fail=1
462
+ fi
463
+ else
464
+ echo "FAIL session-load mirror FP lanes: fh_session_load.sh present but its anchor is missing"
465
+ fail=1
466
+ fi
467
+
468
+ # CLAUDE.md size guard — Claude Code warns «CLAUDE.md is over the 150.0k-char limit» on every session
469
+ # start of a clone (measured 2026-09-26: 154,149 chars since ~v3.16.0). Guard at 145k (headroom ~1k/week).
470
+ if [ ! -f CLAUDE.md ]; then
471
+ _absent_subject_verdict "claude-md size lanes" "CLAUDE.md" || fail=1
472
+ elif [ -f scripts/test_claude_md_size_lanes.sh ]; then
473
+ if ! bash scripts/test_claude_md_size_lanes.sh; then
474
+ fail=1
475
+ fi
476
+ else
477
+ echo "FAIL claude-md size lanes: CLAUDE.md present but its anchor is missing"
478
+ fail=1
479
+ fi
480
+
481
+ # terminal audit banner — templates/fh_audit_check.zsh (sourced from every user's ~/.zshrc by install-wizard)
482
+ # fired 2 false lines forever (harvest glob nothing writes · state-marker sentinels aged as audits) and
483
+ # aborted whole on zsh NOMATCH for a fresh install. Lane = false lines gone · real overdue audits still warn.
484
+ if [ ! -f templates/fh_audit_check.zsh ]; then
485
+ _absent_subject_verdict "audit banner lanes" "templates/fh_audit_check.zsh" || fail=1
486
+ elif [ -f scripts/test_fh_audit_check_lanes.sh ]; then
487
+ if ! bash scripts/test_fh_audit_check_lanes.sh; then
488
+ fail=1
489
+ fi
490
+ else
491
+ echo "FAIL audit banner lanes: fh_audit_check.zsh present but its anchor is missing"
492
+ fail=1
493
+ fi
494
+
454
495
  # typed-finding pipeline — fleet (multi-family, parallel) + reject stage (cross-family verdict, code
455
496
  # drops false positives). Subject = scripts/finding_fleet.sh + scripts/finding_verify.py.
456
497
  if [ ! -f scripts/finding_verify.py ]; then
@@ -268,19 +268,138 @@ OLLAMA_HOST_URL="${FH_OLLAMA_HOST:-http://127.0.0.1:11434}"
268
268
  # carry a verdict". At 512 the same model answered `PASS`. Budget starvation and incapacity are
269
269
  # different findings and must not be reported as one.
270
270
  OLLAMA_NUM_PREDICT="${FH_OLLAMA_NUM_PREDICT:-512}"
271
+ # Per-model generate deadline (seconds). Overridable so the lanes can drive a mid-body stall without
272
+ # waiting four minutes; the default is unchanged.
273
+ OLLAMA_GEN_TIMEOUT="${FH_OLLAMA_GEN_TIMEOUT:-240}"
274
+
275
+ # _http <max-secs> <url> [json-body] — one request, and it KEEPS THE STATUS CODE.
276
+ # Sets HTTP_CODE (000 when no HTTP answer came back at all), HTTP_BODY, HTTP_RC (curl's own rc).
277
+ #
278
+ # 🟥 WHY NOT `curl -sf` (2026-09-24, Glimmer G1): `-f` throws the body away on ANY 4xx/5xx and prints
279
+ # nothing, so «the node answered "invalid model name"» and «no node answered» both reached the
280
+ # caller as the same empty string — and the empty string was rendered UNREACHABLE-THIS-RUN with
281
+ # «(measured, not inferred)» after it. What had been measured was the empty string, not reachability.
282
+ # Those two point the operator in opposite directions (network vs. name/inventory), so they must
283
+ # never share a label. Body and code travel together through one capture; the code is split off
284
+ # the LAST line — no pipe, so no rc is dropped on the way (pipefail class lock).
285
+ _http() {
286
+ local secs="$1" url="$2" data="${3:-}" raw
287
+ if [ -n "$data" ]; then
288
+ raw="$(curl -s --max-time "$secs" -w '\n%{http_code}' "$url" -d "$data" 2>/dev/null)"; HTTP_RC=$?
289
+ else
290
+ raw="$(curl -s --max-time "$secs" -w '\n%{http_code}' "$url" 2>/dev/null)"; HTTP_RC=$?
291
+ fi
292
+ HTTP_CODE="${raw##*$'\n'}"
293
+ case "$raw" in *$'\n'*) HTTP_BODY="${raw%$'\n'*}" ;; *) HTTP_BODY="" ;; esac
294
+ case "$HTTP_CODE" in [0-9][0-9][0-9]) : ;; *) HTTP_CODE="000" ;; esac
295
+ }
296
+
297
+ # _http_why — human reason for HTTP_CODE=000, from curl's rc. Only the common three are named; any
298
+ # other rc is printed as a number rather than guessed at.
299
+ _http_why() {
300
+ case "$HTTP_RC" in
301
+ 7) echo "connection refused" ;;
302
+ 28) echo "timed out" ;;
303
+ 52) echo "empty reply — connection closed without an HTTP answer" ;;
304
+ 6) echo "host not resolved" ;;
305
+ *) echo "curl rc=$HTTP_RC" ;;
306
+ esac
307
+ }
308
+
309
+ # _err_summary — the server's own words for a non-200: the JSON `error` field when there is one,
310
+ # else the first 80 chars of the raw body. One line, no parentheses (they close the label).
311
+ _err_summary() {
312
+ local s
313
+ s="$(printf '%s' "$HTTP_BODY" | python3 -c 'import json,sys
314
+ try: d=json.load(sys.stdin); e=d.get("error","") if isinstance(d,dict) else ""
315
+ except Exception: e=""
316
+ print(e if isinstance(e,str) else json.dumps(e))' 2>/dev/null)"
317
+ [ -n "$s" ] || s="$HTTP_BODY"
318
+ s="$(printf '%s' "$s" | tr '\r\n()' ' []' | cut -c1-80)"
319
+ [ -n "$s" ] || s="empty body"
320
+ printf '%s' "$s"
321
+ }
271
322
 
272
323
  probe_ollama() {
273
324
  command -v curl >/dev/null 2>&1 || { echo "ollama ABSENT — curl missing (absence measured)"; return 0; }
274
- curl -sf --max-time 10 "$OLLAMA_HOST_URL/api/version" >/dev/null 2>&1 || {
275
- printf 'ollama ABSENT — no server at the configured host (absence measured, not assumed)\n'
325
+ _http 10 "$OLLAMA_HOST_URL/api/version"
326
+ if [ "$HTTP_CODE" = "000" ]; then
327
+ printf 'ollama ABSENT — no server at the configured host (%s; absence measured, not assumed)\n' "$(_http_why)"
276
328
  printf ' set FH_OLLAMA_HOST to probe a remote node; default is loopback\n'
277
329
  return 0
278
- }
330
+ fi
331
+ if [ "$HTTP_RC" -ne 0 ]; then
332
+ # An answer started (http code present) but did not finish — nothing about the host was measured.
333
+ printf 'ollama UNMEASURED — /api/version answered http %s but the transfer did not complete (%s)\n' "$HTTP_CODE" "$(_http_why)"
334
+ return 0
335
+ fi
336
+ if [ "$HTTP_CODE" != "200" ]; then
337
+ # Something IS listening — it just is not answering as an Ollama server. Not ABSENT.
338
+ printf 'ollama HOST-ERROR — something answered at the configured host, but /api/version returned http %s: %s\n' \
339
+ "$HTTP_CODE" "$(_err_summary)"
340
+ printf ' a server was reached, so this is not absence; check that FH_OLLAMA_HOST points at Ollama\n'
341
+ return 0
342
+ fi
343
+ # 🟥 «Any 200» is not «an Ollama server» (cross-family review, 2026-09-26). A host that answers
344
+ # 200 to everything and echoes the pinned name back in a generate envelope would otherwise reach
345
+ # PIN-OK(envelope) and JOIN THE PANEL — the envelope anchor is only a server-side fact if the
346
+ # server is the one we think it is. Require the Ollama shape: a JSON object with a string
347
+ # `version`. Anything else is HOST-ERROR and the leg stops.
348
+ if ! printf '%s' "$HTTP_BODY" | python3 -c 'import json,sys
349
+ d=json.load(sys.stdin)
350
+ raise SystemExit(0 if isinstance(d,dict) and isinstance(d.get("version"),str) and d["version"] else 1)' >/dev/null 2>&1; then
351
+ printf 'ollama HOST-ERROR — /api/version returned http 200 but not the Ollama shape {"version": "..."}: %s\n' "$(_err_summary)"
352
+ printf ' something answered, but it is not recognisably Ollama — nothing from this host enters the panel\n'
353
+ return 0
354
+ fi
279
355
 
356
+ # ── FH_OLLAMA_MODELS: comma-separated. Whitespace around an item is trimmed; whitespace INSIDE an
357
+ # item is REJECTED, not normalised. Chosen deliberately (2026-09-24 G1):
358
+ # · Ollama model names cannot contain whitespace, so an inner space means the caller used a
359
+ # different separator contract. Normalising would mean the calibrator GUESSING the input it
360
+ # was given — and a marker quotes this run's output, so "a b" and "a,b" would become
361
+ # indistinguishable in the record, hiding the contract drift that caused the incident.
362
+ # · Trimming "a, b" is not a guess — the commas are there, only padding is removed.
363
+ # · The cost of rejecting is one loud, cheap rephrase (the message prints the corrected value);
364
+ # the cost of guessing is silent. Exit stays 0 — detector, not gate.
280
365
  local models="${FH_OLLAMA_MODELS:-}"
281
- if [ -z "$models" ]; then
282
- models=$(curl -sf --max-time 15 "$OLLAMA_HOST_URL/api/tags" 2>/dev/null \
283
- | python3 -c 'import json,sys
366
+ if [ -n "$models" ]; then
367
+ local cleaned="" item bad="" IFS=,
368
+ for item in $models; do
369
+ item="$(printf '%s' "$item" | sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//')"
370
+ [ -n "$item" ] || continue
371
+ case "$item" in *[[:space:]]*) bad="$item" ;; esac
372
+ cleaned="${cleaned:+$cleaned,}$item"
373
+ done
374
+ if [ -z "$cleaned" ]; then
375
+ # Explicitly set, but nothing survives trimming. Falling through to /api/tags would probe
376
+ # models the caller never named; staying silent would read as "no models".
377
+ printf 'ollama INPUT-ERROR — FH_OLLAMA_MODELS is set but has no model names after trimming: "%s"\n' "$models"
378
+ printf ' unset it to probe the listed models, or give a comma-separated list. Nothing was probed.\n'
379
+ return 0
380
+ fi
381
+ if [ -n "$bad" ]; then
382
+ printf 'ollama INPUT-ERROR — FH_OLLAMA_MODELS item contains whitespace: "%s"\n' "$bad"
383
+ printf ' the separator is a COMMA; model names cannot contain spaces. Nothing was probed.\n'
384
+ printf ' did you mean: FH_OLLAMA_MODELS="%s"\n' "$(printf '%s' "$cleaned" | tr -s '[:space:]' ',')"
385
+ return 0
386
+ fi
387
+ models="$cleaned"
388
+ else
389
+ _http 15 "$OLLAMA_HOST_URL/api/tags"
390
+ if [ "$HTTP_CODE" != "200" ] || [ "$HTTP_RC" -ne 0 ]; then
391
+ # A failed listing is not an empty listing. And a tags call that got no HTTP answer did not
392
+ # measure reachability either — say only what was measured.
393
+ if [ "$HTTP_CODE" = "000" ]; then
394
+ printf 'ollama model list UNMEASURED (tags call got no HTTP answer: %s) — not empty\n' "$(_http_why)"
395
+ elif [ "$HTTP_RC" -ne 0 ]; then
396
+ printf 'ollama model list UNMEASURED (tags call answered http %s but did not complete: %s) — not empty\n' "$HTTP_CODE" "$(_http_why)"
397
+ else
398
+ printf 'ollama REACHABLE but /api/tags returned http %s: %s — model list UNMEASURED, not empty\n' "$HTTP_CODE" "$(_err_summary)"
399
+ fi
400
+ return 0
401
+ fi
402
+ models=$(printf '%s' "$HTTP_BODY" | python3 -c 'import json,sys
284
403
  try: d=json.load(sys.stdin)
285
404
  except Exception: raise SystemExit
286
405
  print(",".join(m["name"] for m in d.get("models",[])[:6]))' 2>/dev/null)
@@ -289,10 +408,21 @@ print(",".join(m["name"] for m in d.get("models",[])[:6]))' 2>/dev/null)
289
408
 
290
409
  # Control runs ONCE per host, not per model: it is a property of the server, and repeating it per
291
410
  # model would just multiply the cost of a fact that cannot differ.
292
- local ctl ctl_state
293
- ctl=$(curl -s --max-time 20 "$OLLAMA_HOST_URL/api/generate" \
294
- -d '{"model":"fh-calib-nonexistent:99b","prompt":"hi","stream":false}' 2>&1)
295
- if printf '%s' "$ctl" | grep -qiE '"error"|not found'; then ctl_state="rejects-bogus"; else ctl_state="accepts-bogus"; fi
411
+ # 🟥 A control that got NO answer is unmeasured — it was previously read as "accepts-bogus"
412
+ # because an empty body contains no "error". Silence is not acceptance.
413
+ local ctl_state
414
+ _http 20 "$OLLAMA_HOST_URL/api/generate" '{"model":"fh-calib-nonexistent:99b","prompt":"hi","stream":false}'
415
+ # 🟥 Only a 4xx is evidence of rejection. A 5xx is the server FAILING, which says nothing about
416
+ # whether it would have validated the name; 000 and an incomplete transfer measured nothing.
417
+ # All three are `unmeasured` (cross-family review, 2026-09-26: 5xx was read as rejects-bogus).
418
+ case "$HTTP_CODE" in
419
+ 4[0-9][0-9]) ctl_state="rejects-bogus" ;;
420
+ 200)
421
+ if printf '%s' "$HTTP_BODY" | grep -qiE '"error"|not found'; then ctl_state="rejects-bogus"
422
+ else ctl_state="accepts-bogus"; fi ;;
423
+ *) ctl_state="unmeasured" ;;
424
+ esac
425
+ [ "$HTTP_RC" -ne 0 ] && ctl_state="unmeasured"
296
426
 
297
427
  local IFS=,
298
428
  for m in $models; do
@@ -305,10 +435,35 @@ print(",".join(m["name"] for m in d.get("models",[])[:6]))' 2>/dev/null)
305
435
  local body out env_model resp compact pin v
306
436
  body=$(python3 -c 'import json,sys; print(json.dumps({"model":sys.argv[1],"prompt":sys.argv[2],"stream":False,"options":{"num_predict":int(sys.argv[3]),"temperature":0}}))' \
307
437
  "$m" "$VERDICT_PROMPT" "$OLLAMA_NUM_PREDICT")
308
- out=$(curl -sf --max-time 240 "$OLLAMA_HOST_URL/api/generate" -d "$body" 2>/dev/null)
309
- if [ -z "$out" ]; then
310
- printf 'ollama %-22s UNREACHABLE-THIS-RUN (measured, not inferred)\n' "$m"; continue
438
+ _http "$OLLAMA_GEN_TIMEOUT" "$OLLAMA_HOST_URL/api/generate" "$body"
439
+ # 🟥 A status line is not a completed answer. If curl failed AFTER the headers (timeout mid-body,
440
+ # connection reset), HTTP_CODE can read 200 while HTTP_BODY is whatever arrived — possibly a
441
+ # complete-looking JSON that would parse to PIN-OK and join the panel. rc≠0 wins over the code.
442
+ if [ "$HTTP_RC" -ne 0 ] && [ "$HTTP_CODE" != "000" ]; then
443
+ printf 'ollama %-22s UNMEASURED-THIS-RUN (http %s but the transfer did not complete: %s) — not in the panel\n' "$m" "$HTTP_CODE" "$(_http_why)"
444
+ continue
311
445
  fi
446
+ # Three different events, three different labels — never collapse them again:
447
+ # 000 → no HTTP answer at all → UNREACHABLE-THIS-RUN (this one IS about the network)
448
+ # 4xx → the server answered and refused → MODEL-ERROR(<its words>) — name / inventory problem
449
+ # 5xx → the server answered and failed → SERVER-ERROR(<its words>) — load / OOM / runtime
450
+ # None of them joins the panel, and none of them is PIN-OK or UNTRUSTED-PIN: nothing was served.
451
+ case "$HTTP_CODE" in
452
+ 000)
453
+ printf 'ollama %-22s UNREACHABLE-THIS-RUN (%s — no HTTP answer to the generate call)\n' "$m" "$(_http_why)"
454
+ continue ;;
455
+ 4[0-9][0-9])
456
+ printf 'ollama %-22s MODEL-ERROR(%s) · control: %s\n' "$m" "$(_err_summary)" "$ctl_state"
457
+ printf ' the server WAS reached and answered http %s — check the model name and this node'"'"'s\n' "$HTTP_CODE"
458
+ printf ' inventory, not the network. Not in the panel: no model was served.\n'
459
+ continue ;;
460
+ 200) : ;;
461
+ *)
462
+ printf 'ollama %-22s SERVER-ERROR(http %s: %s) · control: %s\n' "$m" "$HTTP_CODE" "$(_err_summary)" "$ctl_state"
463
+ printf ' the server WAS reached but failed to serve (load / memory / runtime). Not in the panel.\n'
464
+ continue ;;
465
+ esac
466
+ out="$HTTP_BODY"
312
467
  env_model=$(printf '%s' "$out" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("model",""))' 2>/dev/null)
313
468
  resp=$(printf '%s' "$out" | python3 -c 'import json,sys; print((json.load(sys.stdin).get("response") or "").strip())' 2>/dev/null)
314
469
  compact=$(printf '%s' "$resp" | tr -s '[:space:]' ' ' | sed 's/^ *//; s/ *$//')