@chrono-meta/fh-gate 2.9.1 → 2.10.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.
@@ -11,13 +11,13 @@
11
11
  "plugins": [
12
12
  {
13
13
  "name": "fh-meta",
14
- "version": "2.9.1",
14
+ "version": "2.10.0",
15
15
  "description": "New in 2.2.0: BREAKING (gate): chamber step 6 now reads ACTUAL.md, not BUDGET.md — an in-flight chamber run whose actual cost sits in BUDGET.md blocks until the ACTUAL: line moves to tracks/_chamber/<slug>/ACTUAL.md (the runner prints the path). Why: BUDGET.md's pre-verdict hash IS the ordering witness, and step 6 hard-blocked until that same file changed, so every run that reached COMPLETE necessarily mutated a witnessed artifact and verify returned TAMPERED — the chamber's promotion condition was unsatisfiable by construction, not by strictness. Two roles (immutable witness / post-verdict calibration sink) had collided in one file; each was correct alone, so neither side's code showed the conflict. Also: ko-tech-writer Step 2/4-b scans are now calibration-backed (known-pair fixtures + reproducible command, shipped) — discrimination is proven, 'zero residue' is explicitly NOT; chamber lane suite 12 -> 33 including the runner x witness seam no test covered; chamber_run.sh now teaches the two-commit discipline (gate hashes and verdict hash must land in separate commits/PRs — it previously advised the opposite). New in 2.1.0: BREAKING (gate): `crossfamily: declined` in an Axes 2-3 marker now requires grounds naming a record path that RESOLVES on disk — bare `declined`, and `declined` justified by author judgment, are blocked at commit. Remedy: cite where the operator decision lives (e.g. `.. — operator declined sidecars, per knowledge/shared/rules/operational_adaptation.md`), or use `DEGRADED_PANEL_UNUSED` if a panel was reachable and you chose not to recruit it — which is what author judgment actually is. `declined` was the only enum value with no grounds requirement; a cross-family review then broke the first (vocabulary-grep) fix three ways — self-validating on the value's own token, vacuous keyword passes, and over-blocking real declinations in natural prose — so the check asserts a resolvable record instead of words. Also: standpoint axis gains `tier1b` (a STATIC read of a target repo, executed nothing) plus a decide-in-order procedure, after blind floor-tier sims graded pure cold-reads as `tier2` three rounds running; steel-quench Wave 1's sixth angle (gate-locality) gains the output-template row it never had, so a mandatory angle stops being structurally unreportable; verify-bidirectional gains category 5 (prescriptive doctrine statement); Sister Asset Protocol gains an active-adoption trigger; new resident doctrine — Mechanization Boundary, Local Execution First, Skeleton-not-Muscle, Expedition track, and this package's versioning policy. Hub meta-operations toolkit — 35 skills + 7 agents. New in 2.0.1: harness-doctor cadence hook, portability lint wired into pre-commit, branch_claim.sh claim-count-vs-tree-count warning, louder confidentiality-scan fail-open notice, fh-gate.sh missing-package.json survival, identity ① reclassified 🟢 (cross-harness adapters + relay argument channel). New in 1.4.53: `fh-codex-doctor` (npm bin) — Codex adapter drift scanner; reads the documented M1/M2/M3 skill tier map + skill/agent source and reports codex-native/adapter-required/claude-native/unclassified per unit, wired into `npm test`/`prepublishOnly` (fail-closed on unclassified Claude-native primitives). New in 1.4.49: steel-quench gains Step 0.6 Verdict-Invariance Probe (groundedness axis — a load-bearing judged gate's verdict must track behavior, not rubric phrasing; measured flip-count over cross-family paraphrases; arXiv:2605.06161 Policy Invariance anchor); multi_model_sidecar_strategy §Vendor-native harness (a model is strongest in its own vendor CLI — Claude/CC, GPT/codex, Gemini/Antigravity; a universal router degrades all of them, so it stays an autocomplete/QA sidecar, never orchestration); predelete_check.sh fail-closed rewrite; memory-hygiene A-TMA anchor. New in 1.4.48: phantom-quench + steel-quench gain external frontier anchors (arXiv:2607.02052 package-hallucination; arXiv:2607.02057 prompt-coverage-adequacy); README model-flat claim reframed from a per-release point-curve to structural invariants (operation flattens across tiers; depth tier-order fixed within a generation). New in 1.4.47: onboarding step ① surfaces the Mode D companion-store session-start load in the auto-read salience anchor (previously only in the local binding + rules, so a greeting could skip the load). New in 1.4.46: context-doctor command-output axis (route to rtk/proxy for verbose CLI stdout, complementing .claudeignore; risk-gated to token-scarce envs). New in 1.4.41: context-doctor 2026 trigger vocab (context engineering/rot/collapse) + phantom-citation hardening; hub measurement-integrity-checklist (cross-model measurement pre-flight: display-name pin/reps≥3/discriminating probe). New in 1.4.40: install-wizard queryable-wiki scaffold (INDEX + session-start read + R/W/C ingest). New in 1.4.39: auto-decorrelation (cross-family verifier sidecar recruitment) + video-ingest (capability-routed video ingestion). New in 1.4.x: verify-axis check-class taxonomy (mandatory-pass/measured/judged), no-reinvention Tier-0 inventory, 7-class failure taxonomy, Destructive-Op Gate, Wave-T (Temper), tier-floor governance, Mode D Model Notice, FC consent lane, default-Sonnet guidance. New in 1.3.0: public-surface-audit, field-harvest Mode B auto-trigger, 4-axis gate scope ext. Validated cross-CLI: Claude Code, Codex, Gemini.",
16
16
  "source": "./plugins/fh-meta"
17
17
  },
18
18
  {
19
19
  "name": "fh-commons",
20
- "version": "2.9.1",
20
+ "version": "2.10.0",
21
21
  "description": "Project-agnostic utility skills — 5 skills (convergence-loop · deliberation · mcp-circuit-breaker · token-budget-gate · ko-tech-writer) + 1 agent (quench-challenger). Domain-independent utilities transplantable into any project.",
22
22
  "source": "./plugins/fh-commons"
23
23
  }
package/README.ja.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  <p align="center">
6
6
  <a href="https://github.com/walkinglabs/awesome-harness-engineering#coding-agent-harnesses"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Harness Engineering"></a>
7
+ <a href="https://github.com/VoltAgent/awesome-agent-skills#community-skills"><img src="https://img.shields.io/badge/listed_in-awesome--agent--skills-0ea5e9.svg" alt="Listed in awesome-agent-skills"></a>
7
8
  <img src="https://img.shields.io/badge/Claude_Code-compatible-a855f7.svg" alt="Claude Code">
8
9
  <a href="https://www.npmjs.com/package/@chrono-meta/fh-gate"><img src="https://img.shields.io/npm/v/@chrono-meta/fh-gate.svg?color=cb3837" alt="npm"></a>
9
10
  <a href="https://github.com/chrono-meta/homebrew-forge-harness"><img src="https://img.shields.io/badge/homebrew-tap-FBB040.svg" alt="Homebrew tap"></a>
@@ -19,7 +20,6 @@
19
20
  </p>
20
21
 
21
22
  <p align="center">
22
- <img src="https://raw.githubusercontent.com/chrono-meta/forge-harness/main/docs/demo/mascot.png" alt="" width="120" align="left" style="margin-right:16px">
23
23
  <img src="https://raw.githubusercontent.com/chrono-meta/forge-harness/main/docs/demo/gate-block.gif" alt="regression guard blocking a change that dropped a Done When section, then passing once it is restored" width="820">
24
24
  </p>
25
25
  <p align="center">
@@ -353,7 +353,7 @@ Project B ──→ CLAUDE.md でハブを接続
353
353
  **3段工程** — これはメニューではなく*投資の順序*です:
354
354
 
355
355
  ```mermaid
356
- flowchart LR
356
+ flowchart TD
357
357
  S["① 判断回路<br/>設計の前に"]
358
358
  P["② 並列脱相関<br/>中間で"]
359
359
  B["③ 焼き切る<br/>6つの軸で"]
@@ -597,7 +597,7 @@ forge-harness はプロジェクトを鋼のように扱い、この比喩は装
597
597
  > 高くつく嘘なので、名前は残し、役割だけをここで正します。
598
598
 
599
599
  ```mermaid
600
- flowchart LR
600
+ flowchart TD
601
601
  F["鍛え<br/>① 魂"] --> Q["焼き入れ<br/>② 並列脱相関"] --> T["焼き戻し<br/>③ 6軸"] --> A(["⟹ 加速"])
602
602
  style A fill:#0f766e,stroke:#0f766e,color:#fff
603
603
  ```
package/README.ko.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  <p align="center">
6
6
  <a href="https://github.com/walkinglabs/awesome-harness-engineering#coding-agent-harnesses"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Harness Engineering"></a>
7
+ <a href="https://github.com/VoltAgent/awesome-agent-skills#community-skills"><img src="https://img.shields.io/badge/listed_in-awesome--agent--skills-0ea5e9.svg" alt="Listed in awesome-agent-skills"></a>
7
8
  <img src="https://img.shields.io/badge/Claude_Code-compatible-a855f7.svg" alt="Claude Code">
8
9
  <a href="https://www.npmjs.com/package/@chrono-meta/fh-gate"><img src="https://img.shields.io/npm/v/@chrono-meta/fh-gate.svg?color=cb3837" alt="npm"></a>
9
10
  <a href="https://github.com/chrono-meta/homebrew-forge-harness"><img src="https://img.shields.io/badge/homebrew-tap-FBB040.svg" alt="Homebrew tap"></a>
@@ -19,7 +20,6 @@
19
20
  </p>
20
21
 
21
22
  <p align="center">
22
- <img src="https://raw.githubusercontent.com/chrono-meta/forge-harness/main/docs/demo/mascot.png" alt="" width="120" align="left" style="margin-right:16px">
23
23
  <img src="https://raw.githubusercontent.com/chrono-meta/forge-harness/main/docs/demo/gate-block.gif" alt="regression guard blocking a change that dropped a Done When section, then passing once it is restored" width="820">
24
24
  </p>
25
25
  <p align="center">
@@ -348,7 +348,7 @@ Project B ──→ CLAUDE.md에서 허브 연결
348
348
  **3단 공정** — 이것은 메뉴가 아니라 *투자의 순서*입니다:
349
349
 
350
350
  ```mermaid
351
- flowchart LR
351
+ flowchart TD
352
352
  S["① 설계 전에<br/>판단 회로"]
353
353
  P["② 중간은<br/>병렬 탈상관"]
354
354
  B["③ 마무리<br/>6축 태우기"]
@@ -633,7 +633,7 @@ forge-harness는 프로젝트를 강철처럼 다루고, 이 은유는 장식이
633
633
  > 은유를 맞추자고 출하된 스킬 이름을 바꾸는 게 더 비싼 거짓말이라, 이름은 두고 역할만 여기 바로잡습니다.
634
634
 
635
635
  ```mermaid
636
- flowchart LR
636
+ flowchart TD
637
637
  F["벼림 Forge<br/>① 영혼"] --> Q["담금질 Quench<br/>② 병렬 탈상관"] --> T["뜨임 Temper<br/>③ 6축"] --> A(["⟹ 가속"])
638
638
  style A fill:#0f766e,stroke:#0f766e,color:#fff
639
639
  ```
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  <p align="center">
6
6
  <a href="https://github.com/walkinglabs/awesome-harness-engineering#coding-agent-harnesses"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Harness Engineering"></a>
7
+ <a href="https://github.com/VoltAgent/awesome-agent-skills#community-skills"><img src="https://img.shields.io/badge/listed_in-awesome--agent--skills-0ea5e9.svg" alt="Listed in awesome-agent-skills"></a>
7
8
  <img src="https://img.shields.io/badge/Claude_Code-compatible-a855f7.svg" alt="Claude Code">
8
9
  <a href="https://www.npmjs.com/package/@chrono-meta/fh-gate"><img src="https://img.shields.io/npm/v/@chrono-meta/fh-gate.svg?color=cb3837" alt="npm"></a>
9
10
  <a href="https://github.com/chrono-meta/homebrew-forge-harness"><img src="https://img.shields.io/badge/homebrew-tap-FBB040.svg" alt="Homebrew tap"></a>
@@ -21,7 +22,6 @@
21
22
  </p>
22
23
 
23
24
  <p align="center">
24
- <img src="https://raw.githubusercontent.com/chrono-meta/forge-harness/main/docs/demo/mascot.png" alt="" width="120" align="left" style="margin-right:16px">
25
25
  <img src="https://raw.githubusercontent.com/chrono-meta/forge-harness/main/docs/demo/gate-block.gif" alt="regression guard blocking a change that dropped a Done When section, then passing once it is restored" width="820">
26
26
  </p>
27
27
  <p align="center">
@@ -380,7 +380,7 @@ harness is actually used.
380
380
  **The three-stage process** — this is an *order of investment*, not a menu:
381
381
 
382
382
  ```mermaid
383
- flowchart LR
383
+ flowchart TD
384
384
  S["① Circuit<br/>before design"]
385
385
  P["② Parallel decorrelation<br/>in the middle"]
386
386
  B["③ Burn it down<br/>on six axes"]
@@ -649,7 +649,7 @@ hardened by attack, and only then does it ship faster, for having survived.
649
649
  > the names stay and the roles are stated correctly here.
650
650
 
651
651
  ```mermaid
652
- flowchart LR
652
+ flowchart TD
653
653
  F["Forge<br/>① circuit"] --> Q["Quench<br/>② parallel"] --> T["Temper<br/>③ six axes"] --> A(["⟹ Accelerate"])
654
654
  style A fill:#0f766e,stroke:#0f766e,color:#fff
655
655
  ```
package/README.zh.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  <p align="center">
6
6
  <a href="https://github.com/walkinglabs/awesome-harness-engineering#coding-agent-harnesses"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Harness Engineering"></a>
7
+ <a href="https://github.com/VoltAgent/awesome-agent-skills#community-skills"><img src="https://img.shields.io/badge/listed_in-awesome--agent--skills-0ea5e9.svg" alt="Listed in awesome-agent-skills"></a>
7
8
  <img src="https://img.shields.io/badge/Claude_Code-compatible-a855f7.svg" alt="Claude Code">
8
9
  <a href="https://www.npmjs.com/package/@chrono-meta/fh-gate"><img src="https://img.shields.io/npm/v/@chrono-meta/fh-gate.svg?color=cb3837" alt="npm"></a>
9
10
  <a href="https://github.com/chrono-meta/homebrew-forge-harness"><img src="https://img.shields.io/badge/homebrew-tap-FBB040.svg" alt="Homebrew tap"></a>
@@ -19,7 +20,6 @@
19
20
  </p>
20
21
 
21
22
  <p align="center">
22
- <img src="https://raw.githubusercontent.com/chrono-meta/forge-harness/main/docs/demo/mascot.png" alt="" width="120" align="left" style="margin-right:16px">
23
23
  <img src="https://raw.githubusercontent.com/chrono-meta/forge-harness/main/docs/demo/gate-block.gif" alt="regression guard blocking a change that dropped a Done When section, then passing once it is restored" width="820">
24
24
  </p>
25
25
  <p align="center">
@@ -328,7 +328,7 @@ Project B ──→ 在 CLAUDE.md 中连接中枢
328
328
  **三段工序** —— 这是一个 *投入的顺序*,不是一份菜单:
329
329
 
330
330
  ```mermaid
331
- flowchart LR
331
+ flowchart TD
332
332
  S["① 立坐标系<br/>设计之前"]
333
333
  P["② 并行去相关<br/>中段"]
334
334
  B["③ 烧一遍<br/>六条轴上"]
@@ -561,7 +561,7 @@ forge-harness 把项目当作钢来对待,而这个隐喻是字面的,不是
561
561
  > 是更昂贵的谎言;因此名字留着,只在这里把角色说清楚。
562
562
 
563
563
  ```mermaid
564
- flowchart LR
564
+ flowchart TD
565
565
  F["锻造 Forge<br/>① 回路"] --> Q["淬火 Quench<br/>② 并行去相关"] --> T["回火 Temper<br/>③ 六轴"] --> A(["⟹ 加速 Accelerate"])
566
566
  style A fill:#0f766e,stroke:#0f766e,color:#fff
567
567
  ```
package/docs/ETHOS.md CHANGED
@@ -9,6 +9,11 @@ optimizes for *whether the work holds up*, not how fast it leaves the building.
9
9
  asks "how quickly can the agent ship?", FH asks "what survives a cold, independent pass?" — and makes
10
10
  running that pass routine instead of a chore you skip.
11
11
 
12
+ A note on the word: "harness" is also used, commonly and correctly, for the *runtime
13
+ substrate* — prompts, tools, the agentic loop, the adapter across models. FH uses it for
14
+ what that substrate is **for**: turning intent into machinery you can hold someone to.
15
+ The substrate sense is a layer FH sits on, not a rival definition.
16
+
12
17
  Everything below is **copyable**. None of it is a secret. The principles are the product.
13
18
 
14
19
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrono-meta/fh-gate",
3
- "version": "2.9.1",
3
+ "version": "2.10.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": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-commons",
3
- "version": "2.9.1",
3
+ "version": "2.10.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.9.1",
3
+ "version": "2.10.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -8,6 +8,41 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
8
8
 
9
9
  ---
10
10
 
11
+ ### [2.10.0] — 2026-08-24
12
+
13
+ **BREAKING (gate)**: `lane_runner_check` 가 러너 표면을 워킹트리가 아니라 **git index** 로
14
+ 판정한다. clone 트리에서 untracked 러너에 기대던 레인은 이제 DEBT 로 뜬다 — 그 초록은
15
+ clone 을 못 넘는 것이었다. **처방**: 그 러너를 `git add` 하거나 EXEMPT 로 선언한다.
16
+ npm 설치본(`node_modules`, gitignored)은 `outside-index` 분기로 디스크 폴백하므로 무변경.
17
+
18
+ #### Fixed
19
+ - **러너 표면 index 전환** (`lane_runner_check.sh` · `script_caller_ratchet.sh`) — 러너 이름과
20
+ 본문 둘 다 index 기준(`ls-files` + `cat-file --batch` 단일 프로세스). 실패는 전부 UNMEASURED:
21
+ git 없음 · 깨진 index · `ls-files` rc≠0 · blob 아님 · 조기 종료 · 짧은 본문. 빈 결과로 접는
22
+ 경로 0개. 「git 아님」과 「git 실패」는 `.git` 상향 탐색으로 분리한다(판별자 자신의 실패 대비).
23
+ 🟥 **모집단(검사 대상)은 그대로 디스크 기준** — 그쪽 글롭은 untracked 를 *잡는* 안전 방향이고,
24
+ 함께 바꾸면 새 스크립트가 조용히 모집단에서 빠진다. 위험 방향이 반대인 두 글롭을 갈랐다.
25
+ - dotfile parity: 세그먼트 선행 dot 가드로 `glob.glob` 원래 동작 유지(리터럴 dot 디렉터리 무영향)
26
+
27
+ #### Added
28
+ - `scripts/test_runner_surface_index_lanes.sh` — 32레인, 되돌림 앵커 6그룹(enum·state·dot·
29
+ content·isfile·nul). 각 앵커가 자기 그룹만 적색임을 실행으로 확인
30
+ - `.github/workflows/new-code-anchor.yml` + 체커/레인을 tracked 로 — 종전엔 untracked 라
31
+ CI 에서 한 번도 돌지 않았다. 이 릴리스부터 PR 마다 돈다(필수 체크는 아니다)
32
+
33
+ #### Docs
34
+ - `docs/ETHOS.md` — "harness" 라는 낱말에 대한 한 문단. 🟥 넣기 전에 쟀고 **계측은 「넣지 마라」**
35
+ 였다(플로어 티어 블라인드, CONTROL 3/3 이 문장 없이도 두 뜻을 알았다). 운영자 판정으로 넣었고
36
+ 그 사실을 커밋에 남겼다 — taste 층이다
37
+
38
+ #### Notes
39
+ - cross-family 4라운드, 신규 S/A 벡터 `3 → 1 → 0 → 2 → 0`. R3 에서 뒤집힌 것 자체를 마커에
40
+ 남겼다 — 라운드마다 새 코드가 새 결함을 낳았고, 5라운드는 「조이지 말고 줄여라」로 안 돌렸다
41
+ - 잔여: `outside-index` 트리에서는 이 보호가 꺼진다(라벨만) · `LOCAL_ONLY_SURFACES` 는 디스크
42
+ 기준(의도) · `GIT_DIR`/`GIT_WORK_TREE` 명시 배치 미측정 · `check-ignore` 부재는 fail-closed
43
+
44
+ ---
45
+
11
46
  ### [2.9.1] — 2026-08-23
12
47
 
13
48
  **자릿수 근거 (patch)**: 수정 · 배선 · 표시자료. 행동을 바꾸는 교리도 새 게이트 클래스도 없다.
@@ -270,8 +270,97 @@ fi
270
270
  # treats an EMPTY array's expansion as an unbound variable and aborts. DEBT is now empty by design,
271
271
  # which is exactly the state the plain form cannot survive — measured here 2026-08-13, and it
272
272
  # aborted so early that the script still printed PASS (see the rc routing further down).
273
+ # -- RUNNER SURFACE = THE GIT INDEX, NOT THE WORKING TREE (D-5, 2026-08-24) --------------------
274
+ # An UNTRACKED file must never certify anything as WIRED. Until this fix the RUNNER globs below
275
+ # were resolved against the DISK, so a workflow / hook / script that existed only in this working
276
+ # copy counted as a caller -- and the tree read green on wiring that disappears on `git clone`.
277
+ #
278
+ # The POPULATION globs (what gets CHECKED) stay on DISK on purpose. There an untracked file must
279
+ # be SEEN, so a new uncommitted script goes red instead of slipping through. Only the RUNNER
280
+ # surface moves to the index; moving both would trade one silent pass for another.
281
+ #
282
+ # 🟥 "NOT A REPOSITORY" AND "GIT FAILED" ARE DIFFERENT FACTS AND MUST NOT SHARE A BRANCH.
283
+ # The first draft of this block folded EVERY non-zero `git ls-files` exit into "no index here, use
284
+ # the disk". Cross-family review (codex/gpt-5.5, 2026-08-24) executed the consequence: a fake `git`
285
+ # that exits 1 for everything produced a warning line and then a PASS. A missing binary, a locked
286
+ # or corrupt index, and a permission failure all landed on the SAME branch as an unpacked npm
287
+ # tarball -- so the repair against "green that a clone deletes" had installed a fresh green of its
288
+ # own. That is [[feedback_not_found_is_not_zero_family]] wearing this file's colours, and the
289
+ # asymmetry was backwards: an EMPTY result was routed to UNMEASURED while a FAILED one was routed
290
+ # to a pass.
291
+ #
292
+ # So the state is resolved by POSITIVE questions, in order, and only the answers that are actually
293
+ # established are allowed to reach the disk fallback:
294
+ # git absent / `git --version` non-zero -> UNMEASURED (the instrument, not the tree)
295
+ # rev-parse fails AND a .git exists up-chain -> UNMEASURED (git broke inside a repo)
296
+ # rev-parse fails AND no .git anywhere up-chain-> nongit (an unpacked tarball: disk is right)
297
+ # inside a git dir with no work tree -> nongit
298
+ # in a work tree, `git ls-files` non-zero -> UNMEASURED (locked/corrupt index, permissions)
299
+ # in a work tree, ls-files empty, cwd ignored -> outside-index (a package unpacked INSIDE some
300
+ # other repo -- the index cannot answer for it,
301
+ # and blocking every such install would just
302
+ # train the override)
303
+ # in a work tree, ls-files empty, cwd tracked -> UNMEASURED (an empty index is not zero runners)
304
+ # otherwise -> index
305
+ # 🟥 The discriminator can itself fail, and when it does the answer is UNMEASURED -- never "not a
306
+ # repository". That is why the .git walk-up exists: it is a filesystem fact that needs no working
307
+ # git, so "git could not tell us" and "there is genuinely nothing here" stay separable.
308
+ #
309
+ # 🟥 `git ls-files` into a file, then `$?` on its OWN line. No pipe, no `|| true`: a fallback would
310
+ # hand an empty list to the scan and the scan would render it as "no runners".
311
+ _fh_has_dotgit_upchain() {
312
+ local _d; _d="$(pwd -P)"
313
+ while : ; do
314
+ [ -e "$_d/.git" ] && return 0
315
+ [ "$_d" = "/" ] && return 1
316
+ _d="$(dirname "$_d")"
317
+ done
318
+ }
319
+ FH_INDEX_STATE="UNMEASURED"; FH_INDEX_WHY="not determined"; FH_INDEX_FILE_LIST=""
320
+ if ! command -v git >/dev/null 2>&1; then
321
+ FH_INDEX_WHY="git is not on PATH -- the index could not be read at all"
322
+ else
323
+ _fh_gv="$(git --version 2>/dev/null)"; _fh_gvrc=$?
324
+ if [ "$_fh_gvrc" -ne 0 ] || [ -z "$_fh_gv" ]; then
325
+ FH_INDEX_WHY="\`git --version\` exited $_fh_gvrc -- the git binary is unusable, so nothing below was measured"
326
+ else
327
+ _fh_wt="$(git rev-parse --is-inside-work-tree 2>/dev/null)"; _fh_wtrc=$?
328
+ if [ "$_fh_wtrc" -ne 0 ]; then
329
+ if _fh_has_dotgit_upchain; then
330
+ FH_INDEX_WHY="git works but \`rev-parse --is-inside-work-tree\` exited $_fh_wtrc while a .git exists above this directory -- git failed, this is not a plain directory"
331
+ else
332
+ FH_INDEX_STATE="nongit"; FH_INDEX_WHY="no repository here and no .git anywhere above -- an unpacked tarball"
333
+ fi
334
+ elif [ "$_fh_wt" != "true" ]; then
335
+ FH_INDEX_STATE="nongit"; FH_INDEX_WHY="inside a git dir with no work tree (bare repository)"
336
+ else
337
+ # 🟥 NUL ALL THE WAY. An earlier draft piped this through `tr '\0' '\n'` into an env var,
338
+ # which un-did the whole point of `-z`: a path containing a NEWLINE was split into two paths
339
+ # before python ever saw it. Env vars cannot carry NUL, so the list travels as a FILE and the
340
+ # separator is never translated. Cross-family review, 2026-08-24, round 3.
341
+ _fh_tmp="$(mktemp)"
342
+ git ls-files -z >"$_fh_tmp" 2>/dev/null
343
+ _fh_lrc=$?
344
+ FH_INDEX_FILE_LIST="$_fh_tmp"
345
+ if [ "$_fh_lrc" -ne 0 ]; then
346
+ FH_INDEX_WHY="inside a work tree, but \`git ls-files\` exited $_fh_lrc -- a locked or corrupt index, or a permission failure. NOT an absence of runners"
347
+ elif [ -s "$_fh_tmp" ]; then
348
+ FH_INDEX_STATE="index"; FH_INDEX_WHY="the git index"
349
+ else
350
+ git check-ignore -q . 2>/dev/null; _fh_ci=$?
351
+ if [ "$_fh_ci" -eq 0 ]; then
352
+ FH_INDEX_STATE="outside-index"; FH_INDEX_WHY="this directory is IGNORED by the surrounding repository, so its index cannot answer for these files"
353
+ else
354
+ FH_INDEX_WHY="\`git ls-files\` exited 0 and returned NOTHING while this directory is tracked territory -- an empty index is not zero runners"
355
+ fi
356
+ fi
357
+ fi
358
+ fi
359
+ fi
360
+ export FH_INDEX_STATE FH_INDEX_WHY FH_INDEX_FILE_LIST
361
+
273
362
  out=$(python3 - "${#EXEMPT[@]}" "${EXEMPT[@]+"${EXEMPT[@]}"}" "${DEBT[@]+"${DEBT[@]}"}" <<'PY'
274
- import os, re, sys, glob, json
363
+ import os, re, sys, glob, json, subprocess
275
364
 
276
365
  n_exempt = int(sys.argv[1])
277
366
  exempt = set(sys.argv[2:2 + n_exempt])
@@ -287,14 +376,161 @@ suites = sorted({os.path.basename(f) for f in glob.glob('scripts/*.sh')
287
376
  # Runner surfaces, enumerated rather than assumed. All three were checked by hand when this file was
288
377
  # written: CI runs `bash scripts/selfcheck.sh` + count_check + the plugin validators and nothing else.
289
378
  SELF = os.path.basename(__file__) if '__file__' in dir() else 'lane_runner_check.sh'
290
- runners = []
291
- for pat in ('scripts/*.sh', 'templates/.git-hooks/*', '.github/workflows/*.yml'):
292
- runners += [p for p in glob.glob(pat) if os.path.isfile(p)]
379
+ RUNNER_GLOBS = ('scripts/*.sh', 'templates/.git-hooks/*', '.github/workflows/*.yml')
380
+
381
+ # -- INDEX-vs-DISK enumeration, RUNNER surfaces ONLY. State resolved in the bash preamble above. -
382
+ INDEX_MODE = os.environ.get('FH_INDEX_STATE', '')
383
+ INDEX_WHY = os.environ.get('FH_INDEX_WHY', 'the preamble did not run')
384
+ _idx_path = os.environ.get('FH_INDEX_FILE_LIST', '')
385
+ _idx_raw = b''
386
+ if _idx_path:
387
+ try:
388
+ _idx_raw = open(_idx_path, 'rb').read()
389
+ except OSError:
390
+ _idx_raw = b''
391
+ INDEX_FILES = [_b.decode('utf-8', 'replace') for _b in _idx_raw.split(b'\0') if _b]
392
+ # Fail-closed on anything this file does not recognise, including the empty string a caller that
393
+ # skipped the preamble would leave behind. A mode nobody set is not a mode that means "use disk".
394
+ if INDEX_MODE not in ('index', 'nongit', 'outside-index'):
395
+ INDEX_MODE = 'UNMEASURED'
396
+ if INDEX_MODE == 'index' and not INDEX_FILES:
397
+ INDEX_MODE = 'UNMEASURED'
398
+ INDEX_WHY = 'state said index and the file list is empty -- the two disagree'
399
+
400
+ def _glob_rx(pat):
401
+ # glob semantics, NOT fnmatch, and that includes the DOTFILE rule.
402
+ # `*` -> `[^/]*` alone is WIDER than the `glob.glob()` it replaced: fnmatch translates `*` to
403
+ # `.*`, which also crosses `/`, and neither form hides dotfiles. `glob.glob('scripts/*.sh')`
404
+ # does NOT return `scripts/.x.sh`; a regex without the guard below DOES, so a hidden tracked
405
+ # file would certify a caller that the old surface never contained. Cross-family review,
406
+ # 2026-08-24. The guard is per SEGMENT and keys on a leading `*`/`?` in that segment -- a dot
407
+ # in a literal segment (`templates/.git-hooks/`) is a directory name and is unaffected; what
408
+ # glob hides is a leading dot in the matched BASENAME.
409
+ _segs = []
410
+ for _seg in pat.split('/'):
411
+ _s = ''
412
+ if _seg[:1] in ('*', '?'):
413
+ _s += '(?!\\.)'
414
+ for _c in _seg:
415
+ _s += '[^/]*' if _c == '*' else '[^/]' if _c == '?' else re.escape(_c)
416
+ _segs.append(_s)
417
+ return re.compile('^' + '/'.join(_segs) + '$')
418
+
419
+ def enumerate_runners(patterns):
420
+ # index: the candidate runners are what `git ls-files` says is TRACKED.
421
+ # nongit / outside-index: no index can answer here, so disk is the correct surface -- and the
422
+ # run says which of the two it is out loud. UNMEASURED never reaches this function.
423
+ if INDEX_MODE == 'index':
424
+ # 🟥 NO os.path.isfile HERE. Filtering the INDEX list by what happens to be on disk lets the
425
+ # working tree decide the population of an index-grounded judgment -- a tracked runner the
426
+ # worktree has deleted would silently become "not a runner" instead of "read its blob",
427
+ # which also skips the completeness check below. The index blob exists regardless of the
428
+ # working tree; that is the whole reason to read it. Cross-family review, round 3.
429
+ # The disk branch on the next line KEEPS isfile, and so do LOCAL_ONLY_SURFACES: there the
430
+ # working tree IS the surface, and a name with no file behind it is genuinely nothing.
431
+ _rx = [_glob_rx(_p) for _p in patterns]
432
+ return [_p for _p in INDEX_FILES if any(_r.match(_p) for _r in _rx)]
433
+ return [_p for _pat in patterns for _p in glob.glob(_pat) if os.path.isfile(_p)]
434
+
435
+ if INDEX_MODE == 'UNMEASURED':
436
+ print('CONTROL_FAILED\tthe runner surface is UNMEASURED, not zero runners: ' + INDEX_WHY)
437
+ raise SystemExit(2)
438
+ print('INDEX_MODE\t' + INDEX_MODE + '\t' + INDEX_WHY)
439
+
440
+ runners = enumerate_runners(RUNNER_GLOBS)
293
441
  # This file names every DEBT and EXEMPT suite in its own arrays. Scanning itself would read each of
294
442
  # those declarations as evidence the suite is run — the check would certify its own todo list as
295
443
  # done. Caught by the known-negative control below on the first execution.
296
444
  runners = [r for r in runners if os.path.basename(r) != 'lane_runner_check.sh']
297
445
 
446
+ # -- RUNNER CONTENT = THE INDEX BLOB, NOT THE WORKING TREE FILE -------------------------------
447
+ # 🟥 THE OTHER HALF OF D-5. Moving the runner FILE LIST to the index closed "is this runner in the
448
+ # clone"; it did NOT close "does that runner call this lane in the clone". The names came from
449
+ # `git ls-files` while the bodies were still read with `open()`, so ONE UNSTAGED LINE added to an
450
+ # already-tracked runner certified a wiring that exists in nobody's checkout but this one -- the
451
+ # same defect wearing the other half of its face. Cross-family review, 2026-08-24, round 2.
452
+ # Claiming "the surface is index-grounded" while half of it was not is exactly
453
+ # [[feedback_half_fix_propagation_boundary]] / "measured scope != claimed scope".
454
+ #
455
+ # ONE process, not one per runner: there are ~185 runner surfaces here, and `git show` per file
456
+ # would be ~185 forks. `git cat-file --batch` reads them all from one stdin stream.
457
+ #
458
+ # 🟥 EVERY FAILURE PATH IS UNMEASURED, NEVER AN EMPTY BODY. A missing blob, a short read, a
459
+ # non-blob object, a git that will not start -- each of them, read as "" , renders the runner as
460
+ # calling nothing, which is the fold this whole file exists to refuse. They collect in _BLOB_ERR
461
+ # and route to the same UNMEASURED exit as a broken index does.
462
+ # In `nongit` / `outside-index` there is no blob to read and that is already decided policy
463
+ # (protection off, labelled) -- the loader is simply not run, and the disk reader stays in place.
464
+ # No new state value.
465
+ _BLOBS = {}
466
+ _BLOB_ERR = []
467
+
468
+ def _load_index_blobs(paths):
469
+ if INDEX_MODE != 'index' or not paths:
470
+ return
471
+ # `git cat-file --batch` reads NEWLINE-delimited input, so a path containing one cannot be
472
+ # asked for safely. Refuse to guess: that is UNMEASURED, not "this runner calls nothing".
473
+ for _p in paths:
474
+ if '\n' in _p:
475
+ _BLOB_ERR.append('a runner path contains a newline and cannot be batched: ' + repr(_p))
476
+ if _BLOB_ERR:
477
+ return
478
+ _inp = ''.join(':' + _p + '\n' for _p in paths)
479
+ try:
480
+ _pr = subprocess.run(['git', 'cat-file', '--batch'], input=_inp.encode('utf-8'), stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
481
+ except OSError as _e:
482
+ _BLOB_ERR.append('git cat-file could not be started: ' + str(_e))
483
+ return
484
+ if _pr.returncode != 0:
485
+ _BLOB_ERR.append('git cat-file --batch exited ' + str(_pr.returncode))
486
+ return
487
+ _buf = _pr.stdout
488
+ _pos = 0
489
+ for _p in paths:
490
+ _nl = _buf.find(b'\n', _pos)
491
+ if _nl < 0:
492
+ _BLOB_ERR.append('git cat-file output ended early at ' + _p)
493
+ return
494
+ _hdr = _buf[_pos:_nl].decode('utf-8', 'replace').split()
495
+ _pos = _nl + 1
496
+ if len(_hdr) != 3 or _hdr[1] != 'blob':
497
+ _BLOB_ERR.append('no blob in the index for ' + _p + ': ' + ' '.join(_hdr))
498
+ return
499
+ _sz = int(_hdr[2])
500
+ _end = _pos + _sz
501
+ if _end > len(_buf):
502
+ _BLOB_ERR.append('git cat-file returned a short body for ' + _p)
503
+ return
504
+ _BLOBS[_p] = _buf[_pos:_end].decode('utf-8', 'replace')
505
+ _pos = _end + 1
506
+ # Completeness, checked rather than assumed, and INSIDE the loader so that the loader is a
507
+ # single switch: this is what makes the disk fallback in read_runner unreachable for a runner
508
+ # in index mode. Without it a silently missing key would fall through to the working tree and
509
+ # rebuild the defect one path at a time.
510
+ for _p in paths:
511
+ if _p not in _BLOBS:
512
+ _BLOB_ERR.append('the index blob for ' + _p + ' was never read')
513
+
514
+ _load_index_blobs(runners)
515
+
516
+ def _read_disk(path):
517
+ try:
518
+ return open(path, encoding='utf-8', errors='replace').read()
519
+ except OSError:
520
+ return ''
521
+
522
+ def read_runner(path):
523
+ # index mode: every runner is in _BLOBS (asserted above), so the disk branch is reachable only
524
+ # for surfaces that are deliberately NOT index-backed -- the gitignored local settings file --
525
+ # and for the nongit / outside-index states.
526
+ if path in _BLOBS:
527
+ return _BLOBS[path]
528
+ return _read_disk(path)
529
+
530
+ if _BLOB_ERR:
531
+ print('CONTROL_FAILED\tthe runner CONTENT is UNMEASURED, not empty: ' + ' - '.join(_BLOB_ERR))
532
+ raise SystemExit(2)
533
+
298
534
  # An invocation is `bash <path-ending-in-suite>`, not a mention of the name. The bounded `.{0,60}?`
299
535
  # spans wrappers like `exec bash "$(dirname "$0")/x.sh"` (which contains a space inside the command
300
536
  # substitution) without running to the end of an arbitrary line.
@@ -314,10 +550,7 @@ def has_runner(suite):
314
550
  for r in runners:
315
551
  if os.path.basename(r) == suite:
316
552
  continue
317
- try:
318
- txt = open(r, encoding='utf-8', errors='replace').read()
319
- except OSError:
320
- continue
553
+ txt = read_runner(r)
321
554
  if runner_dispatches(suite, txt):
322
555
  return True
323
556
  return False
@@ -470,7 +703,7 @@ def has_selftest_runner(bare_name):
470
703
  # added at the same time and for the same reason — without it this line is a repair no control
471
704
  # drives, which is the failure mode this file exists to name.
472
705
  _own = bare_name + '.sh'
473
- return any(selftest_dispatched(bare_name, _read(r)) for r in runners if os.path.basename(r) != _own)
706
+ return any(selftest_dispatched(bare_name, read_runner(r)) for r in runners if os.path.basename(r) != _own)
474
707
 
475
708
  selftest_wired = {s for s in selftest_subjects if has_selftest_runner(s)}
476
709
  selftest_undeclared = sorted(s for s in selftest_subjects if s not in selftest_wired)
@@ -602,6 +835,7 @@ for s in selftest_undeclared:
602
835
  PY
603
836
  )
604
837
  rc=$?
838
+ [ -n "${FH_INDEX_FILE_LIST:-}" ] && rm -f "$FH_INDEX_FILE_LIST"
605
839
 
606
840
  if [ "$rc" -eq 2 ]; then
607
841
  echo "FAIL lane-runner: the instrument broke, it did not pass"
@@ -688,6 +922,20 @@ if [ -n "$SELFTEST_UNDECLARED" ]; then
688
922
  echo " in it, or exit 0 will certify a suite that ran nothing."
689
923
  fi
690
924
 
925
+ INDEX_MODE=$(printf '%s\n' "$out" | awk -F'\t' '$1=="INDEX_MODE"{print $2}')
926
+ INDEX_WHY=$(printf '%s\n' "$out" | awk -F'\t' '$1=="INDEX_MODE"{print $3}')
927
+ # Labelled, never silent, and the two disk-fallback states are NOT merged. `nongit` is an
928
+ # unpacked tarball; `outside-index` is this tree sitting inside some OTHER repo that ignores it.
929
+ # Both are correct places to read the disk, and neither may appear inside a normal checkout --
930
+ # if one does, the WIRED count is not index-grounded and the reader has to know that.
931
+ case "$INDEX_MODE" in
932
+ nongit|outside-index)
933
+ echo "⚠️ lane-runner: runner surface enumerated from DISK, not the index ($INDEX_MODE)."
934
+ echo " $INDEX_WHY"
935
+ echo " Correct outside a checkout; WRONG inside one. It is not zero runners either way."
936
+ ;;
937
+ esac
938
+
691
939
  echo "PASS lane-runner: ${TOTAL} suites — ${WIRED} wired · ${N_EXEMPT} exempt · ${N_DEBT} declared debt" \
692
940
  "· self-test: ${ST_WIRED}/${ST_TOTAL} wired"
693
941
  exit 0
@@ -183,6 +183,12 @@ ACCEPTED_ABSENT=(
183
183
  "scripts/script_caller_ratchet.sh"
184
184
  "scripts/ratchet_base_resolve.sh"
185
185
  "scripts/test_script_caller_ratchet_lanes.sh"
186
+ # ── D-5 runner-surface known pair, 2026-08-24 — 같은 사유로 미출하 ────────────────────────
187
+ # test_runner_surface_index_lanes.sh 는 주체가 **둘**이다: lane_runner_check.sh(출하됨)와
188
+ # script_caller_ratchet.sh(미출하). 후자가 없는 트리에서는 파일 상단 가드가 exit 2 로 죽으므로
189
+ # 소비자에게 실으면 **모든 설치에서 계기 오류**가 된다. selfcheck 의 짝 표에서도 sentinel 주체를
190
+ # script_caller_ratchet.sh 로 잡아, 소비자 트리에서는 주체 팔이 먼저 발화해 SKIP 으로 끝난다.
191
+ "scripts/test_runner_surface_index_lanes.sh"
186
192
  # ── The two settings destinations, surfaced 2026-08-13 by fixing this file's own extractor ────
187
193
  # These were invisible until the `js|json` alternation below was corrected: every `.json`
188
194
  # reference in every shipped doc was being truncated to `.js`, a path that exists nowhere, so
@@ -592,6 +592,7 @@ for _pair in \
592
592
  "scripts/stale_clone_guard.sh|scripts/test_stale_clone_guard_lanes.sh" \
593
593
  "plugins/fh-commons/skills/ko-tech-writer/SKILL.md|scripts/test_ko_tech_writer_lanes.sh" \
594
594
  "scripts/script_caller_ratchet.sh|scripts/test_script_caller_ratchet_lanes.sh" \
595
+ "scripts/script_caller_ratchet.sh|scripts/test_runner_surface_index_lanes.sh" \
595
596
  "scripts/mapped_tracks.sh|scripts/test_mapped_tracks_lanes.sh"
596
597
  do
597
598
  _subj="${_pair%%|*}"; _anc="${_pair##*|}"; _lbl="${_anc##*/}"