@chrono-meta/fh-gate 3.36.1 → 3.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +4 -4
- package/knowledge/shared/harness-core/builtin_capability_map.md +23 -2
- package/knowledge/shared/harness-core/claude_md_full_reference.md +7 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +54 -0
- package/package.json +8 -1
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +18 -0
- package/plugins/fh-meta/skills/frontier-digest/SKILL.md +2 -0
- package/plugins/fh-meta/skills/harness-doctor/SKILL.md +1 -0
- package/plugins/fh-meta/skills/harvest-loop/SKILL.md +1 -0
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/card_status_tags.sh +47 -0
- package/scripts/correction_moments.py +116 -0
- package/scripts/destructive_pre_gate.sh +25 -2
- package/scripts/env_layer_fingerprint.sh +44 -3
- package/scripts/probe_live_eval.sh +9 -0
- package/scripts/probe_live_eval_lib.py +40 -0
- package/scripts/selfcheck.sh +3 -0
- package/scripts/selfcheck_shard_weights.txt +184 -0
- package/scripts/session_close_check.sh +11 -0
- package/scripts/test_card_status_tags_lanes.sh +58 -0
- package/scripts/test_correction_moments_lanes.sh +42 -0
- package/scripts/test_destructive_pre_gate_lanes.sh +36 -0
- package/scripts/test_env_layer_fingerprint_lanes.sh +6 -1
- package/scripts/test_fh_detach_lanes.sh +27 -4
- package/scripts/test_live_eval_transitions_lanes.sh +32 -0
- package/scripts/test_selfcheck_shard_lanes.sh +44 -0
- package/templates/fh_audit_check.zsh +140 -0
- package/templates/settings.PreToolUse.snippet.json +2 -1
|
@@ -11,25 +11,25 @@
|
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "fh-meta",
|
|
14
|
-
"version": "3.
|
|
14
|
+
"version": "3.37.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.
|
|
20
|
+
"version": "3.37.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.
|
|
26
|
+
"version": "3.37.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.
|
|
32
|
+
"version": "3.37.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
|
}
|
|
@@ -66,6 +66,26 @@ to MP4 · a session-rail context card with per-category usage. (`/btw` opening a
|
|
|
66
66
|
keyboard shortcut, and nested sessions, are also described by third-party write-ups of the 2026-10-14
|
|
67
67
|
desktop update; a web search the same day found no source at all for the advisor.)
|
|
68
68
|
|
|
69
|
+
### Desktop surfaces exercised — 2026-11-02 (one Code-tab session, CC 2.1.316, auto mode unless noted)
|
|
70
|
+
|
|
71
|
+
The rows above were names only. These were run end to end, once each unless a count is given; read them as
|
|
72
|
+
observations from one machine, not as documented behaviour.
|
|
73
|
+
|
|
74
|
+
| Situation | What happened | So, in FH |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| a Bash `cd` that ends somewhere else | four paths tried, one call each: the repo's `scripts/` and a folder added to the session **persisted** into the next call and the app reported the session's primary working directory moved; the session scratchpad and the repo's parent folder were reset after the call | give later `git` commands an explicit directory (`git -C <repo>`, absolute paths) rather than relying on where the last call ended. In the same session the SubagentStop hook still wrote to the starting repo while the primary directory was moved, so hooks did not follow the `cd` there |
|
|
77
|
+
| wait for a PR's CI, then merge | the app bound a PR opened from the session without being asked. Its tool description says the monitor wakes the session on CI failure, merge conflict or review comment; success is not in that list, and none arrived on success here. Turning the monitor on was refused twice by the auto-mode classifier; the operator turned it on in the PR bar. The app's cached check counts lagged `gh pr checks` once (13 passing + 1 pending vs 15/15) | «merge when green» waits for a person to continue the session or for another notification; then run one current-status check (`gh pr checks`) before the merge verdict. The app's instructions forbid polling CI from the session |
|
|
78
|
+
| change this session's permission mode | lowering (bypass → auto) applied at once with no card (observed). Raising was not exercised; the tool description says it shows an approval card in every mode and is unavailable in unattended sessions | in this app a session can lower its own mode without a person; raising is documented as a person's step. That is an app behaviour to rely on only as far as its description, not a boundary FH has tested |
|
|
79
|
+
| plan limits from inside a session | `get_usage` returned the 5-hour and weekly windows with percent and reset time | a pacing input for long runs. No status-line run was observed from these desktop sessions: a desktop pet fed only by the status line kept a Claude value last written by a terminal session ~20 h earlier, and took a new one only when the status-line program was fed by hand |
|
|
80
|
+
| run a cross-family check from a desktop session | `codex` and `agy` resolved and ran from the desktop shell: one reader-doc review on each, one two-round code review on `codex` | those invocations work; the full `auto-decorrelation` skill (panel discovery, consent) was not exercised from a desktop session |
|
|
81
|
+
| a nested session in its own worktree writing a report into the main checkout | a Write hook refused the main-checkout path; the session wrote inside its worktree and the governor copied the file across | brief side sessions to write in their own tree and say so, or have the governor collect — FH's rule against committing FH assets from a worktree already assumes this |
|
|
82
|
+
| deny rules and PreToolUse hooks under `bypassPermissions` | in a scratch folder, headless, Bash tool only, 3 runs: a `permissions.deny` match, a hook exiting 2 and a hook returning `ask` each left the command unrun (marker files 0/3 each); an unmatched control ran 3/3 | in those runs, rules and exit-2 hooks stopped commands with no classifier in the loop — a result for that configuration, not a guarantee for other tools or setups. `destructive_pre_gate.sh` exited 2 only with `FH_DESTRUCTIVE_BLOCK=1`; unset, a forced branch delete went through in bypass headless runs (3 of 3). Since 2026-11-03 it reads the payload's `permission_mode` and blocks by default under `bypassPermissions` (`FH_DESTRUCTIVE_BLOCK=0` keeps it advisory); other modes are unchanged. The hook wiring lives in the gitignored project settings, so a fresh clone has none until it is installed |
|
|
83
|
+
|
|
84
|
+
Also relevant from the [CLI changelog](https://code.claude.com/docs/en/changelog) (2.1.314, dated October 30, 2026, read
|
|
85
|
+
2026-11-02): it added `permissions.blockWritesOutsideWorkingDirectories`, under which the Write, Edit and NotebookEdit tools
|
|
86
|
+
reject paths outside the working directories in any permission mode. The scope is those three tools: it does not cover shell
|
|
87
|
+
writes, and whether it is on by default was not checked.
|
|
88
|
+
|
|
69
89
|
## Skill frontmatter `context: fork` — what it is NOT
|
|
70
90
|
|
|
71
91
|
`context: fork` runs a skill body as a prompt in a new subagent (general-purpose unless `agent:` says
|
|
@@ -93,7 +113,8 @@ summary, before concluding a fork did or did not happen.
|
|
|
93
113
|
2026-10-15; the docs' skills and model-config pages were read up to 100,000 characters (their last
|
|
94
114
|
~9k / ~17k characters unread).
|
|
95
115
|
- The exact text `ultrathink` injects is not documented.
|
|
96
|
-
- The desktop
|
|
97
|
-
the app's surfaces roll out per account, so another install may show fewer.
|
|
116
|
+
- The first desktop table rests on tool and skill *names* seen in one session, not on docs or on running them;
|
|
117
|
+
the app's surfaces roll out per account, so another install may show fewer. The «exercised — 2026-11-02»
|
|
118
|
+
table was run once on one machine (counts given where more); none of it was repeated on a second install.
|
|
98
119
|
- This map routes; it does not prove a session follows it. Whether a floor-tier session reaches for the
|
|
99
120
|
built-in first is a separate measurement (blind sim, isolated clone, with and without this map).
|
|
@@ -702,6 +702,11 @@ not marketplace-gate alone:
|
|
|
702
702
|
covers that class on that code — a scanner rule set that includes it, or a second review without
|
|
703
703
|
that policy pointed at those call sites — and name which one ran. If no such check can run, this is
|
|
704
704
|
the same applicable-but-tooling-down case as above: manual pass or explicit override, not a silent pass.
|
|
705
|
+
**Point it at what ships, not at the release PR.** A release PR's diff is usually the version bump
|
|
706
|
+
and the changelog, so a review of "the pending changes" there reads almost no shipped code and still
|
|
707
|
+
comes back clean. The surface for a registry publish is the shipped code between the previous release
|
|
708
|
+
tag and the commit being tagged — `git diff <previous-tag>..<release-commit> -- <the files[] paths>`
|
|
709
|
+
— and the record names that range. A clean pass over the release PR alone is not this step.
|
|
705
710
|
|
|
706
711
|
> Routing vs the rows below: `/marketplace-gate` alone = "is this ready to **list on a marketplace**?";
|
|
707
712
|
> `/public-surface-audit` alone = reactive "did I leak a token?"; **this gate** = the *act of going
|
|
@@ -1266,6 +1271,8 @@ Card update is NOT a sub-step of harvest-loop — even if harvest-loop is skippe
|
|
|
1266
1271
|
**Agent View pre-read (mandatory when session ran in Agent View / worktree / background job)**: Before writing the card, read your companion store's handoff files (if you keep one) to recover sub-agent completions that may not be in main session context. Skipping this step in Agent View is the root cause of "card created with stale content" bugs — the main context does not automatically see worktree-completed items.
|
|
1267
1272
|
|
|
1268
1273
|
**Card update obligation** (independent obligation — regardless of harvest-loop completion): Update `reference_next_session_starter.md`.
|
|
1274
|
+
**Status tag per item (2026-11-03)**: every «🌅 다음에 볼 것» item in the new block opens with exactly one tag — `N. [merged|open-pr|in-flight|uncommitted|reverted|planned|operator|held] text`. The tag says what state the item is in, so the next session reads it instead of re-deriving it (merged read as open, a verified-but-uncommitted fix read as done). `session_close_check.sh` ⑤-S lists untagged items (advisory — the tag being *true* stays judgment). The tag does not change step ③ below: `merged` / `reverted` items still move to «↩️ 닫힌 것» unless the next session must act on them. Borrowed from pstack recall tags (`tracks/_meta/research_2026-11-03_pstack_video.md`).
|
|
1275
|
+
|
|
1269
1276
|
① **Agent View pre-read** (see above) → ② Step 0-b cross-check generates removal list → ③ Remove completed items → ④ Add new priorities → ⑤ Fix stale paths/versions → ⑥ Overwrite → ⑦ Output "BEFORE N items → AFTER M items" diff.
|
|
1270
1277
|
"Delta update" not "snapshot" — completed items remaining in next session card is a bug.
|
|
1271
1278
|
🟥 **그리고 그 역방향도 버그다 — «안 닫힌 것이 사라지는 것».** 재작성은 줄이는 일이 아니라 «완료를 덜어내는」 일이다: 카드에서 빠진 항목은 ⓐ `fh_completed_{date}.md` 에 완료로 적혔거나 ⓑ 카드에 «왜 뺐는지」가 적혀 있어야 하고, 둘 다 아니면 유실이다. (2026-08-24 실사고: `knowledge/shared/harness-core/claude_md_gate_details.md §CM-Card-Loss-Evidence`) 기계 앵커는 `session_close_check.sh` ⑤-C(이전 카드의 **미래 날짜**가 카드나 오늘 완료 로그에 살아 있나) — 🟥 **날짜 토큰만 보므로 날짜 없는 미완은 구조적으로 못 잡는다**(앵커지 floor 아님). 외부 근거: arXiv 2607.26637(같은 절). 같은 규율을 카드·메모리·상주 문서를 **줄이는 모든 패스**(마감 ⑤ · `/memory-hygiene` · `/salience-splitter`)에 적용한다 — «줄여라」만 있는 지시는 조용히 사실을 지운다. ⚠️ 그 연구는 반대 방향도 함께 보고한다(작은 코퍼스에서는 응축이 56.2% → 68.8% 로 **도움**) — 그래서 이 규칙은 «줄이지 마라」가 아니라 «빠진 것은 완료이거나 명시된 것이어야 한다」다.
|
|
@@ -5291,3 +5291,57 @@
|
|
|
5291
5291
|
outcome: "3/3 as predicted — both risky scenarios not complete and named the class check; control complete with no extra check"
|
|
5292
5292
|
evidence: "tracks/_meta/.axes_23_passed_docs_prepublish-security-review-policy-gap_2026-11-02.marker"
|
|
5293
5293
|
tokens: "134765 + 111534 + 134559"
|
|
5294
|
+
- date: 2026-11-02
|
|
5295
|
+
agent: "general-purpose (sonnet) ×6 — blind A/B sims of the Pre-Publish 'point it at what ships' line, new text vs main text (purpose: independence)"
|
|
5296
|
+
task: "S1 leading scenario (14 PRs since tag named) 1+1; S2 unleading scenario (release branch, /security-review defaults to the branch diff) 2+2"
|
|
5297
|
+
outcome: "S1 both arms named the tag range — scenario leaked the answer, no discrimination. S2 tag..release-commit range named: new 2/2, old 0/2 (old arms said 'point it at bin/ scripts/ or the release tree'). 'Clean on the release PR completes step 3?': no in 4/4, no difference — the line adds range and record shape, not the refusal"
|
|
5298
|
+
evidence: "PR body of docs/prepublish-security-review-target · scratchpad sim/new.md, old.md, scenario2.txt"
|
|
5299
|
+
tokens: "113122 + 113710 + 113297 + 113283 + 113162 + 113163"
|
|
5300
|
+
- date: 2026-11-02
|
|
5301
|
+
agent: "general-purpose (sonnet) ×2 + web-fetch (sonnet) ×1 — builtin map desktop rows: blind A/B sim and changelog check (purpose: independence)"
|
|
5302
|
+
task: "sim: «merge when CI is green while the user is away» + a stray in-repo cd, routing note = main's desktop section vs main + the new exercised table; web-fetch: verify the 2.1.314 changelog line"
|
|
5303
|
+
outcome: "new arm: one-off gh check, monitor does not wake on success, no polling; main arm: «poll or monitor the PR's checks». cd risk named by both (no difference). Changelog 2.1.314 (Oct 30, 2026) line found verbatim"
|
|
5304
|
+
evidence: "PR body of docs/builtin-map-desktop-measured"
|
|
5305
|
+
tokens: "115132 + 113795 + 22074"
|
|
5306
|
+
- date: 2026-11-03
|
|
5307
|
+
agent: "general-purpose (sonnet) ×2 — FoD audits on a frozen export of 96d66a9: autopilot «safer bypass» promise, and full mode «FH plugged in» (purpose: independence)"
|
|
5308
|
+
task: "A: map autopilot/gate paths, check irreversible classes, fail direction, ledger counts. B: what full mode injects vs FH, prior P-series evidence, cheapest decisive next measurement"
|
|
5309
|
+
outcome: "A: Bash-path git/publish holds; MCP outside hook matchers; gate is a no-op when the app is not running; launcher-form publish (npx … npm publish) and local data-loss git commands not flagged. B: full mode carries a few FH lines + a diff-only second opinion; capability SUGGESTIVE (+8–12pp, no pre-registered threshold met), thinking style NOT MEASURED. Three claims source-grounded by the governor (matcher list, _app_running return 0, publish head match)"
|
|
5310
|
+
evidence: "tracks/_meta/fod_audit_2026-11-03.md"
|
|
5311
|
+
tokens: "244195 + 225116"
|
|
5312
|
+
- date: 2026-11-03
|
|
5313
|
+
agent: "general-purpose (sonnet) ×8 — blind A/B sims of the frontier-digest prior-art line, new SKILL vs main SKILL (purpose: independence)"
|
|
5314
|
+
task: "S1 .worktreeinclude item, no identifier given (2+2); S2 leakcheck item with HN id, existing asset = public-surface-audit + prepublishOnly scan (2+2)"
|
|
5315
|
+
outcome: "S1: no discrimination — the answer was in today's git log, all 4 checked the repo (one old arm also dropped the item for the missing identifier, a scenario defect). S2: new 2/2 grepped and closed it as already covered (prepublishOnly blocks); old 0/2 opened the repo, both left «check whether our scan blocks publish» as the candidate"
|
|
5316
|
+
evidence: "PR body of docs/frontier-digest-prior-art-line"
|
|
5317
|
+
tokens: "122609 + 122589 + 124646 + 122885 + 125135 + 125191 + 123237 + 123368"
|
|
5318
|
+
- date: 2026-11-03
|
|
5319
|
+
agent: "general-purpose (sonnet) ×4 — blind A/B sims of the card status-tag rule, excerpt with vs without the line (purpose: independence)"
|
|
5320
|
+
task: "write the newest card block's «🌅 다음에 볼 것» section from an 8-fact scenario (merged · open PR · uncommitted · planned · operator · reverted · held)"
|
|
5321
|
+
outcome: "new 2/2 tagged all 7 items with the right state; old 0/2 tagged (0/6 each). Side effect: new arms kept merged/reverted facts in 🌅 where old arms moved them to a removed-items note — folded back into the rule"
|
|
5322
|
+
evidence: "PR #1010 body"
|
|
5323
|
+
tokens: "117295 + 117327 + 118690 + 118423"
|
|
5324
|
+
- date: 2026-11-03
|
|
5325
|
+
agent: "general-purpose (sonnet) ×3 — blind A/B sims of the harvest-loop correction_moments line, new excerpt ×2 vs main excerpt ×1 (purpose: independence)"
|
|
5326
|
+
task: "plan a weekly harvest-loop retro (10-27..11-03) up to Step 2: commands in order and what to do with each output; nothing run"
|
|
5327
|
+
outcome: "new 2/2 planned correction_moments.py --since 2026-10-27, read the header limits, kept the output local, and stated «0 pairs = none found by cue words»; old 0/1 had no correction step. Contamination: arms ran git status and saw the branch and the untracked script (the old arm named «correction-moments work» from the branch) — still did not plan the step"
|
|
5328
|
+
evidence: "PR body of feat/correction-moments"
|
|
5329
|
+
tokens: "119563 + 119731 + 121067"
|
|
5330
|
+
- date: 2026-11-03
|
|
5331
|
+
agent: "general-purpose (sonnet) ×1 — today's frontier digest application candidates, read-only (purpose: context)"
|
|
5332
|
+
task: "read frontier_digest_2026_11_03.md, check each Immediate Application Candidate against the repo with grep, rank uncovered ones"
|
|
5333
|
+
outcome: "3 uncovered: live-eval transition list on by default (extend split_by_target) · harness-doctor «called but content-blind» row · Gemini 2.5 Pro re-route sweep (0 hits, doc only)"
|
|
5334
|
+
evidence: "tracks/_meta/morning_report_2026-11-04.md"
|
|
5335
|
+
tokens: "128752"
|
|
5336
|
+
- date: 2026-11-03
|
|
5337
|
+
agent: "general-purpose (sonnet) ×3 — blind A/B sims of the harness-doctor «called but content-blind» row, new excerpt ×2 vs main ×1 (purpose: independence)"
|
|
5338
|
+
task: "audit a toy project with two registered PreToolUse hooks (one always allows despite its comment, one really blocks force push) against the checklist excerpt"
|
|
5339
|
+
outcome: "new 2/2 fired the row at S-tier for the always-allow hook after feeding a known-positive and known-negative input, and passed the real guard; old 0/1 fired no row (it noticed the no-op in prose but had no row to grade it)"
|
|
5340
|
+
evidence: "PR body of docs/harness-doctor-content-blind"
|
|
5341
|
+
tokens: "118926 + 119003 + 119166"
|
|
5342
|
+
- date: 2026-11-03
|
|
5343
|
+
agent: "general-purpose (sonnet) ×2 — blind reader A/B of the live-eval «moved since previous» section (purpose: independence)"
|
|
5344
|
+
task: "read one nightly report (pass rate flat at 0.70, one probe regressed and one recovered) and say whether anything regressed since last night"
|
|
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
|
+
evidence: "PR body of feat/live-eval-moved-since-previous"
|
|
5347
|
+
tokens: "115131 + 115035"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrono-meta/fh-gate",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.37.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": {
|
|
@@ -134,6 +134,11 @@
|
|
|
134
134
|
"scripts/fixtures/frontier_digest_recall.tsv",
|
|
135
135
|
"scripts/pr_merge_verified.sh",
|
|
136
136
|
"scripts/test_pr_merge_verified_lanes.sh",
|
|
137
|
+
"scripts/test_live_eval_transitions_lanes.sh",
|
|
138
|
+
"scripts/correction_moments.py",
|
|
139
|
+
"scripts/test_correction_moments_lanes.sh",
|
|
140
|
+
"scripts/card_status_tags.sh",
|
|
141
|
+
"scripts/test_card_status_tags_lanes.sh",
|
|
137
142
|
"scripts/adapters/fixtures/mate_agent_boundary_known_negative.md",
|
|
138
143
|
"scripts/adapters/fixtures/mate_agent_boundary_known_positive.md",
|
|
139
144
|
"scripts/adapters/fixtures/qasp_web_rules_known_negative.json",
|
|
@@ -250,6 +255,7 @@
|
|
|
250
255
|
"scripts/rtk_gross_ablation.sh",
|
|
251
256
|
"scripts/section_ref_check.py",
|
|
252
257
|
"scripts/selfcheck.sh",
|
|
258
|
+
"scripts/selfcheck_shard_weights.txt",
|
|
253
259
|
"scripts/session_checklist.py",
|
|
254
260
|
"scripts/checklist_unblocked_hook.sh",
|
|
255
261
|
"scripts/session_close_check.sh",
|
|
@@ -417,6 +423,7 @@
|
|
|
417
423
|
"templates/consent_classes.yaml.example",
|
|
418
424
|
"templates/contrib_session.md",
|
|
419
425
|
"templates/degrade_direction_scan.sh",
|
|
426
|
+
"templates/fh_audit_check.zsh",
|
|
420
427
|
"templates/goal-quench-hook-setup.md",
|
|
421
428
|
"templates/goal-quench-settings-merged.json",
|
|
422
429
|
"templates/local_fh_context.md",
|
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
### [Unreleased]
|
|
4
4
|
|
|
5
|
+
### [3.37.0] — 2026-11-04 — 권한 무시 모드에서 파괴 명령 기본 차단 · 카드 상태 태그 · 정정 순간 마이닝 · live-eval 직전 밤 대비 변화 · «측정 못 함» 을 판정으로 내던 채널 여섯
|
|
6
|
+
|
|
7
|
+
새 스크립트와 새 레인이 들어가고 게이트 하나의 기본 동작이 조여져서 버전 정책상 minor 다.
|
|
8
|
+
|
|
9
|
+
**BREAKING (gate): `destructive_pre_gate.sh` 가 `permission_mode=bypassPermissions` 에서 `FH_DESTRUCTIVE_BLOCK` 이 비어 있으면 파괴 명령(`git branch -D` 등)을 경고가 아니라 차단한다 — 권한 무시 모드로 무인 실행하면서 그 명령을 의도한 경우 `FH_DESTRUCTIVE_BLOCK=0` 으로 종전 경고 동작을 고른다.** 다른 권한 모드와 `--stdin-raw`(페이로드 없음) 경로는 바뀌지 않았다.
|
|
10
|
+
|
|
11
|
+
In English: under `bypassPermissions` the destructive-op hook now blocks by default (set `FH_DESTRUCTIVE_BLOCK=0` to keep the old advisory behaviour); session cards get a per-item status tag with an advisory close check; a period retrospective can mine operator correction moments from the utterance ledgers; the nightly live-eval report records which probes flipped since the previous night; harness-doctor gains a «called but content-blind» row; six channels that rendered an unmeasured result as a verdict now say what they measured.
|
|
12
|
+
|
|
13
|
+
소비자에게 닿는 변화:
|
|
14
|
+
- `destructive_pre_gate.sh`(#1008): 위 BREAKING 줄. 근거 실측 — 헤드리스 `--dangerously-skip-permissions` Sonnet 에 버릴 브랜치 `git branch -D` 를 시켰을 때 옛 훅(스위치 비움)은 0/3 보존(삭제됨), 새 훅은 3/3 보존이고 차단 사유가 `permission_mode=bypassPermissions` 를 말한다. 권한 무시 모드에선 경고를 읽는 사람이 실행 전에 없다는 게 이유다. `templates/settings.PreToolUse.snippet.json` 은 설명 문구만 바뀌었다.
|
|
15
|
+
- `card_status_tags.sh` · `session_close_check.sh ⑤-S`(#1010): 다음 세션 카드의 «다음에 볼 것» 항목마다 상태 태그 하나(`merged|open-pr|in-flight|uncommitted|reverted|planned|operator|held`)를 붙이는 규칙과, 태그 없는 항목을 나열하는 마감 점검(권고 — 막지 않는다). 태그가 참인지는 판단으로 남긴다.
|
|
16
|
+
- `correction_moments.py` + harvest-loop Step 1 한 줄(#1011): 발화 원장에서 운영자의 정정 낱말이 든 발화를 추리고, 다른 날 다시 나온 정정을 «아직 못 배운 규칙» 후보로 짝짓는다. 로컬 전용이며 원장 내용을 다른 모델에 보내지 않는다. 짝 0 은 «재발 없음» 이 아니다 — 정정 낱말 없는 정정은 못 잡는다(재현율 미보정, 머리말에 적음).
|
|
17
|
+
- `probe_live_eval.sh` · `probe_live_eval_lib.py`(#1013): 밤마다 내는 live-eval 보고서에 «Moved since previous» 절 — 직전 보고서 대비 판정이 바뀐 프로브를 적는다(통과율이 그대로여도 회귀 하나와 회복 하나가 상쇄되는 경우를 드러낸다). 직전 보고서가 없으면 «not supplied», 프로브 집합이 다르면 «not comparable» 로 적고 변화 없음과 섞지 않는다. `--prev` 와 `FH_LIVE_EVAL_PREV_DIR` 로 지정할 수 있다.
|
|
18
|
+
- `harness-doctor` SKILL(#1012): «호출은 되지만 입력과 무관하게 같은 판정을 내는» 게이트를 S등급 장식으로 판정하는 줄. 판정은 코드 읽기가 아니라 known-positive / known-negative 입력 두 개로 낸다.
|
|
19
|
+
- `frontier-digest` SKILL(#1009): 대화형 실행에서 «FH 적용 후보» 마다 레포를 grep 해 «이미 있나» 줄로 끝낸다.
|
|
20
|
+
- `claude_md_full_reference.md`(#1005 · #1010): Pre-Publish 3단계 보안 점검은 릴리스 PR 이 아니라 «지난 태그 → 릴리스 커밋» 출하 범위를 대상으로 한다는 문단 · 카드 상태 태그 규칙. `builtin_capability_map.md`(#1007): 데스크톱 Code 탭에서 실제로 써 본 표면 기록.
|
|
21
|
+
- 측정 채널 여섯(#1001): `selfcheck --shard` 의 인라인 검사 39개를 지키는 레인(S8) · `env_layer_fingerprint.sh` 의 마커 판정이 훅이 실제로 읽는 이름 하나만 본다 · detach 레인이 `chmod 000` 이 안 먹는 환경(root)에서 통과가 아니라 UNMEASURED · npm 설치본에 빠져 있던 `templates/fh_audit_check.zsh`(install-wizard 의 zshrc 단계가 늘 거절되던 원인)와 `scripts/selfcheck_shard_weights.txt` 를 `files[]` 에 넣었다.
|
|
22
|
+
|
|
5
23
|
### [3.36.1] — 2026-11-02 — 발화 기록 훅이 행을 조용히 잃던 것 · package-coverage 가 쓰이는 예외를 «안 쓰임» 으로 읽던 것 · Pre-Publish 보안 단계 한 문단 · 기능 지도 데스크톱 줄
|
|
6
24
|
|
|
7
25
|
새 스킬 · 새 게이트 레인 · 새 행동 규칙은 없다. 수정과 문서라 버전 정책상 patch 다. 훅 설정은 바뀌지 않았고, 훅이 부르는 스크립트 한 개의 대기 동작이 바뀌었다.
|
|
@@ -102,6 +102,8 @@ Report progress: `📡 HN 15 items · arxiv 5 items · TLDR 5 items · Batch 5 i
|
|
|
102
102
|
|
|
103
103
|
Print the synthesis result in the conversation (format in §Output-Formats): engine line + Highlights + Immediate Application Candidates + Warning Signals + collection stats.
|
|
104
104
|
|
|
105
|
+
**Prior-art line (interactive session only — the API-mode synthesis has no repo access, so it cannot write this).** Before an Immediate Application Candidate is printed or queued, grep the repo for its own token (backticked span / script name / rule name) and end the candidate with `이미 있나: <hit path:line | 0 hits in <dirs searched>>`. A hit is opened, not counted. A 0 with no named scope is not «absent» (not searched ≠ not there). Measured 2026-11-02: candidate «증거 빈 완료 행 세기» already existed as `session_checklist.py check`; the grep before building caught it.
|
|
106
|
+
|
|
105
107
|
**With `--save` flag**: save to **`{FH}/tracks/_meta/frontier_digest_{YYYY_MM_DD}.md`** — underscores in
|
|
106
108
|
the date, matching `date +%Y_%m_%d`. Fallback when no FH install is resolvable:
|
|
107
109
|
`~/.claude/forge-harness/tracks/_meta/` → cwd `tracks/_meta/`, same filename either way. After saving:
|
|
@@ -115,6 +115,7 @@ size instrument* is read. The footprint rows below apply to **both** scopes and
|
|
|
115
115
|
| **Meta-harness** growth since last run: decompose into *new sections* vs *existing-section growth* (mechanical — diff `##` section names + line counts vs the prior run's commit; **first run / no prior commit → report both as n/a, no tier**) | **Tier is decided by the two counts alone**: **S-tier iff existing-section growth > new-section growth** (the file is thickening faster than it is gaining capability); otherwise advisory, no tier. Report both numbers **and** the new sections' names — the names are *reporting output for the human*, never an input to the tier. Do not judge "was this growth capability-bearing?" per line |
|
|
116
116
|
| SKILL.md > 300 lines AND no `SKILL_detail.md` | S-tier — propose `/salience-splitter` (governance-semantic split, not compression) |
|
|
117
117
|
| Rules files unreferenced in CLAUDE.md | R-tier |
|
|
118
|
+
| **Called but content-blind** — a gate · check · lane that IS invoked (has callers) but returns the same verdict whatever its input (the third «decorative» shape, after «no caller» and «caller ignores the result»; arXiv:2610.41604) | S-tier. Detector is the existing revert/mutation probe, not a new scanner: feed one known-positive and one known-negative input and confirm the verdict differs. Same verdict for both → decorative. Reading the code is not the test — a check that greps for its own hook reference passes this row while its verdict never moves |
|
|
118
119
|
| Always-loaded footprint > 40k chars (see scan below for what counts) | S-tier — **lever depends on where the chars live**: rules/detail still auto-loading → relocate to a non-loaded dir (e.g. `knowledge/shared/rules/`), pointers stay in CLAUDE.md · narrative inside CLAUDE.md → `/salience-splitter` · **behavioral content only, nothing left to relocate** → capability-level (merge/retire a governance unit) |
|
|
119
120
|
| **Memory-index footprint** — the session's auto-loaded memory index (`~/.claude/projects/<slug>/memory/MEMORY.md`), reported as **its own line, never summed into the row above** | S-tier > 10k chars — **different residency, different lever**: this one is `/memory-hygiene` (archive closed items to `MEMORY_archive.md`, tighten hooks to one line), NOT `/salience-splitter`. Summing it into the CLAUDE.md row would mis-route the lever, which is exactly what the row above ties to "where the chars live". **Blind spot this closes (2026-07-20, measured)**: a fresh top-level `/context` showed **Memory files = 41.7k of 68.8k resident tokens (61%)**, of which `MEMORY.md` alone was **14.1k — 55% the size of CLAUDE.md (25.5k)** — and the footprint scan below counted **none of it**. The instrument was optimising the smaller half of the surface it claimed to measure |
|
|
120
121
|
| Always-loaded footprint > 80k chars | M-tier — same lever selection, mandatory, **and never self-discharged** (see below) |
|
|
@@ -124,6 +124,7 @@ Output final proposal list → Y: PR creation / N: persist to tracks/_meta/fh_si
|
|
|
124
124
|
|
|
125
125
|
### Step 1 — field-harvest
|
|
126
126
|
`/field-harvest --since 1d` — Fewer than 3 patterns → auto-skip + output "no session harvest targets".
|
|
127
|
+
**Weekly / period runs also read the operator's corrections**: `python3 scripts/correction_moments.py --since <period start>` lists correction moments from the utterance ledgers and pairs the ones that came back on a different day — a returning correction is a rule the harness has not learned yet, so each pair goes to Step 2 as a pattern. Its header prints what it excluded and its recall limit (cue words only); «0 pairs» means none found by cue words, not that none recurred. The ledgers can hold in-house context — read the output yourself, never hand it to another model.
|
|
127
128
|
|
|
128
129
|
### Step 2 — contention-layer
|
|
129
130
|
`/contention-layer [field-harvest output patterns]`
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# card_status_tags.sh — ⑤-S: does every «다음에 볼 것» item in the newest session-card block carry
|
|
3
|
+
# exactly one status tag? ADVISORY: never blocks, never changes a close verdict.
|
|
4
|
+
#
|
|
5
|
+
# Why (2026-11-03, borrowed from pstack's recall tags): card items are free prose, and the next
|
|
6
|
+
# session has to re-derive each item's state — «merged» read as «open PR», a verified-but-uncommitted
|
|
7
|
+
# fix read as done. A one-word tag makes the state a typed property of the record (present · from a
|
|
8
|
+
# closed set), which is what a check may assert; whether the tag is TRUE stays judgment.
|
|
9
|
+
#
|
|
10
|
+
# Tag set (closed): merged · open-pr · in-flight · uncommitted · reverted · planned · operator · held
|
|
11
|
+
# Item form: "N. [tag] text" (the tag is the first thing after "N. ")
|
|
12
|
+
#
|
|
13
|
+
# usage: card_status_tags.sh [card] (default: tracks/_meta/reference_next_session_starter.md)
|
|
14
|
+
# exit: 0 = measured (tagged or not — advisory) · 3 = NOT MEASURED (no card / no section)
|
|
15
|
+
set -u
|
|
16
|
+
FH="$(cd "$(dirname "$0")/.." && pwd)"
|
|
17
|
+
CARD="${1:-$FH/tracks/_meta/reference_next_session_starter.md}"
|
|
18
|
+
TAGS='merged|open-pr|in-flight|uncommitted|reverted|planned|operator|held'
|
|
19
|
+
|
|
20
|
+
if [ ! -f "$CARD" ]; then
|
|
21
|
+
echo "⬜ ⑤-S status tags NOT MEASURED — card not found"
|
|
22
|
+
exit 3
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Newest block = from line 1 to the first «---» line; the section = «## 🌅» up to the next «## ».
|
|
26
|
+
section=$(awk '/^---[[:space:]]*$/ {exit} /^## / {insec = ($0 ~ /^## 🌅/); next} insec' "$CARD")
|
|
27
|
+
if ! awk '/^---[[:space:]]*$/ {exit} /^## 🌅/ {f=1} END {exit !f}' "$CARD"; then
|
|
28
|
+
echo "⬜ ⑤-S status tags NOT MEASURED — newest card block has no «## 🌅» section"
|
|
29
|
+
exit 3
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
items=$(printf '%s\n' "$section" | grep -E '^[0-9]+\. ' || true)
|
|
33
|
+
total=$(printf '%s\n' "$items" | grep -c -E '^[0-9]+\. ' || true)
|
|
34
|
+
if [ "$total" -eq 0 ]; then
|
|
35
|
+
# An empty set is not «all tagged» — say it is empty.
|
|
36
|
+
echo "⬜ ⑤-S status tags: 0 items in «🌅» — nothing to check (not a pass)"
|
|
37
|
+
exit 0
|
|
38
|
+
fi
|
|
39
|
+
good=$(printf '%s\n' "$items" | grep -c -E "^[0-9]+\. \[($TAGS)\] " || true)
|
|
40
|
+
bad=$((total - good))
|
|
41
|
+
if [ "$bad" -eq 0 ]; then
|
|
42
|
+
echo "✅ ⑤-S status tags: $good/$total «🌅» items tagged"
|
|
43
|
+
else
|
|
44
|
+
echo "⚠️ ⑤-S status tags: $bad/$total «🌅» items lack a tag from [$TAGS] (advisory)"
|
|
45
|
+
printf '%s\n' "$items" | grep -v -E "^[0-9]+\. \[($TAGS)\] " | cut -c1-90 | sed 's/^/ ↳ /'
|
|
46
|
+
fi
|
|
47
|
+
exit 0
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""correction_moments.py — find the operator's correction moments in the utterance ledgers and group
|
|
3
|
+
the ones that recur on different days. Input for harvest-loop / memory: a correction that came back on
|
|
4
|
+
a second day is a rule the harness has not learned yet.
|
|
5
|
+
|
|
6
|
+
Borrowed from pstack automate-me (2026-11-03, tracks/_meta/research_2026-11-03_pstack_video.md) without
|
|
7
|
+
its cost: pstack sends every conversation slice to a subagent; this is a local regex + word-overlap pass
|
|
8
|
+
over the ledgers the UserPromptSubmit hook already writes (tracks/_meta/utterances/*.jsonl). Nothing
|
|
9
|
+
leaves the machine — the ledgers can hold in-house context, so do not hand the output to another model.
|
|
10
|
+
|
|
11
|
+
What it claims and what it does not:
|
|
12
|
+
· a "correction moment" = an utterance matching CUE (Korean/English correction words). Cue-word
|
|
13
|
+
recall is the instrument's limit: a correction phrased without any cue word is not seen.
|
|
14
|
+
· "recurring" = two cue hits on different days that share >= --min-shared content words. Word
|
|
15
|
+
overlap is a candidate filter, not a topic judgment — the reader decides whether a group is one rule.
|
|
16
|
+
· every exclusion is counted and printed (malformed rows, short rows), never dropped silently.
|
|
17
|
+
|
|
18
|
+
usage: python3 scripts/correction_moments.py [ledger_dir] [--since YYYY-MM-DD] [--min-shared N] [--all]
|
|
19
|
+
exit: 0 = ran · 2 = ledger dir missing or holds no rows (NOT a "no corrections" result)
|
|
20
|
+
"""
|
|
21
|
+
import glob, json, os, re, sys
|
|
22
|
+
|
|
23
|
+
CUE = re.compile(
|
|
24
|
+
r"(?:^|\s)아니(?=[\s,.]|$)|아니(?:야|라|지|고|잖)|아냐|틀렸|틀린|잘못|말고|정정|하지\s?마|쓰지\s?마|왜\s|다시\s?(?:해|봐|확인)|그게 아니|"
|
|
25
|
+
r"\bno,|\bwrong\b|\bdon'?t\b|\bstop\b|\bnot what\b", re.I)
|
|
26
|
+
STOP = set("그리고 그런데 그러면 이거 이건 그거 그건 저거 지금 여기 거기 이제 근데 그냥 하는 하고 해서 했어 했는데 "
|
|
27
|
+
"있어 있는 없어 없는 아니 아냐 아니야 아니라 말고 다시 정정 해줘 해봐 한번 모두 전부 같은 같아 "
|
|
28
|
+
"this that with from have what when which there would could about into than then also only does your will".split())
|
|
29
|
+
MIN_CHARS = 6
|
|
30
|
+
MAX_CHARS = 600 # longer rows are almost always pasted reports or documents, not a correction in the operator's words
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def words(t):
|
|
34
|
+
ws = set(re.findall(r"[가-힣]{2,}|[A-Za-z][A-Za-z0-9_.\-]{2,}", t.lower()))
|
|
35
|
+
return {w for w in ws if w not in STOP and not CUE.fullmatch(w)}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def cue_window(t):
|
|
39
|
+
"""The sentence holding the first cue word, plus its neighbours — long messages otherwise match on
|
|
40
|
+
unrelated words elsewhere in the text."""
|
|
41
|
+
parts = re.split(r"(?<=[.!?。])\s+|\n+", t)
|
|
42
|
+
for k, p in enumerate(parts):
|
|
43
|
+
if CUE.search(p):
|
|
44
|
+
return " ".join(parts[max(0, k - 1):k + 2])
|
|
45
|
+
return t
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def main(argv):
|
|
49
|
+
args = [a for a in argv if not a.startswith("--")]
|
|
50
|
+
opt = dict(zip(argv[::1], argv[1::1]))
|
|
51
|
+
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
52
|
+
d = args[0] if args and not args[0][:4].isdigit() else os.path.join(root, "tracks", "_meta", "utterances")
|
|
53
|
+
since = opt.get("--since", "")
|
|
54
|
+
min_shared = int(opt.get("--min-shared", "2"))
|
|
55
|
+
files = sorted(glob.glob(os.path.join(d, "*.jsonl")))
|
|
56
|
+
rows, bad, short, envelope, long_ = [], 0, 0, 0, 0
|
|
57
|
+
for f in files:
|
|
58
|
+
sess = os.path.basename(f)[:8]
|
|
59
|
+
for line in open(f, encoding="utf-8", errors="replace"):
|
|
60
|
+
try:
|
|
61
|
+
x = json.loads(line)
|
|
62
|
+
except Exception:
|
|
63
|
+
bad += 1; continue
|
|
64
|
+
t, ts = x.get("text"), x.get("ts")
|
|
65
|
+
if not isinstance(t, str) or not isinstance(ts, str):
|
|
66
|
+
bad += 1; continue
|
|
67
|
+
if ts[:10] < since:
|
|
68
|
+
continue
|
|
69
|
+
if t.lstrip().startswith("<"):
|
|
70
|
+
# subagent hand-backs, peer messages, pasted blocks: the ledger keeps them, they are not the operator's words
|
|
71
|
+
envelope += 1; continue
|
|
72
|
+
if len(t.strip()) < MIN_CHARS:
|
|
73
|
+
short += 1; continue
|
|
74
|
+
if len(t) > MAX_CHARS:
|
|
75
|
+
long_ += 1; continue
|
|
76
|
+
rows.append((ts, sess, t))
|
|
77
|
+
if not rows:
|
|
78
|
+
print("⬜ no ledger rows under %s (files=%d) — NOT MEASURED, not «no corrections»" % (d, len(files)))
|
|
79
|
+
return 2
|
|
80
|
+
hits = [(ts, s, t, words(cue_window(t))) for ts, s, t in rows if CUE.search(t)]
|
|
81
|
+
# PAIRS, not union-find: chaining long messages through one shared word each merged 29 hits into one
|
|
82
|
+
# «group» on the first run (2026-11-03). A pair is two hits on different days whose cue sentences share
|
|
83
|
+
# >= min_shared content words.
|
|
84
|
+
recurring, repaste = [], 0
|
|
85
|
+
for i in range(len(hits)):
|
|
86
|
+
for j in range(i + 1, len(hits)):
|
|
87
|
+
if hits[i][0][:10] != hits[j][0][:10]:
|
|
88
|
+
sh = hits[i][3] & hits[j][3]
|
|
89
|
+
union = hits[i][3] | hits[j][3]
|
|
90
|
+
if len(sh) >= min_shared and union and len(sh) / len(union) < 0.8:
|
|
91
|
+
recurring.append((i, j, sh))
|
|
92
|
+
elif len(sh) >= min_shared:
|
|
93
|
+
repaste += 1 # the same text pasted on two days is not a correction coming back
|
|
94
|
+
recurring.sort(key=lambda p: -len(p[2]))
|
|
95
|
+
days = sorted({r[0][:10] for r in rows})
|
|
96
|
+
print("# correction moments — %s .. %s (%d days)" % (days[0], days[-1], len(days)))
|
|
97
|
+
print("ledgers=%d · utterances=%d · excluded: envelope=%d short(<%d chars)=%d long(>%d chars)=%d malformed=%d · cue hits=%d · "
|
|
98
|
+
"recurring pairs (different days, >=%d shared words)=%d · re-pasted pairs dropped=%d" % (len(files), len(rows), envelope, MIN_CHARS, short, MAX_CHARS, long_, bad,
|
|
99
|
+
len(hits), min_shared, len(recurring), repaste))
|
|
100
|
+
print("limits: cue-word recall only (a correction with no cue word is invisible — e.g. «영어로 써졌네», 2026-10-18) · word overlap is a candidate filter\n")
|
|
101
|
+
for k, (i, j, sh) in enumerate(recurring, 1):
|
|
102
|
+
print("## R%d — shared: %s" % (k, " ".join(sorted(sh)[:8])))
|
|
103
|
+
for x in (i, j):
|
|
104
|
+
print("- %s %s · %s" % (hits[x][0][:16], hits[x][1], cue_window(hits[x][2]).replace("\n", " ")[:160]))
|
|
105
|
+
print()
|
|
106
|
+
if "--all" in argv:
|
|
107
|
+
print("## hits not in a pair")
|
|
108
|
+
grouped = {x for p in recurring for x in p[:2]}
|
|
109
|
+
for i, h in enumerate(hits):
|
|
110
|
+
if i not in grouped:
|
|
111
|
+
print("- %s %s · %s" % (h[0][:16], h[1], h[2].replace("\n", " ")[:160]))
|
|
112
|
+
return 0
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
if __name__ == "__main__":
|
|
116
|
+
sys.exit(main(sys.argv[1:]))
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
# DEGRADE DIRECTION: advisory. Warns and exits 0 — a false block on a developer's shell trains
|
|
20
20
|
# the --no-verify reflex on the hooks that DO guard irreversible surfaces. Set
|
|
21
21
|
# FH_DESTRUCTIVE_BLOCK=1 to escalate to exit 2 (stderr → model, call blocked).
|
|
22
|
+
# EXCEPTION (2026-11-03): with FH_DESTRUCTIVE_BLOCK unset and the hook payload's
|
|
23
|
+
# permission_mode = bypassPermissions, it blocks by default — nobody reads an advisory before a
|
|
24
|
+
# bypass-mode call runs. FH_DESTRUCTIVE_BLOCK=0 restores advisory there. Other modes unchanged.
|
|
22
25
|
# Unparseable/absent payload → silent exit 0 (an unparsed input is not a finding; block mode
|
|
23
26
|
# fails open on a dead python3 — same accepted residual as pipe_verdict_guard, the surface is
|
|
24
27
|
# the reversible Bash call, not the irreversible act itself).
|
|
@@ -73,6 +76,7 @@
|
|
|
73
76
|
set -u
|
|
74
77
|
|
|
75
78
|
CMD=""
|
|
79
|
+
PERM_MODE=""
|
|
76
80
|
if [ "${1:-}" = "--stdin-raw" ]; then
|
|
77
81
|
CMD=$(cat)
|
|
78
82
|
else
|
|
@@ -84,6 +88,14 @@ except Exception: sys.exit(0)
|
|
|
84
88
|
if d.get("tool_name") != "Bash": sys.exit(0)
|
|
85
89
|
sys.stdout.buffer.write((d.get("tool_input", {}).get("command", "") or "").encode("utf-8"))
|
|
86
90
|
' 2>/dev/null) || CMD=""
|
|
91
|
+
# permission_mode rides on every hook payload. Read separately so a missing field changes nothing.
|
|
92
|
+
PERM_MODE=$(printf '%s' "$RAW" | python3 -c '
|
|
93
|
+
import json,sys
|
|
94
|
+
try: d = json.load(sys.stdin)
|
|
95
|
+
except Exception: sys.exit(0)
|
|
96
|
+
m = d.get("permission_mode")
|
|
97
|
+
if isinstance(m, str): sys.stdout.write(m)
|
|
98
|
+
' 2>/dev/null) || PERM_MODE=""
|
|
87
99
|
fi
|
|
88
100
|
[ -n "$CMD" ] || exit 0
|
|
89
101
|
|
|
@@ -193,10 +205,21 @@ hits="${hits} Advisory timing: this context reaches the model on the NEXT t
|
|
|
193
205
|
Destructive-Op Gate order: enumerate → recover → destroy — never destroy-then-check.
|
|
194
206
|
Intentional and reviewed → re-run with trailing \`# noqa: destructive-op\`."
|
|
195
207
|
|
|
196
|
-
|
|
208
|
+
# Block decision. Explicit FH_DESTRUCTIVE_BLOCK wins either way (1 = block, 0 = advisory). Unset:
|
|
209
|
+
# block when the session runs with permission_mode=bypassPermissions — there no human sees the
|
|
210
|
+
# advisory before the call runs, so a warning is a post-mortem (measured 2026-11-03, headless
|
|
211
|
+
# bypass, Sonnet: unset → branch deleted 3/3, =1 → kept 3/3).
|
|
212
|
+
BLOCK_WHY=""
|
|
213
|
+
case "${FH_DESTRUCTIVE_BLOCK-}" in
|
|
214
|
+
1) BLOCK_WHY="FH_DESTRUCTIVE_BLOCK=1 — add noqa after review, or set FH_DESTRUCTIVE_BLOCK=0, to proceed." ;;
|
|
215
|
+
"") [ "$PERM_MODE" = "bypassPermissions" ] && \
|
|
216
|
+
BLOCK_WHY="permission_mode=bypassPermissions (no human sees a warning before the call runs) — add noqa after review, or set FH_DESTRUCTIVE_BLOCK=0 to keep advisory." ;;
|
|
217
|
+
*) BLOCK_WHY="" ;; # 0 and any other explicit value: advisory, as before this default existed
|
|
218
|
+
esac
|
|
219
|
+
if [ -n "$BLOCK_WHY" ]; then
|
|
197
220
|
# Block mode: exit 2 = stderr fed to the model as the blocking reason; stdout ignored by contract.
|
|
198
221
|
printf '%s\n' "$hits" >&2
|
|
199
|
-
printf '%s\n' " [BLOCKED]
|
|
222
|
+
printf '%s\n' " [BLOCKED] $BLOCK_WHY" >&2
|
|
200
223
|
exit 2
|
|
201
224
|
fi
|
|
202
225
|
|
|
@@ -68,6 +68,9 @@ add_row() { ROWS="${ROWS}${1} ${2} ${3} ${4}
|
|
|
68
68
|
|
|
69
69
|
# _exists PATH → PRESENT|ABSENT (파일이든 디렉터리든)
|
|
70
70
|
_exists() { [ -e "$1" ] && printf 'PRESENT' || printf 'ABSENT'; }
|
|
71
|
+
# 날짜 키 (evidence.marker). `FH_FP_TODAY` 는 레인이 날짜를 고정하기 위한 이음새다 —
|
|
72
|
+
# 안 주면 실제 오늘이고, 운영 경로에서는 아무것도 바꾸지 않는다.
|
|
73
|
+
_FP_TODAY="${FH_FP_TODAY:-$(date +%F)}"
|
|
71
74
|
|
|
72
75
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
73
76
|
# probe_hub HUB — 모든 행을 ROWS 에 채운다. 인자를 받으므로 selftest 가 픽스처에 겨눌 수 있다.
|
|
@@ -136,9 +139,25 @@ PY
|
|
|
136
139
|
# ── EVIDENCE 층 — gitignored 기록. 게이트가 **읽는** 입력이다 ──────────────────
|
|
137
140
|
add_row evidence.manifest EVIDENCE "$(_exists "$H/tracks/_meta/edit_manifest.yaml")" \
|
|
138
141
|
"Axis 4 입력 — 없으면 훅이 배선된 쪽에서만 FAIL 이 뜬다"
|
|
142
|
+
# 🟥 **오늘 날짜로 키를 건다 (2026-11-02 실측).** 이 칸은 「마커 파일이 하나라도 있나」를 묻고
|
|
143
|
+
# 있었는데, 소비자는 그걸 안 읽는다: `templates/.git-hooks/pre-commit` 은
|
|
144
|
+
# `.axes_23_passed_<브랜치슬러그>_<오늘>.marker` **하나만** 읽고(그 훅 자신의 주석이 2786
|
|
145
|
+
# 줄에서 그렇게 적는다), 이름이 다른 마커는 없는 것과 같이 취급한다. 그래서 지난 회차 마커가
|
|
146
|
+
# 디스크에 남은 체크아웃에서 이 칸이 `PRESENT` 를 찍었고, ① 판을 읽은 세션은 EVIDENCE 층이
|
|
147
|
+
# 충족됐다고 결론한 다음 **같은 변경이 커밋 게이트에서 막혔다**(같은 날 두 팔로 실측:
|
|
148
|
+
# 배선 없음 → rc=0 무음 통과 / 배선 → rc=1, Axis 2+3 NOT CONFIRMED). 즉 이 칸은 **쓸 수 없는
|
|
149
|
+
# 기록을 충족으로 접고 있었다** — 이 레포가 「미측정을 통과로 접는 채널」로 부르는 그 부류다.
|
|
150
|
+
# 날짜만으로 키를 건다(브랜치까지 거는 것은 아래 잔여). 훅 자신도 2794 줄에서 날짜만으로
|
|
151
|
+
# 목록을 뽑아 「오늘 썼는데 주소가 틀렸다」를 말하므로, 날짜 키는 그 훅의 어휘 안에 있다.
|
|
152
|
+
# ⚠️ **남은 것, 고치지 않았다**: 오늘 날짜에 **다른 브랜치**의 마커만 있으면 이 칸은 여전히
|
|
153
|
+
# PRESENT 다. 브랜치 슬러그를 키에 넣으려면 이 계기가 git 을 요구하게 되고, 그러면 비-깃
|
|
154
|
+
# 픽스처(아래 --selftest)와 깃 없는 소비자 트리에서 판정이 UNMEASURED 로 떨어진다 — 세 값
|
|
155
|
+
# 어휘에서 그건 드리프트로 집계되므로, 더 작은 수리를 택하고 이 잔여를 이름으로 남긴다.
|
|
156
|
+
# ⚠️ 이 변경은 `--digest` 를 바꾼다. 이 줄 이전 회차의 지문과 이후 지문은 **비교 대상이
|
|
157
|
+
# 아니다**(회차 간 분리자로 지문을 쓰는 쪽은 그 경계를 알고 써야 한다).
|
|
139
158
|
add_row evidence.marker EVIDENCE \
|
|
140
|
-
"$([ "$(find "$H/tracks/_meta" -maxdepth 1 -name
|
|
141
|
-
"Axis 2+3 입력 — 마커는
|
|
159
|
+
"$([ "$(find "$H/tracks/_meta" -maxdepth 1 -name ".axes_23_passed_*${_FP_TODAY}.marker" 2>/dev/null | wc -l | tr -d ' ')" -gt 0 ] && printf 'PRESENT' || printf 'ABSENT')" \
|
|
160
|
+
"Axis 2+3 입력 — 훅은 <브랜치>_<오늘> 한 이름만 읽는다. 어제 마커는 있어도 이 세션의 입력이 아니다"
|
|
142
161
|
add_row evidence.card EVIDENCE "$(_exists "$H/tracks/_meta/reference_next_session_starter.md")" \
|
|
143
162
|
"세션 카드 — 없으면 마감 ⑤ 와 온보딩 «returning» 판정의 입력이 없다"
|
|
144
163
|
# 🟥 «tracks 에 파일이 있나» 로 세면 안 된다 — **두 방향으로** 틀린다.
|
|
@@ -283,7 +302,7 @@ if [ "$MODE" = "selftest" ]; then
|
|
|
283
302
|
: > "$POS/.claude/registry/LOCAL_SKILL_REGISTRY.md"
|
|
284
303
|
: > "$POS/CLAUDE.local.md"
|
|
285
304
|
: > "$POS/tracks/_meta/edit_manifest.yaml"
|
|
286
|
-
: > "$POS/tracks/_meta/.
|
|
305
|
+
: > "$POS/tracks/_meta/.axes_23_passed_fixture_${_FP_TODAY}.marker"
|
|
287
306
|
: > "$POS/tracks/_meta/reference_next_session_starter.md"
|
|
288
307
|
probe_hub "$POS"
|
|
289
308
|
pos_absent="$(count_of ABSENT)"
|
|
@@ -296,6 +315,28 @@ if [ "$MODE" = "selftest" ]; then
|
|
|
296
315
|
pos_digest="$(digest_line)"
|
|
297
316
|
[ "$neg_digest" = "$pos_digest" ] && { echo "FAIL selftest: 두 픽스처의 digest 가 같다 — 지문이 상태를 안 나른다"; rc=1; }
|
|
298
317
|
|
|
318
|
+
# ── 묵은 마커 팔 (2026-11-02). 이 팔이 없으면 위의 known-positive 는 「마커 파일이 있다」만
|
|
319
|
+
# 보이고, 이 계기가 고치려는 바로 그 혼동(있다 ≠ 이 세션의 입력이다)을 못 가른다.
|
|
320
|
+
# 수리 전에 돌리면 이 팔이 PRESENT 를 받아 **빨강**이 된다 — 그래서 컨트롤이다.
|
|
321
|
+
STALE="$TMP/stale"
|
|
322
|
+
cp -R "$POS" "$STALE"
|
|
323
|
+
rm -f "$STALE"/tracks/_meta/.axes_23_passed_*.marker
|
|
324
|
+
# 묵은 날짜는 「오늘」과 반드시 달라야 한다 — `FH_FP_TODAY` 로 오늘을 고정한 호출자가
|
|
325
|
+
# 하필 이 날짜를 집으면 이 팔이 자기 주제를 잃는다. 겹치면 하루 뒤로 비킨다.
|
|
326
|
+
_FP_STALE=2000-01-01
|
|
327
|
+
[ "$_FP_STALE" = "$_FP_TODAY" ] && _FP_STALE=1999-01-01
|
|
328
|
+
: > "$STALE/tracks/_meta/.axes_23_passed_fixture_${_FP_STALE}.marker"
|
|
329
|
+
probe_hub "$STALE"
|
|
330
|
+
if [ "$(verdict_of evidence.marker)" = "PRESENT" ]; then
|
|
331
|
+
echo "FAIL selftest: $_FP_STALE 마커 하나뿐인 허브가 evidence.marker=PRESENT — 훅은 그 이름을 안 읽는다"; rc=1
|
|
332
|
+
fi
|
|
333
|
+
# 같은 허브, 날짜만 오늘로 → PRESENT 로 돌아와야 한다(음성 팔이 늘 ABSENT 를 내는 계기와 구분)
|
|
334
|
+
: > "$STALE/tracks/_meta/.axes_23_passed_fixture_${_FP_TODAY}.marker"
|
|
335
|
+
probe_hub "$STALE"
|
|
336
|
+
if [ "$(verdict_of evidence.marker)" != "PRESENT" ]; then
|
|
337
|
+
echo "FAIL selftest: 오늘 날짜 마커를 넣었는데 evidence.marker 가 PRESENT 가 아니다 — 과차단"; rc=1
|
|
338
|
+
fi
|
|
339
|
+
|
|
299
340
|
# 계기-오류 팔: READ 층이 없는 디렉터리를 겨누면 rc=2 여야 한다
|
|
300
341
|
probe_hub "$TMP/nonexistent-hub"
|
|
301
342
|
read_layer_broken || { echo "FAIL selftest: 빈 디렉터리를 겨눴는데 READ 층이 깨진 것으로 안 잡힌다"; rc=1; }
|