@chrono-meta/fh-gate 3.27.0 โ†’ 3.29.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 (71) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/CHEATSHEET.md +2 -2
  3. package/CLAUDE.md +6 -3
  4. package/README.ja.md +2 -4
  5. package/README.ko.md +2 -4
  6. package/README.md +19 -19
  7. package/README.zh.md +2 -4
  8. package/docs/REFERENCE.md +4 -1
  9. package/knowledge/shared/harness-core/claude_md_full_reference.md +2 -0
  10. package/knowledge/shared/harness-core/claude_md_gate_details.md +7 -0
  11. package/knowledge/shared/harness-core/dispatch_conditional_prohibition.md +12 -0
  12. package/knowledge/shared/harness-core/fh_module_contract.md +97 -0
  13. package/knowledge/shared/harness-core/fh_three_layer_canon.md +12 -0
  14. package/knowledge/shared/harness-core/measurement-integrity-checklist.md +16 -0
  15. package/knowledge/shared/learnings/subagent_invocations_log.yaml +137 -0
  16. package/package.json +12 -1
  17. package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
  18. package/plugins/fh-commons/skills/ko-tech-writer/SKILL.md +84 -4
  19. package/plugins/fh-commons/skills/ko-tech-writer/fh-module.yaml +19 -0
  20. package/plugins/fh-commons/skills/ko-tech-writer/fixtures/known_negative.md +73 -1
  21. package/plugins/fh-commons/skills/ko-tech-writer/fixtures/known_positive.md +39 -1
  22. package/plugins/fh-commons/skills/ko-tech-writer/fixtures/known_unclosed.md +6 -0
  23. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  24. package/plugins/fh-meta/CHANGELOG.md +32 -0
  25. package/plugins/fh-meta/skills/auto-decorrelation/SKILL.md +17 -0
  26. package/plugins/fh-meta/skills/frontier-digest/SKILL.md +14 -10
  27. package/plugins/fh-meta/skills/frontier-digest/SKILL_detail.md +17 -1
  28. package/plugins/fh-meta/skills/sim-conductor/SKILL.md +2 -2
  29. package/plugins/fh-meta/skills/sim-conductor/SKILL_detail.md +3 -3
  30. package/plugins/fh-meta/skills/steel-quench/SKILL.md +25 -1
  31. package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
  32. package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
  33. package/scripts/degrade_direction_scan.sh +43 -0
  34. package/scripts/dispatch_receipt.py +185 -0
  35. package/scripts/doc_claim_triad_scan.py +43 -4
  36. package/scripts/fh-gate.sh +71 -11
  37. package/scripts/fh_module_check.py +686 -0
  38. package/scripts/finding_fleet.sh +15 -3
  39. package/scripts/fixtures/frontier_digest_recall.tsv +5 -0
  40. package/scripts/ko_tech_writer_calibrate.py +288 -15
  41. package/scripts/package_coverage_check.sh +5 -0
  42. package/scripts/probe_live_eval.sh +19 -1
  43. package/scripts/probe_live_eval_lib.py +174 -5
  44. package/scripts/resident_cost.py +1 -1
  45. package/scripts/selfcheck.sh +48 -21
  46. package/scripts/session_checklist.py +214 -5
  47. package/scripts/session_close_check.sh +44 -0
  48. package/scripts/sim_isolated_run.sh +31 -0
  49. package/scripts/test_claude_md_size_lanes.sh +22 -7
  50. package/scripts/test_degrade_scan_shell_probes.sh +81 -0
  51. package/scripts/test_dispatch_receipt_lanes.sh +95 -0
  52. package/scripts/test_doc_claim_triad_lanes.sh +30 -0
  53. package/scripts/test_fh_audit_check_lanes.sh +10 -5
  54. package/scripts/test_fh_gate_regressions.sh +71 -1
  55. package/scripts/test_fh_module_check_lanes.sh +581 -0
  56. package/scripts/test_finding_pipeline_lanes.sh +83 -0
  57. package/scripts/test_frontier_digest_recall.sh +26 -0
  58. package/scripts/test_frontier_digest_recall_negctl.sh +15 -0
  59. package/scripts/test_ko_tech_writer_lanes.sh +1 -1
  60. package/scripts/test_locale_invariance_lanes.sh +19 -0
  61. package/scripts/test_mutation_probe_lanes.sh +22 -6
  62. package/scripts/test_probe_live_eval_lanes.sh +116 -0
  63. package/scripts/test_resident_cost_lanes.sh +1 -1
  64. package/scripts/test_selfcheck_state_lanes.sh +32 -0
  65. package/scripts/test_session_checklist_lanes.sh +167 -0
  66. package/scripts/test_sim_isolated_run_lanes.sh +51 -0
  67. package/scripts/test_utterance_checklist_hook_lanes.sh +175 -0
  68. package/scripts/utterance_checklist_hook.py +193 -0
  69. package/scripts/utterance_checklist_hook.sh +31 -0
  70. package/templates/PRE-PUBLISH-CHECKLIST.md +10 -0
  71. package/templates/degrade_direction_scan.sh +43 -0
@@ -142,7 +142,7 @@ with open(sys.argv[2], "w", encoding="utf-8") as w:
142
142
  eval "$cmd" < "$pf" > "$raw" 2>"$out/err2_${fam}_${role}.txt"
143
143
  local rc=$?
144
144
  FAM="$fam" ROLE="$role" RC="$rc" /usr/bin/python3 - "$raw" "$out/part2_${fam}_${role}.jsonl" "$out/findings_r1.jsonl" <<'PYR2'
145
- import json, os, sys
145
+ import json, os, re, sys
146
146
  own_r1 = {} # own round-1 id -> its trusted member_id alias (or None)
147
147
  try:
148
148
  for _l in open(sys.argv[3], encoding="utf-8"):
@@ -186,9 +186,21 @@ with open(dst, "w", encoding="utf-8") as w:
186
186
  line = line.strip().lstrip("\ufeff")
187
187
  if line.startswith("DROPPED:"):
188
188
  _body = line[len("DROPPED:"):]
189
+ # ๐ŸŸฅ A DROPPED line withdraws ONE finding: the one its body STARTS with (id or title, the longest that
190
+ # fits, followed by a non-[A-Za-z0-9_-] char or the end). Searching the whole line used to withdraw
191
+ # every finding merely named in it โ€” ยซcodex-logic-10ยป took ยซcodex-logic-1ยป, title ยซQ10ยป took ยซQ1ยป,
192
+ # ยซโ€ฆ Race condition remains validยป took ยซRace conditionยป โ€” and the silently omitted finding then
193
+ # counted as accounted for, so no fallback ran (L125โ€“L127, 2026-10-22, codex R1). An unrecognised
194
+ # withdrawal falls back to round 1 (the safe side). ASCII boundary so ยซcodex-logic-1์€ยป still counts.
195
+ _head = _body.strip().lstrip("\"'`*#([ ").strip()
196
+ _best = None
189
197
  for _id, _t in own_r1_titles.items():
190
- if _id in _body or (_t and _t in _body):
191
- withdrawn_ids.add(_id)
198
+ for _ref in (_id, _t):
199
+ if _ref and _head.startswith(_ref) and not re.match(r"[A-Za-z0-9_-]", _head[len(_ref):len(_ref) + 1]):
200
+ if _best is None or len(_ref) > len(_best[1]):
201
+ _best = (_id, _ref)
202
+ if _best:
203
+ withdrawn_ids.add(_best[0])
192
204
  # ๐ŸŸฅ saw_bytes ๋ฅผ ์—ฌ๊ธฐ์„œ ยซ์˜ฌ๋ฆฌ์ง€ ์•Š๋Š”๋‹คยป. DROPPED ๋Š” 2์ฐจ ๊ณ„์•ฝ์ด ์š”๊ตฌํ•œ ์ถœ๋ ฅ์ด๋ฏ€๋กœ
193
205
  # ใ€Œ๊ณ„์•ฝ ๋ฐ– ์‘๋‹ตใ€์˜ ์ฆ๊ฑฐ๊ฐ€ ๋  ์ˆ˜ ์—†๋‹ค (cross-family #5, codex 2026-09-10).
194
206
  # ๐ŸŸฅ "DROPPED: none" ์€ ์‚ญ์ œ๊ฐ€ ์•„๋‹ˆ๋‹ค. ์„ธ๋ฉด ยซ์ˆจ์€ ์ˆ˜ํ™• ์†์‹คยป ๊ณ„์ธก์ด ๊ทธ ์ž๋ฆฌ์—์„œ ๊ฑฐ์ง“์ด ๋œ๋‹ค.
@@ -0,0 +1,5 @@
1
+ # item<TAB>kind<TAB>announced-on channel ids (comma-separated; at least ONE must be in SKILL.md Step 1)
2
+ # Known-positive recall set. Channel assignments are the operator-reported/expected venues, not live-verified.
3
+ Aside agent browser (YC-backed) launch-yc,product-hunt
4
+ Orca agent orchestration show-hn,product-hunt,geeknews
5
+ Context7 docs MCP show-hn,product-hunt,geeknews
@@ -21,7 +21,10 @@ Python `re` ๋Š” โ“ ์„ธ ํ—ˆ์šฉ ์—”์ง„ ์ค‘ **์–ด๋””์—๋‚˜ ์žˆ๋Š” ์œ ์ผํ•œ ๊ฒƒ**
21
21
  โ‡’ ์ด๊ฑธ ํ†ต๊ณผํ–ˆ๋‹ค๊ณ  ยซStep 2 ์ž”์—ฌ 0ยป ์„ ์ฃผ์žฅํ•˜๋ฉด
22
22
  `harness_terminal_correlation_and_recommendations.md` ์˜ ๊ฐ•๋“ฑ ์‚ฌ์œ ๊ฐ€ ๊ทธ๋Œ€๋กœ ์žฌ๋ฐœํ•œ๋‹ค.
23
23
 
24
- exit: 0 ์ „ ๋ ˆ์ธ ํŒ๋ณ„ ยท 1 ํŒ๋ณ„ ์‹คํŒจ ยท 10 harness error(ํ”ฝ์Šค์ฒ˜ ๋ถ€์žฌ)
24
+ ์‚ฌ์šฉ: python3 ko_tech_writer_calibrate.py (๋ณด์ •)
25
+ python3 ko_tech_writer_calibrate.py --scan ๋ฌธ์„œ.md (๊ฐ™์€ ๋ ˆ์ธยทํ•„ํ„ฐ๋กœ ๋ฌธ์„œ ์Šค์บ”, ์ค„\t๋ ˆ์ธ\t๋ณธ๋ฌธ)
26
+
27
+ exit: 0 ์ „ ๋ ˆ์ธ ํŒ๋ณ„ ยท 1 ํŒ๋ณ„ ์‹คํŒจ(ํ”ฝ์Šค์ฒ˜ ๋ถ€์žฌ ํฌํ•จ โ€” known_unclosed.md ๊ฐ€ ์—†์œผ๋ฉด 1) ยท 3 --scan ๋Œ€์ƒ์— ์•ˆ ๋‹ซํžŒ ๋ธ”๋ก ยท 10 harness error(์ž…๋ ฅ ์˜ค๋ฅ˜)
25
28
  """
26
29
  import os
27
30
  import re
@@ -30,6 +33,7 @@ import sys
30
33
  HERE = os.path.dirname(os.path.abspath(__file__))
31
34
  FIX = os.path.join(HERE, "..", "plugins", "fh-commons", "skills", "ko-tech-writer", "fixtures")
32
35
  POS = os.path.join(FIX, "known_positive.md")
36
+ UNC = os.path.join(FIX, "known_unclosed.md")
33
37
  NEG = os.path.join(FIX, "known_negative.md")
34
38
 
35
39
  # (๋ผ๋ฒจ, ํŒจํ„ด) โ€” Step 2 ์˜ 5ํด๋ž˜์Šค + Step 4-b ์˜ 2ํŒจํ„ด.
@@ -56,27 +60,235 @@ LANES = [
56
60
  # ๋‹ซํžŒ ๋ช…์‚ฌ ์–ดํœ˜๋ผ **recall ์ด ๋‚ฎ๋‹ค** โ€” ๋‚ฎ์€ ์ชฝ์ด ๊ณผ์ฐจ๋‹จ๋ณด๋‹ค ์•ˆ์ „ํ•œ ๋ฐฉํ–ฅ์ด๊ณ ,
57
61
  # ๋„“ํžˆ๋ ค๋ฉด ์–ดํœ˜๋ฅผ ๋Š˜๋ฆฌ๋Š” ๊ฒŒ ์•„๋‹ˆ๋ผ ํ˜•ํƒœ์†Œ ๋ถ„์„์ด ํ•„์š”ํ•˜๋‹ค.
58
62
  ("C4 ์กฐ๊ฐ๋ฌธ(ํ›„๋ณดยท๋‹ซํžŒ ์–ดํœ˜)", r"(์ธต|๊ฒƒ|์ |์ถ•|๊ฑด|๋ฟ|๋ฐ”|์…ˆ)\.\s*(<!--|$)"),
59
- ("C5 ์†Œ์œ  ์ง์—ญ", r"(์„|๋ฅผ) (๊ฐ–|๊ฐ€์ง€)"),
63
+ # ๊ฐ–์ถ”๋‹ค(์ ˆ์ฐจ๋ฅผ ๊ฐ–์ถ˜ ๊ฒ€ํ† )๋Š” ยซhaveยป ์ง์—ญ์ด ์•„๋‹ˆ๋‹ค โ€” `๊ฐ–(?!์ถ”|์ถ˜|์ถœโ€ฆ)` ๋กœ ๋บ๋‹ค (๊ฐ–์ถ˜ยท๊ฐ–์ถœยท๊ฐ–์ถฐ ํ˜•ํƒœ ํฌํ•จ โ€” ์ฒซํŒ `๊ฐ–(?!์ถ”)` ๋Š” ยซ๊ฐ–์ถ˜ยป ์„ ๋ชป ๋บ๋‹ค)(tuning doc 1๊ฑด์—์„œ 2๊ฑด ์˜คํƒ, ๋ณด๊ณ ์น˜ยทn=1ยท๋…๋ฆฝ ์•„๋‹˜).
64
+ ("C5 ์†Œ์œ  ์ง์—ญ", r"(์„|๋ฅผ) ?(๊ฐ–(?!์ถ”|์ถ˜|์ถœ|์ถค|์ถฐ|์ท„|์ถฅ)|๊ฐ€์ง€(?!๋Ÿฐ|๊ฐ|์น˜))"), # ๊ฐ€์ง€๋Ÿฐํžˆยท๊ฐ€์ง€๊ฐ์ƒ‰ยท๊ฐ€์ง€์น˜๊ธฐ ๋Š” ์†Œ์œ ๊ฐ€ ์•„๋‹ˆ๋‹ค(2์ถ• ๋ฆฌ๋ทฐ B1)
60
65
  ("C6 ์ „์นญ ์–ดํœ˜", r"์ „๋ถ€|๋ชจ๋‘|ํ•˜๋‚˜๋„|์ „ํ˜€|์ผ์ ˆ|์˜ˆ์™ธ ์—†์ด"),
61
66
  ("C6b ๋ถ€์ •ํ˜• ์ „์นญ", r"(์•ˆ|๋ชป) ?(ํ–ˆ|๋งŒ๋“ค|๋‚˜์˜ค|์žกํžˆ)|์ง€ ์•Š์•˜(๋‹ค|์Šต๋‹ˆ๋‹ค)"),
67
+ # โ”€โ”€ ์ธก์ • ํด๋ž˜์Šค (2026-10-17 ์ˆ˜ํ™• ยง4 (๋‚ด๋ถ€ ๊ธฐ๋ก) ์—์„œ ๋ณด์ •ํ•œ ์ •๊ทœ์‹)
68
+ # ๐ŸŸฅ ์•„๋ž˜ ํžˆํŠธ๋Š” ์ „๋ถ€ ยซํ›„๋ณดยป๋‹ค. ์šด์˜์ž ์†ํŽธ์ง‘์ด ์ด ํŒจํ„ด๋“ค๊ณผ ๋ฐ˜๋Œ€๋กœ ๊ฐ„ ์‚ฌ๋ก€๊ฐ€ ์žˆ๋‹ค(๊ทธ๊ฒƒ์„ ๋“ฑ).
69
+ ("C7 ๊ฒนํ™”์‚ด๊ด„ํ˜ธยท๋‚ซํ‘œ(Y1/Y2)", r"[ยซยปใ€Œใ€ใ€Žใ€]", "skipfig"),
70
+ ("C8 ์ ˆ ๊ธฐํ˜ธ(Y3)", r"ยง"),
71
+ # ๋ถ€์ • ๋ชฉ๋ก: ์•ˆ ๋˜/๋œ/๋ฉ/๋จ/๋ผ/ํ•จ ๋Š” ์ •์ƒ ์šฉ๋ก€(tuning doc 1๊ฑด์—์„œ ์˜คํƒ 4๊ฑด ์ „๋ถ€ ์ด ํ˜•ํƒœ, ๋ณด๊ณ ์น˜ยทn=1ยท๋…๋ฆฝ ์•„๋‹˜). ๊ทธ๋ฆผ/์ฝ”๋“œ ๋ธ”๋ก ์•ˆ์€ ํŽธ์ง‘ ๋Œ€์ƒ ๋ฐ–.
72
+ ("C9 ์•ˆ/๋ชป+๋™์‚ฌ(N3ยทํ›„๋ณดยท๋…ธ์ด์ฆˆ ํผ)", r"(?<![๊ฐ€-ํžฃ])(์•ˆ|๋ชป) (?!(?:๋˜|๋ผ|๋ฉ๋‹ˆ๋‹ค|๋ฉ๋‹ˆ๊นŒ|๋œ๋‹ค|๋œ|๋จ|๋๋‹ค|๋์Šต๋‹ˆ๋‹ค|๋˜๋Š”|๋˜๋‚˜|๋˜๋ฉด|๋ผ์š”|ํ•จ|ํ•จ์œผ๋กœ|ํ•จ์„|ํ•จ์ด|ํ•จ์€|ํ•จ๊ณผ)(?![๊ฐ€-ํžฃ]))[๊ฐ€-ํžฃ]{1,6}", "candidate", "skipfig", "neg=1"),
73
+ ("C10 ๊ตฌ์–ด ์ด์œ  ์–ด๋ฏธ(N4)", r"(๋‹ˆ๊นŒ์š”|๊ณ ์š”|๊ฑฐ๋“ ์š”|๋‹ฌ๋ผ๋„์š”)[*.\s]*(<!--.*)?$"),
74
+ ("C11 ๋‹น์‹ ยทํ•„์š”๋กœ(N5)", r"๋‹น์‹ |ํ•„์š”๋กœ\s*(ํ•ฉ|ํ•˜|ํ•œ)"),
75
+ ("C12 ๋ผํ‹ด ๋’ค ์กฐ์‚ฌ ๋„์–ด์“ฐ๊ธฐ(N9)", r"[A-Za-z0-9)`]\s(๋Š”|์€|์ด|๊ฐ€|์„|๋ฅผ|๋กœ|๋กœ๋Š”|์˜|์—์„œ|์—)(?![๊ฐ€-ํžฃ])", "skipfig"),
76
+ # โ”€โ”€ 2026-10-17 ์ €๋… ์šด์˜์ž ๊ต์ • N14ยทN15. ํ•ฉ์„ฑ์–ด/๋ณตํ•ฉ์–ด๋กœ๋งŒ ์ขํ˜”๋‹ค(์ผ์ƒ์–ด ๊ฒน์นจ์€ ๋ ˆ์ธ์—์„œ ๋บŒ)
77
+ ("C13 ๋‚ด๋ถ€ ํ•ฉ์„ฑ์–ด(N14)", r"๊ณต๊ฒฉ ๋ฐฐํ„ฐ๋ฆฌ|์ด๊ธด ๊ธฐ๋ก|์—ดํ™” ๋ฐฉํ–ฅ ๋ Œ์ฆˆ"),
78
+ ("C14 ์‹œํ—˜โ†’ํ…Œ์ŠคํŠธ ๋ณตํ•ฉ์–ด(N15)", r"(?<![๊ฐ€-ํžฃ])์‹œํ—˜\s?(ํ™˜๊ฒฝ|๊ฒฐ๊ณผ|์ผ€์ด์Šค|์ฝ”๋“œ|์ž๋™ํ™”|ํ•˜๋„ค์Šค|ํ†ต๊ณผ)"),
79
+ # โ”€โ”€ ๊ฒฝ๋™์‚ฌ ยซ๋‚ด๋‹คยป ํ›„๋ณด (S23 ๋ณ€์ข…). ๐ŸŸฅ UNCALIBRATED: ใ€ŒํŒ์ •์„ ๋‚ด๋ฆฌ๋‹คใ€๋Š” ๊ด€์šฉ๊ตฌ๋ผ ยซ๋‚ด๋Š”ยป ๋„ ์ •์ƒ ์šฉ๋ก€๊ฐ€ ๋งŽ๋‹ค โ†’ ๊ณผ์ฐจ๋‹จ์ด ์˜ˆ์ƒ ๊ฒฐ๊ณผ.
80
+ # ํŒ๋ณ„๋ ฅ์„ ์ฃผ์žฅํ•˜์ง€ ์•Š๋Š”๋‹ค. ์žก๋Š” ํ˜•ํƒœ ๋‘˜: ๋”ฐ์˜ดํ‘œ ๋ช…์‚ฌ+๋ฅผ ๋ƒˆ๋‹ค / ํŒ์ •์„ ๋‚ด๋Š”.
81
+ ("C15 ๊ฒฝ๋™์‚ฌ ๋‚ด๋‹ค(ํ›„๋ณดยทUNCALIBRATED)", r"['โ€™โ€ใ€ยปใ€\"`]\s?(์„|๋ฅผ) (๋ƒˆ|๋‚ธ|๋‚ด๋Š”|๋‚ผ|๋ƒ…)|ํŒ์ •์„ (๋ƒˆ|๋‚ธ|๋‚ด๋Š”|๋‚ผ|๋ƒ…)", "candidate", "uncalibrated", "neg=1"),
82
+ # โ”€โ”€ S7 ๋‚ด๋ถ€ ์กฐ์–ด ํ›„๋ณด ์ถ”์ถœ๊ธฐ (ํ•จ์ˆ˜ lane โ€” ์ค„ ํŒจํ„ด์ด ์•„๋‹ˆ๋ผ ๋ฌธ์„œ ์ „์ฒด๋ฅผ ๋ณธ๋‹ค)
83
+ ("C16 ๋‚ด๋ถ€ ์กฐ์–ด ํ›„๋ณด(S7ยทํ›„๋ณด)", None, "s7"),
62
84
  ]
63
85
 
86
+ # โ”€โ”€ ์ค„ ํ•„ํ„ฐ: ๊ทธ๋ฆผ/์ฐจํŠธ ๋ธ”๋กยท์ฝ”๋“œ ํŽœ์Šค ์•ˆ์˜ ์ค„์€ ํŽธ์ง‘ ๋Œ€์ƒ์ด ์•„๋‹ˆ๋‹ค (lane 4๋ฒˆ์งธ ์ธ์ž "skipfig")
87
+ # ์ƒํƒœ๊ธฐ๊ณ„๋‹ค: ํŽœ์Šค๋Š” ``` ์™€ ~~~ ๋ฅผ ๋”ฐ๋กœ ๋‹ซ๊ณ , [๊ทธ๋ฆผ: โ€ฆ] ์€ ๋Œ€๊ด„ํ˜ธ ๊นŠ์ด๋กœ ๋‹ซ๋Š”๋‹ค(`[๊ทธ๋ฆผ: x[0] y]` ๊ฐ€ ์ผ์ฐ ์•ˆ ๋‹ซํžŒ๋‹ค).
88
+ # ๐ŸŸฅ ์•ˆ ๋‹ซํžŒ ๋ธ”๋ก์€ EOF ๊นŒ์ง€ ๋ฌธ์„œ๋ฅผ ์‚ผํ‚จ๋‹ค โ†’ ํ†ต๊ณ„์— open_fence/open_fig ๋กœ ๋‚จ๊ธฐ๊ณ  scan ๋ชจ๋“œ๊ฐ€ ๊ฒฝ๊ณ  + ๋น„0 ์ข…๋ฃŒ.
89
+ FIG_OPEN = re.compile(r"\[(?:๊ทธ๋ฆผ|์ฐจํŠธ):")
90
+
91
+
92
+ class Blocks(object):
93
+ def __init__(self):
94
+ self.fence = None # "`" | "~" | None
95
+ self.fence_line = 0
96
+ self.depth = 0 # [๊ทธ๋ฆผ: ๋Œ€๊ด„ํ˜ธ ๊นŠ์ด
97
+ self.fig_line = 0
98
+ self.total = self.skipped = 0
99
+
100
+
101
+ def _strip(line, st, n):
102
+ """st ์ƒํƒœ๋กœ line ์„ ๋„๋ ค๋‚ธ ๋‚˜๋จธ์ง€๋ฅผ ๋Œ๋ ค์ค€๋‹ค."""
103
+ ls = line.lstrip()
104
+ if st.fence:
105
+ if ls.startswith(st.fence * 3):
106
+ st.fence = None
107
+ return ""
108
+ if st.depth == 0 and (ls.startswith("```") or ls.startswith("~~~")):
109
+ st.fence, st.fence_line = ls[0], n
110
+ return ""
111
+ out, pos = [], 0
112
+ while True:
113
+ if st.depth > 0:
114
+ while pos < len(line) and st.depth > 0:
115
+ if line[pos] == "[":
116
+ st.depth += 1
117
+ elif line[pos] == "]":
118
+ st.depth -= 1
119
+ pos += 1
120
+ if st.depth > 0:
121
+ return "".join(out)
122
+ m = FIG_OPEN.search(line, pos)
123
+ if not m:
124
+ out.append(line[pos:])
125
+ return "".join(out)
126
+ out.append(line[pos:m.start()])
127
+ st.depth, st.fig_line, pos = 1, n, m.end()
128
+
129
+
130
+ def iter_lines(lines, skipfig, st):
131
+ for i, raw in enumerate(lines, 1):
132
+ line = raw.rstrip("\n")
133
+ st.total += 1
134
+ if skipfig:
135
+ kept = _strip(line, st, i)
136
+ if kept != line:
137
+ st.skipped += 1
138
+ line = kept
139
+ yield i, line
140
+
141
+
142
+ def read_lines(path):
143
+ with open(path, encoding="utf-8") as fh:
144
+ return fh.read().split("\n")
145
+
146
+
147
+ def scan_lines(path, skipfig=False, st=None):
148
+ """(์ค„๋ฒˆํ˜ธ, ์ค„) ๋ฅผ ๋‚ธ๋‹ค. skipfig ๋ฉด ํŽœ์Šค ยท [๊ทธ๋ฆผ:/์ฐจํŠธ: โ€ฆ] ๋ธ”๋ก(์—ฌ๋Ÿฌ ์ค„ ํฌํ•จ)์„ ์ค„์—์„œ ๋„๋ ค๋‚ธ๋‹ค. ํ†ต๊ณ„๋Š” st ์—."""
149
+ return iter_lines(read_lines(path), skipfig, st or Blocks())
150
+
151
+
152
+ def unclosed(st):
153
+ out = []
154
+ if st.fence:
155
+ out.append("code fence (%s) opened at line %d" % (st.fence * 3, st.fence_line))
156
+ if st.depth > 0:
157
+ out.append("[๊ทธ๋ฆผ:/์ฐจํŠธ: block opened at line %d" % st.fig_line)
158
+ return out
159
+
160
+
161
+ # โ”€โ”€ S7 ํ›„๋ณด ์ถ”์ถœ๊ธฐ. ๋‚ฑ๋ง ํŒ์ •์ด ์•„๋‹ˆ๋ผ ยซ์ฒซ ๋“ฑ์žฅ์— ํ’€์ด๊ฐ€ ์žˆ๋‚˜ยป ๋งŒ ๋ณธ๋‹ค. ํžˆํŠธ๋Š” ์ „๋ถ€ ํ›„๋ณด.
162
+ # ๋„๋ฆฌ ์•Œ๋ ค์ง„ ์•ฝ์–ด๋Š” ๋…์ž์ธต์— ๋”ฐ๋ผ ๋‹ค๋ฅด๋‹ค โ€” ๊ธฐ๋ณธ ๋ชฉ๋ก์€ ๊ธฐ์ˆ  ๋…์ž ๊ธฐ์ค€์ด๊ณ  ๋ฌธ์„œ๋งˆ๋‹ค ๊ณ ์ณ๋ผ(๋…์ž์ธต ๋ˆˆ๊ธˆ์ด ๋จผ์ €).
163
+ # `--scan FILE --s7-common LIST` ๋กœ ํ†ต์งธ ๊ต์ฒดํ•œ๋‹ค(์ค„๋‹น ํ•˜๋‚˜, # ์ฃผ์„). ๊ธฐ๋ณธ ๋ชฉ๋ก์€ ๊ณ ์ •์ด๊ณ  ํ”ฝ์Šค์ฒ˜๊ฐ€ ํ•ญ๋ชฉ ํ•˜๋‚˜(MCP)๋ฅผ ๋ชป ๋ฐ•๋Š”๋‹ค.
164
+ S7_COMMON = {"AI", "API", "URL", "HTTP", "HTTPS", "JSON", "YAML", "CLI", "CI", "CD", "PR", "UI", "UX",
165
+ "LLM", "SQL", "HTML", "CSS", "OS", "ID", "QA", "PDF", "CPU", "GPU", "UTF", "SDK", "MCP"}
166
+ ACRO = re.compile(r"(?<![A-Za-z0-9])[A-Z]{2,}[A-Z0-9]*(?![A-Za-z])")
167
+ HEADING = re.compile(r"^\s{0,3}#{1,6}\s")
168
+ COMMENT = re.compile(r"<!--.*?-->", re.S)
169
+
170
+
171
+ def has_gloss(term, line, heading):
172
+ """์ฒซ ๋“ฑ์žฅ ์ค„์— ํ’€์ด๊ฐ€ ์žˆ๋‚˜. ๊ด„ํ˜ธ ํ’€์ด TERM(ํ•œ๊ธ€โ€ฆ) / ํ•œ๊ธ€(TERM) / TERM = / TERM์€ยท๋Š” โ€ฆ ์ž…๋‹ˆ๋‹ค.
173
+ ์ œ๋ชฉ ์ค„์€ ยซ์ œ๋ชฉ ์•ˆ์—ยป ํ’€์ด๊ฐ€ ์žˆ์–ด์•ผ ํ•œ๋‹ค โ€” ๋’ค ๋ณธ๋ฌธ์˜ ์ •์˜๋Š” ยซ์ •์˜ ์ „์— ์ œ๋ชฉ์— ์ผ๋‹คยป ๋ฅผ ์ง€์šฐ์ง€ ์•Š๋Š”๋‹ค."""
174
+ t = re.escape(term)
175
+ if re.search(t + r"\s?\([^)]*[๊ฐ€-ํžฃ][^)]*\)", line):
176
+ return True
177
+ if re.search(t + r"\s?\(\s?[A-Za-z][A-Za-z-]+(\s+[A-Za-z-]+)+\s?\)", line): # CORS(Cross-Origin Resource Sharing) โ€” ์˜๋ฌธ ํ’€์ด๋„ ํ’€์ด๋‹ค(2์ถ• ๋ฆฌ๋ทฐ B3)
178
+ return True
179
+ if re.search(r"[๊ฐ€-ํžฃ][๊ฐ€-ํžฃ ]{1,30}\(\s?" + t + r"\s?\)", line):
180
+ return True
181
+ if re.search(t + r"\s?=\s?(?![0-9])", line): # TTL=60 ์€ ๊ฐ’์ด์ง€ ํ’€์ด๊ฐ€ ์•„๋‹ˆ๋‹ค
182
+ return True
183
+ # ์ •์˜ํ˜•: ยซTERM์ด๋ž€/๋ž€ โ€ฆยป, ๋œปยท์•ฝ์žยท์ค„์ž„๋ง์„ ๋งํ•˜๋Š” ยซTERM์€/๋Š” โ€ฆยป, ๋˜๋Š” ์„ค๋ช…์ด 6์ž ์ด์ƒ์ธ ยซTERM์€/๋Š” โ€ฆ ์ž…๋‹ˆ๋‹คยป
184
+ # (ยซRBAC์€ ํ•„์ˆ˜์ž…๋‹ˆ๋‹คยป ์ฒ˜๋Ÿผ ์ˆ ์–ด๊ฐ€ ์งง์œผ๋ฉด ์ •์˜๊ฐ€ ์•„๋‹ˆ๋‹ค โ€” 2์ถ• ๋ฆฌ๋ทฐ B3. ์˜๋ฏธ ํŒ์ •์ด๋ผ ํ›„๋ณด ๋ ˆ์ธ์˜ ์ ˆ์ถฉ์ด๋‹ค)
185
+ if not heading and (re.search(t + r"(์ด๋ž€|๋ž€)\s", line)
186
+ or re.search(t + r"(์€|๋Š”)[^.]{0,60}(์•ฝ์ž|์ค„์ž„๋ง|๋œปํ•ฉ๋‹ˆ๋‹ค|๋œปํ•œ๋‹ค|์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค|์˜๋ฏธํ•œ๋‹ค|๋งํ•ฉ๋‹ˆ๋‹ค|๊ฐ€๋ฆฌํ‚ต๋‹ˆ๋‹ค|๊ฐ€๋ฆฌํ‚จ๋‹ค)", line)
187
+ or re.search(t + r"(์€|๋Š”)\s[^.]{6,60}(์ž…๋‹ˆ๋‹ค|์ด๋‹ค)", line)):
188
+ return True
189
+ return False
190
+
191
+
192
+ def load_common(path):
193
+ with open(path, encoding="utf-8") as fh:
194
+ return {l.split("#")[0].strip() for l in fh if l.split("#")[0].strip()}
195
+
196
+
197
+ def s7_candidates(path, common=None, st=None):
198
+ """[(์šฉ์–ด, ์ค„๋ฒˆํ˜ธ, ์ข…๋ฅ˜)] โ€” ์ข…๋ฅ˜: heading-before-gloss(์ œ๋ชฉ ์ฒซ ๋“ฑ์žฅยท์ œ๋ชฉ ์•ˆ ํ’€์ด ์—†์Œ) ยท unglossed-first-use.
199
+ ๋‹ค๋ฅธ ๋ ˆ์ธ๊ณผ ๊ฐ™์€ ๋ธ”๋ก ํ•„ํ„ฐ(ํŽœ์Šคยท๊ทธ๋ฆผ)๋ฅผ ์“ด๋‹ค."""
200
+ common = S7_COMMON if common is None else common
201
+ text = open(path, encoding="utf-8").read()
202
+ text = COMMENT.sub(lambda m: re.sub(r"[^\n]", " ", m.group(0)), text) # ์ค„๋ฒˆํ˜ธ ๋ณด์กด
203
+ seen, out = set(), []
204
+ for i, line in iter_lines(text.split("\n"), True, st or Blocks()):
205
+ heading = bool(HEADING.match(line))
206
+ # ์ฝ”๋“œ ์ŠคํŒฌ ยท URL ์•ˆ์˜ ๋Œ€๋ฌธ์ž๋Š” ๋…์ž ์–ดํœ˜๊ฐ€ ์•„๋‹ˆ๋‹ค(2์ถ• ๋ฆฌ๋ทฐ B2) โ€” ๊ฐ™์€ ๊ธธ์ด์˜ ๊ณต๋ฐฑ์œผ๋กœ ์ง€์›Œ ์œ„์น˜๋ฅผ ๋ณด์กดํ•œ๋‹ค
207
+ scan = re.sub(r"`[^`]*`|https?://\S+", lambda mm: " " * len(mm.group(0)), line)
208
+ for m in ACRO.finditer(scan):
209
+ term = m.group(0)
210
+ if term in seen or term in common or term.rstrip("0123456789") in common: # HTTP2 โ†’ HTTP
211
+ continue
212
+ seen.add(term)
213
+ if not has_gloss(term, line, heading):
214
+ out.append((term, i, "heading-before-gloss" if heading else "unglossed-first-use"))
215
+ return out
216
+
217
+
64
218
  # ์ ˆ๋Œ€ ์žกํžˆ๋ฉด ์•ˆ ๋˜๋Š” ํ† ํฐ โ€” ใ€Œ๋Š˜ ์žก๋Š”๋‹คใ€๋ฅผ ๋‚ด๋Š” ์ฃฝ์€ ๊ณ„๊ธฐ ๋ฐฐ์ œ์šฉ
65
219
  NEVER = r"ZZZ_absent_token_ZZZ"
66
220
 
67
221
 
68
- def count(path, pattern):
222
+ def count(path, pattern, skipfig=False):
69
223
  """ํŒจํ„ด์— ๋งค์นญ๋˜๋Š” **์ค„ ์ˆ˜**. ํŒŒ์ผ ๋ถ€์žฌ๋Š” ์˜ˆ์™ธ๋กœ ์˜ฌ๋ฆฐ๋‹ค(๋ฌด์Œ 0 ๊ธˆ์ง€)."""
70
224
  rx = re.compile(pattern, re.MULTILINE)
71
- n = 0
72
- with open(path, encoding="utf-8") as fh:
73
- for line in fh:
74
- if rx.search(line.rstrip("\n")):
75
- n += 1
76
- return n
225
+ return sum(1 for _, line in scan_lines(path, skipfig) if rx.search(line))
226
+
227
+
228
+ def scan(path, common=None):
229
+ """๋ฌธ์„œ ์Šค์บ” ๋ชจ๋“œ: ์ „ ๋ ˆ์ธ(+S7)์„ ๊ฐ™์€ ํ•„ํ„ฐ๋กœ ๋Œ๋ ค (rows, stats) ๋ฅผ ๋‚ธ๋‹ค โ€” ๋ ˆ์ธ ์ •์˜์˜ ๋‹จ์ผ ์†Œ์Šค.
230
+ stats = ๋ ˆ์ธ๋ณ„ Blocks ์ค‘ skipfig ๋ ˆ์ธ์˜ ๊ฒƒ(๋ชจ๋“  skipfig ๋ ˆ์ธ์ด ๊ฐ™์€ ์ƒํƒœ๊ธฐ๊ณ„๋ผ ํ•˜๋‚˜๋ฉด ์ถฉ๋ถ„)."""
231
+ rows, st = [], Blocks()
232
+ for lane in LANES:
233
+ label, pat, flags = lane[0], lane[1], lane[2:]
234
+ if "s7" in flags:
235
+ for term, i, kind in s7_candidates(path, common):
236
+ rows.append((label, i, "%s [%s]" % (term, kind)))
237
+ continue
238
+ rx = re.compile(pat)
239
+ sk = "skipfig" in flags
240
+ lst = Blocks()
241
+ for i, line in scan_lines(path, sk, lst):
242
+ if rx.search(line):
243
+ rows.append((label, i, line.strip()))
244
+ if sk:
245
+ st = lst
246
+ return rows, st
247
+
248
+
249
+ def scan_main(args):
250
+ """--scan FILE [--s7-common LIST]. ์ž…๋ ฅ ์˜ค๋ฅ˜๋Š” stderr + 10, ์•ˆ ๋‹ซํžŒ ๋ธ”๋ก์€ ๊ฒฝ๊ณ  + 3."""
251
+ path = common_path = None
252
+ it = iter(args)
253
+ for a in it:
254
+ if a == "--s7-common":
255
+ common_path = next(it, None)
256
+ if not common_path:
257
+ sys.stderr.write("usage error: --s7-common needs a file\n")
258
+ return 10
259
+ elif path is None and not a.startswith("--"):
260
+ path = a
261
+ else:
262
+ sys.stderr.write("usage: ko_tech_writer_calibrate.py --scan FILE [--s7-common LIST]\n")
263
+ return 10
264
+ if path is None:
265
+ sys.stderr.write("usage: ko_tech_writer_calibrate.py --scan FILE [--s7-common LIST]\n")
266
+ return 10
267
+ try:
268
+ common = load_common(common_path) if common_path else None
269
+ rows, st = scan(path, common)
270
+ except (OSError, UnicodeDecodeError) as e:
271
+ sys.stderr.write("harness error: cannot scan %s: %s\n" % (path, e))
272
+ return 10
273
+ print("scanned: %s %d lines" % (path, st.total))
274
+ print("s7-common: %s (%d entries)" % (common_path or "default", len(common if common is not None else S7_COMMON)))
275
+ print("skipped: %d lines (fence/fig); filter applies to C7, C9, C12, C16 only" % st.skipped)
276
+ for label, i, text in rows:
277
+ print("%d\t%s\t%s" % (i, label, text[:200]))
278
+ bad = unclosed(st)
279
+ if bad:
280
+ for b in bad:
281
+ sys.stderr.write("WARNING unclosed block at EOF: %s -- everything after it was skipped; C7/C9/C12/C16 results are NOT valid\n" % b)
282
+ return 3
283
+ return 0
77
284
 
78
285
 
79
286
  def main():
287
+ if len(sys.argv) > 1:
288
+ if sys.argv[1] == "--scan":
289
+ return scan_main(sys.argv[2:])
290
+ sys.stderr.write("usage: ko_tech_writer_calibrate.py [--scan FILE [--s7-common LIST]]\n")
291
+ return 10
80
292
  for p in (POS, NEG):
81
293
  if not os.path.isfile(p):
82
294
  sys.stderr.write("harness error: fixture missing %s\n" % p)
@@ -89,10 +301,51 @@ def main():
89
301
  print("")
90
302
 
91
303
  npass = nfail = 0
92
- for label, pat in LANES:
93
- p = count(POS, pat)
94
- n = count(NEG, pat)
95
- if p >= 1 and n == 0:
304
+ ncand = []
305
+ for lane in LANES:
306
+ label, pat, flags = lane[0], lane[1], lane[2:]
307
+ candidate = "candidate" in flags
308
+ if candidate or "s7" in flags:
309
+ ncand.append(label.split()[0] + (" UNCALIBRATED" if "uncalibrated" in flags else ""))
310
+ if "s7" in flags:
311
+ p, n = len(s7_candidates(POS)), len(s7_candidates(NEG))
312
+ if p >= 1 and n == 0:
313
+ print("OK %s -- CANDIDATE-ONLY: positive %d / negative 0 (discriminates the constructed pair; "
314
+ "precision on real documents UNMEASURED, hits need per-case judgment)" % (label, p))
315
+ npass += 1
316
+ else:
317
+ print("FAIL %s -- positive %d / negative %d (needs positive >= 1 and negative 0)" % (label, p, n))
318
+ nfail += 1
319
+ continue
320
+ sk = "skipfig" in flags
321
+ p = count(POS, pat, sk)
322
+ n = count(NEG, pat, sk)
323
+ want = [int(f[4:]) for f in flags if f.startswith("neg=")]
324
+ if want and n != want[0]:
325
+ # ํ›„๋ณด ๋ ˆ์ธ๋„ ์Œ์„ฑ ์ˆ˜๋Š” ๊ณ ์ •ํ•œ๋‹ค: ๋ฌธ์„œํ™”๋œ ๊ณผ์ฐจ๋‹จ ์ค„ ยซ๋งŒยป ๊ฑธ๋ ค์•ผ ํ•œ๋‹ค. ์ƒˆ ์˜คํƒ(๋˜๋Š” ๋ถ€์ • ๋ชฉ๋ก ์†Œ์‹ค)์ด ยซ์˜ˆ์ƒ๋œ ๊ณผ์ฐจ๋‹จยป ์— ๋ฌปํžˆ์ง€ ์•Š๊ฒŒ.
326
+ print("FAIL %s -- negative count %d != documented over-block %d (a new false alarm, or the exclusion was lost)"
327
+ % (label, n, want[0]))
328
+ nfail += 1
329
+ elif "uncalibrated" in flags:
330
+ if p >= 1 and n >= 1:
331
+ print("OK %s -- UNCALIBRATED CANDIDATE: positive %d / negative %d (idiom over-block shown; "
332
+ "no discrimination claimed)" % (label, p, n))
333
+ npass += 1
334
+ else:
335
+ print("FAIL %s -- uncalibrated candidate lane lost its positive or its documented over-block "
336
+ "(positive %d / negative %d)" % (label, p, n))
337
+ nfail += 1
338
+ elif candidate:
339
+ # ํ›„๋ณด ์ „์šฉ ๋ ˆ์ธ: ์ •์ƒ ์šฉ๋ก€๋ฅผ ์žก๋Š” ๊ณผ์ฐจ๋‹จ์ด **์˜ˆ์ƒ๋œ ๊ฒฐ๊ณผ**๋‹ค. ํŒ๋ณ„(discriminates)์„ ์ฃผ์žฅํ•˜์ง€ ์•Š๋Š”๋‹ค.
340
+ if p >= 1 and n >= 1:
341
+ print("OK %s -- CANDIDATE-ONLY: positive %d / negative %d (expected over-block; "
342
+ "does NOT discriminate, hits need per-case judgment)" % (label, p, n))
343
+ npass += 1
344
+ else:
345
+ print("FAIL %s -- candidate lane lost its documented over-block or positive "
346
+ "(positive %d / negative %d)" % (label, p, n))
347
+ nfail += 1
348
+ elif p >= 1 and n == 0:
96
349
  print("OK %s -- positive %d / negative 0 (discriminates)" % (label, p))
97
350
  npass += 1
98
351
  elif p < 1:
@@ -103,6 +356,23 @@ def main():
103
356
  % (label, n))
104
357
  nfail += 1
105
358
 
359
+ # ๋ธ”๋ก ํ•„ํ„ฐ ๋ ˆ์ธ โ€” ์•ˆ ๋‹ซํžŒ [๊ทธ๋ฆผ: ์ด ยซ๋ณด๊ณ ยป ๋˜๋Š”๊ฐ€(์–‘์„ฑ ํ”ฝ์Šค์ฒ˜) ยท ์ •์ƒ ํ”ฝ์Šค์ฒ˜(~~~ ํŽœ์Šคยท์ค‘์ฒฉ ๋Œ€๊ด„ํ˜ธ ํฌํ•จ)๋Š” ๋‹ซํžŒ ์ฑ„ ๋๋‚˜๋Š”๊ฐ€
360
+ if not os.path.isfile(UNC):
361
+ print("FAIL BLOCK unclosed fixture missing -- %s" % UNC)
362
+ nfail += 1
363
+ else:
364
+ su, sn = Blocks(), Blocks()
365
+ list(scan_lines(UNC, True, su))
366
+ list(scan_lines(NEG, True, sn))
367
+ if unclosed(su) and not unclosed(sn) and sn.skipped >= 1:
368
+ print("OK BLOCK unclosed-block report -- positive: %s / negative: closed, %d lines skipped (discriminates)"
369
+ % ("; ".join(unclosed(su)), sn.skipped))
370
+ npass += 1
371
+ else:
372
+ print("FAIL BLOCK unclosed-block report -- positive %r / negative %r (skipped %d)"
373
+ % (unclosed(su), unclosed(sn), sn.skipped))
374
+ nfail += 1
375
+
106
376
  # META ์ปจํŠธ๋กค 1 โ€” ์—†๋Š” ํ† ํฐ์ด ์–‘์ชฝ ๋‹ค 0์ธ๊ฐ€ (๊ณ„๊ธฐ๊ฐ€ ยซ๋Š˜ ์žก๋Š”๋‹คยป ๋ฅผ ๋‚ด์ง€ ์•Š๋Š”๋‹ค)
107
377
  if count(POS, NEVER) == 0 and count(NEG, NEVER) == 0:
108
378
  print("OK META control -- an absent token matches nothing in either fixture")
@@ -122,9 +392,12 @@ def main():
122
392
 
123
393
  print("")
124
394
  if nfail == 0:
125
- print("CALIBRATED (%d lanes) -- Step 2 five classes + Step 4-b two patterns discriminate."
126
- % npass)
395
+ ndisc = npass - len(ncand)
396
+ print("CALIBRATED (%d discriminating incl. 2 meta controls; %d candidate-only: %s) -- Step 2 classes + Step 4-b discriminate; candidate lanes do not."
397
+ % (ndisc, len(ncand), ", ".join(ncand)))
127
398
  print(" NOT proven: 'zero residue' in any real document. That is measured per document.")
399
+ print(" C7-C12 positives are the harvest's own 'before' sentences (re-built short); C13-C14 positives are constructed (no harvest pair), so")
400
+ print(" false-positive rate on out-of-distribution text is UNMEASURED. C9 over-blocks by design.")
128
401
  print(" Citing this suite as evidence of 'zero residue' reproduces the very downgrade")
129
402
  print(" recorded in harness_terminal_correlation_and_recommendations.md.")
130
403
  return 0
@@ -39,6 +39,11 @@ 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-10-19 โ€” cartridge admission checker and its lanes. Not shipped yet on purpose: publishing cartridges
43
+ # (fh-cartridges) is an open operator decision, and shipping the checker would put it in the next npm
44
+ # release by default. selfcheck resolves its row as SKIP (ยซnot in files[], and absentยป) on a consumer tree.
45
+ "scripts/cartridge_admit.py"
46
+ "scripts/test_cartridge_admit_lanes.sh"
42
47
  # ๐ŸŸฅ 2026-09-21 (์•ผ๊ฐ„) โ€” ์ •์ฑ…๋ Œ์ฆˆ ์ฑ„์ ๊ธฐ์™€ ๊ทธ ๋ ˆ์ธ. **FH ์ž๊ธฐ ์—ฐ๊ตฌ์˜ ์‹คํ—˜ ๊ธฐ๋ก**์ด์ง€ ์†Œ๋น„์ž
43
48
  # ๋Šฅ๋ ฅ์ด ์•„๋‹ˆ๋‹ค: ํŒ์ • ๋Œ€์ƒ์ด `scripts/fixtures/policy_lens_knownpair_2026-09-21/` ์•ˆ์˜
44
49
  # 1์ฐจ ๋Ÿฐ 48๊ฐœ ํŒŒ์ผ(236K)์ด๊ณ , ๊ทธ๊ฒƒ๊นŒ์ง€ ์‹ค์–ด ๋ณด๋‚ด๋ฉด ์•„๋ฌด๋„ ์•ˆ ์“ฐ๋Š” ์‹คํ—˜ ์•„์นด์ด๋ธŒ๊ฐ€ ํŒจํ‚ค์ง€
@@ -69,6 +69,8 @@
69
69
  # bash scripts/probe_live_eval.sh --ids G-GREET-01,G-TRIG-02 --model sonnet
70
70
  # bash scripts/probe_live_eval.sh --subset 3
71
71
  # bash scripts/probe_live_eval.sh --subset 3 --report-out /tmp/spot.md # spot-check: keep the nightly record untouched
72
+ # bash scripts/probe_live_eval.sh --target G-TRIG-02 --before tracks/_meta/live_eval_2026-10-16.md
73
+ # # after a repair aimed at one probe: target reported apart from the other probes, before/after
72
74
  # bash scripts/probe_live_eval.sh # full selected set โ€” nightly cron shape
73
75
  #
74
76
  # PORTABILITY: bash 3.2 (macOS) + bash 5.x (Linux CI). No associative arrays, no `${var,,}`,
@@ -140,6 +142,8 @@ SUBSET=""
140
142
  IDS=""
141
143
  OUTDIR=""
142
144
  REPORT_OUT="" # --report-out: where the markdown report lands (default: tracks/_meta/live_eval_<date>.md)
145
+ TARGET="" # --target <probe-id>: report that probe apart from the rest (record only; default output unchanged)
146
+ BEFORE="" # --before <prior live_eval .md>: the "before" side of the --target split
143
147
  NO_EVIDENCE=0 # --no-evidence: skip the preserved-artifact copy (lanes / throwaway spot-checks)
144
148
  while [ $# -gt 0 ]; do
145
149
  case "$1" in
@@ -151,6 +155,8 @@ while [ $# -gt 0 ]; do
151
155
  --out) OUTDIR="${2:-}"; shift 2 ;;
152
156
  --report-out) REPORT_OUT="${2:-}"; shift 2 ;; # lanes/spot-checks MUST pass this โ€” never the live path
153
157
  --no-evidence) NO_EVIDENCE=1; shift ;;
158
+ --target) TARGET="${2:-}"; shift 2 ;;
159
+ --before) BEFORE="${2:-}"; shift 2 ;;
154
160
  *) echo "unknown flag: $1" >&2; exit 2 ;;
155
161
  esac
156
162
  done
@@ -198,6 +204,15 @@ if [ "$SELECTED_COUNT" -eq 0 ]; then
198
204
  exit 2
199
205
  fi
200
206
 
207
+ # --target must name a probe that is actually in this run: a typo would otherwise burn the whole
208
+ # live run and only fail at report time.
209
+ if [ -n "$TARGET" ] && ! grep -qxF -- "$TARGET" "$SPEC_DIR/selected_ids.txt"; then
210
+ echo "โŒ --target '$TARGET' is not among the selected probes (see SELECTED above) โ€” refusing before any live call." >&2
211
+ rm -rf "$WORKDIR"
212
+ exit 2
213
+ fi
214
+ [ -z "$BEFORE" ] || [ -n "$TARGET" ] || { echo "โŒ --before only makes sense with --target" >&2; rm -rf "$WORKDIR"; exit 2; }
215
+
201
216
  # `claude` presence is the REAL runner's preflight, so it is checked only on that path. Under
202
217
  # FH_SIM_RUNNER_BIN the stub owns its own preflight โ€” measured 2026-09-05 on CI (ubuntu, no
203
218
  # `claude` installed): this line fired BEFORE the stub was ever called, so FF2/FF3/FF4/FF6 went
@@ -336,7 +351,10 @@ echo ""
336
351
  # default overwrote a real night's distribution once (2026-09-05 10:18: test_probe_live_eval_lanes.sh FF4
337
352
  # ran the real script with a stub runner and replaced the 02:30 report). Lanes pass --report-out.
338
353
  REPORT_PATH="${REPORT_OUT:-$REPO_ROOT/tracks/_meta/live_eval_${RUN_DATE}.md}"
339
- python3 "$LIB" score \
354
+ SCORE_EXTRA=()
355
+ [ -n "$TARGET" ] && SCORE_EXTRA+=(--target "$TARGET")
356
+ [ -n "$BEFORE" ] && SCORE_EXTRA+=(--before "$BEFORE")
357
+ python3 "$LIB" score ${SCORE_EXTRA[@]+"${SCORE_EXTRA[@]}"} \
340
358
  --probes-live "$PROBES_LIVE" \
341
359
  --select-json "$SELECT_JSON" \
342
360
  --ids-file "$SPEC_DIR/selected_ids.txt" \