@chrono-meta/fh-gate 3.39.0 → 3.40.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/regression/probes_live.yaml +9 -2
- package/.claude-plugin/marketplace.json +4 -4
- package/CLAUDE.md +2 -2
- package/README.ja.md +22 -20
- package/README.ko.md +2 -2
- package/README.md +2 -2
- package/README.zh.md +22 -20
- package/knowledge/shared/harness-core/claude_md_full_reference.md +8 -1
- package/knowledge/shared/harness-core/dispatch_conditional_prohibition.md +9 -0
- package/knowledge/shared/harness-core/fh_module_contract.md +68 -3
- package/knowledge/shared/harness-core/governor_landing_before_compact.md +4 -4
- package/knowledge/shared/harness-core/lease_record_channel.md +26 -2
- package/knowledge/shared/harness-core/onboarding_acceleration_autopilot.md +7 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +36 -0
- package/knowledge/shared/rules/operations.md +1 -0
- package/package.json +10 -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 +45 -0
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/agent_tools_pin.txt +16 -0
- package/scripts/catch_tally.py +215 -0
- package/scripts/claim_precision_report.py +138 -0
- package/scripts/fh_module_check.py +182 -1
- package/scripts/generated_harness_check.py +4 -0
- package/scripts/package_coverage_check.sh +5 -0
- package/scripts/post_squash_verify.sh +53 -1
- package/scripts/pr_merge_verified.sh +56 -0
- package/scripts/probe_live_eval.sh +61 -0
- package/scripts/probe_live_eval_lib.py +47 -4
- package/scripts/selfcheck.sh +5 -0
- package/scripts/selfdev_merge_tier.sh +153 -0
- package/scripts/session_checklist.py +38 -1
- package/scripts/session_close_check.sh +67 -1
- package/scripts/sim_isolated_run.sh +62 -1
- package/scripts/test_agent_tools_pin_lanes.sh +73 -0
- package/scripts/test_catch_tally_lanes.sh +10 -0
- package/scripts/test_claim_precision_report_lanes.sh +77 -0
- package/scripts/test_fh_module_check_lanes.sh +106 -1
- package/scripts/test_generated_harness_check_lanes.sh +8 -0
- package/scripts/test_post_squash_verify_lanes.sh +23 -2
- package/scripts/test_pr_merge_verified_lanes.sh +55 -3
- package/scripts/test_probe_live_eval_lanes.sh +160 -5
- package/scripts/test_selfdev_merge_tier_lanes.sh +128 -0
- package/scripts/test_session_checklist_lanes.sh +57 -0
- package/scripts/test_session_close_chain_lanes.sh +93 -0
- package/scripts/test_sim_isolated_run_lanes.sh +67 -0
- package/templates/harness_birth_core.md +57 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrono-meta/fh-gate",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.40.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,8 @@
|
|
|
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/selfdev_merge_tier.sh",
|
|
138
|
+
"scripts/test_selfdev_merge_tier_lanes.sh",
|
|
137
139
|
"scripts/test_live_eval_transitions_lanes.sh",
|
|
138
140
|
"scripts/correction_moments.py",
|
|
139
141
|
"scripts/test_correction_moments_lanes.sh",
|
|
@@ -174,6 +176,8 @@
|
|
|
174
176
|
"scripts/digest_landing_check.sh",
|
|
175
177
|
"scripts/absorption_queue.py",
|
|
176
178
|
"scripts/test_absorption_queue_lanes.sh",
|
|
179
|
+
"scripts/catch_tally.py",
|
|
180
|
+
"scripts/test_catch_tally_lanes.sh",
|
|
177
181
|
"scripts/digest_slow_leg.py",
|
|
178
182
|
"scripts/test_digest_slow_leg_lanes.sh",
|
|
179
183
|
"scripts/directional_diff_gate.sh",
|
|
@@ -260,6 +264,10 @@
|
|
|
260
264
|
"scripts/selfcheck.sh",
|
|
261
265
|
"scripts/selfcheck_shard_weights.txt",
|
|
262
266
|
"scripts/session_checklist.py",
|
|
267
|
+
"scripts/agent_tools_pin.txt",
|
|
268
|
+
"scripts/test_agent_tools_pin_lanes.sh",
|
|
269
|
+
"scripts/claim_precision_report.py",
|
|
270
|
+
"scripts/test_claim_precision_report_lanes.sh",
|
|
263
271
|
"scripts/checklist_unblocked_hook.sh",
|
|
264
272
|
"scripts/convergence_verdict.py",
|
|
265
273
|
"scripts/session_close_check.sh",
|
|
@@ -434,6 +442,7 @@
|
|
|
434
442
|
"templates/fh_audit_check.zsh",
|
|
435
443
|
"templates/goal-quench-hook-setup.md",
|
|
436
444
|
"templates/goal-quench-settings-merged.json",
|
|
445
|
+
"templates/harness_birth_core.md",
|
|
437
446
|
"templates/local_fh_context.md",
|
|
438
447
|
"templates/predelete_check.sh",
|
|
439
448
|
"templates/predelete_check.test.sh",
|
|
@@ -2,6 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
### [Unreleased]
|
|
4
4
|
|
|
5
|
+
### [3.40.0] — 2026-11-13
|
|
6
|
+
|
|
7
|
+
New scripts and lanes ship, and three checks that were already in the package now refuse more, so this is a minor by the version policy. Three `BREAKING (gate)` lines are below; each applies only if you call the named script yourself. The self-dev loop and its candidate auto-merge change (#1079, #1071) are not in the npm package: `scripts/selfdev_loop.sh`, `scripts/selfdev_queue.py` and its launchd plist stay in the hub clone. The new session-ledger scripts (#1076) are also not shipped. The new read-only reports (`catch_tally.py`, `claim_precision_report.py`) and the new live-eval and sim-runner options run only when you invoke them; no hook or setting is added or wired by default.
|
|
8
|
+
|
|
9
|
+
BREAKING (gate): `scripts/pr_merge_verified.sh` with `--lease '<label>'` (any label that does not start with «operator») now runs `scripts/selfdev_merge_tier.sh` on the PR's recorded head before merging and exits **7**, merging nothing, unless the tier says `TIER=AUTO`. The tier's allow-list is FH's own doc/skill/test paths; a change to any other file, a skill edit that touches verdict or scoring lines, an edited test lane, or a change over 300 lines is `HOLD`. Before, any non-empty label merged. If you pass `--lease` for a standing approval on a repo that is not this hub, either drop the flag (a merge with no `--lease` still runs, and now prints a `lease=NONE` warning first) or pass the per-PR answer as `--lease 'operator: «<their words>» <date>'` (#1068, #1064, #1065).
|
|
10
|
+
|
|
11
|
+
BREAKING (gate): `scripts/post_squash_verify.sh --precheck` (and so `pr_merge_verified.sh`) now refuses a `--rerun` command that prints nothing when it passes, with rc **3** before the merge — for example `grep -q …`, `… >/dev/null`, or `python3 -c` with no print. Before, such a command was accepted, merged, and then ended `verify-incomplete` (rc 4) because of the silence guard. Add `&& echo '<what passed>'` to the command. The rc 4 guard after the merge is unchanged for shapes the static read cannot see (#1061).
|
|
12
|
+
|
|
13
|
+
BREAKING (gate): `scripts/fh_module_check.py check` now BLOCKs (rc 1) a module whose shipped Python imports a non-standard-library package without a guard, and reports UNMEASURED (rc 2) for a shipped `.py` it cannot parse. A guarded import (`try: … except ImportError`) is a NOTE, not a block. The three modules in this package pass. If you author your own modules, make the import stdlib-only or guard it and exit 2 naming the missing module (#1067).
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Session close counts what the methods caught. Wrap-up ⑤(a) now asks for a `## 잡은 것` table in the day's completed-work file (defect · method that caught it · who missed it · evidence), and `scripts/catch_tally.py` counts those tables over a date range. A day with no section is reported as not recorded, not as zero. Report only; it never blocks. It runs when you run it or when the wrap-up text tells the agent to (#1058).
|
|
17
|
+
- `scripts/claim_precision_report.py`: a read-only counter over existing request-checklist result sheets. It prints how many rows were marked DONE and how many a later sheet of the same session shows as reopened or not re-judged. No ratio, no pass/fail; sessions with one sheet are listed as not measured. Nothing calls it (#1078).
|
|
18
|
+
- `scripts/session_close_check.sh` gains a report-only `①-r` line that lists PRs whose last merge receipt is not `verified`, from the last `FH_RECEIPT_WINDOW_DAYS` days (default 7); older ones are counted on their own line. The close check's exit code does not change (#1059).
|
|
19
|
+
- `templates/harness_birth_core.md` and a route to it: when you ask for a harness for a new or empty project, the routing rows in `CLAUDE.md` and `onboarding_acceleration_autopilot.md` tell the agent to read it before writing the first file. It names the five parts a new harness carries (purpose, when unsure, calibration without a script, irreversible edges, typed verdict). The shipped `CLAUDE.md` text changes, so an agent that loads it routes differently on that request; no script runs (#1073).
|
|
20
|
+
- `scripts/sim_isolated_run.sh` takes four opt-in flags for a consumer-like arm: `--setting-sources` (must include `local`), `--settings`, `--permission-mode` (only `default`, `acceptEdits`, `plan`; `bypassPermissions` is refused) and `--add-wrapper-dir`. With none given the arguments passed to `claude` are byte-identical to before (#1072).
|
|
21
|
+
- live-eval reports gain a «State fingerprint (record only — not scored)» block appended after the verdict, one line per rep: changed-path count, unhashed count and a short hash of what the arm left in its clone (`MISSING` when the runner wrote no treediff). No verdict row moves (#1077).
|
|
22
|
+
- live-eval episodes record wall seconds. The runner writes `wall_s` to `meta.tsv` and the report's Budget cell prints `wall_s=<min>..<max>` and `tokens_used=UNMEASURED`; an episode with no readable clock is counted as unmeasured, not 0. Verdicts are unchanged (#1081).
|
|
23
|
+
- Module manifests may now rely on the runtime-dependency and question-shaped-description rules (`fh_module_contract.md` §2b and §2c). `scripts/generated_harness_check.py` adds an info-level `W8` for a skill description with no question example; info never changes a verdict (#1067).
|
|
24
|
+
- `scripts/agent_tools_pin.txt` and a lane that pin each shipped agent's `tools:` restriction, so widening one shows as a diff. Test and package-list change only; the agent files are unchanged (#1080).
|
|
25
|
+
- Hub-clone only, not in the npm package: a shared session ledger pilot (`scripts/session_ledger_write.sh`, `session_ledger_read.py`) where child sessions append typed lines and the root session reads them (#1076).
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- `scripts/selfdev_merge_tier.sh` (shipped): a `SKILL.md` or `SKILL_detail.md` edit is now `HOLD` when a changed line (added or removed) carries verdict or scoring words (`PASS`, `FAIL`, `HOLD`, `verdict`, `threshold`, `rubric`, …), and `HOLD` when the diff cannot be read in full. Before, every skill-file edit was `AUTO` by path. This only affects a caller of the tier script; see the first `BREAKING (gate)` line (#1064).
|
|
29
|
+
- Self-dev loop, hub clone only: a `seed: candidate` PR no longer waits for the operator by seed alone. It is eligible for the existing auto-merge only if it deletes no file, removes no more lines than it adds, names no ablation, carries a cross-family marker, and the path tier says `AUTO`; at most 2 auto-merges per run (`SELFDEV_MAX_AUTO_MERGES`, lower only). The loop is not shipped, is installed by hand from a plist whose template ships `SELFDEV_DRY_RUN=1` and `SELFDEV_NO_MERGE=1`, and `SELFDEV_NO_MERGE` set to anything other than `0` or empty turns merging off while still reporting eligible PRs (#1079). The builder is also told the run's watchdog limit, and commits left unpushed on an `auto/selfdev-*` branch are reported as STRANDED (#1071).
|
|
30
|
+
- Lease record channel docs (`lease_record_channel.md`, `dispatch_conditional_prohibition.md`): a per-PR operator answer needs no lease line; only a standing grant does, and one received remotely counts as a one-time grant for that session until applied at the desk. `lease_line_apply.sh` (hub clone only) gets `apply-all` for queued drafts, and inside a worktree it defaults to the main checkout's lease file and draft folder. A dead internal path was removed from the doc (#1069, #1070, #1060).
|
|
31
|
+
- `scripts/session_checklist.py` strips leading complete `<system-reminder>` blocks from a human entry before it becomes a checklist row, so a row keeps the operator's words; unclosed or mid-text tags are kept (#1059).
|
|
32
|
+
- `pr_merge_verified.sh` prints a three-line advisory before the merge when no `--lease` is given (the receipt records `lease=NONE`); rc and merge are unchanged (#1065).
|
|
33
|
+
- README (ja, zh): the evidence wording is brought up to the English README (#1075). The v1.0.3 paper snapshot's citations are pinned like v1.0 to v1.0.2 (#1056; not in the npm package). Sub-agent invocation log entries for 2026-11-08 and 2026-11-10 (#1059, #1075).
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
- live-eval: a rep whose runner `meta.tsv` has a nonzero `rc` is scored `FAILED-TO-RUN`, not `FAIL`. A usage-limit reply is non-empty text and used to be scored as a failed answer; reply text is never inspected, and a run with no `meta.tsv` scores as before (#1074).
|
|
37
|
+
- live-eval probe `G-TRIG-04` now accepts «weekly harvest» as well as `harvest-loop`. The old pattern missed 5 of 60 correct routes; the change widens what passes, and its remaining blind spot is named in the probe's `unseen` field (#1063).
|
|
38
|
+
- Housekeeping, no consumer effect: `.gitignore` covers `lease_line_apply.sh`'s `CLAUDE.local.md` backups (#1057; the file is not in the npm package).
|
|
39
|
+
|
|
40
|
+
### [3.39.1] — 2026-11-08
|
|
41
|
+
|
|
42
|
+
Documentation-only patch.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
- `knowledge/shared/harness-core/fh_module_contract.md`: a short glossary (module = cartridge, the unit with a manifest; skill/agent = what a module provides; plugin = the distribution unit; one spelling `UNMEASURED`), a rule that a command which exits 0 on a negative finding is a measurement engine and not a `provides.verdicts` entry, and a note that exit code 3 means different things in different scripts (#1054).
|
|
46
|
+
- `knowledge/shared/harness-core/governor_landing_before_compact.md`: internal pointers an outside reader cannot follow were removed (#1054).
|
|
47
|
+
- README (en/ko/ja/zh): the sentence between «You get three things:» and the table moved below the table; «the author» now reads «the author of FH» (#1054).
|
|
48
|
+
- `.claude/regression/ablation_verdicts.md`: the §Autonomous Initiative Layer KEEP verdict is now a table row, re-measured (#1053).
|
|
49
|
+
|
|
5
50
|
### [3.39.0] — 2026-11-07
|
|
6
51
|
|
|
7
52
|
New scripts and lanes ship, so this is a minor by the version policy. No existing gate tightens. The new hook is not wired by default. The `persona-cast` and `convergence-loop` skills now tell the agent to run their engines instead of counting by hand, so a session that uses those skills runs the scripts.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Declared tools: restriction per agent definition — a lane pins each line (present + unchanged).
|
|
2
|
+
# Change a restriction here in the same commit as the agent file; widening it is then a visible diff.
|
|
3
|
+
plugins/fh-commons/agents/a11y-lens.md|Read, Grep, Glob
|
|
4
|
+
plugins/fh-commons/agents/be-dev-lens.md|Read, Grep, Glob
|
|
5
|
+
plugins/fh-commons/agents/designer-lens.md|Read, Grep, Glob
|
|
6
|
+
plugins/fh-commons/agents/fe-dev-lens.md|Read, Grep, Glob
|
|
7
|
+
plugins/fh-commons/agents/qa-lens.md|Read, Grep, Glob
|
|
8
|
+
plugins/fh-commons/agents/quench-challenger.md|Read, Grep, Glob
|
|
9
|
+
plugins/fh-commons/agents/ux-writer-lens.md|Read, Grep, Glob
|
|
10
|
+
plugins/fh-meta/agents/beginner.md|Read
|
|
11
|
+
plugins/fh-meta/agents/challenger.md|Read, Grep, Glob, WebSearch, WebFetch
|
|
12
|
+
plugins/fh-meta/agents/expert.md|Read, WebSearch, WebFetch
|
|
13
|
+
plugins/fh-meta/agents/fact-checker.md|Read, Grep, Glob
|
|
14
|
+
plugins/fh-meta/agents/hub-persona-auditor.md|Read, Grep, Glob
|
|
15
|
+
plugins/fh-meta/agents/main-player.md|Read, Grep, Glob
|
|
16
|
+
plugins/fh-meta/agents/persona-innovator.md|Read, Grep, Glob, WebSearch, WebFetch
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""catch_tally.py — 마감 때 적은 «잡은 것» 표를 날짜 범위로 센다.
|
|
3
|
+
|
|
4
|
+
왜 (2026-11-08 운영자): «작은 시뮬레이션보다는 정말 어려운 무언가에 맞닥뜨렸을 때 방법론들로
|
|
5
|
+
결함을 잡은 것들을 그때그때 마감 때 카운트해 보는 게 맞을 듯». 11-07 두 번의 재측정은 심은
|
|
6
|
+
결함이 쉬워 일반 검토가 87~100% 를 잡았고(천장), 방법 차이를 잴 힘이 없었다. 방법의 값은
|
|
7
|
+
실작업에서 «일반 검토·저자가 놓친 것을 무엇이 잡았나» 로 드러나므로 그 기록을 센다.
|
|
8
|
+
|
|
9
|
+
기록 자리: Session Wrap-up ⑤(a) 가 `tracks/_meta/fh_completed_{date}.md` 에 쓰는 `## 잡은 것` 절.
|
|
10
|
+
|
|
11
|
+
## 잡은 것
|
|
12
|
+
| 결함 | 잡은 방법 | 놓친 쪽 | 근거 |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| 빈 집합에서 판정이 통과로 기움 | cross-family | author | #1041 |
|
|
15
|
+
|
|
16
|
+
또는 잡은 게 없으면 표 대신 한 줄: `0건 — <살펴본 범위>`
|
|
17
|
+
|
|
18
|
+
기계가 보는 것은 기록의 성질뿐이다(present · typed · attributable). 그 결함이 정말 어려웠는지,
|
|
19
|
+
그 방법이 정말 잡았는지는 판단이고 이 스크립트는 판정하지 않는다.
|
|
20
|
+
- 절이 없거나 범위 없는 0건뿐인 날 = NOT_RECORDED (0 이 아니다 — 안 적은 것과 잡은 게 없는 것은 다르다)
|
|
21
|
+
- `0건 —` 뒤에 범위가 없으면 INVALID (빈 0 은 미측정과 구분이 안 된다)
|
|
22
|
+
- 방법·놓친 쪽이 닫힌 목록 밖이거나 근거가 비면 그 행은 INVALID 로 따로 찍고 세지 않는다
|
|
23
|
+
|
|
24
|
+
사용:
|
|
25
|
+
catch_tally.py [--dir tracks/_meta] [--days 7] [--until YYYY-MM-DD]
|
|
26
|
+
catch_tally.py --self-test
|
|
27
|
+
exit: 0 집계 · 1 self-test 실패 · 2 INVALID 행 있음(집계는 찍는다) · 10 입력 오류
|
|
28
|
+
"""
|
|
29
|
+
import argparse, datetime as dt, os, re, sys, tempfile
|
|
30
|
+
|
|
31
|
+
METHODS = ["cross-family", "revert-probe", "control", "lens", "gate", "lane", "operator", "self"]
|
|
32
|
+
MISSED = ["author", "plain-review", "lane", "gate", "none"]
|
|
33
|
+
HEAD_RE = re.compile(r"^##\s+(잡은 것|Catches)\s*$")
|
|
34
|
+
ZERO_RE = re.compile(r"^\s*0건\s*(?:—|-{1,2})\s*(.*)$")
|
|
35
|
+
FILE_RE = re.compile(r"^fh_completed_(\d{4}-\d{2}-\d{2})\.md$")
|
|
36
|
+
PLACEHOLDER = {"", "-", "—", "tbd", "없음", "n/a", "na"}
|
|
37
|
+
# 근거 = PR(#123 · /pull/123) · 커밋 해시(7~40자) · 파일:줄. 그 밖의 낱말만 있으면 «귀속 가능» 이 아니다.
|
|
38
|
+
EVIDENCE_RE = re.compile(r"#\d+|/pull/\d+|\b[0-9a-f]{7,40}\b|[\w./-]+\.\w+:\d+")
|
|
39
|
+
SEP_RE = re.compile(r"^:?-+:?$")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def parse_section(text):
|
|
43
|
+
"""Return (state, rows, invalid). state ∈ NOT_RECORDED | ZERO | ROWS."""
|
|
44
|
+
lines = text.splitlines()
|
|
45
|
+
starts = [i for i, l in enumerate(lines) if HEAD_RE.match(l)]
|
|
46
|
+
if not starts:
|
|
47
|
+
return "NOT_RECORDED", [], []
|
|
48
|
+
rows, invalid, zero = [], [], None
|
|
49
|
+
for s in starts: # 하루에 마감이 둘 이상이면 절도 둘 이상일 수 있다 — 전부 읽는다
|
|
50
|
+
for l in lines[s + 1:]:
|
|
51
|
+
if l.startswith("#"):
|
|
52
|
+
break
|
|
53
|
+
m = ZERO_RE.match(l)
|
|
54
|
+
if m:
|
|
55
|
+
scope = m.group(1).strip()
|
|
56
|
+
if scope.lower() in PLACEHOLDER:
|
|
57
|
+
invalid.append((l.strip(), "0건 뒤에 살펴본 범위가 없다"))
|
|
58
|
+
else:
|
|
59
|
+
zero = scope
|
|
60
|
+
continue
|
|
61
|
+
if not l.strip().startswith("|"):
|
|
62
|
+
continue
|
|
63
|
+
cells = [c.strip() for c in l.strip().strip("|").split("|")]
|
|
64
|
+
if all(SEP_RE.match(c) for c in cells) or cells[0] == "결함":
|
|
65
|
+
continue # 구분선 · 머리줄
|
|
66
|
+
if len(cells) != 4:
|
|
67
|
+
invalid.append((l.strip(), f"칸이 {len(cells)}개 — 4칸(결함·잡은 방법·놓친 쪽·근거)이어야 한다"))
|
|
68
|
+
continue
|
|
69
|
+
defect, method, missed, evidence = cells
|
|
70
|
+
why = []
|
|
71
|
+
if defect.lower() in PLACEHOLDER:
|
|
72
|
+
why.append("결함이 비었다")
|
|
73
|
+
if method not in METHODS:
|
|
74
|
+
why.append(f"잡은 방법 «{method}» 는 목록 밖")
|
|
75
|
+
if missed not in MISSED:
|
|
76
|
+
why.append(f"놓친 쪽 «{missed}» 는 목록 밖")
|
|
77
|
+
if evidence.lower() in PLACEHOLDER:
|
|
78
|
+
why.append("근거가 비었다")
|
|
79
|
+
elif not EVIDENCE_RE.search(evidence):
|
|
80
|
+
why.append(f"근거 «{evidence}» 에 PR · 커밋 · 파일:줄이 없다")
|
|
81
|
+
if why:
|
|
82
|
+
invalid.append((l.strip(), " · ".join(why)))
|
|
83
|
+
else:
|
|
84
|
+
rows.append((defect, method, missed, evidence))
|
|
85
|
+
if rows:
|
|
86
|
+
return "ROWS", rows, invalid
|
|
87
|
+
if zero is not None:
|
|
88
|
+
return "ZERO", [], invalid
|
|
89
|
+
return "NOT_RECORDED", [], invalid
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def tally(d, days, until):
|
|
93
|
+
lo = until - dt.timedelta(days=days - 1)
|
|
94
|
+
found, badnames = {}, []
|
|
95
|
+
for name in sorted(os.listdir(d)):
|
|
96
|
+
m = FILE_RE.match(name)
|
|
97
|
+
if not m:
|
|
98
|
+
continue
|
|
99
|
+
try:
|
|
100
|
+
day = dt.date.fromisoformat(m.group(1))
|
|
101
|
+
except ValueError:
|
|
102
|
+
badnames.append(name) # 범위 판단을 못 하니 무조건 알린다 — 한 파일이 리포트 전체를 죽이지 않게
|
|
103
|
+
continue
|
|
104
|
+
if lo <= day <= until:
|
|
105
|
+
with open(os.path.join(d, name), encoding="utf-8") as f:
|
|
106
|
+
found[day] = parse_section(f.read())
|
|
107
|
+
return lo, found, badnames
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def report(d, days, until, out=sys.stdout):
|
|
111
|
+
lo, found, badnames = tally(d, days, until)
|
|
112
|
+
by_m = {k: 0 for k in METHODS}
|
|
113
|
+
by_x = {k: 0 for k in MISSED}
|
|
114
|
+
states = {"ROWS": 0, "ZERO": 0, "NOT_RECORDED": 0}
|
|
115
|
+
bad = []
|
|
116
|
+
for day, (state, rows, invalid) in sorted(found.items()):
|
|
117
|
+
states[state] += 1
|
|
118
|
+
for _, mth, mis, _ in rows:
|
|
119
|
+
by_m[mth] += 1
|
|
120
|
+
by_x[mis] += 1
|
|
121
|
+
bad += [(day, r, w) for r, w in invalid]
|
|
122
|
+
bad += [("-", n, "파일 이름의 날짜가 달력에 없다") for n in badnames]
|
|
123
|
+
nofile = [str(lo + dt.timedelta(days=i)) for i in range(days)
|
|
124
|
+
if lo + dt.timedelta(days=i) not in found]
|
|
125
|
+
total = sum(by_m.values())
|
|
126
|
+
p = lambda *a: print(*a, file=out)
|
|
127
|
+
p(f"catch_tally {lo}..{until} · 마감 기록 파일 {len(found)}개 "
|
|
128
|
+
f"(잡은 것 있음 {states['ROWS']} · 0건(범위 적음) {states['ZERO']} · 🟥 미기록 {states['NOT_RECORDED']})")
|
|
129
|
+
if nofile:
|
|
130
|
+
p(f" ⬜ 마감 파일 자체가 없는 날 {len(nofile)}개(마감이 없었거나 안 적음 — 0 으로 세지 않는다): {', '.join(nofile)}")
|
|
131
|
+
if states["NOT_RECORDED"]:
|
|
132
|
+
miss = [str(k) for k, v in found.items() if v[0] == "NOT_RECORDED"]
|
|
133
|
+
p(f" 🟥 미기록(절 없음 또는 범위 없는 0건) = 0 이 아니다: {', '.join(miss)}")
|
|
134
|
+
p(f" 잡은 것 {total}건")
|
|
135
|
+
p(" 잡은 방법: " + " · ".join(f"{k} {v}" for k, v in by_m.items() if v) if total else " 잡은 방법: —")
|
|
136
|
+
p(" 놓친 쪽: " + " · ".join(f"{k} {v}" for k, v in by_x.items() if v) if total else " 놓친 쪽: —")
|
|
137
|
+
for day, r, w in bad:
|
|
138
|
+
p(f" ⚠️ INVALID {day}: {w} — {r}")
|
|
139
|
+
return 2 if bad else 0
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def self_test():
|
|
143
|
+
ok = True
|
|
144
|
+
with tempfile.TemporaryDirectory() as t:
|
|
145
|
+
w = lambda n, s: open(os.path.join(t, n), "w", encoding="utf-8").write(s)
|
|
146
|
+
w("fh_completed_2026-01-05.md", "# x\n## 잡은 것\n| 결함 | 잡은 방법 | 놓친 쪽 | 근거 |\n|---|---|---|---|\n"
|
|
147
|
+
"| 빈 집합 통과 | cross-family | author | #1 |\n| 되돌려도 초록 | revert-probe | lane | commit:abc1234 |\n"
|
|
148
|
+
"| 오타 | codex | author | #2 |\n## 다음\n| 무시 | self | none | x |\n")
|
|
149
|
+
w("fh_completed_2026-01-06.md", "## 잡은 것\n0건 — FoD 릴리스 PR 두 개만 봄\n")
|
|
150
|
+
w("fh_completed_2026-01-07.md", "# 절 없음\n")
|
|
151
|
+
w("fh_completed_2026-01-08.md", "## Catches\n0건 —\n")
|
|
152
|
+
w("fh_completed_2025-12-01.md", "## 잡은 것\n| 범위 밖 | self | none | #9 |\n")
|
|
153
|
+
w("fh_completed_2026-01-03.md", "## 잡은 것\n| 칸 부족 | self | author |\n| | self | author | #1 |\n"
|
|
154
|
+
"| 칸 넘침 | self | author | #1 | x |\n| 근거 낱말 | self | author | banana |\n"
|
|
155
|
+
"| 파일 근거 | lens | plain-review | scripts/x.sh:12 |\n")
|
|
156
|
+
w("fh_completed_2026-02-30.md", "## 잡은 것\n0건 — x\n")
|
|
157
|
+
import io
|
|
158
|
+
buf = io.StringIO()
|
|
159
|
+
rc = report(t, 7, dt.date(2026, 1, 8), buf)
|
|
160
|
+
o = buf.getvalue()
|
|
161
|
+
checks = [
|
|
162
|
+
("rc=2 (INVALID 있음)", rc == 2),
|
|
163
|
+
("잡은 것 3건(목록 밖 행·다른 절·범위 밖 날 제외)", "잡은 것 3건" in o),
|
|
164
|
+
("cross-family 1 · revert-probe 1", "cross-family 1" in o and "revert-probe 1" in o),
|
|
165
|
+
("놓친 쪽 author 1 · lane 1", "author 1" in o and "lane 1" in o),
|
|
166
|
+
("0건+범위 = ZERO 로 셈", "0건(범위 적음) 1" in o),
|
|
167
|
+
("절 없는 날·빈 0건 = 미기록, 0 아님", "미기록 2" in o and "2026-01-07, 2026-01-08" in o),
|
|
168
|
+
("범위 없는 0건 = INVALID", "살펴본 범위가 없다" in o),
|
|
169
|
+
("목록 밖 방법 = INVALID", "«codex» 는 목록 밖" in o),
|
|
170
|
+
("칸 부족 = INVALID", "칸이 3개" in o),
|
|
171
|
+
("빈 결함 칸 = INVALID(구분선으로 오인 안 함)", "결함이 비었다" in o),
|
|
172
|
+
("칸 넘침 = INVALID", "칸이 5개" in o),
|
|
173
|
+
("근거에 PR·커밋·파일:줄 없음 = INVALID", "«banana» 에 PR" in o),
|
|
174
|
+
("파일:줄 근거는 유효 — lens 1 셈", "lens 1" in o),
|
|
175
|
+
("달력에 없는 날짜 파일 = INVALID, 리포트는 계속", "달력에 없다" in o and "2026-02-30" in o),
|
|
176
|
+
("파일 없는 날 = 따로 표시(0 아님)", "파일 자체가 없는 날 2개" in o and "2026-01-02, 2026-01-04" in o),
|
|
177
|
+
]
|
|
178
|
+
# 컨트롤: 같은 디렉터리에서 유효 행만 남기면 rc=0 이어야 한다(INVALID 판정이 늘 켜진 건 아님)
|
|
179
|
+
w("fh_completed_2026-01-05.md", "## 잡은 것\n| 빈 집합 통과 | cross-family | author | #1 |\n")
|
|
180
|
+
w("fh_completed_2026-01-08.md", "## 잡은 것\n0건 — 문서 PR 하나\n")
|
|
181
|
+
os.remove(os.path.join(t, "fh_completed_2026-01-03.md"))
|
|
182
|
+
os.remove(os.path.join(t, "fh_completed_2026-02-30.md"))
|
|
183
|
+
rc2 = report(t, 7, dt.date(2026, 1, 8), io.StringIO())
|
|
184
|
+
checks.append(("컨트롤: 유효 기록만이면 rc=0", rc2 == 0))
|
|
185
|
+
for name, good in checks:
|
|
186
|
+
print(("PASS " if good else "FAIL ") + name)
|
|
187
|
+
ok &= good
|
|
188
|
+
if not ok:
|
|
189
|
+
print("--- 출력 ---\n" + o)
|
|
190
|
+
return 0 if ok else 1
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def main():
|
|
194
|
+
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
|
195
|
+
ap.add_argument("--dir", default=os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "tracks", "_meta"))
|
|
196
|
+
ap.add_argument("--days", type=int, default=7)
|
|
197
|
+
ap.add_argument("--until", default=None)
|
|
198
|
+
ap.add_argument("--self-test", action="store_true")
|
|
199
|
+
a = ap.parse_args()
|
|
200
|
+
if a.self_test:
|
|
201
|
+
return self_test()
|
|
202
|
+
if a.days < 1 or not os.path.isdir(a.dir):
|
|
203
|
+
print(f"입력 오류: --dir {a.dir} / --days {a.days}", file=sys.stderr)
|
|
204
|
+
return 10
|
|
205
|
+
try:
|
|
206
|
+
until = dt.date.fromisoformat(a.until) if a.until else dt.date.today()
|
|
207
|
+
until - dt.timedelta(days=a.days - 1)
|
|
208
|
+
except (ValueError, OverflowError):
|
|
209
|
+
print(f"입력 오류: --until {a.until}", file=sys.stderr)
|
|
210
|
+
return 10
|
|
211
|
+
return report(a.dir, a.days, until)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
if __name__ == "__main__":
|
|
215
|
+
sys.exit(main())
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""claim_precision_report.py — completion-claim record counter (read-only, no verdict).
|
|
3
|
+
|
|
4
|
+
Origin: frontier digest 2026-11-11, arXiv:2611.10063 («completion-claim precision»).
|
|
5
|
+
|
|
6
|
+
What it counts, over existing request-checklist result sheets
|
|
7
|
+
(`tracks/_meta/session_checklist_<date>_<session>.md`):
|
|
8
|
+
|
|
9
|
+
N rows whose 상태 reads DONE in some sheet of a session
|
|
10
|
+
M of those, rows that a LATER sheet of the same session shows with a
|
|
11
|
+
non-DONE 상태 the status enum can read (downgraded / reopened in the record). Sticky:
|
|
12
|
+
a still-later DONE does not erase the reopening.
|
|
13
|
+
B of those (not in M), rows the NEWEST sheet of the session did not
|
|
14
|
+
re-judge: 상태 empty there, a value outside the status enum (e.g. «—»),
|
|
15
|
+
or the row is absent from it. That is a channel gap, NOT a correction,
|
|
16
|
+
and it is printed apart so «not re-judged» never reads as «still DONE».
|
|
17
|
+
|
|
18
|
+
Unreadable sheets are listed and do not count toward «measured».
|
|
19
|
+
Channels: only sessions with 2+ readable sheets can show a later re-judgment. Sessions
|
|
20
|
+
with a single sheet are listed as NOT MEASURED (their M is unknown, not 0).
|
|
21
|
+
Corrections made only in conversation, PRs or later sessions with a different
|
|
22
|
+
session id are not in these sheets and are named as an unread channel.
|
|
23
|
+
|
|
24
|
+
It reports record properties only — no ratio threshold, no pass/fail.
|
|
25
|
+
Rows are keyed by (시각, first 40 chars of 발화); a key seen twice in one sheet
|
|
26
|
+
is counted once and reported as a collision.
|
|
27
|
+
|
|
28
|
+
rc: 0 report printed · 10 no sheets found · 2 usage error.
|
|
29
|
+
"""
|
|
30
|
+
import argparse
|
|
31
|
+
import collections
|
|
32
|
+
import glob
|
|
33
|
+
import os
|
|
34
|
+
import re
|
|
35
|
+
import sys
|
|
36
|
+
|
|
37
|
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
38
|
+
import session_checklist as sc # single source for table parsing + status enum
|
|
39
|
+
|
|
40
|
+
NAME_RE = re.compile(r"session_checklist_(\d{4}-\d\d-\d\d)_(.+)\.md$")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def row_keys(path):
|
|
44
|
+
"""Yield (key, status_keys_or_None) for every 상태-table row of one sheet."""
|
|
45
|
+
tables, rc = sc.load_tables(path)
|
|
46
|
+
if not tables:
|
|
47
|
+
return
|
|
48
|
+
for header, rows in tables:
|
|
49
|
+
idx = [sc.find_header_index(header, n) for n in ("상태", "시각", "발화")]
|
|
50
|
+
if any(i is None or i < 0 for i in idx):
|
|
51
|
+
continue
|
|
52
|
+
si, ti, ui = idx
|
|
53
|
+
for r in rows:
|
|
54
|
+
if len(r) <= max(idx):
|
|
55
|
+
continue
|
|
56
|
+
yield (r[ti].strip(), r[ui].strip()[:40]), sc.classify_status(r[si]), r[si].strip()
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def classify_or_none(raw):
|
|
60
|
+
"""True only for a cell the status enum can read and that is not DONE-only-absent."""
|
|
61
|
+
return sc.classify_status(raw)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def main(argv=None):
|
|
65
|
+
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
|
|
66
|
+
ap.add_argument("--dir", required=True, help="folder holding session_checklist_*.md")
|
|
67
|
+
ap.add_argument("--show", type=int, default=10, help="list up to N reopened rows")
|
|
68
|
+
a = ap.parse_args(argv)
|
|
69
|
+
|
|
70
|
+
by = collections.defaultdict(list)
|
|
71
|
+
for f in sorted(glob.glob(os.path.join(a.dir, "session_checklist_*.md"))):
|
|
72
|
+
m = NAME_RE.search(os.path.basename(f))
|
|
73
|
+
if m:
|
|
74
|
+
by[m.group(2)].append((m.group(1), f))
|
|
75
|
+
if not by:
|
|
76
|
+
print("claim-precision: sheets=0 — NOT MEASURED (no session_checklist_*.md in %s)" % a.dir)
|
|
77
|
+
return 10
|
|
78
|
+
|
|
79
|
+
n = m_ = b = coll = 0
|
|
80
|
+
measured, single, unparsed = [], [], []
|
|
81
|
+
shown = []
|
|
82
|
+
for sid, sheets in sorted(by.items()):
|
|
83
|
+
parsed = []
|
|
84
|
+
for date, f in sheets:
|
|
85
|
+
tables, rc = sc.load_tables(f)
|
|
86
|
+
if not tables or rc is not None or next(row_keys(f), None) is None:
|
|
87
|
+
# no table, or a table without 상태/시각/발화 rows: nothing measurable in this sheet
|
|
88
|
+
unparsed.append(os.path.basename(f)) # a sheet we could not read is NOT a clean sheet
|
|
89
|
+
continue
|
|
90
|
+
parsed.append((date, f))
|
|
91
|
+
if len(parsed) < 2:
|
|
92
|
+
single.append(sid)
|
|
93
|
+
continue
|
|
94
|
+
measured.append(sid)
|
|
95
|
+
done_at = {} # key -> date first seen DONE
|
|
96
|
+
reopened = {} # key -> (date, raw) first later non-empty non-DONE — sticky, a later DONE never erases it
|
|
97
|
+
last_date = parsed[-1][0]
|
|
98
|
+
in_last = {} # key -> raw 상태 in the newest parsed sheet
|
|
99
|
+
for date, f in parsed:
|
|
100
|
+
seen_here = set()
|
|
101
|
+
for key, st, raw in row_keys(f):
|
|
102
|
+
if key in seen_here:
|
|
103
|
+
coll += 1
|
|
104
|
+
continue
|
|
105
|
+
seen_here.add(key)
|
|
106
|
+
is_done = bool(st) and "DONE" in st
|
|
107
|
+
if date == last_date:
|
|
108
|
+
in_last[key] = raw
|
|
109
|
+
if key in done_at and date != done_at[key] and not is_done and st: # st None = blank or a cell outside the enum («—»)
|
|
110
|
+
reopened.setdefault(key, (date, raw))
|
|
111
|
+
if is_done and key not in done_at:
|
|
112
|
+
done_at[key] = date
|
|
113
|
+
n += len(done_at)
|
|
114
|
+
for key, (date, raw) in reopened.items():
|
|
115
|
+
m_ += 1
|
|
116
|
+
if len(shown) < a.show:
|
|
117
|
+
shown.append((sid, key, done_at[key], date, raw))
|
|
118
|
+
# B: DONE rows the newest sheet did not re-judge — row blank there, or row absent from it.
|
|
119
|
+
for key, d0 in done_at.items():
|
|
120
|
+
if key in reopened or d0 == last_date:
|
|
121
|
+
continue
|
|
122
|
+
if not classify_or_none(in_last.get(key, "")):
|
|
123
|
+
b += 1
|
|
124
|
+
|
|
125
|
+
print("claim-precision: sessions=%d measured=%d not-measured(<2 readable sheets)=%d"
|
|
126
|
+
% (len(by), len(measured), len(single)))
|
|
127
|
+
print(" N done-rows=%d · M later reopened (non-DONE in the enum)=%d · B not re-judged in newest sheet (blank, absent or outside the enum)=%d · key collisions=%d"
|
|
128
|
+
% (n, m_, b, coll))
|
|
129
|
+
print(" channels read: session_checklist sheets of %s" % (", ".join(measured) or "—"))
|
|
130
|
+
print(" NOT MEASURED: sessions with <2 readable sheets %s · unreadable sheets %s · corrections outside "
|
|
131
|
+
"these sheets (conversation, PRs, other session ids)" % (", ".join(single) or "—", ", ".join(unparsed) or "—"))
|
|
132
|
+
for sid, key, d0, d1, raw in shown:
|
|
133
|
+
print(" ↩︎ %s %s «%s» DONE@%s → %s@%s" % (sid, key[0], key[1], d0, raw, d1))
|
|
134
|
+
return 0
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
if __name__ == "__main__":
|
|
138
|
+
sys.exit(main())
|