@chrono-meta/fh-gate 3.37.0 → 3.38.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.
Files changed (57) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/knowledge/shared/harness-core/self_evolution_routine.md +22 -0
  3. package/knowledge/shared/learnings/subagent_invocations_log.yaml +30 -0
  4. package/package.json +2 -1
  5. package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
  6. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  7. package/plugins/fh-meta/CHANGELOG.md +13 -1
  8. package/plugins/fh-meta/skills/frontier-digest/SKILL_detail.md +7 -3
  9. package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
  10. package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
  11. package/scripts/adapters/gstack_content_safety.sh +1 -1
  12. package/scripts/capability_effect_probe.sh +2 -2
  13. package/scripts/chamber_run.sh +2 -2
  14. package/scripts/compaction_probe.sh +14 -14
  15. package/scripts/fh_session_load.sh +2 -2
  16. package/scripts/frontier_digest_autopilot.sh +10 -0
  17. package/scripts/gate_shape_scan.sh +1 -1
  18. package/scripts/governor_board.sh +2 -2
  19. package/scripts/outbound_pr_gate.sh +1 -1
  20. package/scripts/package_coverage_check.sh +10 -0
  21. package/scripts/pr_merge_verified.sh +8 -1
  22. package/scripts/probe_live_eval_lib.py +49 -2
  23. package/scripts/residency_admission_check.sh +1 -1
  24. package/scripts/selfcheck.sh +5 -0
  25. package/scripts/session_close_check.sh +2 -2
  26. package/scripts/sim_isolated_run.sh +2 -2
  27. package/scripts/test_count_check_decl_lanes.sh +1 -1
  28. package/scripts/test_degrade_scan_shell_probes.sh +1 -1
  29. package/scripts/test_dispatch_log_lanes.sh +3 -3
  30. package/scripts/test_fh_qp_lanes.sh +1 -1
  31. package/scripts/test_fh_run_resolver_lanes.sh +4 -4
  32. package/scripts/test_finding_pipeline_lanes.sh +7 -7
  33. package/scripts/test_gate_two_verdicts_lanes.sh +1 -1
  34. package/scripts/test_lane_runner_lanes.sh +1 -1
  35. package/scripts/test_lane_stub_env_lanes.sh +2 -2
  36. package/scripts/test_map_postprocess_lanes.sh +1 -1
  37. package/scripts/test_marker_address_lanes.sh +1 -1
  38. package/scripts/test_marker_defense_lanes.sh +1 -1
  39. package/scripts/test_marker_oracle_lanes.sh +1 -1
  40. package/scripts/test_outbound_pr_gate_lanes.sh +1 -1
  41. package/scripts/test_peer_worktree_detect_lanes.sh +1 -1
  42. package/scripts/test_pr_merge_verified_lanes.sh +8 -0
  43. package/scripts/test_precommit_staged_drift_lanes.sh +1 -1
  44. package/scripts/test_preprep_adjacent_dup_lanes.sh +1 -1
  45. package/scripts/test_prepush_destructive_lanes.sh +1 -1
  46. package/scripts/test_probe_live_eval_lanes.sh +68 -1
  47. package/scripts/test_regression_guard_ci_lanes.sh +8 -8
  48. package/scripts/test_regression_guard_codecomment_lanes.sh +140 -0
  49. package/scripts/test_revert_probe_lanes.sh +1 -1
  50. package/scripts/test_selfcheck_state_lanes.sh +1 -1
  51. package/scripts/test_stale_ref_close_lanes.sh +1 -1
  52. package/scripts/test_temper_check_lanes.sh +1 -1
  53. package/scripts/test_utterance_intake_lanes.sh +9 -9
  54. package/scripts/test_verdict_watermark_lanes.sh +3 -3
  55. package/scripts/test_worktree_reclaim_lanes.sh +1 -1
  56. package/templates/.git-hooks/pre-commit +2 -2
  57. package/templates/regression_guard.sh +32 -2
@@ -11,25 +11,25 @@
11
11
  "plugins": [
12
12
  {
13
13
  "name": "fh-meta",
14
- "version": "3.37.0",
14
+ "version": "3.38.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": "3.37.0",
20
+ "version": "3.38.0",
21
21
  "description": "Project-agnostic utility skills — 7 skills (convergence-loop · deliberation · mcp-circuit-breaker · token-budget-gate · ko-tech-writer · persona-cast · standpoint-review) + 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.37.0",
26
+ "version": "3.38.0",
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.37.0",
32
+ "version": "3.38.0",
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
  }
@@ -56,6 +56,28 @@ cheap signal accumulation; weekly = one considered proposal.
56
56
  - **`claude/` branch prefix only.** Do not enable "unrestricted branch pushes" for this routine.
57
57
  - **Methodology mirror stays clean.** Daily digests live on the GitHub Issue, never in `tracks/**`
58
58
  (gitignored) and never committed to the methodology tree.
59
+
60
+ ### 3b. The operator's own machine — a narrower auto-merge (2026-11-04)
61
+
62
+ The remote routine above is unchanged. **On the hub operator's machine only**, a RECORDED standing
63
+ request (quoted words · dated lease · scope — `CLAUDE.local.md`, never a session's own initiative)
64
+ lets `scripts/selfdev_loop.sh` merge a self-dev PR unattended when **all** of these hold, each
65
+ checked mechanically after the builder has finished (the builder never grades its own merge):
66
+
67
+ 1. **Direction was human** — the PR's `request: «…»` equals, character for character, an open
68
+ operator request from a session checklist (`seed=human` in `scripts/selfdev_queue.py`).
69
+ Machine-proposed candidates (digest, absorption queue, correction moments, card `[planned]`)
70
+ open a PR and wait. This keeps goal-quench §Autonomy Ladder's «direction is always human».
71
+ 2. **Reversible by path** — every changed file is on `scripts/selfdev_merge_tier.sh`'s allow-list
72
+ (docs, knowledge outside rules/gate docs, skill docs, CATALOG, an *added* lane), ≤ 300 lines.
73
+ 3. **CI green**, and the branch's 4-axis marker carries `crossfamily: panel(…)`.
74
+ 4. **Not demoted** — an operator `Revert "selfdev: …"` on main in the last 30 days holds everything
75
+ (goal-quench §Autonomy Ladder (d), rollback feeds demotion).
76
+
77
+ What this gives up, by the operator's choice: goal-quench Path 2's «review before consumption» for
78
+ that narrow class — the review moves to the morning report (`tracks/_meta/selfdev/report_<date>.md`)
79
+ and to revert. Publish · delete · tag · history rewrite stay human on every path. A plugin user's
80
+ install does not ship this behaviour: for them the same records become an issue or PR *proposal*.
59
81
  - **Cost ceiling.** Both arms run `WebSearch`/`WebFetch`. Daily draws subscription usage and counts
60
82
  against the per-account routine daily cap; keep the daily prompt to collection-only.
61
83
  - **Cite-verify (PR #112 lesson, 2026-06-22) — do not weaken.** Any citation / source / version claim
@@ -5345,3 +5345,33 @@
5345
5345
  outcome: "with the section: named G-TRIG-05 PASS->FAIL and G-TRIG-02 FAIL->PASS and said the flat rate hides it; without: «can't tell from this file»"
5346
5346
  evidence: "PR body of feat/live-eval-moved-since-previous"
5347
5347
  tokens: "115131 + 115035"
5348
+ - date: 2026-11-04
5349
+ agent: "general-purpose (sonnet) ×1 — consumer-side measurement of the published 3.37.0 destructive-op hook (purpose: independence)"
5350
+ task: "npm pack the published package into an empty /private/tmp dir (no install scripts, no ~/.claude), feed the hook synthetic PreToolUse JSON for bypass/default modes and FH_DESTRUCTIVE_BLOCK=0, compare its sha with main"
5351
+ outcome: "5/5 as designed — bypass force-push exit 2 · FH_DESTRUCTIVE_BLOCK=0 advisory · default advisory · git status allowed · rm -rf on an arbitrary absolute path allowed (documented residual); hook sha equals main. Caught the governor's wrong package name in the card (forge-harness → @chrono-meta/fh-gate)"
5352
+ evidence: "fh_completed_2026-11-04.md «세션 bebe7abb» · /private/tmp/fh-3370-consumer.LG6V"
5353
+ tokens: "134376"
5354
+ - date: 2026-11-04
5355
+ agent: "general-purpose (sonnet) ×1 — diagnosis of a suspected double count in .subagent_dispatch_tally.detail (purpose: context)"
5356
+ task: "find every writer of the tally/detail rows, reproduce one SubagentStop on a scratch copy, compare live counts"
5357
+ outcome: "suspicion refuted — one writer, one row per event; 2026-11-03 tally 37 = detail count 37 (governor re-checked); the «two rows» were internal-agent rows mixed into detail"
5358
+ evidence: "fh_completed_2026-11-04.md «세션 bebe7abb»"
5359
+ tokens: "129495"
5360
+ - date: 2026-11-04
5361
+ agent: "general-purpose (sonnet) ×1 — blind run of the edited frontier-digest GeekNews section (purpose: independence, floor-tier first use)"
5362
+ task: "follow only the edited section (curl -sL …/rss/news) and report bytes, entries, items and the progress fragment"
5363
+ outcome: "28,635 B · 20 entries · «GeekNews 5 items» — matched the governor's same-minute measurement; old command (no -L) was 0 B"
5364
+ evidence: "PR #1015 body · marker .axes_23_passed_fix_digest-geeknews-redirect_2026-11-04"
5365
+ tokens: "122365"
5366
+ - date: 2026-11-04
5367
+ agent: "fh-meta:beginner (sonnet) ×1 — blind cold-read of a public FoD guide draft as a non-developer and a skeptical developer (purpose: independence)"
5368
+ task: "read only docs/WHY_GATE.md (cross-refs GUIDE/README allowed) and report where a non-developer stops, claims stronger than their own evidence, open developer questions, top 3 edits"
5369
+ outcome: "flagged undefined terms (hook/MCP/PR/corpus/p) and 9 over-strong claims (unqualified 100%, «won't happen», unmeasured «continues the work») — all applied: glossary, limits beside summary numbers, «미측정» marks, softened wording"
5370
+ evidence: "FoD PR #214 body (Review section)"
5371
+ tokens: "77735"
5372
+ - date: 2026-11-05
5373
+ agent: "fh-commons:quench-challenger (opus) ×1 — Axis 2 adversarial pass on the live-eval Instrument line (purpose: independence)"
5374
+ task: "attack the staged diff of probe_live_eval_lib.py + test_probe_live_eval_lanes.sh: verdict/rc movement, previous-report reader, false claims, lane discrimination, npm-install behaviour"
5375
+ outcome: "1 MED (sim runner not fingerprinted — fixed, IF4 added) · 3 LOW (wording, IF1 skip reason, IF3 fixture path — fixed; reader negative fixture left out of scope) · verdict path confirmed untouched"
5376
+ evidence: "selfdev PR auto/selfdev-2026-11-05-1 body · marker .axes_23_passed_auto_selfdev-2026-11-05-1_2026-11-05"
5377
+ tokens: "47401"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrono-meta/fh-gate",
3
- "version": "3.37.0",
3
+ "version": "3.38.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": {
@@ -369,6 +369,7 @@
369
369
  "scripts/test_push_zone_lanes.sh",
370
370
  "scripts/test_regression_guard_ci_lanes.sh",
371
371
  "scripts/test_regression_guard_sibling_lanes.sh",
372
+ "scripts/test_regression_guard_codecomment_lanes.sh",
372
373
  "scripts/test_relay_channel_lanes.sh",
373
374
  "scripts/test_remote_marker_gate_lanes.sh",
374
375
  "scripts/test_residency_admission_lanes.sh",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-commons",
3
- "version": "3.37.0",
3
+ "version": "3.38.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": "3.37.0",
3
+ "version": "3.38.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -2,7 +2,19 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
- ### [3.37.0] — 2026-11-04 — 권한 무시 모드에서 파괴 명령 기본 차단 · 카드 상태 태그 · 정정 순간 마이닝 · live-eval 직전 밤 대비 변화 · «측정 못 함» 을 판정으로 내던 채널 여섯
5
+ ### [3.38.0] — 2026-11-05
6
+
7
+ ### Added
8
+ - Self-dev loop (`scripts/selfdev_loop.sh`): an unattended loop in its own clone, with a path-tier auto-merge (#1016). `SELFDEV_NO_MERGE` opens PRs but never merges; its parsing is fail-closed, and the template plist ships it set (#1024). A builder that is not logged in is reported as a HARNESS-ERROR, and the template plist sets `USER` (#1024).
9
+ - Queue builder (`scripts/selfdev_queue.py`): a row open only in an older checklist is `seed=recheck` and cannot authorize an auto-merge. If today's frontier digest is not yet written, yesterday's is used and labelled (#1023).
10
+ - live-eval reports carry an Instrument line: git blob ids of the runner, scorer, probes and sim runner (#1025).
11
+
12
+ ### Fixed
13
+ - Regression guard F4 no longer counts Python comments as operational tokens. Only the comment text is removed, after its position is verified; any mismatch or parse failure counts unfiltered. Shell is not filtered (#1022).
14
+ - pipefail early-exit pipelines across 100+ lines (#1019, #1020) and a SIGPIPE race in a regression-guard CI lane (#1021).
15
+ - frontier-digest follows the GeekNews feedburner redirect (#1015).
16
+
17
+ ## [3.37.0] — 2026-11-04 — 권한 무시 모드에서 파괴 명령 기본 차단 · 카드 상태 태그 · 정정 순간 마이닝 · live-eval 직전 밤 대비 변화 · «측정 못 함» 을 판정으로 내던 채널 여섯
6
18
 
7
19
  새 스크립트와 새 레인이 들어가고 게이트 하나의 기본 동작이 조여져서 버전 정책상 minor 다.
8
20
 
@@ -179,10 +179,14 @@ row today; known-negative = an empty body yields the UNMEASURED line, not `0`.
179
179
  ### GeekNews — news.hada.io (RSS)
180
180
 
181
181
  ```bash
182
- curl -s --max-time 8 "https://news.hada.io/rss/news"
182
+ curl -sL --max-time 8 "https://news.hada.io/rss/news"
183
183
  ```
184
184
 
185
- Korean dev-news aggregator (HN-equivalent), AI-heavy. **The `/rss/news` path serves an Atom feed** (`<feed>`/`<entry>`, NOT RSS `<item>` — verified 2026-06-20: 50 `<entry>` elements, 0 `<item>`). Parse `<entry>` → `<title>` + `<link href>`; keep AI/agent/LLM/harness-relevant items only. `/rss/news` is a *general* dev-news feed, so if 0 AI-relevant items remain after filtering, **drop GeekNews from this run's progress line rather than padding to 5**. Endpoint verified HTTP 200 (2026-06-20); `/rss/new` and `/rss/topics` 404 — use `/rss/news`. Max 5 items.
185
+ 🟥 **`-L` is load-bearing (2026-11-04).** `/rss/news` now answers `302 → feeds.feedburner.com/geeknews-feed`;
186
+ without `-L` the body is **0 bytes**, with `-L` it was 28,635 B / 20 `<entry>` (same run). A 0-byte body is
187
+ `UNMEASURED (empty body)`, never `0 items`.
188
+
189
+ Korean dev-news aggregator (HN-equivalent), AI-heavy. **The `/rss/news` path serves an Atom feed** (`<feed>`/`<entry>`, NOT RSS `<item>` — verified 2026-06-20: 50 `<entry>` elements, 0 `<item>`; 2026-11-04 after the redirect: 20 `<entry>`, 0 `<item>`). Parse `<entry>` → `<title>` + `<link href>`; keep AI/agent/LLM/harness-relevant items only. `/rss/news` is a *general* dev-news feed, so if 0 AI-relevant items remain after filtering, **drop GeekNews from this run's progress line rather than padding to 5**. Endpoint verified HTTP 200 (2026-06-20); `/rss/new` and `/rss/topics` 404 — use `/rss/news`. Max 5 items.
186
190
 
187
191
  ### Launch channels and vendor feeds (added 2026-10-17; ids match SKILL.md Step 1)
188
192
 
@@ -196,7 +200,7 @@ were live-checked once on 2026-10-17 (HTTP status · entries counted by `<entry`
196
200
  - **Product Hunt (`product-hunt`)**: official Atom feed `https://www.producthunt.com/feed` (2026-10-17: 200, 50 `<entry>`). ⚠️ the `?category=` parameter returned a byte-near-identical feed, so it is not shown to filter — filter by keyword yourself. Parse `<entry>` title + link.
197
201
  - **Show HN (`show-hn`)**: `'https://hn.algolia.com/api/v1/search_by_date?tags=show_hn&query=<KW>&hitsPerPage=8&numericFilters=points%3E10'` (quoted; 2026-10-17: 200, 8 hits for «agent») for the same keywords as the HN leg. Cite the HN item id.
198
202
  - **GeekNews (`geeknews`)**: unchanged section above (still wired).
199
- - **Vendor changelogs/blogs (`vendor-changelogs`)**: Feeds: OpenAI `https://openai.com/news/rss.xml` (200, RSS) · Google DeepMind `https://deepmind.google/blog/rss.xml` (200, RSS). HTML pages, no feed found (200, parse with WebFetch): Anthropic `https://www.anthropic.com/news` · Gemini API changelog `https://ai.google.dev/gemini-api/docs/changelog` · Meta AI `https://ai.meta.com/blog/` · Cursor `https://cursor.com/changelog`. Keep entries newer than the previous digest; cite the entry URL.
203
+ - **Vendor changelogs/blogs (`vendor-changelogs`)**: Feeds: OpenAI `https://openai.com/news/rss.xml` (200, RSS) · Google DeepMind `https://deepmind.google/blog/rss.xml` (200, RSS). HTML pages, no feed found (200, parse with WebFetch): Anthropic `https://www.anthropic.com/news` · Gemini API changelog `https://ai.google.dev/gemini-api/docs/changelog` (⚠️ 2026-11-04: `301 → https://aistudio.google.com/docs/changelog`, a JS shell to curl — read it with WebFetch or report `UNMEASURED (js shell)`) · Meta AI `https://ai.meta.com/blog/` · Cursor `https://cursor.com/changelog`. Keep entries newer than the previous digest; cite the entry URL.
200
204
 
201
205
  Recall regression: `scripts/test_frontier_digest_recall.sh` against `scripts/fixtures/frontier_digest_recall.tsv` (structural only: each known item must have a channel in the Step 1 list; the channel assignments are expectations, not announcement evidence — do not cite the lane as measured recall).
202
206
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-preprep",
3
- "version": "3.37.0",
3
+ "version": "3.38.0",
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.37.0",
3
+ "version": "3.38.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -155,7 +155,7 @@ while IFS= read -r f; do
155
155
  [ -n "$f" ] || continue
156
156
  [ -f "$f" ] && [ -r "$f" ] || continue
157
157
  LC_ALL=C grep -Iq . "$f" 2>/dev/null || continue # 바이너리는 대상이 아니다
158
- [ -n "$(tr -d '[:space:]' < "$f" 2>/dev/null | head -c 1)" ] || continue # 공백뿐 = 내용 없음
158
+ [ -n "$(tr -d '[:space:]' < "$f" 2>/dev/null | cut -c1-1)" ] || continue # 공백뿐 = 내용 없음
159
159
 
160
160
  # 판정은 파이프를 통과시키지 않는다(PIPE-VERDICT).
161
161
  out=$(cd "$PEER_ROOT" && bun "$CLI" --from-file "$f" 2>&1); rc=$?
@@ -80,7 +80,7 @@ ORDER_writes="read-only write-local write-remote"
80
80
  _idx() { local v="$1" i=0 x; for x in $ORDER_writes; do [ "$x" = "$v" ] && { printf '%d' "$i"; return; }; i=$((i+1)); done; printf '%d' -1; }
81
81
 
82
82
  _key() { # $1=capfile $2=key
83
- sed -n "s/^[[:space:]]*$2:[[:space:]]*//p" "$1" 2>/dev/null | head -1 \
83
+ sed -n "s/^[[:space:]]*$2:[[:space:]]*//p" "$1" 2>/dev/null | sed -n 1p \
84
84
  | sed 's/[[:space:]]*$//'
85
85
  }
86
86
 
@@ -416,7 +416,7 @@ $out2"
416
416
  # 조용히 실패한다. 그 실패를 「안 썼다」로 렌더하면 [S] 를 고치면서 같은 얼굴의 결함을
417
417
  # 새로 만드는 것이다 — 실측: `core.pager` 를 심으려던 capability 가 수리 직후
418
418
  # **VERIFIED** 를 받았다(실물 레포는 깨끗해졌지만 판정이 거짓). 미측정은 미측정으로 낸다.
419
- if [ "$rc" -ge 10 ] || printf '%s' "$out" | grep -qiE 'command not found|no such file|not a git repository'; then
419
+ if [ "$rc" -ge 10 ] || printf '%s' "$out" | grep -ciE 'command not found|no such file|not a git repository' >/dev/null; then
420
420
  printf '⚠️ UNVERIFIABLE %s — 진입점이 이 샌드박스에서 못 돌았다(rc=%s). 미측정이지 통과 아님\n' "$cap" "$rc"
421
421
  return "$RC_UNVERIFIABLE"
422
422
  fi
@@ -111,7 +111,7 @@ if grep -q '<one line: the capability' "$WS/INTENT.md"; then
111
111
  fi
112
112
  # gate (a) is "artifact exists WITH real content", not just "placeholder removed" (Axis-2 LOW-6): require
113
113
  # at least one non-empty numbered success condition so a gutted INTENT.md doesn't pass.
114
- if ! awk '/^## Success conditions/{f=1;next} /^## /{f=0} f && /^[0-9]+\.[[:space:]]*[^[:space:]]/{print; exit}' "$WS/INTENT.md" | grep -q .; then
114
+ if ! awk '/^## Success conditions/{f=1;next} /^## /{f=0} f && /^[0-9]+\.[[:space:]]*[^[:space:]]/{print; exit}' "$WS/INTENT.md" | grep -c . >/dev/null; then
115
115
  # 계약을 **에러 메시지가 가르친다.** 이 형식은 CHAMBER_RUN_SKELETON.md 에 한 글자도 없어서,
116
116
  # 스켈레톤만 읽고 쓴 INTENT 가 반려됐다 — gate-locality(계약이 게이트 구현에만 산다).
117
117
  # 같은 런에서 step 6 도 같은 이유로 막혔다(N=2). 문서는 드리프트하지만 에러는 코드와 같이 산다.
@@ -190,7 +190,7 @@ fi
190
190
  # PARTIAL-EMIT listed FIRST in every alternation so it is never mis-extracted as its EMIT substring.
191
191
  VERDICT=$(grep -ioE '^VERDICT:[[:space:]]*(PARTIAL-EMIT|EMIT|KILL|CURATED|NOT-APPLICABLE)' "$WS/EMISSION_VERDICT.md" 2>/dev/null | head -1 | grep -ioE 'PARTIAL-EMIT|EMIT|KILL|CURATED|NOT-APPLICABLE' | head -1 | tr 'a-z' 'A-Z')
192
192
  # a bare "## Verdict:" prose line (run #3 style) also counts if it names KILL/EMIT
193
- [ -z "$VERDICT" ] && VERDICT=$(grep -ioE 'VERDICT[: *]+\**(PARTIAL-EMIT|EMIT|KILL|CURATED|NOT-APPLICABLE)' "$WS/EMISSION_VERDICT.md" 2>/dev/null | grep -ioE 'PARTIAL-EMIT|EMIT|KILL|CURATED|NOT-APPLICABLE' | head -1 | tr 'a-z' 'A-Z')
193
+ [ -z "$VERDICT" ] && VERDICT=$(grep -ioE 'VERDICT[: *]+\**(PARTIAL-EMIT|EMIT|KILL|CURATED|NOT-APPLICABLE)' "$WS/EMISSION_VERDICT.md" 2>/dev/null | grep -ioE 'PARTIAL-EMIT|EMIT|KILL|CURATED|NOT-APPLICABLE' | sed -n 1p | tr 'a-z' 'A-Z')
194
194
  if [ -z "$VERDICT" ]; then
195
195
  echo " ⛔ step 5 BLOCKED: no VERDICT (EMIT|PARTIAL-EMIT|KILL|CURATED|NOT-APPLICABLE) found in $WS/EMISSION_VERDICT.md, re-run."; exit 1
196
196
  fi
@@ -251,7 +251,7 @@ do_digest() {
251
251
  [ -n "$_cp_git" ] && printf '%s\n' "$_cp_git"
252
252
  echo
253
253
  echo "── 운영자 발화 (앞 25건) ──"
254
- awk '/^## 운영자 발화/{f=1;next} /^## /{f=0} f' "$sealfile" 2>/dev/null | grep -E '^[0-9]+\.|^제외:|^합계:' | head -25
254
+ awk '/^## 운영자 발화/{f=1;next} /^## /{f=0} f' "$sealfile" 2>/dev/null | grep -E '^[0-9]+\.|^제외:|^합계:' | sed -n '1,25p'
255
255
  echo
256
256
  echo " ⚠️ 이 원장은 **축자 기록**이다. 여기 있는 발화가 기록에 착지했는지는 별도 검증이다"
257
257
  echo " (scripts/utterance_landing_check.sh)."
@@ -265,7 +265,7 @@ do_digest() {
265
265
  # ─────────────────────────────────────────────────────────────────────────────
266
266
  do_score() {
267
267
  local transcript="$1" outdir="$2"
268
- local latest; latest="$(ls -t "$outdir"/seal_*.md 2>/dev/null | head -1)"
268
+ local latest; latest="$(ls -t "$outdir"/seal_*.md 2>/dev/null | sed -n 1p)"
269
269
  echo "🟥 REFUTED — 전사본 grep 채점은 성립하지 않는다. 아무 판정도 여기에 의존하지 않는다."
270
270
  echo " 실측(2026-08-08 첫 실압축): 압축 후에도 전사본이 전 레코드를 보존한다(ⓐ)."
271
271
  echo " → grep 은 손실 0 을 영원히 보고한다 = fail-open 계기. 캘리브레이션 부족이 아니라 가정 오류."
@@ -298,7 +298,7 @@ self_test() {
298
298
  do_seal "$T/tr.jsonl" "$T/out" "sess1" >/dev/null 2>&1; rc=$?
299
299
  t "seal 정상 종료" 0 "$rc"
300
300
 
301
- local sf; sf="$(ls "$T/out"/seal_*.md 2>/dev/null | head -1)"
301
+ local sf; sf="$(ls "$T/out"/seal_*.md 2>/dev/null | sed -n 1p)"
302
302
  [ -n "$sf" ] && r=YES || r=NO
303
303
  t "봉인 파일 생성" YES "$r"
304
304
 
@@ -332,7 +332,7 @@ self_test() {
332
332
  # ── 회귀 레인: SIGPIPE 소비 누락 (2026-08-08 실측 재현) ──
333
333
  # 소비자가 파이프를 먼저 닫아도 마커는 소비돼야 한다. 인쇄 뒤에 rm 을 두면 여기서 되돌아온다.
334
334
  do_seal "$T/tr.jsonl" "$T/out3" "sess3" >/dev/null 2>&1
335
- do_digest "$T/out3" "sess3" 2>/dev/null | head -1 >/dev/null 2>&1
335
+ do_digest "$T/out3" "sess3" 2>/dev/null | head -1 >/dev/null 2>&1 # pipefail-intentional: 이 레인의 자극이다 — 소비자가 파이프를 먼저 닫는 상황을 일부러 만든다(codex R1 지목)
336
336
  d2="$(do_digest "$T/out3" "sess3" 2>/dev/null | wc -c | tr -d ' ')"
337
337
  t "파이프 조기 종료 후에도 소비됨 (무한 재주입 방지)" 0 "$d2"
338
338
 
@@ -349,7 +349,7 @@ self_test() {
349
349
  t "빈 페이로드에도 봉인은 생성된다" YES "$rc"
350
350
  [ -f "$T/pl/.last_payload" ] && rc=YES || rc=NO
351
351
  t "원본 페이로드가 기록된다 (원인 추적 가능)" YES "$rc"
352
- local sf2; sf2="$(ls -t "$T/pl"/seal_*.md 2>/dev/null | head -1)"
352
+ local sf2; sf2="$(ls -t "$T/pl"/seal_*.md 2>/dev/null | sed -n 1p)"
353
353
  grep -qE 'payload: (fallback-session|fallback-mtime-UNVERIFIED|unresolved)' "$sf2" 2>/dev/null && rc=YES || rc=NO
354
354
  t "payload 상태가 typed 로 남는다 (무음 아님)" YES "$rc"
355
355
 
@@ -406,7 +406,7 @@ self_test() {
406
406
  # #11 신선도 가드가 **구형식 pending(경로 한 줄)** 에서 무음으로 꺼지지 않는다.
407
407
  # 실측 2026-08-13: 이 경로로 5일 묵은 봉인이 "직전 압축"이라고 주장하며 실제 세션에 주입됐다.
408
408
  do_seal "$T/tr.jsonl" "$T/out11" "SESSA" >/dev/null 2>&1
409
- local p11; p11="$(ls "$T/out11"/.pending_* 2>/dev/null | head -1)"
409
+ local p11; p11="$(ls "$T/out11"/.pending_* 2>/dev/null | sed -n 1p)"
410
410
  cut -f1 "$p11" > "$p11.t" 2>/dev/null && mv "$p11.t" "$p11" # 구형식으로 강등 = 봉인 시각 소실
411
411
  local d11; d11="$(do_digest "$T/out11" "SESSA" 2>/dev/null)"
412
412
  case "$d11" in *"직전 압축 전에"*) rc=YES ;; *) rc=NO ;; esac
@@ -425,7 +425,7 @@ self_test() {
425
425
  # #11c **미래 시각**도 신선도 판정 불가다 — 음수 _age 는 `-gt 43200` 을 통과 못 해서
426
426
  # 가드가 또 조용히 꺼진다. cross-family(codex/gpt-5.5)가 이번 수리 안에서 지목한 세 번째 얼굴.
427
427
  do_seal "$T/tr.jsonl" "$T/out11c" "SESSA" >/dev/null 2>&1
428
- local p11c; p11c="$(ls "$T/out11c"/.pending_* 2>/dev/null | head -1)"
428
+ local p11c; p11c="$(ls "$T/out11c"/.pending_* 2>/dev/null | sed -n 1p)"
429
429
  awk -v ts="$(( $(date +%s) + 86400 ))" 'BEGIN{FS=OFS="\t"}{$3=ts;print}' "$p11c" > "$p11c.t" \
430
430
  && mv "$p11c.t" "$p11c"
431
431
  local d11c; d11c="$(do_digest "$T/out11c" "SESSA" 2>/dev/null)"
@@ -441,7 +441,7 @@ self_test() {
441
441
  # 검증: 이 레인 없이 `elif [ "$_age" -gt 43200 ]` 가지를 통째로 지워도 39쌍 전부 초록이었다.
442
442
  # (Axis 2 M-3 지목. 세션 일치 케이스라 주장은 유지되고 나이는 부가정보로 붙는다 — M-4)
443
443
  do_seal "$T/tr.jsonl" "$T/out11d" "SESSA" >/dev/null 2>&1
444
- local p11d; p11d="$(ls "$T/out11d"/.pending_* 2>/dev/null | head -1)"
444
+ local p11d; p11d="$(ls "$T/out11d"/.pending_* 2>/dev/null | sed -n 1p)"
445
445
  awk -v ts="$(( $(date +%s) - 432000 ))" 'BEGIN{FS=OFS="\t"}{$3=ts;print}' "$p11d" > "$p11d.t" \
446
446
  && mv "$p11d.t" "$p11d"
447
447
  local d11d; d11d="$(do_digest "$T/out11d" "SESSA" 2>/dev/null)"
@@ -456,7 +456,7 @@ self_test() {
456
456
  # 셸 즉시 종료 → exit 0 미도달 → stdout 통째 폐기. 이 파일의 「훅은 절대 비영 종료 안 한다」
457
457
  # 불변식이 입력 하나로 깨지던 자리다(Axis 2 M-1, 실측 재현).
458
458
  do_seal "$T/tr.jsonl" "$T/out11e" "SESSA" >/dev/null 2>&1
459
- local p11e; p11e="$(ls "$T/out11e"/.pending_* 2>/dev/null | head -1)"
459
+ local p11e; p11e="$(ls "$T/out11e"/.pending_* 2>/dev/null | sed -n 1p)"
460
460
  awk 'BEGIN{FS=OFS="\t"}{$3="08123456";print}' "$p11e" > "$p11e.t" && mv "$p11e.t" "$p11e"
461
461
  local d11e d11e_rc
462
462
  d11e="$(do_digest "$T/out11e" "SESSA" 2>&1)"; d11e_rc=$?
@@ -473,7 +473,7 @@ self_test() {
473
473
  # 막는 마지막 층이고, 지우면 그 경우가 조용히 「일치」로 렌더된다. 이 레인은 회귀 앵커가 아니라
474
474
  # **방어 가지가 살아 있다는 증명**이다 — 도달 경로가 있는 척하지 않으려고 여기 적는다.
475
475
  do_seal "$T/tr.jsonl" "$T/out13" "SESSX" >/dev/null 2>&1
476
- local sf13; sf13="$(ls -t "$T/out13"/seal_*.md 2>/dev/null | head -1)"
476
+ local sf13; sf13="$(ls -t "$T/out13"/seal_*.md 2>/dev/null | sed -n 1p)"
477
477
  printf '%s\t%s\t%s\n' "$sf13" "SESSX" "$(( $(date +%s) - 432000 ))" > "$T/out13/.pending_SESSA"
478
478
  local d13; d13="$(do_digest "$T/out13" "SESSA" 2>/dev/null)"
479
479
  case "$d13" in *"다른 세션(SESSX)"*) rc=YES ;; *) rc=NO ;; esac
@@ -501,7 +501,7 @@ self_test() {
501
501
  # 남의 봉인을 09-30 두 세션 · 10-03 한 세션에 주입했다. 구형식은 아무도 더 이상 쓰지 않으므로
502
502
  # 거기 남은 것은 정의상 낡다. 컨트롤: 같은 디렉터리에 내 마커를 넣으면 주입된다(계기 살아 있음).
503
503
  do_seal "$T/tr.jsonl" "$T/out14" "SESSOLD" >/dev/null 2>&1
504
- local sf14; sf14="$(ls -t "$T/out14"/seal_*.md 2>/dev/null | head -1)"
504
+ local sf14; sf14="$(ls -t "$T/out14"/seal_*.md 2>/dev/null | sed -n 1p)"
505
505
  rm -f "$T/out14"/.pending_* 2>/dev/null
506
506
  printf '%s\n' "$sf14" > "$T/out14/.pending" # 08-08 이전 모양 — 경로 한 줄
507
507
  local d14; d14="$(do_digest "$T/out14" "SESSNEW" 2>/dev/null | wc -c | tr -d ' ')"
@@ -558,7 +558,7 @@ self_test() {
558
558
  # #5 세션 미상 폴백은 **미검증으로 라벨**돼야 한다 (침묵 추정 금지)
559
559
  local sf5
560
560
  printf '%s' '{}' | bash "$0" seal --dir "$T/out5" >/dev/null 2>&1
561
- sf5="$(ls -t "$T/out5"/seal_*.md 2>/dev/null | head -1)"
561
+ sf5="$(ls -t "$T/out5"/seal_*.md 2>/dev/null | sed -n 1p)"
562
562
  # ⚠️ 성질은 "세션 미상 폴백이 **타입으로 남는다**" 이지 특정 값 하나가 아니다. 특정 값으로
563
563
  # 과대명세했더니 **저자 머신의 전사본이 있어야만 통과**하는 레인이 됐고, selfcheck 에 배선하자
564
564
  # CI 가 82db426 부터 빨개졌다(로컬 초록 ≠ CI 초록, 실측). 전사본이 없는 러너에서는 `unresolved`
@@ -638,11 +638,11 @@ if [ "$MODE" != "digest" ] && { [ -z "$TRANSCRIPT" ] || [ ! -f "$TRANSCRIPT" ];
638
638
  # 세션 id 를 알면 **그 세션의 전사본**을 고른다. mtime 최신을 고르면 같은 레포에 세션이 둘 열려
639
639
  # 있을 때 **남의 발화를 이 세션 것으로 봉인**한다(high 리뷰 #5, 이 디렉토리에 전사본 125개).
640
640
  if [ "$SESSION" != "unknown" ] && [ -n "$SESSION" ]; then
641
- _cand="$(ls "$_dir"/"$SESSION"*.jsonl 2>/dev/null | head -1)"
641
+ _cand="$(ls "$_dir"/"$SESSION"*.jsonl 2>/dev/null | sed -n 1p)"
642
642
  [ -n "$_cand" ] && PAYLOAD_STATUS="fallback-session"
643
643
  fi
644
644
  if [ -z "$_cand" ]; then
645
- _cand="$(ls -t "$_dir"/*.jsonl 2>/dev/null | head -1)"
645
+ _cand="$(ls -t "$_dir"/*.jsonl 2>/dev/null | sed -n 1p)"
646
646
  # 세션 미상 → 최신을 쓰되 **검증 불가임을 타입으로 남긴다.** 침묵 추정 금지.
647
647
  [ -n "$_cand" ] && PAYLOAD_STATUS="fallback-mtime-UNVERIFIED"
648
648
  fi
@@ -285,7 +285,7 @@ _hd_latest() { # stdout: 가장 최근 리포트의 mtime (없으면 빈 문자
285
285
  _hd_has_history() { # «굴러가는 설치인가» — 이것도 합집합으로 본다
286
286
  for _d in "$FH/tracks/_meta" ${BE:+"$BE/$TM"}; do
287
287
  [ -d "$_d" ] || continue
288
- find "$_d" -maxdepth 1 -name 'fh_completed_*.md' -print 2>/dev/null | grep -q . && return 0
288
+ find "$_d" -maxdepth 1 -name 'fh_completed_*.md' -print 2>/dev/null | grep -c . >/dev/null && return 0
289
289
  done
290
290
  return 1
291
291
  }
@@ -569,7 +569,7 @@ done
569
569
  # here either (unlike tracks-meta above, which pmh-dev#68 PR #368 review flagged for exactly this).
570
570
  INDEX_HEAD=""
571
571
  if [ -f "$BE/INDEX.md" ]; then
572
- INDEX_HEAD="$(grep -iE 'live pointer|Live pointers' -A 8 "$BE/INDEX.md" 2>/dev/null | head -10)"
572
+ INDEX_HEAD="$(grep -iE 'live pointer|Live pointers' -A 8 "$BE/INDEX.md" 2>/dev/null | sed -n '1,10p')"
573
573
  fi
574
574
 
575
575
  # 5) Emit the freshness block (short + imperative). Only speak if there is something to say.
@@ -119,6 +119,16 @@ _log "Stage 1 (digest) OK for ${HUMAN_DATE}."
119
119
 
120
120
  cd "$FH_DIR" || { _log "cannot cd to \$FH_DIR ($FH_DIR)"; exit 1; }
121
121
 
122
+ # ── Stage 2 retired here (2026-11-04) → scripts/selfdev_loop.sh ─────────────
123
+ # Measured: 25 consecutive daily runs (2026-10-11 → 2026-11-04) logged «Stage 2 SKIPPED: working tree
124
+ # is dirty» — the shared checkout always carries untracked experiment trees, so rail ① below made the
125
+ # stage permanently dead. The self-dev loop now runs in its own clone (selfdev_loop.sh, nightly), which
126
+ # has no shared-tree reason to skip. Set FD_AUTOPILOT_STAGE2=1 to run the old in-checkout stage anyway.
127
+ if [ "${FD_AUTOPILOT_STAGE2:-0}" != 1 ]; then
128
+ _log "Stage 2 retired — self-dev runs in its own clone via scripts/selfdev_loop.sh (FD_AUTOPILOT_STAGE2=1 to force the old path)."
129
+ exit 0
130
+ fi
131
+
122
132
  # ── Stage 2 preconditions (rails ① ② ③) ─────────────────────────────────────
123
133
  if [ -n "$(git status --porcelain 2>/dev/null)" ]; then
124
134
  _log "Stage 2 SKIPPED: working tree is dirty (another session's uncommitted work may be live) — never touching it unattended."
@@ -43,7 +43,7 @@ COMMENT_RE='^[[:space:]]*(#|//|\*([[:space:]]|$)|/\*|--([[:space:]]|$)|;|"""|'"'
43
43
  scan_one() { # $1=file → prints hits, returns 0 hit / 1 none / 3 unscannable
44
44
  local f="$1" body v e r hits
45
45
  [ -r "$f" ] || { echo "UNSCANNABLE $f (unreadable)"; return 3; }
46
- if /usr/bin/file -b --mime-encoding "$f" 2>/dev/null | /usr/bin/grep -q '^binary$'; then
46
+ if /usr/bin/file -b --mime-encoding "$f" 2>/dev/null | /usr/bin/grep -c '^binary$' >/dev/null; then
47
47
  echo "UNSCANNABLE $f (binary)"; return 3; fi
48
48
  # one pass: drop comment-led lines, then classify (VERDICT wins over EXPOSURE over IRREV per line)
49
49
  # 🟥 pmh-dev #76 (2026-09-11): 여러 줄 docstring 의 «안쪽» 줄은 줄머리가 따옴표가 아니라 COMMENT_RE 를 통과했다 —
@@ -304,7 +304,7 @@ CLOSED_CHANNELS=""
304
304
  _closed() { CLOSED_CHANNELS="$CLOSED_CHANNELS
305
305
  - $1"; }
306
306
 
307
- _field() { sed -n "s/^$2=//p" "$1" 2>/dev/null | head -1; }
307
+ _field() { sed -n "s/^$2=//p" "$1" 2>/dev/null | sed -n 1p; }
308
308
 
309
309
  # crossfamily 값 → 판에 찍을 계열 토큰. **enum 을 다시 판정하지 않는다** — 정본은
310
310
  # `templates/.git-hooks/pre-commit` 의 validate_crossfamily_leg 이고, 여기서 그 로직을 다시
@@ -507,7 +507,7 @@ EOF
507
507
  case "$n" in ''|*[!0-9]*) prog='미측정' ;; *) prog="+$n" ;; esac
508
508
  fi
509
509
  if [ "$prog" != "미측정" ] && [ -d "$p" ]; then
510
- [ -n "$(git -C "$p" status --porcelain 2>/dev/null | head -1)" ] && prog="$prog*"
510
+ [ -n "$(git -C "$p" status --porcelain 2>/dev/null | sed -n 1p)" ] && prog="$prog*"
511
511
  fi
512
512
 
513
513
  # 마지막 움직임 — 커밋 시각과 claim 시각 중 **늦은 쪽**. 둘 다 없으면 빈칸(0 아님).
@@ -215,7 +215,7 @@ _add() { REASONS="${REASONS} - $1
215
215
  _field() { # $1 = field name; echoes the value line or nothing
216
216
  ls -1 "$RECDIR"/outbound_pr_"$TODAY"_*.md 2>/dev/null | while read -r f; do
217
217
  grep -m1 -E "^[[:space:]]*$1:" "$f" 2>/dev/null
218
- done | head -1
218
+ done | sed -n 1p
219
219
  }
220
220
  _records=$(ls -1 "$RECDIR"/outbound_pr_"$TODAY"_*.md 2>/dev/null | wc -l | tr -d ' ')
221
221
 
@@ -39,6 +39,16 @@ cd "$REPO_ROOT" || exit 1
39
39
  # scripts/sync_to_be_lanes.sh — forward-path lane suite for sync-to-be.sh, itself
40
40
  # ACCEPTED_ABSENT above; added 2026-08-14, pmh-dev#69.
41
41
  ACCEPTED_ABSENT=(
42
+ # 2026-11-04 — unattended self-dev loop. Operator-machine only, by the operator's own scope
43
+ # (CLAUDE.local.md §FH 자체개발 자율화: «일반 사용자는 이슈/PR 제안»): shipping it would put an
44
+ # auto-merging loop into every consumer install. self_evolution_routine.md §3b names these files to
45
+ # say exactly that; selfcheck resolves their rows as SKIP on a consumer tree.
46
+ "scripts/selfdev_loop.sh"
47
+ "scripts/selfdev_merge_tier.sh"
48
+ "scripts/selfdev_queue.py"
49
+ "scripts/test_selfdev_merge_tier_lanes.sh"
50
+ "scripts/test_selfdev_queue_lanes.sh"
51
+ "scripts/test_selfdev_loop_lanes.sh"
42
52
  # 2026-10-19 — cartridge admission checker and its lanes. Not shipped yet on purpose: publishing cartridges
43
53
  # (fh-cartridges) is an open operator decision, and shipping the checker would put it in the next npm
44
54
  # release by default. selfcheck resolves its row as SKIP («not in files[], and absent») on a consumer tree.
@@ -33,12 +33,13 @@
33
33
  # (gh non-zero but GitHub says MERGED → continue to verify; state unreadable → 4, outcome UNKNOWN)
34
34
 
35
35
  set -uo pipefail
36
- PR=""; RERUN=""; RERUN_SET=0; REPO="."; LEASE="NONE"
36
+ PR=""; RERUN=""; RERUN_SET=0; REPO="."; LEASE="NONE"; EXPECT_HEAD=""
37
37
  _need() { [ $# -ge 2 ] || { echo "🟥 $1 needs a value" >&2; exit 2; }; }
38
38
  while [ $# -gt 0 ]; do
39
39
  case "$1" in
40
40
  --rerun) _need "$@"; RERUN="${2-}"; RERUN_SET=1; shift 2 ;;
41
41
  --repo) _need "$@"; REPO="${2:-}"; shift 2 ;;
42
+ --expect-head) _need "$@"; EXPECT_HEAD="${2-}"; shift 2 ;;
42
43
  --lease) _need "$@"; LEASE="${2-}"; [ -n "$LEASE" ] || { echo "🟥 --lease needs a non-empty label" >&2; exit 2; }; shift 2 ;;
43
44
  -h|--help) sed -n '2,30p' "$0"; exit 0 ;;
44
45
  -*) echo "unknown arg: $1" >&2; exit 2 ;;
@@ -96,6 +97,12 @@ HEAD_OID=$(gh pr view "$PR" --json headRefOid -q .headRefOid < /dev/null) || HEA
96
97
  git fetch -q origin "pull/$PR/head" < /dev/null 2>/dev/null || git fetch -q origin "$HEAD_OID" < /dev/null 2>/dev/null || true
97
98
  git cat-file -e "$HEAD_OID^{commit}" 2>/dev/null \
98
99
  || { echo "🟥 HARNESS-ERROR (before merge): PR head $HEAD_OID not fetchable — not merging" >&2; exit 4; }
100
+ # --expect-head: the caller already judged ONE commit; merging any other is refused before the merge
101
+ # (selfdev_loop.sh, codex R2 2026-11-04 — without it the head this script records could be a commit
102
+ # pushed after the caller's checks, and --match-head-commit would then bind to the unchecked one).
103
+ if [ -n "$EXPECT_HEAD" ] && [ "$HEAD_OID" != "$EXPECT_HEAD" ]; then
104
+ echo "🟥 PR #$PR head is $HEAD_OID, not the checked $EXPECT_HEAD — not merging" >&2; exit 2
105
+ fi
99
106
  echo "── PR #$PR head recorded: $HEAD_OID"
100
107
 
101
108
  # 1b. coverage advisory — WARNING ONLY (never changes rc, never merges or refuses). post_squash_verify's precheck rejects a
@@ -16,6 +16,7 @@ import re
16
16
  import sys
17
17
  import os
18
18
  import glob
19
+ import hashlib
19
20
  from datetime import date
20
21
 
21
22
  ID_RE = re.compile(r'^[A-Z][A-Z0-9]*-[A-Z0-9]+-[0-9]+$')
@@ -744,7 +745,50 @@ def render_target_md(t):
744
745
  return out
745
746
 
746
747
 
747
- def render_report_md(select_result, score_result, run_date):
748
+ def _git_blob_sha(path):
749
+ """git's blob id for the file's CURRENT bytes (identical to `git hash-object <path>`), computed
750
+ in-process: no git binary needed, and an uncommitted edit still gets its own id. A commit SHA
751
+ would say nothing about a dirty tree, which is exactly the run this line must not mislabel.
752
+ A symlink is FOLLOWED (the bytes that ran are hashed, not the link path git would hash for a
753
+ mode-120000 entry) — none of the four instrument files is a symlink today. None when unreadable."""
754
+ try:
755
+ with open(path, 'rb') as f:
756
+ data = f.read()
757
+ except (OSError, TypeError):
758
+ return None
759
+ return hashlib.sha1(b'blob %d\0' % len(data) + data).hexdigest()
760
+
761
+
762
+ def instrument_fingerprint(probes_live_path):
763
+ """[(name, blob_sha_or_None)] for the four files that make up the INSTRUMENT of a live run:
764
+ the runner, this scorer, the probe definitions (their expect patterns are scoring rules) and
765
+ the sim runner that produced the response bodies — `FH_SIM_RUNNER_BIN` when set (the same
766
+ override probe_live_eval.sh reads; a stub-driven run must not print a live run's fingerprint),
767
+ named `sim_runner(override)` so the swap is visible, else scripts/sim_isolated_run.sh.
768
+ The target — CLAUDE.md, rules, skills — is deliberately not here: two reports with the same
769
+ fingerprint and a different verdict moved because of the target or the model, not the scorer."""
770
+ me = os.path.realpath(__file__) # realpath, not abspath: a symlinked import must still find
771
+ here = os.path.dirname(me) # the runner beside the REAL scorer file
772
+ return [('runner', _git_blob_sha(os.path.join(here, 'probe_live_eval.sh'))),
773
+ ('scorer', _git_blob_sha(me)),
774
+ ('probes', _git_blob_sha(probes_live_path)),
775
+ ('sim_runner(override)' if os.environ.get('FH_SIM_RUNNER_BIN') else 'sim_runner',
776
+ _git_blob_sha(os.environ.get('FH_SIM_RUNNER_BIN')
777
+ or os.path.join(here, 'sim_isolated_run.sh')))]
778
+
779
+
780
+ def render_instrument_line(fp):
781
+ """Record only — no verdict reads it. Unreadable files are written UNKNOWN, never dropped."""
782
+ if fp is None:
783
+ return "- Instrument: not supplied by the caller"
784
+ return ("- Instrument (git blob ids, `git hash-object --no-filters <file>`, SHA-1 object format): "
785
+ + " · ".join("%s=%s" % (n, s if s else 'UNKNOWN(unreadable)') for n, s in fp)
786
+ + " — the same id in two reports = the same bytes; UNKNOWN on either side = not "
787
+ "comparable, never «same». NOT covered: the `claude` CLI version and the model "
788
+ "(the Run heading names the model)")
789
+
790
+
791
+ def render_report_md(select_result, score_result, run_date, instrument=None):
748
792
  lines = []
749
793
  lines.append("# live_eval — %s" % run_date)
750
794
  lines.append("")
@@ -752,6 +796,8 @@ def render_report_md(select_result, score_result, run_date):
752
796
  "each probe checks and why. Static-only coverage lives in `/prompt-regression`; "
753
797
  "this file is its live twin's record.")
754
798
  lines.append("")
799
+ lines.append(render_instrument_line(instrument))
800
+ lines.append("")
755
801
  lines.append("## Selection")
756
802
  lines.append("- Selected: %d" % len(select_result['selected']))
757
803
  lines.append("- Excluded: %d" % len(select_result['excluded']))
@@ -932,7 +978,8 @@ def _cmd_score(args):
932
978
  print("OVERALL: %s (rc=%d)" % (score_result['overall'], score_result['rc']))
933
979
 
934
980
  if args.report_out:
935
- md = render_report_md(select_result, score_result, args.run_date or str(date.today()))
981
+ md = render_report_md(select_result, score_result, args.run_date or str(date.today()),
982
+ instrument=instrument_fingerprint(args.probes_live))
936
983
  os.makedirs(os.path.dirname(args.report_out), exist_ok=True)
937
984
  with open(args.report_out, 'w', encoding='utf-8') as f:
938
985
  f.write(md)
@@ -113,7 +113,7 @@ if [ ! -d "$ROOT/tracks/_meta" ]; then
113
113
  fi
114
114
 
115
115
  today=$(date +%Y-%m-%d)
116
- marker=$(ls -t "$ROOT"/tracks/_meta/.axes_23_passed_*_"$today".marker 2>/dev/null | head -1)
116
+ marker=$(ls -t "$ROOT"/tracks/_meta/.axes_23_passed_*_"$today".marker 2>/dev/null | sed -n 1p)
117
117
  if [ -z "$marker" ]; then
118
118
  cat >&2 <<MSG
119
119
  ❌ 상주 순증(+$net 줄)인데 오늘자 마커가 없다.