@chrono-meta/fh-gate 3.22.2 → 3.23.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.
@@ -11,25 +11,25 @@
11
11
  "plugins": [
12
12
  {
13
13
  "name": "fh-meta",
14
- "version": "3.22.2",
14
+ "version": "3.23.1",
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": "3.22.2",
20
+ "version": "3.23.1",
21
21
  "description": "Project-agnostic utility skills — 6 skills (convergence-loop · deliberation · mcp-circuit-breaker · token-budget-gate · ko-tech-writer · persona-cast) + 7 agents (quench-challenger + the web-review cast: designer · ux-writer · fe-dev · be-dev · qa · a11y). Domain-independent utilities transplantable into any project.",
22
22
  "source": "./plugins/fh-commons"
23
23
  },
24
24
  {
25
25
  "name": "fh-qp",
26
- "version": "3.22.2",
26
+ "version": "3.23.1",
27
27
  "description": "QP (Quality Platform) — the generic edition of a field QA harness's Prepare→Automation→Regression loop as an FH plugin: 4 skills (qp router · qp-plan · qp-run · qp-regress) + qp_tools.sh (target-class · adapter-probe · mask · surface-reach · mtm-check · run-verbs, typed exit codes) + a zero-domain-constant profile slot + 29 known-pair lanes. Drives web targets through the session's Playwright MCP and desktop targets through computer-use MCP (mobile deferred); calls a registered qasp typed capability when one exists (strictest-wins) — none is registered today, so the MCP fallback is the first edition. Verdict contract: a MACHINE closure requires a recorded assertion; a failed first step is attributed BLOCKED, not FAIL; surface_reach counts every TC in the denominator. Born as chamber run #18 (EMIT, 2026-09-05).",
28
28
  "source": "./plugins/fh-qp"
29
29
  },
30
30
  {
31
31
  "name": "fh-preprep",
32
- "version": "3.22.2",
32
+ "version": "3.23.1",
33
33
  "description": "preprep — a presentation-preparation harness. 1 skill. One CLI over 17 lanes (7 built-in + 10 module) that reads a declared surface manifest and checks a talk's assets against each other: canonical terms, jargon glosses, retired vocabulary, inter-slide dependencies, pacing, get/put round-trips, adjacent duplication, slide relations, geometry, attribute consistency, fonts, diagrams, slide refs, and screen-parity between manuscript and deck. Verdict contract: exit 0 pass / 1 findings / 2 cannot-judge — a surface that could not be read is UNMEASURED, never 0. Promoted out of fh-commons 2026-09-13 after the skill grew past one role (routing / lane modules / fixtures).",
34
34
  "source": "./plugins/fh-preprep"
35
35
  }
@@ -494,6 +494,27 @@ Split honestly by moment; only one of the three is closable today.
494
494
  the table would merge confidently in the wrong direction — A3 is the known instance of that hazard,
495
495
  and the mitigation (strictness read off outcomes, `on_exceed` mandatory) covers only numeric axes.
496
496
 
497
+ - **No composition-unit review.** The skill gates this note knows of (the 6-item bar ·
498
+ `asset-placement-gate` · the 4-axis gate) judge **one skill at a time**. A chain can be harmful while
499
+ each link passes. `arXiv:2609.30383` (Skill Cascading Attacks) splits one harmful goal across several
500
+ individually harmless skill edits; in the paper's example one skill weakens a warning, the next
501
+ down-ranks it, the last drops it from a summary, and no per-skill review sees it. That example was
502
+ **not reproduced here**. The Cross-Project Skill Bus and `agent-composer` are two places where FH
503
+ strings skills together, so the gap applies to FH. **What holds today** is narrower than a chain
504
+ check: a field capability's constraints merge strictest-wins (§ⓐ); standing consent never promotes a
505
+ class that *feeds* an irreversible sink (CLAUDE.md §Operational Adaptation Loop, taint rule); and the
506
+ irreversible step itself still meets its own gate (CLAUDE.md §Irreversibility Gates). None of the
507
+ three reads what the earlier links did to the data. No check reads the composed chain as one unit.
508
+ Named, not built.
509
+ - **Gates judge the action, not its outcome.** FH's gates (and the FoD permission gate) decide on the
510
+ command before it runs. An approved action can still leave an unapproved persistent effect, and the
511
+ mismatch only shows when the approved execution is compared with the state it left behind — the case
512
+ `arXiv:2609.31301` (EffectMatch) handles at an execution boundary. The one outcome check this note
513
+ knows of on a merge path is `scripts/pr_merge_verified.sh`, which compares what `main` received
514
+ against the branch after a squash merge. It covers one surface and is not a general mechanism. This
515
+ note has not identified a general outcome record elsewhere (a wider search was not run). Named, not
516
+ built.
517
+
497
518
  ## References
498
519
 
499
520
  - `fh_integration_contract.md` — the inbound twin (how external callers invoke FH gates); verdict and
@@ -4574,3 +4574,50 @@
4574
4574
  15행 분류, 1순위(배포본 npm test 파손)를 타르볼 실측으로 확인 → #832
4575
4575
  learning: >-
4576
4576
  에이전트가 말한 원인(bin 3개)보다 실제가 넓었다(❌148) — 분류 결과는 실측 전 착수 근거일 뿐
4577
+
4578
+ - date: 2026-09-29
4579
+ session: 9d093859 (주간 — FoD v0.1.2~v0.1.6 · 칸 3 그림자 · Windows 이식 · FH 대화창)
4580
+ agent: general-purpose ×13
4581
+ task: >-
4582
+ 에이전트 로고 복원 · 게이트 창 호버 설명 · 게이트 14차(브랜치 정리 사람 패턴 · M3 · 회수 영수증) · S1 틀 r2 + 근거 PREREG ·
4583
+ 질문 판정기 R1~R3 · 지도 후속 · 클린룸 v2 재교정 · 게이트 수리(리다이렉트 파서 · 회수 링크) · Windows 이식(게이트 + 대화창) ·
4584
+ FH 대화창 + 게이트 최신판 동조 · 머지 상태 증거 조각 · 외부 자료(Jev·Kev·Qwev) 읽기
4585
+ count: 13
4586
+ outcome: partial
4587
+ evidence: >-
4588
+ FoD #163 · #164(v0.1.5) · #166(v0.1.6) 머지·설치·릴리스, 전부 main 게이트 ×2 FAIL 0 · 대화창 레인 135/0 · Windows 레인 63/30/50 +
4589
+ macOS 불변 차이 0 · 클린룸 v2 봉인 유지 · 머지 상태 증거 레인 29/0(되돌림 5) — 머지 보류(Axis 1 사실상 필수화 = 운영자 결정) ·
4590
+ partial 사유: Windows 에이전트가 «라이브 금지» 지시에도 live.sh 에 --fingerprint 로 «물어봐서» 4레인이 실제로 돌고 기본 조립
4591
+ 트리를 오염(14:16 — build.sh 의 rm -rf 로 해소, 산출물 오염 0 확인) · 대화창 에이전트가 업무용 런처 이름을 소스에 박아 기밀 스캔 FAIL(거버너 수리)
4592
+ learning: >-
4593
+ «금지»는 지시문으로 안 닫힌다 — 모르는 플래그는 dry-run 이 아니라 실행이다. 임무문에 «live.sh 는 어떤 인자로도 부르지 마라 +
4594
+ 전용 FOD_WORK» 를 박는다(메모리 feedback_live_script_flag_probe_runs_the_lane). 채점기는 머지 스크립트 출력 안의 증거를 안 읽고
4595
+ 별도 `gh pr view … statusCheckRollup` 호출만 읽는다 — 절차로 먼저 닫고 코드는 운영자 결정 뒤.
4596
+
4597
+ - date: 2026-09-29
4598
+ session: 9d093859 (야간 전반 — 압축 전)
4599
+ agent: general-purpose ×5
4600
+ task: >-
4601
+ 게이트 마찰 수리(«이번만 허용» v0.1.7) · 세션 바로가기 설계(design_2026-09-29_fod-session-jump) · Jev 후속 · 링크 읽기(Kev/Qwev 논문) · 머지 상태 증거 조각
4602
+ count: 5
4603
+ outcome: partial
4604
+ evidence: >-
4605
+ v0.1.7 머지·설치·릴리스 · 설계 문서 착지 · 머지 증거 조각 레인 29/0 이나 머지 보류(운영자 결정) — 건수는 압축 전 인계 목록 기준(세부 산출은 fh_completed_2026-09-29)
4606
+ learning: >-
4607
+ 설계 에이전트가 상류 focus.js 를 읽었으므로 v0.1.9 구현자는 새 에이전트로 갈랐다(클린룸) — 설계 문서 대신 공식 문서 근거만 발췌한 명세를 줬다
4608
+
4609
+ - date: 2026-09-30
4610
+ session: 9d093859 (야간 후반 — FoD v0.1.8 · v0.1.9 · 게이트 수리 · 디자인 루프)
4611
+ agent: general-purpose ×9 · fh-commons:designer-lens ×9 · fh-commons:ux-writer-lens ×3 · fh-commons:a11y-lens ×3 · fh-meta:beginner ×6 · fh-meta:main-player ×3
4612
+ task: >-
4613
+ 디자인 언어 조사 · 채점기 기권 경보 · 공용 토큰 · v0.1.9 클릭 창(클린룸) · 게이트 활동 창 리디자인 · 설정창 여섯 탭 · 원장 facets/게이트 fail-open 수리 ·
4614
+ 릴리스 통합 · 통합 라이브 빨강 셋 수리 · 페르소나 리뷰 세 창 × 3~5라운드
4615
+ count: 33
4616
+ outcome: accepted
4617
+ evidence: >-
4618
+ FoD #169(v0.1.8) · #170 · #171 · #172(v0.1.9) 머지 · v0.1.8 · v0.1.9 설치·릴리스(dmg 다이제스트 대조) · main 게이트 405/0 ×2 ·
4619
+ 세 창 페르소나 리뷰 신규 S=0 수렴 · 게이트 fail-open 셋(래퍼 뒤 heredoc 셸 · 명령 자리 치환 · 동적 하위명령) 닫음, codex R1–R4 주장은 전수 재현으로 판정(거짓 다수)
4620
+ learning: >-
4621
+ 라이브 캡처 → 페르소나 리뷰가 오프라인 레인 수백 개가 못 본 것을 반복해 잡았다(보내기 회귀 · 목록 행 잘림 · 정보 히어로 찌그러짐). 반대로 리뷰어는
4622
+ 캡처 시점 차이를 «숫자 모순» 으로 두 번 오독했다 — 리뷰어 지적도 원자료로 재현한 뒤 수리 대상으로 넣는다. 헤드리스 창은 focusin 이 안 와서
4623
+ 포커스 단언은 CDP 포커스 흉내로만 잴 수 있다(메모리 feedback_headless_window_no_focus_events)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrono-meta/fh-gate",
3
- "version": "3.22.2",
3
+ "version": "3.23.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": {
@@ -31,7 +31,8 @@
31
31
  "prepack": "find plugins -type d -name __pycache__ -prune -exec rm -rf {} + 2>/dev/null; true",
32
32
  "prepare": "chmod +x bin/fh-gate.js bin/fh-run.js bin/fh-goal.js bin/fh-codex-doctor.js scripts/fh-gate.sh scripts/fh-run.sh scripts/fh-goal.sh",
33
33
  "postinstall": "node scripts/postinstall_notice.js",
34
- "test": "bash scripts/selfcheck.sh",
34
+ "test": "FH_SELFCHECK_PROFILE=consumer bash scripts/selfcheck.sh",
35
+ "test:full": "bash scripts/selfcheck.sh",
35
36
  "prepublishOnly": "bash scripts/prepublish_scope_note.sh && bash scripts/publish_freshness_check.sh && bash scripts/version_lockstep_check.sh && bash scripts/package_coverage_check.sh --vs-tarball && bash scripts/files_manifest_shipping_check.sh --vs-tarball && bash scripts/public_surface_scan_files.sh",
36
37
  "release": "bash scripts/public_surface_scan_files.sh && npm publish"
37
38
  },
@@ -148,6 +149,7 @@
148
149
  "scripts/compaction_probe.sh",
149
150
  "scripts/consent_registry_check.sh",
150
151
  "scripts/context_continuity_score.sh",
152
+ "scripts/round/nameleak_check.sh",
151
153
  "scripts/count_check.sh",
152
154
  "scripts/daily_report.sh",
153
155
  "scripts/degrade_direction_scan.sh",
@@ -240,6 +242,8 @@
240
242
  "scripts/test_adapter_lanes.sh",
241
243
  "scripts/test_backtick_guard_lanes.sh",
242
244
  "scripts/test_branch_claim_lanes.sh",
245
+ "scripts/main_commit_guard.sh",
246
+ "scripts/test_main_commit_guard_lanes.sh",
243
247
  "scripts/test_capability_entrypoint_shipping.sh",
244
248
  "scripts/test_card_drift_probe.sh",
245
249
  "scripts/test_chamber_sig_lanes.sh",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-commons",
3
- "version": "3.22.2",
3
+ "version": "3.23.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.22.2",
3
+ "version": "3.23.1",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -1,5 +1,40 @@
1
1
  # forge-harness (fh-meta) Changelog
2
2
 
3
+ ### [3.23.1] — 2026-09-30 — 문서 · 기록 (3.23.0 을 함께 싣는 첫 발행)
4
+
5
+ **patch.** 3.23.0 은 태그만 달리고 npm 에 발행되지 않았다 — 3.22.2 에서 올라오면 아래 3.23.0 의 BREAKING (gate) 도 이 발행에 들어 있다.
6
+
7
+ - `capability_composition_contract.md §3` · `agent-composer` Step 2.7: 명명된 잔여 둘 — 스킬 조합 단위 검토 없음(arXiv:2609.30383) · 게이트는 행동을 판정하고 결과를 대조하지 않는다(arXiv:2609.31301)
8
+ - 디스패치 원장 기록(`subagent_invocations_log.yaml`)
9
+
10
+ ### [3.23.0] — 2026-09-29 — 로컬 main 에 FH 자산을 직접 커밋하지 못하고, 설치본 npm test 가 소비자 프로필로 돈다
11
+
12
+ **minor — 게이트를 조인다.**
13
+
14
+ > 🟥 **BREAKING (gate): FH 자산이 staged 된 커밋이 `main`/`master` 위에서는 pre-commit 에 막힌다** — 브랜치로 옮겨라
15
+ > (`git switch -c <branch>`, staged 변경은 따라온다). 의도한 것이면 `MAIN_COMMIT_OK=1 git commit …`
16
+ > (`tracks/_meta/.main_commit_override_log` 에 기록). «FH 자산」 = 4축 분류기가 잡는 파일이다 — 그 밖의 파일만
17
+ > staged 된 커밋(예: `package.json` 단독)과 detached HEAD(리베이스 진행 중 · bisect)는 대상이 아니다.
18
+ > main 위의 merge · cherry-pick · revert · `--amend` 커밋은 **막힌다**(모두 main 에 새 커밋을 쓴다).
19
+
20
+ - **`scripts/main_commit_guard.sh`** + pre-commit 배선 — 통합 브랜치는 PR 전용인데 로컬 main 커밋이 N≥5 났다
21
+ (09-11 · 09-18 ×2 · 09-20). 푸시 게이트보다 먼저, 커밋하는 자리에서 막는다. 레인 `scripts/test_main_commit_guard_lanes.sh`
22
+ (단위 5 · 실제 훅 4 · 되돌림 1).
23
+ - **`npm test` = 소비자 프로필** — 설치된 패키지 안에서 `FH_SELFCHECK_PROFILE=consumer` 로 selfcheck 를 돌린다.
24
+ git 체크아웃이 있어야 잴 수 있는 스위트 8개(클론 · `.git/fh-claims` · docs/map · .github/workflows · .gitignore ·
25
+ `git ls-files` 가 필요한 것)는 **이름을 찍고** 건너뛰고, 끝에 목록을 한 번 더 낸다 — PASS 로 세지 않는다.
26
+ 체크아웃·CI 에서는 이 프로필이 무시된다(경고). 전체는 `npm run test:full`. CI 는 전과 같이 전체를 돈다.
27
+ 대부분 소비자에게도 의미 있는 스위트는 통째로 빼지 않는다 — `test_verdict_watermark_lanes.sh` 는 git 트리나
28
+ 미출하 `round/` 계기가 필요한 레인 2묶음(L25a~d · L27)만 패키지 모드에서 이름을 찍고 건너뛴다(체크아웃에서는 여전히 실패).
29
+ `test_probe_live_eval_lanes.sh` 도 같다 — 채점기 레인 30개는 돌고, 미출하 `probes.md` 를 읽는 블록 둘만 이름을 찍고 건너뛴다.
30
+ - **`context_continuity_score.sh` 오염 게이트의 비-git 대체 측정이 `tracks/` 를 뺀다** — 팔의 클론에 안 오는 경로를 훑어
31
+ 입력(qset·봉인) 자신을 «오염」으로 잡고 있었다. 설치본에서 `--rescore` 가 rc=5 로 막히던 것이 풀린다(L21~L23 이
32
+ 패키지에서 실제로 돈다).
33
+ - **`scripts/round/nameleak_check.sh` 출하** — 출하되는 `context_continuity_score.sh` 의 `--rescore` 경로가 부르는데
34
+ 안 실려서, 설치본에서 채점기가 rc=7 로 죽고 있었다(진짜 배포 누락). ⚠️ 채점기의 **회차 실행** 경로는 여전히
35
+ 미출하 `round/gatecheck_qset.sh` 를 요구한다(rc=8) — 소비자는 회차를 안 돌린다는 기존 결정(ACCEPTED_ABSENT)대로다.
36
+ - live-eval 문턱 0.8 — 근거를 실측으로 남겼다(아래 스크립트 주석). 값은 안 바꿨다.
37
+
3
38
  ### [3.22.2] — 2026-09-28 — 설치된 패키지의 자기검사가 없는 파일을 실패로 부르지 않고, 훅 계약 문서가 공식 문서와 실측을 가른다
4
39
 
5
40
  **patch — 수정 + 문서.** 소비자의 게이트 수용은 안 깬다(막는 쪽으로 바뀐 것 없음).
@@ -253,6 +253,11 @@ If 🚨 items exist, insert before the standard Y/E/N in Step 3:
253
253
 
254
254
  `no` → remove that operation or cancel entirely. Safe remaining operations can continue.
255
255
 
256
+ **Named residual — the plan is gated per step, never as a chain.** A composition whose steps each pass can
257
+ still be harmful as a whole (skills that each soften one signal until it disappears). No check here reads
258
+ the chain as one unit. The 🚨 table above flags a step only by its own type, so a harmless-looking step
259
+ that shapes what a later irreversible step acts on is not flagged. Detail: `knowledge/shared/harness-core/capability_composition_contract.md §3`.
260
+
256
261
  ---
257
262
 
258
263
  ## Step 3. Approval → Execution
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-preprep",
3
- "version": "3.22.2",
3
+ "version": "3.23.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.22.2",
3
+ "version": "3.23.1",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -517,7 +517,9 @@ while IFS='|' read -r _q _k _t tok _general _probe; do
517
517
  [ "$tok_rc" -le 1 ] || tok_rc=2 # git grep: 0=found 1=none, 그 외는 오류
518
518
  else
519
519
  echo "⚠️ git 저장소가 아니다 — 워킹트리로 대체 측정한다(팔이 보는 것과 다를 수 있다)" >&2
520
- tok_out=$(grep -RlF --exclude-dir=.git -- "$tok" "$HERE" 2>&1); tok_rc=$?
520
+ # `tracks/` 는 빼고 잰다 — 위 근거 그대로: 팔의 클론에는 gitignored 인 tracks/ 가 안 온다.
521
+ # 안 빼면 봉인 원장·qset 입력 자신이 «오염»으로 잡혀 설치본의 --rescore 가 rc=5 로 막힌다(2026-09-29 실측).
522
+ tok_out=$(grep -RlF --exclude-dir=.git --exclude-dir=tracks -- "$tok" "$HERE" 2>&1); tok_rc=$?
521
523
  fi
522
524
  if [ "$tok_rc" -ge 2 ]; then
523
525
  echo "🟥 qset 오염 검사 자체가 실패했다 (rc=$tok_rc) — «오염 없음»이 아니다" >&2
@@ -141,17 +141,33 @@ PY
141
141
  "Axis 2+3 입력 — 마커는 브랜치·날짜별이라 한쪽에만 산다"
142
142
  add_row evidence.card EVIDENCE "$(_exists "$H/tracks/_meta/reference_next_session_starter.md")" \
143
143
  "세션 카드 — 없으면 마감 ⑤ 와 온보딩 «returning» 판정의 입력이 없다"
144
- # 🟥 «tracks 에 파일이 있나» 로 세면 안 된다 — tracks/_contrib/** 와 일부 _meta 파일은
145
- # **tracked** 라 새 클론에도 딸려 온다. 그걸 세면 갓 클론한 허브가 「기록이 있다」로 읽히고,
146
- # 그것이 CLAUDE.md 가 이름으로 적어 둔 온보딩 분기 FP 와 같은 오류다(2026-08-30 실측).
147
- # 그래서 **git 이 추적하지 않는 파일만** 센다 = 이 체크아웃에서만 사는 기록.
148
- local untracked_tracks=0
144
+ # 🟥 «tracks 에 파일이 있나» 로 세면 안 된다 — **두 방향으로** 틀린다.
145
+ # ⓐ tracks/_contrib/** 와 일부 _meta 파일은 **tracked** 라 새 클론에도 딸려 온다. 그걸 세면
146
+ # 갓 클론한 허브가 「기록이 있다」로 읽히고, 그것이 CLAUDE.md 가 이름으로 적어 둔 온보딩
147
+ # 분기 FP 와 같은 오류다(2026-08-30 실측).
148
+ # ⓑ 🟥 그런데 «untracked 면 전부» 로 세도 틀린다(2026-09-28 실측, 이 계기의 두 번째 결함).
149
+ # 게이트와 스캔이 돌면서 `tracks/_meta/governance_log_<날짜>.yaml` ·
150
+ # `tracks/_meta/.outbound_query_override_log` 같은 **기계 산출물**을 그 밑에 쓴다. 그걸 세면
151
+ # **계기를 한 번 돌린 것 자체가 이 행을 뒤집는다**: 같은 커밋(600e774)의 두 체크아웃이
152
+ # 갓 클론한 쪽 `ABSENT`/`4f43f6f744e8` · 스위트를 돌린 쪽 `PRESENT`/`3f33bfcd0255` 로
153
+ # 갈렸다. 이 계기의 용도가 바로 그 두 지문의 대조라서, 관측자 효과는 여기서 결함이다.
154
+ # ⇒ 세는 것은 **기록 부류**다 — `mapped_tracks.sh` 가 온보딩 분기를 정할 때 읽는 것과
155
+ # **같은 글로브**(`tracks/*/session_*.md` · `tracks/_meta/*.md`)에서 tracked 를 뺀 것.
156
+ # 행의 설명문이 약속하는 코퍼스(«인사 분기와 recall 이 읽는 코퍼스»)와 실제로 세는 것이
157
+ # 같아야 한다는 뜻이고, 두 계기의 일치는 레인 L8c 가 기계로 박는다.
158
+ local untracked_tracks=0 _trk _f _rel
149
159
  if git -C "$H" rev-parse --git-dir >/dev/null 2>&1; then
150
- # 전체 파일 수 − tracked 파일 수. `ls-files --others` 의 ignored/non-ignored 플래그 조합에
151
- # 기대지 않는다: 두 부류 모두 «이 체크아웃에만 사는 것»이라 합쳐서 세야 맞다.
152
- _all="$(find "$H/tracks" -type f ! -name '.gitkeep' 2>/dev/null | grep -c . || true)"
153
- _trk="$(git -C "$H" ls-files -- tracks 2>/dev/null | grep -vc '\.gitkeep$' || true)"
154
- untracked_tracks=$(( _all - _trk )); [ "$untracked_tracks" -lt 0 ] && untracked_tracks=0
160
+ _trk="$(git -C "$H" ls-files -- tracks 2>/dev/null)"
161
+ for _f in "$H"/tracks/*/session_*.md "$H"/tracks/_meta/*.md; do
162
+ [ -f "$_f" ] || continue
163
+ _rel="tracks/${_f#"$H"/tracks/}"
164
+ # 🟥 파이프를 쓰지 마라 — `printf "$_trk" | grep -qxF` 는 `set -o pipefail` 아래에서
165
+ # 매치했을 때 생산자가 SIGPIPE 로 죽어 rc=141 을 올린다(= 매치를 «무매치» 로 읽는다).
166
+ # `_trk` 는 허브가 커지면 같이 커지는 명령 출력이라 상한이 없다. here-string 은 파이프가
167
+ # 아니라 그 경합이 아예 없다. 같은 자리의 실사고는 `mapped_tracks.sh` 쪽 — 레인 L8d.
168
+ if grep -qxF "$_rel" <<<"$_trk"; then continue; fi
169
+ untracked_tracks=$(( untracked_tracks + 1 ))
170
+ done
155
171
  else
156
172
  # git 이 아니면 «없음»이 아니라 «못 쟀음» — 픽스처/비-git 디렉터리를 0 으로 접지 않는다.
157
173
  untracked_tracks=UNMEASURABLE
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env bash
2
+ # main_commit_guard.sh — block a LOCAL commit of FH assets straight onto main/master.
3
+ #
4
+ # WHY (2026-09-29, operator «추천대로»): the integration branch is PR-only, and the server enforces
5
+ # it on push (`enforce_admins`), but local commits to `main` kept happening anyway — N≥5 measured
6
+ # (2026-09-11 list, 09-18 twice, 09-20). Each one had to be moved to a branch by hand afterwards,
7
+ # and on a shared checkout a stray `main` commit is also what the next session's `git switch -c`
8
+ # silently inherits. The push gate catches it late; this catches it at the point it is made.
9
+ #
10
+ # SCOPE — deliberately narrow:
11
+ # · Called by templates/.git-hooks/pre-commit ONLY on the path where an FH asset is staged. A
12
+ # commit with no FH asset (companion store, non-FH files) never reaches this script.
13
+ # · «FH asset» means what the 4-axis classifier in the hook calls one (HEAVY/LIGHT). A commit that
14
+ # stages only files outside it — e.g. `package.json` alone — does not reach this script. Named
15
+ # residual, not widened here: widening the classifier changes the 4-axis gate too.
16
+ # · Blocks on branch `main` or `master` — INCLUDING merge / cherry-pick / revert / `--amend`
17
+ # commits made while on main: each of those writes a new commit onto main. Only a detached HEAD
18
+ # (rebase in progress · bisect) passes, because no branch is being written.
19
+ # · If this script is absent the hook warns and does NOT block (same as branch_claim.sh): a
20
+ # consumer install may carry the hook template without the scripts/ helper.
21
+ # · Override: MAIN_COMMIT_OK=1 — same channel shape as MAIN_PUSH_OK / DESTRUCTIVE_OP_OK /
22
+ # PUBLIC_SURFACE_OK. Every use is appended to tracks/_meta/.main_commit_override_log.
23
+ #
24
+ # Exit: 0 pass · 1 block. Prints nothing on a plain pass (the hook's output is already long).
25
+ # Anchor: scripts/test_main_commit_guard_lanes.sh (unit + real-hook known-pair + revert).
26
+ set -u
27
+ # EVIDENCE_ROOT is supplied by the hook (main tree, worktree-safe); direct callers may point it elsewhere.
28
+ ROOT="${EVIDENCE_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
29
+ BRANCH="${MAIN_GUARD_BRANCH:-$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")}"
30
+
31
+ case "$BRANCH" in
32
+ main|master) ;;
33
+ *) exit 0 ;;
34
+ esac
35
+
36
+ if [ "${MAIN_COMMIT_OK:-0}" = "1" ]; then
37
+ echo " ⚠️ [main-commit] FH asset committed directly on '$BRANCH' by MAIN_COMMIT_OK=1 (logged)"
38
+ mkdir -p "$ROOT/tracks/_meta" 2>/dev/null
39
+ echo "$(date +%Y-%m-%dT%H:%M:%S) MAIN_COMMIT_OK override — branch $BRANCH — $(git diff --cached --name-only 2>/dev/null | wc -l | tr -d ' ') staged path(s)" \
40
+ >> "$ROOT/tracks/_meta/.main_commit_override_log" 2>/dev/null || true
41
+ exit 0
42
+ fi
43
+
44
+ echo " ❌ [main-commit] FH asset staged on '$BRANCH' — the integration branch is PR-only."
45
+ echo " Move it: git switch -c <branch> (the staged changes come with you), then commit there."
46
+ echo " Deliberate? MAIN_COMMIT_OK=1 git commit … (logged to tracks/_meta/.main_commit_override_log)"
47
+ exit 1
@@ -142,7 +142,17 @@ _SESS=0
142
142
  _SESS_NAMES=""
143
143
  _is_shipped() { # $1 = path relative to HUB_ROOT
144
144
  [ "$_TRACKED_OK" = "1" ] || return 1
145
- printf '%s\n' "$_TRACKED" | grep -qxF "$1"
145
+ # 🟥 here-string, NOT a pipe. Under `set -o pipefail` a matching `grep -qxF` exits before
146
+ # reading its input, the producer dies of SIGPIPE, and pipefail raises that 141 as the
147
+ # pipeline's status — so **a match is read as a non-match**. `$_TRACKED` is `git ls-files`
148
+ # output, which grows with the hub, so there is no structural bound to hide behind: the
149
+ # scanner's own measurements put the onset near ~16 KB (`pipefail_earlyexit_scan.sh` header),
150
+ # ≈300 tracked paths under tracks/. Reproduced deterministically at 6,000 paths
151
+ # (2026-09-28): pipe form → rc=141 “NO-MATCH”, here-string → MATCH.
152
+ # 🟥 And the direction is the one this function exists to prevent: a shipped file read as
153
+ # user-made makes a **fresh clone** answer `returning`, the onboarding FP CLAUDE.md names.
154
+ # Lane: test_mapped_tracks_lanes.sh §L-pipe.
155
+ grep -qxF "$1" <<<"$_TRACKED"
146
156
  }
147
157
  for _f in "$HUB_ROOT"/tracks/*/session_*.md "$HUB_ROOT"/tracks/_meta/*.md; do
148
158
  [ -f "$_f" ] || continue
@@ -89,6 +89,17 @@ LIB="$REPO_ROOT/scripts/probe_live_eval_lib.py"
89
89
  SIM_RUNNER="${FH_SIM_RUNNER_BIN:-$REPO_ROOT/scripts/sim_isolated_run.sh}"
90
90
 
91
91
  # ── file-header constant — the "문턱" the design brief calls for. Change here, not per-invocation. ──
92
+ # 🟢 MEASURED BASIS (2026-09-29) — the value is unchanged; what changed is that it now has one.
93
+ # Nightly pass_rate since the roster was fixed at 12 probes (09-19 … 09-29, 11 nights):
94
+ # 0.83 · 0.92 · 1.00 · 0.92 · 1.00 · 1.00 · 0.92 · 0.92 · 1.00 · 1.00 · 1.00 → min 10/12.
95
+ # With 12 probes one probe = 0.083, so 0.8 sits exactly one step below the observed normal
96
+ # minimum: 9/12 (0.75) fails, 10/12 passes. Raising it to 0.85 would have flagged 09-19 (10/12)
97
+ # — 1 false alarm in 11 normal nights. The two known-bad nights before the roster change
98
+ # (09-12 = 0.18, 09-13 = UNCALIBRATED) sit far below either value, so 0.8 loses none of them.
99
+ # Per-stratum thresholds (STABLE/FLAKY/HARD) stay deferred until n≥30 per probe — the 2026-09-21
100
+ # stratification found the gain collapses to 0.003 MAE once those two nights are excluded.
101
+ # Source: tracks/_meta/live_eval_*.md (gitignored) · live_eval_stratify_RESULT_2026-09-21.md.
102
+ # 🟥 Re-derive when the roster size changes: the step width (1/N) is what this number rests on.
92
103
  THRESHOLD="0.8"
93
104
 
94
105
  # ── EVIDENCE PRESERVATION (2026-09-14) ────────────────────────────────────────────────────────
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env bash
2
+ # 이름 누출 — «생성기 + 백스톱». 검사기가 판정하지 않는다.
3
+ #
4
+ # 🟥 초판은 자기 논지를 반증했다. 헤더가 「목록은 안 본다」고 적어놓고
5
+ # `ASSIGN_RE='…(ARM|CTRL|arm|ctrl)…'` 로 **낱말 4개를 열거**했고,
6
+ # `OPAQUE_RE='^[0-9a-z_]+$'` 가 소문자면 통과시켜서 실측으로 뚫렸다:
7
+ # treatment · baseline · placebo · control_a · exposed → 전부 rc=0 «불투명» 🟥
8
+ # ⇒ «4낱말 대신 4낱말»이었다. 열거를 늘리는 수리는 REFUSE_RE 의 네 번째 수리와 같은 형태다.
9
+ # ([[feedback_citing_a_rule_is_not_obeying_it]] — 적는 행위가 «지켰다는 감각»을 만든다.
10
+ # 저자도 검토자도 못 잡았고 세 번째 팔이 잡았다.)
11
+ #
12
+ # 🟥 그래서 방향을 뒤집는다 — **화이트리스트**다:
13
+ # 「나쁜 낱말이 없으면 통과」 ✗ 열거는 언제나 불완전하다
14
+ # 「생성기가 낸 형태가 아니면 차단」 ✓ 사람이 고른 이름은 전부 막힌다
15
+ # 그리고 더 근본적으로: **라벨을 사람이 고르지 않게 한다.** `gen` 이 그 자리다.
16
+ # 검사기는 «생성이 안 쓰였을 때» 무는 백스톱으로만 남는다 —
17
+ # §1 결론(«사람의 읽기에 안 맡긴다»)의 라벨 판이다.
18
+ #
19
+ # 🟥 seal 파일명은 다른 근거로 판정한다 — 실물 규약을 **관측**했다(19건 전수,
20
+ # tracks/_meta/compaction/): `seal_<8hex>-<3hex>_<YYYYMMDD>-<HHMMSS>.md`.
21
+ # 그건 열거가 아니라 **형태 일치**이므로 이 문제가 없다.
22
+ #
23
+ # 🟥 시야 판별자 — 검사 «대상»을 이름 문자열 셋으로 좁힌다. 파일 전체 grep 을 안 한다.
24
+ # ⇒ `context_continuity_score.sh:481·728·729`(같은 basename 이지만 `echo` 로 운영자
25
+ # 콘솔에 간다)는 **애초에 입력이 아니다** = 구조적으로 오조준 불가.
26
+ # 필터는 뚫리고 형태는 안 뚫린다.
27
+ #
28
+ # 사용
29
+ # nameleak_check.sh gen → 회차가 쓸 라벨 하나를 «생성»해서 찍는다
30
+ # nameleak_check.sh <seal> <out-dir> <라벨> → rc 0 통과 · 1 누출 · 2 인자오류
31
+ # 🟥 판정은 rc 로 한다. 출력 문구를 grep 하지 마라 — 요약줄이 같이 잡혀서 개수가 틀린다(실측).
32
+ set -uo pipefail
33
+
34
+ # ── 생성 형태 (이 한 줄이 «불투명»의 정의다) ─────────────────────────────────
35
+ # w + 8자리 이상 hex. 길이가 8이면 사전 단어와 우연히 겹칠 확률이 사실상 0이다.
36
+ # 🟥 잔여를 이름으로 남긴다: `wdeadbeef` 같은 hex-단어는 형태를 통과한다. 막지 않는다 —
37
+ # 막으려면 다시 «낱말 열거»가 되고, 그게 이 파일이 폐기한 방식이다. 확률로 산다.
38
+ GEN_RE='^w[0-9a-f]{8,}$'
39
+ gen_one(){ printf 'w%s\n' "$(od -An -N4 -tx1 /dev/urandom | tr -d ' \n')"; }
40
+
41
+ # ── seal 이름 (관측한 실물 규약, 2026-09-01) ─────────────────────────────────
42
+ # 🟥 정규식이 «정본»이고 생성기는 그것에 «검정»된다. 두 곳에 따로 적으면 갈린다 —
43
+ # 오늘 그 축(「갈라 적을 수 있으면 다시 갈린다」)이라 생성 직후 SEAL_RE 로 자기검사한다.
44
+ # 통과 못 하면 이름을 «안 내고» 실패한다: 틀린 이름을 내면 회차가 통째로 무효다.
45
+ SEAL_RE='^seal_[0-9a-f]{8}-[0-9a-f]{3}_[0-9]{8}-[0-9]{6}\.md$'
46
+ gen_seal(){
47
+ local n
48
+ n="seal_$(od -An -N4 -tx1 /dev/urandom | tr -d ' \n')-$(od -An -N2 -tx1 /dev/urandom | tr -d ' \n' | cut -c1-3)_$(date +%Y%m%d-%H%M%S).md"
49
+ if printf '%s' "$n" | grep -qE "$SEAL_RE"; then printf '%s\n' "$n"; return 0; fi
50
+ echo "🟥 gen-seal 이 자기 검사기를 통과 못 했다: $n" >&2; return 1
51
+ }
52
+
53
+ if [ "${1:-}" = gen ]; then gen_one; exit $?; fi
54
+ if [ "${1:-}" = gen-seal ]; then gen_seal; exit $?; fi
55
+
56
+ SEAL_NAME="${1:-}"; OUTDIR_NAME="${2:-}"; ARM_LABEL="${3:-}"
57
+ [ -n "$SEAL_NAME" ] && [ -n "$OUTDIR_NAME" ] && [ -n "$ARM_LABEL" ] || {
58
+ echo "usage: nameleak_check.sh gen | <seal-basename> <out-dir-basename> <arm-label>" >&2; exit 2; }
59
+
60
+ # 🟥 SEAL_RE 는 위에서 «한 번만» 정의한다 — 생성기와 검사기가 같은 상수를 쓴다
61
+ bad=0
62
+ say(){ printf ' %s %s\n' "$1" "$2"; }
63
+
64
+ # ① seal 파일명 — 관측한 실물 규약과 «구분 불가»한가
65
+ if printf '%s' "$SEAL_NAME" | grep -qE "$SEAL_RE"; then
66
+ say 🟢 "seal $SEAL_NAME"
67
+ else
68
+ say 🟥 "seal $SEAL_NAME — 실물 규약과 다르다 (seal_<8hex>-<3hex>_<YYYYMMDD>-<HHMMSS>.md)"
69
+ bad=$((bad+1))
70
+ fi
71
+
72
+ # ② out-dir · ③ 팔 라벨 — 둘 다 팔의 cwd 조상/자신이라 시야 «안»이다.
73
+ # 🟥 실물 규약이 없으므로 «생성 형태»만 통과시킨다. 사람이 고른 이름은 전부 막힌다.
74
+ for _pair in "outdir:$OUTDIR_NAME" "arm:$ARM_LABEL"; do
75
+ _k="${_pair%%:*}"; _v="${_pair#*:}"
76
+ if printf '%s' "$_v" | grep -qE "$GEN_RE"; then
77
+ say 🟢 "$_k $_v"
78
+ else
79
+ say 🟥 "$_k $_v — 생성 형태가 아니다 — 'nameleak_check.sh gen' 을 써라"
80
+ bad=$((bad+1))
81
+ fi
82
+ done
83
+
84
+ [ "$bad" -gt 0 ] && { echo "🟥 이름 누출 ${bad}건 — 회차를 열지 않는다"; exit 1; }
85
+ echo "🟢 이름 누출 0건"; exit 0
@@ -58,6 +58,30 @@ SHIPPY
58
58
  # repo above node_modules and call their install a checkout. A worktree's `.git` is a file; -e covers it.
59
59
  _package_mode() { [ ! -e .git ]; }
60
60
 
61
+ # ── Consumer profile (2026-09-29) — what `npm test` runs inside an installed package ──────────────
62
+ # `npm test` = `FH_SELFCHECK_PROFILE=consumer bash scripts/selfcheck.sh`; `npm run test:full` and CI
63
+ # run the full suite. Eight suites below measure things only a git CHECKOUT has (a clone to make,
64
+ # `.git/fh-claims`, docs/map, .github/workflows, .gitignore, `git ls-files`) — inside a tarball they
65
+ # are not failing, they are unmeasurable. A suite that is MOSTLY consumer-relevant stays in and skips
66
+ # only its checkout-bound lanes itself, by name (test_verdict_watermark_lanes.sh · test_probe_live_eval_lanes.sh do this). The consumer profile names each one it skips and prints
67
+ # the list again at the end; it never counts them as PASS.
68
+ # 🟥 The profile is honoured ONLY in package mode. Set in a checkout (CI, the author) it is ignored
69
+ # with a warning — otherwise one env var would silently shrink the required check.
70
+ _CONSUMER=0
71
+ if [ "${FH_SELFCHECK_PROFILE:-full}" = consumer ]; then
72
+ if _package_mode; then _CONSUMER=1
73
+ else echo "⚠️ FH_SELFCHECK_PROFILE=consumer IGNORED — this tree is a git checkout; running the full suite"; fi
74
+ fi
75
+ CHECKOUT_ONLY_SUITES="test_package_coverage_lanes.sh test_files_manifest_shipping_lanes.sh test_map_postprocess_lanes.sh test_remote_marker_gate_lanes.sh test_worktree_reclaim_lanes.sh test_sim_isolated_run_lanes.sh test_utterance_intake_lanes.sh test_precommit_pointer_index_lanes.sh"
76
+ CONSUMER_SKIPPED=""
77
+ _consumer_skip() { # $1 = suite basename · rc 0 = skip it (and it has been named)
78
+ [ "$_CONSUMER" -eq 1 ] || return 1
79
+ case " $CHECKOUT_ONLY_SUITES " in *" $1 "*) ;; *) return 1 ;; esac
80
+ case " $CONSUMER_SKIPPED " in *" $1 "*) ;; *) CONSUMER_SKIPPED="$CONSUMER_SKIPPED $1" ;; esac
81
+ echo "SKIP $1 (consumer profile — needs a git checkout; run \`npm run test:full\` in a clone)"
82
+ return 0
83
+ }
84
+
61
85
  # ── The single verdict for "my subject is not here" ───────────────────────────────────────────
62
86
  # Measured 2026-08-12 (card §🔱⑮ A2): **18 blocks in this file** rendered a green SKIP when their
63
87
  # subject was absent, and **all 18 subjects are declared in package.json files[] and present in the
@@ -761,7 +785,8 @@ fi
761
785
  if [ ! -f scripts/package_coverage_check.sh ]; then
762
786
  _absent_subject_verdict "test_package_coverage_lanes.sh" "scripts/package_coverage_check.sh" || fail=1
763
787
  elif [ -f scripts/test_package_coverage_lanes.sh ]; then
764
- if ! bash scripts/test_package_coverage_lanes.sh; then
788
+ if _consumer_skip test_package_coverage_lanes.sh; then :
789
+ elif ! bash scripts/test_package_coverage_lanes.sh; then
765
790
  fail=1
766
791
  fi
767
792
  # The CHECKER's semantics are deliberately fail-closed and must not be softened: given a git
@@ -801,7 +826,8 @@ fi
801
826
  if [ ! -f scripts/files_manifest_shipping_check.sh ]; then
802
827
  _absent_subject_verdict "test_files_manifest_shipping_lanes.sh" "scripts/files_manifest_shipping_check.sh" || fail=1
803
828
  elif [ -f scripts/test_files_manifest_shipping_lanes.sh ]; then
804
- if ! bash scripts/test_files_manifest_shipping_lanes.sh; then
829
+ if _consumer_skip test_files_manifest_shipping_lanes.sh; then :
830
+ elif ! bash scripts/test_files_manifest_shipping_lanes.sh; then
805
831
  fail=1
806
832
  fi
807
833
  # Same applicability guard as package-coverage directly above, same reason: a repo with no npm
@@ -1013,6 +1039,8 @@ do
1013
1039
  _subj="${_pair%%|*}"; _anc="${_pair##*|}"; _lbl="${_anc##*/}"
1014
1040
  if [ ! -f "$_subj" ]; then
1015
1041
  _absent_subject_verdict "$_lbl" "$_subj" || fail=1
1042
+ elif [ -f "$_anc" ] && _consumer_skip "$_lbl"; then
1043
+ :
1016
1044
  elif [ -f "$_anc" ]; then
1017
1045
  # `< /dev/null` and the timeout are not decoration: test_frontier_digest_retry.sh deliberately
1018
1046
  # plants a `sleep 300` stub and asserts a 3s watchdog kills it. If that watchdog ever regresses
@@ -1542,7 +1570,8 @@ done
1542
1570
  if [ ! -f scripts/sim_isolated_run.sh ]; then
1543
1571
  _absent_subject_verdict "test_sim_isolated_run_lanes.sh" "scripts/sim_isolated_run.sh" || fail=1
1544
1572
  elif [ -f scripts/test_sim_isolated_run_lanes.sh ]; then
1545
- if ! bash scripts/test_sim_isolated_run_lanes.sh; then
1573
+ if _consumer_skip test_sim_isolated_run_lanes.sh; then :
1574
+ elif ! bash scripts/test_sim_isolated_run_lanes.sh; then
1546
1575
  fail=1
1547
1576
  fi
1548
1577
  else
@@ -1718,6 +1747,16 @@ else
1718
1747
  fail=1
1719
1748
  fi
1720
1749
 
1750
+ # main-commit guard (2026-09-29) — FH assets never land on main/master by a local commit. Same
1751
+ # subject/anchor shape as branch_claim above; both ship, so an absent subject is a deletion, not a skip.
1752
+ if [ ! -f scripts/main_commit_guard.sh ]; then
1753
+ _absent_subject_verdict "test_main_commit_guard_lanes.sh" "scripts/main_commit_guard.sh" || fail=1
1754
+ elif [ -f scripts/test_main_commit_guard_lanes.sh ]; then
1755
+ bash scripts/test_main_commit_guard_lanes.sh || fail=1
1756
+ else
1757
+ echo "FAIL test_main_commit_guard_lanes.sh: main_commit_guard.sh present but its anchor is missing"; fail=1
1758
+ fi
1759
+
1721
1760
  # prless_delta_scan lanes — «커밋은 됐는데 착륙 경로에 안 올라간» 델타를 세는 advisory 계기.
1722
1761
  # 🟥 레인의 하중선은 **음성 컨트롤**이다: 이 레포는 squash 머지를 쓰므로 순진한 per-commit 비교는
1723
1762
  # 이미 착륙한 브랜치를 «미착륙» 으로 읽는다(2026-09-19 실측: naive 33/40 · git cherry 17/40 ·
@@ -2628,8 +2667,12 @@ else
2628
2667
  echo "SKIP rules-dotfile (package mode: .git 없음 — 소스 트리 전용 검사)"
2629
2668
  fi
2630
2669
 
2670
+ if [ "$_CONSUMER" -eq 1 ]; then
2671
+ _n=$(printf '%s\n' $CONSUMER_SKIPPED | grep -c .)
2672
+ echo "CONSUMER PROFILE — $_n checkout-only suite(s) NOT measured here (not a pass):$CONSUMER_SKIPPED"
2673
+ fi
2631
2674
  if [ "$fail" -ne 0 ]; then
2632
2675
  echo "SELFCHECK: FAIL"
2633
2676
  exit 1
2634
2677
  fi
2635
- echo "SELFCHECK: PASS"
2678
+ if [ "$_CONSUMER" -eq 1 ]; then echo "SELFCHECK: PASS (consumer profile)"; else echo "SELFCHECK: PASS"; fi
@@ -188,5 +188,104 @@ PY
188
188
  fi
189
189
  fi
190
190
 
191
+ # ─────────────────────────────────────────────────────────────────────────────
192
+ # L8b — 🟥 관측자 효과: **계기를 돌린 것 자체가 행을 뒤집으면 안 된다.**
193
+ # 게이트·스캔은 `tracks/_meta/governance_log_<날짜>.yaml` 과
194
+ # `tracks/_meta/.outbound_query_override_log` 를 실제로 쓴다(실측 2026-09-28, 이 저장소).
195
+ # 그 둘이 `evidence.tracks` 를 PRESENT 로 만들면, **같은 커밋의 두 체크아웃이 지문이 갈린다** —
196
+ # 그리고 이 계기의 유일한 용도가 그 대조라서, 그때 계기는 자기 목적을 잃는다.
197
+ # 그래서 이 레인은 판정만 보지 않고 **지문 문자열 전체가 바이트 동일한지**를 본다.
198
+ _t "L8b 기계 산출물은 판정도 지문도 안 바꾼다"
199
+ mk_hub "$TMP/obs"
200
+ git -C "$TMP/obs" add -A >/dev/null 2>&1
201
+ _d_before="$(FH_HUB="$TMP/obs" bash "$S" --digest 2>/dev/null)"
202
+ printf 'runs: []\n' > "$TMP/obs/tracks/_meta/governance_log_2026-01-01.yaml"
203
+ : > "$TMP/obs/tracks/_meta/.outbound_query_override_log"
204
+ _d_after="$(FH_HUB="$TMP/obs" bash "$S" --digest 2>/dev/null)"
205
+ _row_after="$(FH_HUB="$TMP/obs" bash "$S" --tsv 2>/dev/null | grep '^evidence.tracks ')"
206
+ if [ -z "$_d_before" ] || [ -z "$_d_after" ]; then
207
+ _no "계기 오류 — --digest 가 빈 문자열을 냈다. 이 팔은 공허했을 것"
208
+ elif [ "$_d_before" != "$_d_after" ]; then
209
+ _no "기계 산출물이 지문을 바꿨다 — 두 체크아웃 대조가 무의미해진다"
210
+ elif ! printf '%s' "$_row_after" | grep -q ' ABSENT '; then
211
+ _no "기계 산출물을 «이 체크아웃에만 사는 세션 기록» 으로 읽는다 — 설명문과 세는 것이 어긋남"
212
+ else _ok; fi
213
+
214
+ # L8b-pos — 같은 픽스처의 판별력 컨트롤. 위 팔이 «아무것도 안 세는 코드» 로도 통과하면 공허하므로,
215
+ # **진짜 기록 하나**를 같은 자리에 심어 행이 여전히 뒤집히는지 본다(안 뒤집히면 계기가 죽은 것).
216
+ _t "L8b-pos 진짜 세션 기록은 같은 자리에서 행을 뒤집는다"
217
+ printf '# session\n' > "$TMP/obs/tracks/_meta/session_probe.md"
218
+ # 🟥 CAPTURE FIRST, THEN GREP. 이 계기는 로컬 층이 비면 **rc=1 로 끝나는 것이 정상**이고(L2 가
219
+ # 그걸 앵커한다), `set -o pipefail` 아래에서 `계기 | grep -q` 는 grep 이 매치해도 계기의 1 을
220
+ # 파이프라인 코드로 올린다 — 즉 초록인 팔이 빨강으로 보인다. 이 레인의 초판이 그대로 밟았다.
221
+ _pos_out="$(FH_HUB="$TMP/obs" bash "$S" --tsv 2>/dev/null)" || true
222
+ if printf '%s\n' "$_pos_out" | grep -qc '^evidence.tracks EVIDENCE PRESENT' >/dev/null \
223
+ && [ "$(printf '%s\n' "$_pos_out" | grep -c '^evidence.tracks EVIDENCE PRESENT')" -eq 1 ]; then _ok
224
+ else _no "기록을 심었는데도 PRESENT 가 아니다 — 술어가 아무것도 안 센다(L8b 가 공허하게 통과했을 것)"; fi
225
+
226
+ # L8c — 🟥 두 계기가 **같은 코퍼스**를 센다는 관계를 박는다.
227
+ # `evidence.tracks` 의 설명문이 약속하는 것은 «인사 분기와 recall 이 읽는 코퍼스» 이고,
228
+ # 그 인사 분기를 실제로 내는 것은 `mapped_tracks.sh` 의 `session_files` 다. 두 술어가 갈리면
229
+ # 지문은 «기록 있음» 을 말하면서 인사는 `new` 를 내거나 그 반대가 된다 — 어느 쪽도 오류가 안 뜬다.
230
+ # 한쪽 로직을 베끼는 대신 **관계**를 박는다(#784 L14g 와 같은 형태).
231
+ _t "L8c evidence.tracks ⟺ mapped_tracks session_files>0"
232
+ _agree() { # $1 = fixture dir → "TRACKS=<state> SESS=<n>"
233
+ local d="$1" _st _ss
234
+ _st="$(FH_HUB="$d" bash "$S" --tsv 2>/dev/null | awk -F'\t' '$1=="evidence.tracks"{print $3}')"
235
+ _ss="$( cd "$d" && bash "$SUT_MT" 2>/dev/null | sed -n 's/^session_files=//p' )"
236
+ printf 'TRACKS=%s SESS=%s' "${_st:-MISSING}" "${_ss:-MISSING}"
237
+ }
238
+ SUT_MT="$(pwd -P)/scripts/mapped_tracks.sh"
239
+ if [ ! -f "$SUT_MT" ]; then
240
+ echo "UNMEASURED — mapped_tracks.sh 부재, 관계를 잴 대상이 없다 (통과 아님)"
241
+ else
242
+ mk_hub "$TMP/agree_no"; git -C "$TMP/agree_no" add -A >/dev/null 2>&1
243
+ printf 'runs: []\n' > "$TMP/agree_no/tracks/_meta/governance_log_2026-01-01.yaml"
244
+ mk_hub "$TMP/agree_yes" full; git -C "$TMP/agree_yes" add -A >/dev/null 2>&1
245
+ # 🟥 full 픽스처는 tracked 로 add 된다 — 그러면 둘 다 «동봉된 것» 이라 세지 말아야 한다.
246
+ # 관계 레인이 재려는 것은 «untracked 기록» 이므로, 기록 하나를 add 이후에 만든다.
247
+ printf '# session\n' > "$TMP/agree_yes/tracks/_meta/session_after_add.md"
248
+ # 🟥 박는 것은 **개수가 아니라 존재의 일치**다. `mapped_tracks.sh` 의 두 글로브는
249
+ # `tracks/_meta/session_*.md` 를 양쪽에서 잡아 같은 파일을 두 번 센다(선행 동작, 이 PR 이
250
+ # 건드리지 않는다). 개수를 박으면 이 레인은 그 무해한 중복에 결박되고, 정작 재려던
251
+ # «둘이 같은 코퍼스를 보나» 는 안 재게 된다.
252
+ _a_no="$(_agree "$TMP/agree_no")"; _a_yes="$(_agree "$TMP/agree_yes")"
253
+ _no_st="${_a_no%% *}"; _no_ss="${_a_no##* }"
254
+ _yes_st="${_a_yes%% *}"; _yes_ss="${_a_yes##* }"
255
+ if [ "$_no_st" = "TRACKS=ABSENT" ] && [ "$_no_ss" = "SESS=0" ] \
256
+ && [ "$_yes_st" = "TRACKS=PRESENT" ] && [ "$_yes_ss" != "SESS=0" ] \
257
+ && [ "$_yes_ss" != "SESS=MISSING" ]; then _ok
258
+ else _no "두 계기가 어긋난다 — 기록없음팔:[$_a_no] 기록있음팔:[$_a_yes]"; fi
259
+ fi
260
+
261
+ # L8b-rev — 🟥 되돌림 프로브. 위 두 팔이 **이 수리에 결박돼 있나**를 본다: 술어를 옛 형태
262
+ # («untracked 면 전부 센다»)로 되돌린 복사본에서 L8b 가 **반드시 빨강**이어야 한다.
263
+ # 빨강이 안 되면 L8b 는 아무 결함에도 안 묶인 장식이다.
264
+ _t "L8b-rev 되돌림 — 넓은 술어로 복원하면 L8b 가 적색"
265
+ MUTB="$TMP/mut_broad.sh"
266
+ python3 - "$S" "$MUTB" <<'PY'
267
+ import io, re, sys
268
+ src = io.open(sys.argv[1], encoding='utf-8').read()
269
+ old = ' for _f in "$H"/tracks/*/session_*.md "$H"/tracks/_meta/*.md; do'
270
+ new = ' for _f in $(find "$H/tracks" -type f ! -name .gitkeep 2>/dev/null); do' # portability-noqa: 파이썬 문자열이다 — 셸 루프가 아니고, 뮤턴트 쪽 실제 루프는 바로 다음 줄에서 `[ -f "$_f" ] || continue` 를 그대로 물려받는다
271
+ if src.count(old) != 1:
272
+ sys.stderr.write("SUBN=%d\n" % src.count(old)); sys.exit(3)
273
+ io.open(sys.argv[2], 'w', encoding='utf-8').write(src.replace(old, new, 1))
274
+ PY
275
+ _revrc=$?
276
+ if [ "$_revrc" -ne 0 ]; then
277
+ _no "계기 오류 — 뮤턴트 치환이 1회가 아니었다(rc=$_revrc). 이 팔은 공허했을 것"
278
+ else
279
+ mk_hub "$TMP/rev"; git -C "$TMP/rev" add -A >/dev/null 2>&1
280
+ _rb="$(FH_HUB="$TMP/rev" bash "$MUTB" --digest 2>/dev/null)"
281
+ printf 'runs: []\n' > "$TMP/rev/tracks/_meta/governance_log_2026-01-01.yaml"
282
+ _ra="$(FH_HUB="$TMP/rev" bash "$MUTB" --digest 2>/dev/null)"
283
+ if [ -z "$_rb" ] || [ -z "$_ra" ]; then
284
+ _no "계기 오류 — 뮤턴트가 지문을 안 냈다. 침묵은 아무 뜻이 없다"
285
+ elif [ "$_rb" = "$_ra" ]; then
286
+ _no "뮤턴트도 지문이 안 변한다 — L8b 는 이 결함에 결박돼 있지 않다"
287
+ else _ok; fi
288
+ fi
289
+
191
290
  echo "── $([ "$fail" -eq 0 ] && echo 'all lanes ok' || echo 'FAILURES above') ──"
192
291
  exit "$fail"
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env bash
2
+ # test_main_commit_guard_lanes.sh — known pair for scripts/main_commit_guard.sh and its wiring in
3
+ # templates/.git-hooks/pre-commit. Runs in disposable clones — never touches this checkout.
4
+ #
5
+ # UNIT (the script alone, branch injected via MAIN_GUARD_BRANCH):
6
+ # U1 main → rc=1 · U2 master → rc=1 · U3 feature branch → rc=0, silent · U4 HEAD (detached) → rc=0
7
+ # U5 main + MAIN_COMMIT_OK=1 → rc=0 AND one log line appended (override is recorded, not just allowed)
8
+ # REAL HOOK (shallow clone, hook installed, output discriminated by the guard's own tag — the clone
9
+ # carries no marker/manifest, so OTHER axes block every commit and rc is not this lane's signal):
10
+ # H1 FH asset staged on main → «[main-commit]» ❌ line (the fixed case)
11
+ # H2 NON-FH file staged on main → no guard line (scope: FH assets only)
12
+ # H3 FH asset staged on a feature branch → no guard line (control: not unconditional)
13
+ # H4 FH asset on main + MAIN_COMMIT_OK=1 → override line (channel works through the hook)
14
+ # REVERT: the hook with the guard call removed must turn H1 red — else H1 is decoration.
15
+ # Usage: bash scripts/test_main_commit_guard_lanes.sh [--hook <path>]
16
+ set -u
17
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
18
+ HOOK="$ROOT/templates/.git-hooks/pre-commit"; [ "${1:-}" = "--hook" ] && HOOK="$2"
19
+ G="$ROOT/scripts/main_commit_guard.sh"
20
+ pass=0; fail=0
21
+ ok(){ printf ' ✅ %s\n' "$1"; pass=$((pass+1)); }
22
+ no(){ printf ' ❌ %s\n' "$1"; fail=$((fail+1)); }
23
+ [ -f "$G" ] || { echo "FAIL subject absent: $G"; exit 1; }
24
+ T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
25
+
26
+ echo "[main-commit-guard] unit"
27
+ mkdir -p "$T/u" && cd "$T/u" && git init -q 2>/dev/null
28
+ for b in main master; do
29
+ out=$(MAIN_GUARD_BRANCH=$b EVIDENCE_ROOT="$T/u" bash "$G" 2>&1); rc=$?
30
+ { [ "$rc" = 1 ] && printf '%s' "$out" | grep -q '\[main-commit\]'; } && ok "U $b → rc=1, names itself" || no "U $b → rc=$rc [$out]"
31
+ done
32
+ out=$(MAIN_GUARD_BRANCH=feat/x EVIDENCE_ROOT="$T/u" bash "$G" 2>&1); rc=$?
33
+ { [ "$rc" = 0 ] && [ -z "$out" ]; } && ok "U3 feature branch → rc=0, silent" || no "U3 feature → rc=$rc [$out]"
34
+ out=$(MAIN_GUARD_BRANCH=HEAD EVIDENCE_ROOT="$T/u" bash "$G" 2>&1); rc=$?
35
+ [ "$rc" = 0 ] && ok "U4 detached HEAD (rebase/bisect) → rc=0" || no "U4 detached → rc=$rc"
36
+ out=$(MAIN_COMMIT_OK=1 MAIN_GUARD_BRANCH=main EVIDENCE_ROOT="$T/u" bash "$G" 2>&1); rc=$?
37
+ n=$(grep -c 'MAIN_COMMIT_OK override' "$T/u/tracks/_meta/.main_commit_override_log" 2>/dev/null); n=${n:-0}
38
+ { [ "$rc" = 0 ] && [ "$n" = 1 ]; } && ok "U5 MAIN_COMMIT_OK=1 → rc=0 and logged once" || no "U5 override rc=$rc log=$n"
39
+
40
+ hook_case(){ # $1 label $2 hook $3 branch $4 file-to-stage $5 want(GUARD|NONE|OVERRIDE) [$6 env]
41
+ local label="$1" hook="$2" br="$3" f="$4" want="$5" envv="${6:-}" got out
42
+ rm -rf "$T/r"; git clone -q --depth 1 "file://$ROOT" "$T/r" 2>/dev/null || { no "$label — clone failed"; return; }
43
+ ( cd "$T/r" && git config user.email t@t && git config user.name t \
44
+ && mkdir -p .git/hooks && cp "$hook" .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit \
45
+ && cp "$G" scripts/main_commit_guard.sh \
46
+ && git checkout -q -B "$br" ) || { no "$label — setup failed"; return; } # the clone starts on the SOURCE's HEAD, not main
47
+ mkdir -p "$T/r/$(dirname "$f")"; printf 'lane probe\n' >> "$T/r/$f"
48
+ out=$(cd "$T/r" && git add "$f" && env $envv FH_SKIP_GATE_AXES=1 git commit -qm probe 2>&1)
49
+ if printf '%s' "$out" | grep -q '❌ \[main-commit\]'; then got=GUARD
50
+ elif printf '%s' "$out" | grep -q 'MAIN_COMMIT_OK=1 (logged)'; then got=OVERRIDE
51
+ else got=NONE; fi
52
+ [ "$got" = "$want" ] && ok "$label → $got" || { no "$label → $got (expected $want)"; printf '%s\n' "$out" | grep -E 'main-commit|FH 4-Axis|No FH' | head -3 | sed 's/^/ /'; }
53
+ }
54
+ if [ ! -e "$ROOT/.git" ]; then # installed package: nothing to clone — say so, never fold into PASS
55
+ echo " ⏭️ SKIP (PASS 아님) — hook/revert arms need a git checkout to clone; this tree has no .git"
56
+ echo "[main-commit-guard] $pass passed, $fail failed (hook arms skipped)"; [ "$fail" -eq 0 ]; exit $?
57
+ fi
58
+ echo "[main-commit-guard] real hook: $HOOK"
59
+ hook_case "H1 FH asset on main" "$HOOK" main scripts/lane_probe.sh GUARD
60
+ hook_case "H2 non-FH file on main" "$HOOK" main lane_probe.txt NONE
61
+ hook_case "H3 FH asset on a feature branch" "$HOOK" feat/lane scripts/lane_probe.sh NONE
62
+ hook_case "H4 FH asset on main + override" "$HOOK" main scripts/lane_probe.sh OVERRIDE "MAIN_COMMIT_OK=1"
63
+
64
+ echo "[main-commit-guard] revert probe"
65
+ M="$T/hook_mutant"; sed 's#bash "\$MCG"#true#' "$HOOK" > "$M"
66
+ if cmp -s "$HOOK" "$M"; then no "REVERT mutant did not apply (sed matched nothing) — HARNESS-ERROR, not a pass"
67
+ else
68
+ f0=$fail; hook_case "REVERT guard call removed → H1 must go red" "$M" main scripts/lane_probe.sh GUARD >/dev/null
69
+ if [ "$fail" -gt "$f0" ]; then fail=$f0; ok "REVERT without the call, H1 no longer blocks — the lane measures the wiring"
70
+ else no "REVERT H1 still GUARD with the call removed — H1 is decoration"; fi
71
+ fi
72
+ echo "[main-commit-guard] $pass passed, $fail failed"; [ "$fail" -eq 0 ]
@@ -214,6 +214,79 @@ printf '%s' "$_ngout" | grep -q '^onboarding_branch=' \
214
214
  && ok "B-5 the branch key is emitted even on the UNMEASURED path" \
215
215
  || ng "B-5 UNMEASURED path emits no branch key — silence is not an answer"
216
216
 
217
+ # ─────────────────────────────────────────────────────────────────────────────
218
+ # L-pipe — 🟥 `_is_shipped` 가 **큰 tracked 목록에서 매치를 무매치로 읽으면** 안 된다.
219
+ #
220
+ # `set -o pipefail` 아래에서 `printf '%s\n' "$_TRACKED" | grep -qxF "$1"` 는, 매치가 목록 앞쪽에
221
+ # 있으면 grep 이 입력을 끝까지 안 읽고 끝나서 printf 가 SIGPIPE 로 죽고, pipefail 이 그 **141** 을
222
+ # 파이프라인 코드로 올린다 ⇒ 함수가 «동봉된 파일이 아니다» 로 답한다. `$_TRACKED` 는
223
+ # `git ls-files` 출력이라 허브가 커지면 같이 커진다 — 구조적 상한이 없다.
224
+ # (온셋 실측 ~16 KB: `scripts/pipefail_earlyexit_scan.sh` 헤더. 여기 픽스처는 결정적으로
225
+ # 뒤집히도록 그보다 크게 잡는다.)
226
+ #
227
+ # 🟥 방향이 이 함수의 존재 이유와 정반대다: **동봉된 파일이 사용자 기록으로 세어져, 갓 클론한
228
+ # 허브가 `returning` 을 답한다** — CLAUDE.md 가 이름으로 적어 둔 온보딩 FP 바로 그것.
229
+ BIG="$(fh_fixture_root "$(mktemp -d)")"
230
+ mkdir -p "$BIG/scripts" "$BIG/tracks/_meta" "$BIG/tracks/_pad"
231
+ cp "$SUT" "$BIG/scripts/mapped_tracks.sh"
232
+ git -C "$BIG" init -q 2>/dev/null
233
+ # 매치 대상: ls-files 정렬에서 **맨 앞**에 오도록 `_meta` 아래에 둔다('_' < 소문자).
234
+ printf '# shipped session record\n' > "$BIG/tracks/_meta/a.md"
235
+ # 그 뒤를 긴 경로로 채워 목록을 16 KB 훨씬 위로 올린다. 이름이 `session_*` 가 아니라서
236
+ # 세는 루프의 글로브에는 안 걸린다 — 오직 «목록 크기» 만 담당한다. 🟥 그리고 밑줄 접두
237
+ # 디렉터리(`_pad`)여야 한다: 일반 이름이면 «매핑된 프로젝트» 로 세어져 `COUNT>0` 이 되고,
238
+ # 그러면 `session_files=0` 이어도 분기가 `returning` 이라 이 레인이 엉뚱한 것을 잰다(초판 실측).
239
+ _i=0
240
+ while [ "$_i" -lt 2000 ]; do
241
+ printf 'x\n' > "$BIG/tracks/_pad/pad_${_i}_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.md"
242
+ _i=$((_i + 1))
243
+ done
244
+ git -C "$BIG" add -A >/dev/null 2>&1
245
+ _LSBYTES=$(git -C "$BIG" ls-files -- tracks | wc -c | tr -d ' ')
246
+ if [ "${_LSBYTES:-0}" -lt 65536 ]; then
247
+ echo "ⓘ L-pipe UNMEASURED — tracked 목록이 ${_LSBYTES}B 로 작아 경합을 세울 수 없다 (통과 아님)"
248
+ else
249
+ _mt_run() { ( cd "$1" && bash scripts/mapped_tracks.sh 2>/dev/null ); }
250
+ _o="$(_mt_run "$BIG")"
251
+ _sess=$(printf '%s\n' "$_o" | sed -n 's/^session_files=//p')
252
+ _br=$(printf '%s\n' "$_o" | sed -n 's/^onboarding_branch=//p')
253
+ [ "$_sess" = "0" ] && [ "$_br" = "new" ] \
254
+ && ok "L-pipe ${_LSBYTES}B tracked 목록에서도 동봉 파일은 제외된다 (session_files=0 · new)" \
255
+ || ng "L-pipe 동봉 파일이 사용자 기록으로 세어졌다 — session_files=$_sess branch=$_br (갓 클론이 returning)"
256
+
257
+ # 판별력 컨트롤 — 같은 픽스처에서 **정말 untracked** 인 기록 하나는 여전히 세어져야 한다.
258
+ # 이게 없으면 위 팔은 «아무것도 안 세는 코드» 로도 초록이다.
259
+ printf '# user record\n' > "$BIG/tracks/_meta/zz_user.md"
260
+ _o2="$(_mt_run "$BIG")"
261
+ _sess2=$(printf '%s\n' "$_o2" | sed -n 's/^session_files=//p')
262
+ [ "${_sess2:-0}" -ge 1 ] \
263
+ && ok "L-pipe control — untracked 기록은 같은 목록 크기에서도 세어진다 (session_files=$_sess2)" \
264
+ || ng "L-pipe control — untracked 기록이 안 세어졌다: 위 팔은 공허하게 통과했다"
265
+ rm -f "$BIG/tracks/_meta/zz_user.md"
266
+
267
+ # 되돌림 프로브 — 파이프 형태로 복원한 복사본은 **반드시** 위 팔을 깨야 한다.
268
+ MUTP="$BIG/scripts/mapped_tracks_mut.sh"
269
+ python3 - "$SUT" "$MUTP" <<'PY'
270
+ import io, sys
271
+ src = io.open(sys.argv[1], encoding='utf-8').read()
272
+ old = ' grep -qxF "$1" <<<"$_TRACKED"'
273
+ new = ' printf \'%s\\n\' "$_TRACKED" | grep -qxF "$1"'
274
+ if src.count(old) != 1:
275
+ sys.stderr.write("SUBN=%d\n" % src.count(old)); sys.exit(3)
276
+ io.open(sys.argv[2], 'w', encoding='utf-8').write(src.replace(old, new, 1))
277
+ PY
278
+ if [ $? -ne 0 ]; then
279
+ ng "L-pipe revert — 뮤턴트 치환이 1회가 아니었다. 이 프로브는 공허했을 것"
280
+ else
281
+ _om="$( cd "$BIG" && bash scripts/mapped_tracks_mut.sh 2>/dev/null )"
282
+ _sessm=$(printf '%s\n' "$_om" | sed -n 's/^session_files=//p')
283
+ [ "${_sessm:-0}" -ge 1 ] \
284
+ && ok "L-pipe revert — 파이프 형태를 복원하면 동봉 파일이 다시 오집된다 (session_files=$_sessm)" \
285
+ || ng "L-pipe revert — 뮤턴트도 0 을 냈다. 이 레인은 그 결함에 결박돼 있지 않다"
286
+ fi
287
+ fi
288
+ rm -rf "$BIG"
289
+
217
290
  if [ "$FAIL" -eq 0 ]; then
218
291
  echo "MAPPED-TRACKS LANES: PASS ($PASS/$PASS)"
219
292
  echo " NOT covered: whether the synergy skill (or any other consumer) actually CALLS this."
@@ -47,7 +47,18 @@ command -v python3 >/dev/null 2>&1 || { echo "❌ HARNESS-ERROR — python3 miss
47
47
  # this file's own header reserves for exactly this ("harness error (setup failed, not a verdict)").
48
48
  # 🟥 This does NOT decide whether probes.md should ship. That is an operator call and is untouched;
49
49
  # what changes is only that the non-answer stops rendering as a verdict.
50
- [ -f "$PROBES_MD" ] || { echo "❌ HARNESS-ERROR — $PROBES_MD missing (not shipped in the npm package; the select/dry-run lanes need the hub repo)"; exit 10; }
50
+ # 🟢 2026-09-29: in an INSTALLED package (no .git at the root) the missing probes.md no longer kills the
51
+ # whole suite — the scorer-only lanes (score-pair · reason-pair · majority · blackout · control-b ·
52
+ # advisory) need neither probes.md nor a checkout, so they run; the lanes that read the real probe
53
+ # files (select-guard · dead-pointer · dry-run · fail-fast · evidence) are skipped BY NAME and
54
+ # counted. In a checkout the same absence is still exit 10 — there it means a broken tree.
55
+ NOPROBES=0
56
+ if [ ! -f "$PROBES_MD" ]; then
57
+ if [ ! -e "$REPO_ROOT/.git" ]; then NOPROBES=1
58
+ else echo "❌ HARNESS-ERROR — $PROBES_MD missing (not shipped in the npm package; the select/dry-run lanes need the hub repo)"; exit 10; fi
59
+ fi
60
+ SKIPPED_BLOCKS=""
61
+ _skipblock() { printf ' ⏭️ SKIP (PASS 아님 · 설치된 패키지 — probes.md 미출하) — %s\n' "$1"; SKIPPED_BLOCKS="$SKIPPED_BLOCKS [$1]"; }
51
62
  [ -f "$PROBES_LIVE" ] || { echo "❌ HARNESS-ERROR — $PROBES_LIVE missing"; exit 10; }
52
63
 
53
64
  T="$(mktemp -d)" || { echo "❌ HARNESS-ERROR — mktemp failed"; exit 10; }
@@ -186,6 +197,7 @@ out="$(_reason_row "$RROOT4" X4)"
186
197
  _lane RF4 reason-pair "control — a PASS row carries no reason (field is FAILED-TO-RUN-only)" \
187
198
  "PASS " "$out"
188
199
 
200
+ if [ "$NOPROBES" -eq 1 ]; then _skipblock "select-guard · dead-pointer · dry-run · fail-fast (read the real probes.md)"; else
189
201
  # ── select-guard: mechanical rule reproduces the real 12/21 split ──────────────────────────────
190
202
  echo ""
191
203
  echo "── select-guard ──────────────────────────────────────────────────"
@@ -452,6 +464,7 @@ else
452
464
  fi
453
465
 
454
466
 
467
+ fi
455
468
  echo "── majority over reps (2026-09-06) ───────────────────────────────"
456
469
  # WHY THESE LANES EXIST. Until 2026-09-06 the scorer read only `*_r1.txt`, so a probe's verdict was
457
470
  # one sample. Re-scoring three real run artifacts then found 5 of 12 probes FLAKY — two runs 15
@@ -629,6 +642,7 @@ _lane AD1 advisory "advisory_re is recorded in reason and does not change the ve
629
642
  "PASS|advisory[deep-clarify] 3/3" "$r"
630
643
 
631
644
  echo ""
645
+ if [ "$NOPROBES" -eq 1 ]; then _skipblock "evidence preservation EV1-EV8 (runner --ids needs probes.md)"; else
632
646
  echo "── evidence preservation (2026-09-14) ────────────────────────────"
633
647
  # WHY. Every run's response bodies went into a mktemp and died with it, so 2026-09-12 (pass_rate
634
648
  # 0.18) and 2026-09-13 (every probe 0/3) are PERMANENTLY unattributable — model blip, rate limit,
@@ -708,9 +722,11 @@ LIVE_EV="$REPO_ROOT/tracks/_meta/live_eval_runs"
708
722
  _lane EV8 evidence "control — the LIVE evidence dir was not written by these lanes" \
709
723
  "$LIVE_EV_BEFORE" "$([ -d "$LIVE_EV" ] && find "$LIVE_EV" -mindepth 1 -maxdepth 1 | wc -l | tr -d ' ' || echo ABSENT)"
710
724
 
725
+ fi
711
726
  echo ""
712
727
  echo "── summary ──────────────────────────────────────────────────────"
713
728
  echo "lanes: $N failed: $([ "$FAIL" -eq 0 ] && echo 0 || echo '>=1')"
729
+ [ -n "$SKIPPED_BLOCKS" ] && echo "skipped (installed package, not a pass):$SKIPPED_BLOCKS"
714
730
  if [ "$FAIL" -ne 0 ]; then
715
731
  echo "RESULT: REGRESSION"
716
732
  exit 1
@@ -16,6 +16,11 @@ T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
16
16
  pass=0; fail=0
17
17
  ok(){ printf ' ✅ %s\n' "$1"; pass=$((pass+1)); }
18
18
  no(){ printf ' ❌ %s\n' "$1"; fail=$((fail+1)); }
19
+ # 패키지 모드(.git 없음 = 설치된 npm 트리)에서만: 의도적으로 미출하한 round/ 계기나 git 트리를 전제하는
20
+ # 레인을 **이름 붙여** 건너뛴다 — PASS 로 세지 않는다. 체크아웃에서는 같은 부재가 여전히 ❌ 다.
21
+ _pkg(){ [ ! -e "$ROOT/.git" ]; }
22
+ skipped=0
23
+ sk(){ printf ' ⏭️ SKIP (PASS 아님 · 패키지 모드) — %s\n' "$1"; skipped=$((skipped+1)); }
19
24
  [ -f "$S" ] || { echo "❌ HARNESS-ERROR — 채점기 없음: $S"; exit 10; }
20
25
 
21
26
  # 🟥 미끼 토큰은 조립한다 — 리터럴로 적으면 그 순간 tracked 코퍼스에 들어가고,
@@ -354,6 +359,7 @@ if [ -x "$_NLK" ] && [ -f "$_GK" ] && [ -f "$_QK" ] && [ -f "$_SK" ]; then
354
359
  bash "$_GK" "$_QK" "$_SK" post '' '' 'w12345678' 'w87654321' >/dev/null 2>&1
355
360
  [ "$?" = 5 ] && ok "L25d 검사기 부재 → 실패(스킵 아님)" || no "L25d 부재를 스킵으로 접는다"
356
361
  mv "$_mv" "$_NLK"; chmod +x "$_NLK"
362
+ elif _pkg && [ ! -f "$_GK" ]; then sk "L25a~d — 게이트 scripts/round/gatecheck_qset.sh 는 의도적 미출하(ACCEPTED_ABSENT)"
357
363
  else no "L25 픽스처 없음 — 검사 못 함(스킵 아님)"; fi
358
364
 
359
365
  # ── L25e 🟥 nameleak_check 를 «직접» 부른다 — L25a~d 는 게이트를 통한 간접 호출뿐이라
@@ -393,6 +399,7 @@ if [ -x "$ROOT/scripts/round/fallback_reach_probe.sh" ]; then
393
399
  bash "$ROOT/scripts/round/fallback_reach_probe.sh" >/dev/null 2>&1 \
394
400
  && ok "L27 폴백이 실제로 탄다 (깨진 토큰 3종)" \
395
401
  || no "L27 폴백 미도달 — 폴백은 장식이고 48 바는 «인쇄»다"
402
+ elif _pkg; then sk "L27 — scripts/round/fallback_reach_probe.sh 는 의도적 미출하(ACCEPTED_ABSENT)"
396
403
  else no "L27 프로브 없음 — 검사 못 함(스킵 아님)"; fi
397
404
 
398
405
  # ── L28 🟥 «처치 둘을 곱했을 때» — deliver 분기가 누적된 $q 를 버리면 안 된다 ───
@@ -449,5 +456,5 @@ printf 'q1\tpositive\t질문P\tcontext_continuity\t\t\n' > "$T/q6c.tsv"
449
456
  O=$(run29 "$T/q6c.tsv" "$T/o"); rc=$?
450
457
  [ "$rc" = 5 ] && ok "L29d 6열 qset 의 tracked 토큰 → 오염 차단(5)" || no "L29d 6열 qset 에서 오염 게이트가 눈을 감는다 [rc=$rc]"
451
458
 
452
- echo "verdict watermark lanes: $pass passed, $fail failed"
459
+ echo "verdict watermark lanes: $pass passed, $fail failed$( [ "$skipped" -gt 0 ] && printf ', %s skipped (package mode — not a pass)' "$skipped")"
453
460
  [ "$fail" -eq 0 ] || exit 1
@@ -561,6 +561,18 @@ else
561
561
  GATE_MODE="lightweight"
562
562
  fi
563
563
 
564
+ # ── Main-commit guard (2026-09-29) — FH assets never land on main/master by a local commit ──
565
+ # Placed HERE, after the «no FH asset → exit 0» return, on purpose: the scope is FH assets only;
566
+ # a companion-store or non-FH commit must not reach it. Detail + override: scripts/main_commit_guard.sh
567
+ MCG="$REPO_ROOT/scripts/main_commit_guard.sh"
568
+ if [ -f "$MCG" ]; then
569
+ if ! EVIDENCE_ROOT="$EVIDENCE_ROOT" MAIN_GUARD_BRANCH="$BRANCH" bash "$MCG"; then
570
+ FAILED=1
571
+ fi
572
+ else
573
+ echo " ⚠️ main-commit guard NOT INSTALLED (scripts/main_commit_guard.sh) — skipped, not passed"
574
+ fi
575
+
564
576
  # TOCTOU 완화: 앞선 branch-claim check 이후 게이트들이 도는 동안 peer 가 브랜치를 옮길 수
565
577
  # 있다. 최종 판정 직전에 한 번 더 돌려 창을 좁힌다. (원자적 close 는 reference-transaction
566
578
  # 훅의 몫 — 이건 완화이지 해결이 아니다.)