@chrono-meta/fh-gate 3.44.0 → 3.45.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/rules/fh_4axis_gate.md +50 -608
- package/.claude-plugin/marketplace.json +4 -4
- package/CATALOG.md +21 -0
- package/CHEATSHEET.md +7 -1
- package/docs/codex-compat.md +1 -1
- package/knowledge/shared/harness-core/fh_4axis_gate_detail.md +679 -0
- package/knowledge/shared/harness-core/fh_integration_contract.md +1 -1
- package/knowledge/shared/harness-core/fh_module_contract.md +106 -3
- package/knowledge/shared/harness-core/heavy_skill_to_cartridge.md +185 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +209 -0
- package/package.json +17 -1
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-commons/skills/ko-tech-writer/SKILL.md +9 -8
- package/plugins/fh-commons/skills/ko-tech-writer/SKILL_detail.md +20 -0
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +95 -0
- package/plugins/fh-meta/skills/auto-decorrelation/SKILL.md +13 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL_detail.md +4 -0
- package/plugins/fh-meta/skills/steel-quench/SKILL_detail.md +2 -1
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/agy_launch_guard.sh +117 -1
- package/scripts/below_floor_scan.sh +30 -0
- package/scripts/codex_launch_guard.sh +38 -2
- package/scripts/correction_moments.py +23 -2
- package/scripts/fh-gate.sh +612 -14
- package/scripts/fh-goal.sh +56 -12
- package/scripts/fh-run.sh +1 -1
- package/scripts/fh_gate_exec.sh +272 -0
- package/scripts/fh_session_load.sh +17 -0
- package/scripts/finding_fleet.sh +2 -1
- package/scripts/finding_verifier.sh +2 -1
- package/scripts/fixtures/heavy_skill_smell/clean/tidy-notes/README.md +16 -0
- package/scripts/fixtures/heavy_skill_smell/clean/tidy-notes/scripts/check_refs.py +12 -0
- package/scripts/fixtures/heavy_skill_smell/clean/tidy-notes/scripts/test_check_refs.py +24 -0
- package/scripts/fixtures/heavy_skill_smell/clean/tidy-notes/skills/tidy-notes/SKILL.md +16 -0
- package/scripts/fixtures/heavy_skill_smell/clean/tidy-notes/skills/tidy-notes/fh-module.yaml +20 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/docs-publisher-pro/SKILL.md +25 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/docs-publisher-pro/hooks/hooks.json +7 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/docs-publisher-pro/scripts/check_links.py +25 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/docs-publisher-pro/scripts/publish.sh +9 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/docs-publisher-pro/scripts/publish_guard.py +6 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/docs-publisher-pro/scripts/setup.sh +5 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/release-notes-pro/SKILL.md +25 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/release-notes-pro/hooks/hooks.json +10 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/release-notes-pro/scripts/check_refs.py +12 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/release-notes-pro/scripts/guard_push.py +9 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/release-notes-pro/scripts/install.sh +6 -0
- package/scripts/fixtures/heavy_skill_smell/heavy/release-notes-pro/scripts/ship.sh +9 -0
- package/scripts/heavy_skill_smell.py +311 -0
- package/scripts/job_heartbeat.py +186 -0
- package/scripts/live_eval_matrix.py +128 -0
- package/scripts/live_eval_trace.py +176 -1
- package/scripts/package_coverage_check.sh +18 -0
- package/scripts/prepush_guard_check.sh +8 -0
- package/scripts/probe_live_eval.sh +32 -0
- package/scripts/probe_live_eval_lib.py +8 -2
- package/scripts/selfcheck.sh +111 -0
- package/scripts/selfcheck_shard_weights.txt +2 -0
- package/scripts/sidecar_calibrate.sh +7 -5
- package/scripts/sim_isolated_run.sh +20 -0
- package/scripts/test_agy_launch_guard_lanes.sh +120 -0
- package/scripts/test_below_floor_scan_lanes.sh +85 -0
- package/scripts/test_codex_launch_guard_lanes.sh +45 -0
- package/scripts/test_correction_moments_lanes.sh +37 -0
- package/scripts/test_fh_gate_absorb_lanes.sh +255 -0
- package/scripts/test_fh_gate_defaults_lanes.sh +169 -0
- package/scripts/test_fh_gate_exec_lanes.sh +244 -0
- package/scripts/test_fh_gate_fusion_lanes.sh +202 -0
- package/scripts/test_fh_gate_regressions.sh +92 -1
- package/scripts/test_fh_goal_change_detection_lanes.sh +103 -3
- package/scripts/test_finding_pipeline_lanes.sh +35 -1
- package/scripts/test_guard_anchor_override_env_lanes.sh +84 -0
- package/scripts/test_heavy_skill_smell_lanes.sh +160 -0
- package/scripts/test_job_heartbeat_lanes.sh +96 -0
- package/scripts/test_live_eval_construct_lanes.sh +29 -6
- package/scripts/test_live_eval_matrix_lanes.sh +53 -0
- package/scripts/test_live_eval_trace_lanes.sh +112 -5
- package/scripts/test_name_boundary_locale_lanes.sh +36 -5
- package/scripts/test_prepush_marker_lookup_lanes.sh +143 -0
- package/scripts/test_probe_live_eval_lanes.sh +43 -0
- package/scripts/test_regression_guard_sibling_lanes.sh +52 -1
- package/scripts/test_sidecar_calibrate_lanes.sh +1 -1
- package/scripts/test_sim_isolated_run_lanes.sh +43 -0
- package/scripts/universal_guard_check.sh +8 -0
- package/templates/.claude/rules/mcp_tool_gating.md +27 -0
- package/templates/.git-hooks/pre-push +60 -3
- package/templates/regression_guard.sh +8 -4
- package/templates/settings.LaneGap.snippet.json +27 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""live_eval_matrix.py — per-probe verdicts across every nightly live-eval report, read once.
|
|
3
|
+
|
|
4
|
+
Why (frontier digest 2026-11-12, arXiv:2611.13709): a pooled pass rate such as 0.8 can hide a
|
|
5
|
+
probe that has never passed. probe_live_eval.sh already compares each report with the one before it
|
|
6
|
+
(`moved since previous`). It does not show the whole history: which probes always pass, which never
|
|
7
|
+
did, and which flip back and forth. This reads every live_eval_<YYYY-MM-DD>.md in a folder and
|
|
8
|
+
prints a probe × date matrix plus four lists:
|
|
9
|
+
always-pass — every scored report says PASS (scored = PASS or FAIL)
|
|
10
|
+
never-pass — every scored report says FAIL
|
|
11
|
+
mixed — both PASS and FAIL appear
|
|
12
|
+
too-few — fewer than 2 scored reports, so no bin applies (an absence is not a bin)
|
|
13
|
+
|
|
14
|
+
Record only. It prints record properties (counts and lists) and no verdict. No threshold, and the
|
|
15
|
+
exit code ignores the bins. Whether a never-pass probe means a dead rule or a broken probe is a
|
|
16
|
+
human judgment. UNCALIBRATED, FAILED-TO-RUN and rows whose verdict is outside the enum are counted in their own columns and are never
|
|
17
|
+
counted as FAIL. A probe that did not run did not fail.
|
|
18
|
+
|
|
19
|
+
Parsing reuses probe_live_eval_lib.parse_prev_report (single source for the run-table shape).
|
|
20
|
+
|
|
21
|
+
Usage:
|
|
22
|
+
live_eval_matrix.py [--dir <folder>] # default <repo>/tracks/_meta (the reports are gitignored)
|
|
23
|
+
exit: 0 printed · 10 input error (folder missing)
|
|
24
|
+
"""
|
|
25
|
+
import glob
|
|
26
|
+
import os
|
|
27
|
+
import re
|
|
28
|
+
import sys
|
|
29
|
+
|
|
30
|
+
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
31
|
+
sys.path.insert(0, HERE)
|
|
32
|
+
import probe_live_eval_lib as L # noqa: E402
|
|
33
|
+
|
|
34
|
+
NAME = re.compile(r"^live_eval_(\d{4}-\d{2}-\d{2})\.md$")
|
|
35
|
+
OUT_OF_ENUM = "OUT-OF-ENUM" # row present, verdict cell outside the run-table enum (not scored, not absent)
|
|
36
|
+
SHORT = {L.PASS: "P", L.FAIL: "F", L.UNCALIBRATED: "U", L.FAILED_TO_RUN: "R", "UNKNOWN-ID": "?", OUT_OF_ENUM: "N"}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def collect(folder):
|
|
40
|
+
"""-> (dates, {date: {id: verdict}}, unreadable[names]). Files are matched by exact name only;
|
|
41
|
+
stratify/RESULT files and other suffixes are not run tables of this shape and are skipped."""
|
|
42
|
+
reports, unreadable = {}, []
|
|
43
|
+
for p in sorted(glob.glob(os.path.join(folder, "live_eval_*.md"))):
|
|
44
|
+
m = NAME.match(os.path.basename(p))
|
|
45
|
+
if not m:
|
|
46
|
+
continue
|
|
47
|
+
rows = L.parse_prev_report(p)
|
|
48
|
+
if rows is None:
|
|
49
|
+
unreadable.append(os.path.basename(p))
|
|
50
|
+
else:
|
|
51
|
+
reports[m.group(1)] = rows
|
|
52
|
+
# parse_prev_report keeps only enum verdicts. A known probe row whose verdict cell is outside the
|
|
53
|
+
# enum (measured 2026-11-13: «NOT-LIVE-MEASURABLE (…)» in 60+ real reports) would otherwise print
|
|
54
|
+
# as absent, which claims the probe was not in that report when it was there but not scored.
|
|
55
|
+
ids = {i for r in reports.values() for i in r}
|
|
56
|
+
for d, rows in reports.items():
|
|
57
|
+
text = L._read_text(os.path.join(folder, "live_eval_%s.md" % d)) or ""
|
|
58
|
+
for line in text.splitlines():
|
|
59
|
+
cells = [c.strip() for c in line.strip().strip("|").split("|")]
|
|
60
|
+
if line.startswith("|") and len(cells) >= 2 and cells[0] in ids and cells[0] not in rows:
|
|
61
|
+
rows[cells[0]] = OUT_OF_ENUM
|
|
62
|
+
return sorted(reports), reports, unreadable
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def bins(dates, reports):
|
|
66
|
+
ids = sorted({i for d in dates for i in reports[d]})
|
|
67
|
+
out = {"always-pass": [], "never-pass": [], "mixed": [], "too-few": []}
|
|
68
|
+
detail = {}
|
|
69
|
+
for i in ids:
|
|
70
|
+
seq = [reports[d].get(i) for d in dates]
|
|
71
|
+
scored = [v for v in seq if v in (L.PASS, L.FAIL)]
|
|
72
|
+
p, f = scored.count(L.PASS), scored.count(L.FAIL)
|
|
73
|
+
other = sum(1 for v in seq if v is not None and v not in (L.PASS, L.FAIL))
|
|
74
|
+
absent = seq.count(None)
|
|
75
|
+
if len(scored) < 2:
|
|
76
|
+
b = "too-few"
|
|
77
|
+
elif f == 0:
|
|
78
|
+
b = "always-pass"
|
|
79
|
+
elif p == 0:
|
|
80
|
+
b = "never-pass"
|
|
81
|
+
else:
|
|
82
|
+
b = "mixed"
|
|
83
|
+
out[b].append(i)
|
|
84
|
+
detail[i] = {"seq": seq, "pass": p, "fail": f, "other": other, "absent": absent, "bin": b}
|
|
85
|
+
return out, detail
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def render(folder, dates, reports, unreadable):
|
|
89
|
+
lines = ["live-eval matrix (record only — no verdict, exit code ignores bins)",
|
|
90
|
+
"folder: %s" % folder,
|
|
91
|
+
"reports read: %d%s" % (len(dates), (" (%s .. %s)" % (dates[0], dates[-1])) if dates else ""),
|
|
92
|
+
"reports unreadable or without a run table: %d%s" % (
|
|
93
|
+
len(unreadable), (" — " + ", ".join(unreadable)) if unreadable else "")]
|
|
94
|
+
if not dates:
|
|
95
|
+
lines.append("no readable report — nothing to bin (not measured, not zero)")
|
|
96
|
+
return "\n".join(lines)
|
|
97
|
+
b, detail = bins(dates, reports)
|
|
98
|
+
lines.append("legend: P=PASS F=FAIL U=UNCALIBRATED R=FAILED-TO-RUN ?=UNKNOWN-ID N=row present, verdict outside the enum .=absent from that report")
|
|
99
|
+
lines.append("")
|
|
100
|
+
w = max(len(i) for i in detail)
|
|
101
|
+
for i in sorted(detail):
|
|
102
|
+
d = detail[i]
|
|
103
|
+
cells = "".join(SHORT.get(v, "?") if v is not None else "." for v in d["seq"])
|
|
104
|
+
lines.append("%-*s %s pass=%d fail=%d not-scored=%d absent=%d %s" % (
|
|
105
|
+
w, i, cells, d["pass"], d["fail"], d["other"], d["absent"], d["bin"]))
|
|
106
|
+
lines.append("")
|
|
107
|
+
for k in ("always-pass", "never-pass", "mixed", "too-few"):
|
|
108
|
+
lines.append("%s: %d%s" % (k, len(b[k]), (" — " + ", ".join(b[k])) if b[k] else ""))
|
|
109
|
+
return "\n".join(lines)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def main(argv):
|
|
113
|
+
folder = os.path.join(os.path.dirname(HERE), "tracks", "_meta")
|
|
114
|
+
if len(argv) >= 2 and argv[0] == "--dir":
|
|
115
|
+
folder = argv[1]
|
|
116
|
+
elif argv:
|
|
117
|
+
sys.stderr.write("usage: live_eval_matrix.py [--dir <folder>]\n")
|
|
118
|
+
return 10
|
|
119
|
+
if not os.path.isdir(folder):
|
|
120
|
+
sys.stderr.write("folder not found: %s\n" % folder)
|
|
121
|
+
return 10
|
|
122
|
+
dates, reports, unreadable = collect(folder)
|
|
123
|
+
print(render(folder, dates, reports, unreadable))
|
|
124
|
+
return 0
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
if __name__ == "__main__":
|
|
128
|
+
sys.exit(main(sys.argv[1:]))
|
|
@@ -11,7 +11,9 @@ Two uses:
|
|
|
11
11
|
extract <stream.jsonl> <out.txt> <tools.txt> (runner) write the final result text and the init
|
|
12
12
|
tool/MCP/plugin inventory. Exit 3 on a stream that has no parseable result event — never an empty
|
|
13
13
|
«the session said nothing» (same rule as sim_isolated_run.sh's turns path).
|
|
14
|
-
|
|
14
|
+
profile <stream.jsonl> (runner) one record-only line: top-level tool calls in four bins
|
|
15
|
+
(explore · edit · test-run · other). Exit 3 and «trace=UNREADABLE» on a stream it cannot read.
|
|
16
|
+
library: parse_stream(path) · behave_hit(trace, spec) · inventory(trace) · profile_bins(trace)
|
|
15
17
|
|
|
16
18
|
`behave:` grammar (one per probe, value is an ERE, no colon by probes_live.yaml convention):
|
|
17
19
|
read=<re> some SUCCESSFUL Read (file_path) or Grep (path) call matches — Python `re`, not POSIX
|
|
@@ -89,6 +91,46 @@ def parse_stream(path):
|
|
|
89
91
|
return out
|
|
90
92
|
|
|
91
93
|
|
|
94
|
+
def inventory_parts(trace):
|
|
95
|
+
"""The arm's surface as three sets — the same elements `inventory` joins — so a reader can be told
|
|
96
|
+
WHICH ones differ. None when the init event was absent. plugins=None means UNKNOWN (no list)."""
|
|
97
|
+
if trace is None or trace['tools'] is None:
|
|
98
|
+
return None
|
|
99
|
+
return {'tools': set(trace['tools']), 'mcp': set(trace['mcp'] or []),
|
|
100
|
+
'plugins': set(trace['plugins']) if trace.get('plugins') is not None else None}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def _plugin_label(entry):
|
|
104
|
+
"""«source[=version]» for a plugin entry (the JSON array [name, source, version]); the source
|
|
105
|
+
already carries the name in the real init (name@marketplace). Anything else is shown as stored —
|
|
106
|
+
including a multi-init mismatch blob (named residual: it is not broken down per plugin)."""
|
|
107
|
+
try:
|
|
108
|
+
n, src, ver = json.loads(entry)
|
|
109
|
+
except Exception:
|
|
110
|
+
return entry
|
|
111
|
+
src = str(src or '') # unvalidated init JSON: a non-string source must not raise (it would change rc)
|
|
112
|
+
lab = src if src.startswith('%s@' % n) else ('%s@%s' % (n, src) if src else str(n))
|
|
113
|
+
return lab + ('=%s' % ver if ver else '')
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def surface_diff(parts_list):
|
|
117
|
+
"""Elements that are not in every arm, per kind — «mcp=a,b; plugins=x@y=1.0» — or '' when the
|
|
118
|
+
sets agree. Nothing is dropped: an UNKNOWN plugin list in some arm is named as such."""
|
|
119
|
+
out = []
|
|
120
|
+
for key in ('tools', 'mcp', 'plugins'):
|
|
121
|
+
sets = [p[key] for p in parts_list]
|
|
122
|
+
unknown = key == 'plugins' and any(x is None for x in sets)
|
|
123
|
+
sets = [x for x in sets if x is not None]
|
|
124
|
+
if unknown and sets:
|
|
125
|
+
out.append('plugins=UNKNOWN in some arm')
|
|
126
|
+
# among the arms whose list is known (codex R1: an UNKNOWN arm must not hide a known difference)
|
|
127
|
+
diff = set().union(*sets) - set.intersection(*sets) if sets else set()
|
|
128
|
+
if diff:
|
|
129
|
+
shown = sorted(_plugin_label(e) for e in diff) if key == 'plugins' else sorted(diff)
|
|
130
|
+
out.append('%s=%s' % (key, ','.join(shown)))
|
|
131
|
+
return '; '.join(out) # SURFACE_DIFF_RETURN (TR24 mutates this line)
|
|
132
|
+
|
|
133
|
+
|
|
92
134
|
def inventory(trace):
|
|
93
135
|
"""One comparable string for the arm's tool/MCP/plugin surface, or None when the init event was
|
|
94
136
|
absent. An init without a plugin list reads plugins=UNKNOWN, so it never equals an arm that has one."""
|
|
@@ -123,6 +165,137 @@ def behave_hit(trace, spec):
|
|
|
123
165
|
return any(_read_hit(c, trace, pat) for c in file_calls)
|
|
124
166
|
|
|
125
167
|
|
|
168
|
+
# ── Behaviour profile (2026-11-17, record only — never read by a scorer) ─────────────────────────
|
|
169
|
+
# Two arms with the same PASS rate can still behave differently (arXiv:2611.17440): one may skip
|
|
170
|
+
# verification and pass anyway. The profile counts the arm's top-level tool calls in four bins.
|
|
171
|
+
# Every EMITTED call counts, successful or not — an attempted test run is still a test run.
|
|
172
|
+
# Bash is binned by its command text, in this order (first match wins):
|
|
173
|
+
# test-run some segment RUNS a test: its command word is a runner (pytest, jest, vitest, npm/pnpm/
|
|
174
|
+
# yarn test, go/cargo test, make test|check, python -m pytest|unittest), or a test
|
|
175
|
+
# script (selfcheck.sh, test_*.sh|py, *_lanes.sh) as the command or as the script
|
|
176
|
+
# argument of bash/sh/zsh/python. Naming a test file as data (`cat test_x.py`) is not a run.
|
|
177
|
+
# edit a write shape: a redirect to a file (not /dev/null, not >&N), sed -i / -Ei / --in-place,
|
|
178
|
+
# tee, or a segment whose command word is mv cp rm mkdir touch chmod ln
|
|
179
|
+
# explore the first command after any leading `cd …` is a read-only one (ls cat grep find …,
|
|
180
|
+
# git log/status/diff/show/…, gh … view/list/status/diff/checks)
|
|
181
|
+
# other anything else — running a script that is not a test lands here
|
|
182
|
+
# Named residuals: only the first non-cd segment decides explore, so `ls && ./build.sh` reads as
|
|
183
|
+
# explore; a redirect inside a quoted string reads as edit; a test runner named differently from the
|
|
184
|
+
# list reads as other; a runner inside a shell string (`bash -c 'pytest'`) or behind a wrapper that
|
|
185
|
+
# carries options (`env -i pytest`, `nice -n 10 pytest`, `timeout --signal=TERM 60 pytest`) reads as
|
|
186
|
+
# other; `git branch` / `git remote` read as other even when they only list. These are a heuristic's
|
|
187
|
+
# edges — after two cross-family rounds each found new ones, they are named here, not chased (a static
|
|
188
|
+
# shell-string reader does not converge). The profile is record only, so a misbinned call moves no
|
|
189
|
+
# verdict. Binning is calibrated on two hand-labelled nightly runs (17/17 calls, explore and other
|
|
190
|
+
# bins) — edit and test-run were exercised on fixtures only.
|
|
191
|
+
EXPLORE_TOOLS = ('Read', 'Grep', 'Glob', 'LS', 'NotebookRead', 'WebFetch', 'WebSearch', 'ToolSearch')
|
|
192
|
+
EDIT_TOOLS = ('Edit', 'Write', 'MultiEdit', 'NotebookEdit')
|
|
193
|
+
_TEST_SCRIPT_RE = re.compile(r'^(?:selfcheck\.sh|test_[\w.-]*\.(?:sh|py)|[\w.-]*_lanes?\.sh)$')
|
|
194
|
+
_TEST_RUNNERS = ('pytest', 'py.test', 'jest', 'vitest')
|
|
195
|
+
_SHELLS = ('bash', 'sh', 'zsh', 'python', 'python3')
|
|
196
|
+
_WRITE_RE = re.compile(r'>>?(?!&)\s*(?!/dev/null\b)[^\s&|;>]|\btee\b')
|
|
197
|
+
_EDIT_WORDS = ('mv', 'cp', 'rm', 'mkdir', 'touch', 'chmod', 'ln')
|
|
198
|
+
_EXPLORE_WORDS = ('ls', 'cat', 'head', 'tail', 'grep', 'egrep', 'rg', 'find', 'wc', 'tree', 'stat', 'file',
|
|
199
|
+
'pwd', 'which', 'echo', 'printf', 'less', 'diff', 'du', 'sort', 'uniq', 'cut', 'sed', 'awk',
|
|
200
|
+
'jq', 'readlink', 'realpath', 'basename', 'dirname', 'date', 'id', 'whoami')
|
|
201
|
+
_GIT_READ = ('log', 'status', 'diff', 'show', 'ls-files', 'ls-tree', 'blame',
|
|
202
|
+
'rev-parse', 'grep', 'describe', 'shortlog', 'reflog')
|
|
203
|
+
_GH_READ = ('view', 'list', 'status', 'diff', 'checks')
|
|
204
|
+
PROFILE_BINS = ('explore', 'edit', 'test-run', 'other')
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def _segments(cmd):
|
|
208
|
+
"""Each segment's words, with leading VAR=value assignments and the wrappers env / time / nice /
|
|
209
|
+
exec / command / timeout <secs> dropped, so the command word is the one that runs; empty
|
|
210
|
+
segments skipped."""
|
|
211
|
+
for seg in re.split(r'&&|\|\||;|\n|\|', cmd):
|
|
212
|
+
words = seg.split()
|
|
213
|
+
while words:
|
|
214
|
+
if re.match(r'^[A-Za-z_][A-Za-z0-9_]*=', words[0]) or words[0] in ('env', 'time', 'nice', 'exec', 'command'):
|
|
215
|
+
words = words[1:]
|
|
216
|
+
elif words[0] == 'timeout' and len(words) > 1:
|
|
217
|
+
words = words[2:]
|
|
218
|
+
else:
|
|
219
|
+
break
|
|
220
|
+
if words:
|
|
221
|
+
yield words
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def _runs_test(w):
|
|
225
|
+
base = lambda x: x.rsplit('/', 1)[-1]
|
|
226
|
+
if w[0] in _TEST_RUNNERS or _TEST_SCRIPT_RE.match(base(w[0])):
|
|
227
|
+
return True
|
|
228
|
+
if w[0] in ('npm', 'pnpm', 'yarn') and 'test' in w[1:3]:
|
|
229
|
+
return True
|
|
230
|
+
if (w[0] in ('go', 'cargo') and w[1:2] == ['test']) or (w[0] == 'make' and w[1:2] in (['test'], ['check'])):
|
|
231
|
+
return True
|
|
232
|
+
if w[0] in _SHELLS:
|
|
233
|
+
args = [x for x in w[1:] if not x.startswith('-')]
|
|
234
|
+
if w[0].startswith('python') and '-m' in w and w[w.index('-m') + 1:w.index('-m') + 2] in (['pytest'], ['unittest']):
|
|
235
|
+
return True
|
|
236
|
+
return bool(args) and bool(_TEST_SCRIPT_RE.match(base(args[0])))
|
|
237
|
+
return False
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def _sed_in_place(w):
|
|
241
|
+
return w[0] == 'sed' and any(x.startswith('--in-place') or re.match(r'^-[a-zA-Z]*i', x) for x in w[1:])
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def _bash_bin(cmd):
|
|
245
|
+
cmd = str(cmd or '')
|
|
246
|
+
segs = list(_segments(cmd))
|
|
247
|
+
if any(_runs_test(w) for w in segs):
|
|
248
|
+
return 'test-run'
|
|
249
|
+
if _WRITE_RE.search(cmd) or any(w[0] in _EDIT_WORDS or _sed_in_place(w) for w in segs):
|
|
250
|
+
return 'edit'
|
|
251
|
+
first = next((w for w in segs if w[0] != 'cd'), None)
|
|
252
|
+
if not first:
|
|
253
|
+
return 'other'
|
|
254
|
+
if first[0] in _EXPLORE_WORDS:
|
|
255
|
+
return 'explore'
|
|
256
|
+
if first[0] == 'git' and any(w in _GIT_READ for w in first[1:3] if not w.startswith('-')):
|
|
257
|
+
return 'explore'
|
|
258
|
+
if first[0] == 'gh' and any(w in _GH_READ for w in first[1:4]):
|
|
259
|
+
return 'explore'
|
|
260
|
+
return 'other'
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def profile_bins(trace):
|
|
264
|
+
"""{bin: count} over the top-level calls of a parsed trace."""
|
|
265
|
+
out = dict.fromkeys(PROFILE_BINS, 0)
|
|
266
|
+
for name, inp, _ in trace['calls']:
|
|
267
|
+
if name in EXPLORE_TOOLS:
|
|
268
|
+
b = 'explore'
|
|
269
|
+
elif name in EDIT_TOOLS:
|
|
270
|
+
b = 'edit'
|
|
271
|
+
elif name == 'Bash':
|
|
272
|
+
b = _bash_bin((inp or {}).get('command') if isinstance(inp, dict) else '')
|
|
273
|
+
else:
|
|
274
|
+
b = 'other'
|
|
275
|
+
out[b] += 1
|
|
276
|
+
return out
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def _profile(src):
|
|
280
|
+
"""One line for the report. A stream that cannot be read says so (exit 3) — never counts of 0.
|
|
281
|
+
A stream with no result event or damaged lines keeps its counts and says they are a lower bound."""
|
|
282
|
+
tr = parse_stream(src)
|
|
283
|
+
if tr is None:
|
|
284
|
+
print('trace=UNREADABLE')
|
|
285
|
+
return 3
|
|
286
|
+
p = profile_bins(tr)
|
|
287
|
+
line = ' '.join('%s=%d' % (b, p[b]) for b in PROFILE_BINS) + ' total=%d' % sum(p.values())
|
|
288
|
+
flags = []
|
|
289
|
+
if tr['result'] is None:
|
|
290
|
+
flags.append('result=MISSING')
|
|
291
|
+
if tr['damaged']:
|
|
292
|
+
flags.append('damaged=%d' % tr['damaged'])
|
|
293
|
+
if flags:
|
|
294
|
+
line += ' ' + ' '.join(flags) + ' (counts are a lower bound)'
|
|
295
|
+
print(line)
|
|
296
|
+
return 0
|
|
297
|
+
|
|
298
|
+
|
|
126
299
|
def _extract(src, dst_txt, dst_tools):
|
|
127
300
|
tr = parse_stream(src)
|
|
128
301
|
if tr is None or tr['result'] is None or tr['damaged']:
|
|
@@ -137,5 +310,7 @@ def _extract(src, dst_txt, dst_tools):
|
|
|
137
310
|
if __name__ == '__main__':
|
|
138
311
|
if len(sys.argv) == 5 and sys.argv[1] == 'extract':
|
|
139
312
|
sys.exit(_extract(*sys.argv[2:5]))
|
|
313
|
+
if len(sys.argv) == 3 and sys.argv[1] == 'profile':
|
|
314
|
+
sys.exit(_profile(sys.argv[2]))
|
|
140
315
|
print(__doc__, file=sys.stderr)
|
|
141
316
|
sys.exit(2)
|
|
@@ -84,6 +84,24 @@ ACCEPTED_ABSENT=(
|
|
|
84
84
|
# release by default. selfcheck resolves its row as SKIP («not in files[], and absent») on a consumer tree.
|
|
85
85
|
"scripts/cartridge_admit.py"
|
|
86
86
|
"scripts/test_cartridge_admit_lanes.sh"
|
|
87
|
+
# 2026-11-18 — core cartridge loader (SessionStart hook), its snippet, example list and lanes. The loader only loads
|
|
88
|
+
# snapshots that cartridge_admit.py admitted (the list carries its snapshot_sha256), and that checker is not
|
|
89
|
+
# shipped (above) — so ship all of them together when the operator decides to publish cartridges, or none.
|
|
90
|
+
# Shipping the snippet alone would make install-wizard register a hook for consumers who cannot admit anything.
|
|
91
|
+
"scripts/cartridge_loader.py"
|
|
92
|
+
"scripts/cartridge_loader.sh"
|
|
93
|
+
"scripts/test_cartridge_loader_lanes.sh"
|
|
94
|
+
"templates/settings.CartridgeLoader.snippet.json"
|
|
95
|
+
# 2026-11-19 — measurement scoreboard renderer and its lanes. It reads the operator's sealed measurement records across
|
|
96
|
+
# their own repositories; a consumer has none of those records, so it is not shipped. selfcheck resolves the anchor
|
|
97
|
+
# row as SKIP («not in files[], and absent»).
|
|
98
|
+
"scripts/scoreboard_render.py"
|
|
99
|
+
"scripts/test_scoreboard_render_lanes.sh"
|
|
100
|
+
# 2026-11-19 — FH-side check that the published fh-techwriter copy of ko-tech-writer still matches FH's export,
|
|
101
|
+
# and its lanes. A maintainer tool for this repository's own export, not a consumer capability: a consumer has
|
|
102
|
+
# no fh-techwriter copy to compare. selfcheck resolves its anchor row as SKIP («not in files[], and absent»).
|
|
103
|
+
"scripts/fh_techwriter_sync_check.sh"
|
|
104
|
+
"scripts/test_fh_techwriter_sync_lanes.sh"
|
|
87
105
|
# 🟥 2026-09-21 (야간) — 정책렌즈 채점기와 그 레인. **FH 자기 연구의 실험 기록**이지 소비자
|
|
88
106
|
# 능력이 아니다: 판정 대상이 `scripts/fixtures/policy_lens_knownpair_2026-09-21/` 안의
|
|
89
107
|
# 1차 런 48개 파일(236K)이고, 그것까지 실어 보내면 아무도 안 쓰는 실험 아카이브가 패키지
|
|
@@ -19,6 +19,14 @@
|
|
|
19
19
|
# Runs in throwaway repos (mktemp): never touches this repo's index or worktree.
|
|
20
20
|
# Usage: bash scripts/prepush_guard_check.sh → exit 0 all pairs hold, 1 otherwise.
|
|
21
21
|
set -uo pipefail
|
|
22
|
+
# Measure the pre-push hook as it behaves by DEFAULT: an override the caller exported (PUBLIC_SURFACE_OK=1 …) must
|
|
23
|
+
# not reach the hook under test (pmh-dev #91 ②, 2026-11-15). Lane: scripts/test_guard_anchor_override_env_lanes.sh.
|
|
24
|
+
# Also the two non-override inputs the hook reads from the environment (codex R1): PSA_PATTERNS replaces the
|
|
25
|
+
# fixtures' synthetic operator patterns, FH_DESTRUCTIVE_BASE moves the destructive-advisory baseline.
|
|
26
|
+
unset PUBLIC_SURFACE_OK DESTRUCTIVE_OP_OK FH_NOVELTY_OK MAIN_PUSH_OK PUSH_ZONE_OK TAG_VERSION_OK TRACKS_GITLINK_OK TRACKS_PUBLIC_OK PSA_PATTERNS FH_DESTRUCTIVE_BASE 2>/dev/null || true
|
|
27
|
+
# Every PSA_* input too (codex R2: PSA_ALLOWLIST suppressed a planted positive) — by prefix, so a new PSA_ input
|
|
28
|
+
# cannot slip past a hand-written list. The scan library sets the ones it needs itself.
|
|
29
|
+
for _v in $(compgen -v | grep '^PSA_'); do unset "$_v"; done; unset _v
|
|
22
30
|
|
|
23
31
|
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
|
|
24
32
|
HOOK_SRC="$REPO_ROOT/templates/.git-hooks/pre-push"
|
|
@@ -439,6 +439,38 @@ score_rc=$?
|
|
|
439
439
|
done < "$SPEC_DIR/selected_ids.txt"
|
|
440
440
|
} >> "$REPORT_PATH"
|
|
441
441
|
|
|
442
|
+
# Behaviour profile (2026-11-17, arXiv:2611.17440 — record only, never read by the scorer above).
|
|
443
|
+
# Two arms with the same pass rate can still behave differently — one may skip verification and pass
|
|
444
|
+
# anyway. One line per rep: the arm's top-level tool calls in four bins, counted from the event stream
|
|
445
|
+
# the runner already keeps (bin rules: scripts/live_eval_trace.py). A rep with no stream says MISSING,
|
|
446
|
+
# an unreadable one UNREADABLE — never counts of 0. Appended AFTER score; score_rc is untouched.
|
|
447
|
+
{
|
|
448
|
+
echo ""
|
|
449
|
+
echo "## Behaviour profile (record only — not scored)"
|
|
450
|
+
echo ""
|
|
451
|
+
if [ -z "$FH_LIVE_TRACE_ARG" ]; then
|
|
452
|
+
echo "behaviour-profile: not recorded — FH_LIVE_TRACE=0 (no event stream kept)"
|
|
453
|
+
else
|
|
454
|
+
while IFS= read -r id; do
|
|
455
|
+
[ -z "$id" ] && continue
|
|
456
|
+
for arm in primary control control_b; do
|
|
457
|
+
[ "$arm" = control_b ] && [ ! -f "$SPEC_DIR/$id.control_b.txt" ] && continue
|
|
458
|
+
r=1
|
|
459
|
+
while [ "$r" -le "$REPS" ]; do
|
|
460
|
+
st="$OUTDIR/$id/${arm}_r${r}.stream.jsonl"
|
|
461
|
+
if [ ! -f "$st" ]; then
|
|
462
|
+
echo "behaviour-profile: $id $arm r$r trace=MISSING"
|
|
463
|
+
else
|
|
464
|
+
bp="$(python3 "$REPO_ROOT/scripts/live_eval_trace.py" profile "$st" 2>/dev/null)"
|
|
465
|
+
echo "behaviour-profile: $id $arm r$r ${bp:-trace=UNREADABLE}"
|
|
466
|
+
fi
|
|
467
|
+
r=$((r + 1))
|
|
468
|
+
done
|
|
469
|
+
done
|
|
470
|
+
done < "$SPEC_DIR/selected_ids.txt"
|
|
471
|
+
fi
|
|
472
|
+
} >> "$REPORT_PATH"
|
|
473
|
+
|
|
442
474
|
if [ -n "$EVIDENCE_DIR" ]; then
|
|
443
475
|
# The report is part of the evidence: a preserved body set with no verdict beside it forces the
|
|
444
476
|
# next reader to re-derive what the run concluded.
|
|
@@ -529,6 +529,7 @@ def score_run(live_rows, run_root, ids_in_order, threshold, model, reps=1):
|
|
|
529
529
|
except (ValueError, re.error) as e:
|
|
530
530
|
behave_err, behave = str(e), None
|
|
531
531
|
inventories, inv_unknown, traces, no_trace, b_reps = set(), 0, {}, 0, []
|
|
532
|
+
inv_parts = {} # inventory string → its three sets, so the INVALID reason can name the difference
|
|
532
533
|
damaged, any_trace = 0, False
|
|
533
534
|
ctrl_b_absent = False # rep-1 only, diagnostic: which arm actually produced nothing
|
|
534
535
|
per_rep = [] # [(verdict, phit, chit, primary_text, control_text)]
|
|
@@ -569,6 +570,7 @@ def score_run(live_rows, run_root, ids_in_order, threshold, model, reps=1):
|
|
|
569
570
|
inv = _trace.inventory(tr)
|
|
570
571
|
if inv is not None:
|
|
571
572
|
inventories.add(inv)
|
|
573
|
+
inv_parts[inv] = _trace.inventory_parts(tr)
|
|
572
574
|
elif tr is not None:
|
|
573
575
|
inv_unknown += 1
|
|
574
576
|
traces[(arm, i)] = tr
|
|
@@ -633,8 +635,12 @@ def score_run(live_rows, run_root, ids_in_order, threshold, model, reps=1):
|
|
|
633
635
|
elif behave and any_trace and (no_trace or damaged):
|
|
634
636
|
row['reason'] = 'TRACE-INCOMPLETE: %d rep(s) missing an arm trace · %d damaged stream(s)' % (no_trace, damaged)
|
|
635
637
|
elif len(inventories) > 1:
|
|
636
|
-
|
|
637
|
-
|
|
638
|
+
# Name what differs FIRST (2026-11-20 weekly audit: two 840-char lists side by side, the
|
|
639
|
+
# diff left to a human, INVALID rose 0→3/12 unexplained); the full lists still follow.
|
|
640
|
+
_d = _trace.surface_diff([inv_parts[x] for x in sorted(inventories)])
|
|
641
|
+
row['reason'] = 'INVALID-COMPARISON: arms saw %d different tool/MCP/plugin lists — %s%s' % (
|
|
642
|
+
len(inventories), ('not in every arm: %s — ' % (_d or 'none — the lists differ only in duplicates or count')),
|
|
643
|
+
' ≠ '.join(sorted(inventories)))
|
|
638
644
|
if len(ran_reps) > 1 and 0 < len(pass_reps) < len(ran_reps):
|
|
639
645
|
flaky = 'FLAKY across reps (%s)' % ','.join(r[0] for r in per_rep)
|
|
640
646
|
# an INVALID-COMPARISON reason must survive: the surface mismatch is why there is no number
|
package/scripts/selfcheck.sh
CHANGED
|
@@ -397,6 +397,17 @@ else
|
|
|
397
397
|
fail=1
|
|
398
398
|
fi
|
|
399
399
|
|
|
400
|
+
# fh-gate review stage + execution layer (2026-11-19): the built-in /code-review is the default reviewer on
|
|
401
|
+
# the claude backend, its findings carried as labelled; E0 scanners and E1 target lanes run in a copy. Both
|
|
402
|
+
# suites are token-free (stub backends, scratch repos) and ship with the package, as the gate does.
|
|
403
|
+
for _fhg_lane in scripts/test_fh_gate_defaults_lanes.sh scripts/test_fh_gate_exec_lanes.sh scripts/test_fh_gate_fusion_lanes.sh scripts/test_fh_gate_absorb_lanes.sh; do
|
|
404
|
+
if [ -f "$_fhg_lane" ]; then
|
|
405
|
+
bash "$_fhg_lane" || fail=1
|
|
406
|
+
else
|
|
407
|
+
echo "FAIL fh-gate: $_fhg_lane missing"; fail=1
|
|
408
|
+
fi
|
|
409
|
+
done
|
|
410
|
+
|
|
400
411
|
# pre-push stdin integrity — anchors the 2026-07-20 fail-open hole (a stdin-inheriting subprocess
|
|
401
412
|
# above the ref loop drains git's ref list → Destructive-Op gate silently allows a delete/force push).
|
|
402
413
|
# Wired here, not left standalone: an unwired checker is the exact defect this session found in
|
|
@@ -1185,7 +1196,10 @@ for _pair in \
|
|
|
1185
1196
|
"scripts/destructive_pre_gate.sh|scripts/test_destructive_pre_gate_lanes.sh" \
|
|
1186
1197
|
"scripts/probe_live_eval_lib.py|scripts/test_live_eval_transitions_lanes.sh" \
|
|
1187
1198
|
"scripts/correction_moments.py|scripts/test_correction_moments_lanes.sh" \
|
|
1199
|
+
"scripts/below_floor_scan.sh|scripts/test_below_floor_scan_lanes.sh" \
|
|
1200
|
+
"scripts/job_heartbeat.py|scripts/test_job_heartbeat_lanes.sh" \
|
|
1188
1201
|
"scripts/probe_live_eval_lib.py|scripts/test_live_eval_construct_lanes.sh" \
|
|
1202
|
+
"scripts/live_eval_matrix.py|scripts/test_live_eval_matrix_lanes.sh" \
|
|
1189
1203
|
"scripts/live_eval_trace.py|scripts/test_live_eval_trace_lanes.sh" \
|
|
1190
1204
|
"scripts/probe_live_eval_lib.py|scripts/test_live_eval_trace_lanes.sh" \
|
|
1191
1205
|
"scripts/sim_isolated_run.sh|scripts/test_live_eval_trace_lanes.sh" \
|
|
@@ -1224,6 +1238,14 @@ for _pair in \
|
|
|
1224
1238
|
"plugins/fh-meta/skills/frontier-digest/SKILL.md|scripts/test_frontier_digest_recall.sh" \
|
|
1225
1239
|
"scripts/test_frontier_digest_recall.sh|scripts/test_frontier_digest_recall_negctl.sh" \
|
|
1226
1240
|
"scripts/fh_module_check.py|scripts/test_fh_module_check_lanes.sh" \
|
|
1241
|
+
"scripts/heavy_skill_smell.py|scripts/test_heavy_skill_smell_lanes.sh" \
|
|
1242
|
+
"scripts/cartridge_loader.py|scripts/test_cartridge_loader_lanes.sh" \
|
|
1243
|
+
"scripts/scoreboard_render.py|scripts/test_scoreboard_render_lanes.sh" \
|
|
1244
|
+
"scripts/fh_gate_exec.sh|scripts/test_fh_gate_exec_lanes.sh" \
|
|
1245
|
+
"scripts/fh-gate.sh|scripts/test_fh_gate_fusion_lanes.sh" \
|
|
1246
|
+
"scripts/fh-gate.sh|scripts/test_fh_gate_absorb_lanes.sh" \
|
|
1247
|
+
"scripts/fh-gate.sh|scripts/test_fh_gate_defaults_lanes.sh" \
|
|
1248
|
+
"scripts/fh_techwriter_sync_check.sh|scripts/test_fh_techwriter_sync_lanes.sh" \
|
|
1227
1249
|
"scripts/knowledge_seam_check.sh|scripts/test_knowledge_seam_lanes.sh" \
|
|
1228
1250
|
"templates/.git-hooks/pre-commit|scripts/test_marker_crossfamily_lanes.sh" \
|
|
1229
1251
|
"templates/.git-hooks/pre-commit|scripts/test_marker_floor_lanes.sh" \
|
|
@@ -2223,6 +2245,28 @@ else
|
|
|
2223
2245
|
fail=1
|
|
2224
2246
|
fi
|
|
2225
2247
|
|
|
2248
|
+
# prepush_marker_lookup — the pre-push Load-Bearing gate reads this branch's marker where pre-commit
|
|
2249
|
+
# writes it (the evidence root), not a path only the main checkout has.
|
|
2250
|
+
if [ -f scripts/test_prepush_marker_lookup_lanes.sh ]; then
|
|
2251
|
+
if ! bash scripts/test_prepush_marker_lookup_lanes.sh; then
|
|
2252
|
+
fail=1
|
|
2253
|
+
fi
|
|
2254
|
+
else
|
|
2255
|
+
echo "FAIL test_prepush_marker_lookup_lanes.sh: absent — the pre-push marker lookup has no lane"
|
|
2256
|
+
fail=1
|
|
2257
|
+
fi
|
|
2258
|
+
|
|
2259
|
+
# guard_anchor_override_env — the two guard anchors (universal_guard_check.sh · prepush_guard_check.sh)
|
|
2260
|
+
# must measure the hook's default whatever override the caller exported (PUBLIC_SURFACE_OK=1 …).
|
|
2261
|
+
if [ -f scripts/test_guard_anchor_override_env_lanes.sh ]; then
|
|
2262
|
+
if ! bash scripts/test_guard_anchor_override_env_lanes.sh; then
|
|
2263
|
+
fail=1
|
|
2264
|
+
fi
|
|
2265
|
+
else
|
|
2266
|
+
echo "FAIL test_guard_anchor_override_env_lanes.sh: absent — the anchors' override scrub has no lane"
|
|
2267
|
+
fail=1
|
|
2268
|
+
fi
|
|
2269
|
+
|
|
2226
2270
|
# And the ablation calibrator, for the third instance of the same reason. Its whole job is telling
|
|
2227
2271
|
# apart states that look identical from outside — "the arm could not answer" vs "the runner is dead"
|
|
2228
2272
|
# vs "the runner read the answer off disk" — and round 2 of its own adversarial review found that
|
|
@@ -2698,6 +2742,62 @@ else
|
|
|
2698
2742
|
fail=1
|
|
2699
2743
|
fi
|
|
2700
2744
|
|
|
2745
|
+
# fh_module_check.py — the REAL-CORPUS arm. Wired 2026-11-16 (clean-room audit round 9) because the
|
|
2746
|
+
# 19 RD fixture lanes in test_fh_module_check_lanes.sh measure the CHECKER and nothing measured its
|
|
2747
|
+
# SUBJECTS. Three `fh-module.yaml` manifests ship (plugins/fh-commons/skills/{ko-tech-writer,
|
|
2748
|
+
# persona-cast,convergence-loop}) and no standing channel ever ran the install-time check over them:
|
|
2749
|
+
# measured with grep over scripts/, templates/.git-hooks/ and .github/ — 0 callers, the only hits
|
|
2750
|
+
# being this file's pair declaration, the spec, CATALOG.md and the lane suite's own fixtures.
|
|
2751
|
+
# plugins/fh-meta/CHANGELOG.md asserts "The three modules in this package pass". That was true when
|
|
2752
|
+
# measured by hand (all three rc 0, re-measured 2026-11-16) and had NO channel behind it, so a drift
|
|
2753
|
+
# in a manifest, or in a shipped .py inside one of those skills, would have been found by the
|
|
2754
|
+
# consumer installing the module rather than here. The install-time verdict is exactly what a
|
|
2755
|
+
# context-less clone user meets first, which is why it belongs in this file and not in a lane.
|
|
2756
|
+
# Package mode is decided by BOTH sides being absent — the `probe_scope_check.sh` idiom two blocks
|
|
2757
|
+
# up, whose own comment earns the rule that over-blocking the normal case is a defect too.
|
|
2758
|
+
# The subject's exit contract, from its own header: 0 OK · 1 BLOCK · 2 UNMEASURED ·
|
|
2759
|
+
# 3 OK-but-UNCALIBRATED, which it calls "never a clean pass" — so 2 and 3 are NOT passes here. They
|
|
2760
|
+
# print at the LINE HEAD as `INCOMPLETE fh-module …` rather than only as a ⬜ decoration, because a
|
|
2761
|
+
# non-pass written in a local decoration is one the next round's log diff cannot count (round 8).
|
|
2762
|
+
# Why not `_show_failure`: that helper extracts ❌-marked lines from a SUITE's output, and this
|
|
2763
|
+
# subject speaks a different vocabulary — `BLOCK:`/`UNMEASURED:`/`RESULT:` lines. Handing it this
|
|
2764
|
+
# output would print the trailing NOTE instead of the reason, so the reason is lifted directly.
|
|
2765
|
+
_fmc_why() { printf '%s\n' "$1" | grep -E '^(BLOCK|UNMEASURED|UNCAL|RESULT):' | head -6 | sed 's/^/ /'; }
|
|
2766
|
+
_fmc_manifests=$(find . -name fh-module.yaml -not -path './node_modules/*' -not -path './.git/*' 2>/dev/null | sort)
|
|
2767
|
+
# `wc -l` over a sed-stripped list rather than `grep -c . || true`: grep exits 1 on a zero count, so
|
|
2768
|
+
# the obvious form needs a `|| true`, and a short-circuit to a permissive value is the exact shape
|
|
2769
|
+
# degrade_direction_scan.sh exists to flag. `wc` always exits 0, so the count needs no rescue.
|
|
2770
|
+
_fmc_n=$(printf '%s\n' "$_fmc_manifests" | sed '/^[[:space:]]*$/d' | wc -l | tr -d ' ')
|
|
2771
|
+
if [ ! -f scripts/fh_module_check.py ] && [ "$_fmc_n" -eq 0 ]; then
|
|
2772
|
+
echo "SKIP fh_module_check.py corpus (package mode: neither the checker nor any fh-module.yaml is here)"
|
|
2773
|
+
elif [ ! -f scripts/fh_module_check.py ]; then
|
|
2774
|
+
echo "FAIL fh_module_check.py corpus: $_fmc_n manifest(s) present but the checker is missing — the install-time verdict is UNMEASURED, not clean"
|
|
2775
|
+
fail=1
|
|
2776
|
+
elif [ "$_fmc_n" -eq 0 ]; then
|
|
2777
|
+
echo "FAIL fh_module_check.py corpus: the checker is here but no fh-module.yaml was found — the corpus vanished; UNMEASURED, not clean"
|
|
2778
|
+
fail=1
|
|
2779
|
+
else
|
|
2780
|
+
_fmc_bad=0
|
|
2781
|
+
while IFS= read -r _m; do
|
|
2782
|
+
[ -n "$_m" ] || continue
|
|
2783
|
+
_out=$(python3 scripts/fh_module_check.py check "$_m" 2>&1); _rc=$?
|
|
2784
|
+
case "$_rc" in
|
|
2785
|
+
0) echo "PASS fh-module ${_m#./} (install-time check: OK)" ;;
|
|
2786
|
+
1) echo "FAIL fh-module ${_m#./}: BLOCK (rc 1) — this module would be refused at install time"
|
|
2787
|
+
_fmc_why "$_out"; _fmc_bad=1 ;;
|
|
2788
|
+
2) echo "INCOMPLETE fh-module ${_m#./}: ⬜ UNMEASURED (rc 2 — unreadable, tooling down, or empty core list). NOT a pass"
|
|
2789
|
+
_fmc_why "$_out"; _fmc_bad=1 ;;
|
|
2790
|
+
3) echo "INCOMPLETE fh-module ${_m#./}: ⬜ OK-but-UNCALIBRATED (rc 3) — the subject's own contract calls this never a clean pass"
|
|
2791
|
+
_fmc_bad=1 ;;
|
|
2792
|
+
*) echo "INCOMPLETE fh-module ${_m#./}: ⬜ the checker exited $_rc, outside its documented 0/1/2/3 contract — UNMEASURED"
|
|
2793
|
+
_fmc_why "$_out"; _fmc_bad=1 ;;
|
|
2794
|
+
esac
|
|
2795
|
+
done <<_FMC_EOF
|
|
2796
|
+
$_fmc_manifests
|
|
2797
|
+
_FMC_EOF
|
|
2798
|
+
[ "$_fmc_bad" -eq 0 ] || fail=1
|
|
2799
|
+
fi
|
|
2800
|
+
|
|
2701
2801
|
# utterance landing check — the close chain's CONTENT anchor, and it has to be RUN, not parsed.
|
|
2702
2802
|
# Measured 2026-08-08 on the branch that introduced it: the only thing in this file that touched
|
|
2703
2803
|
# `scripts/utterance_landing_check.sh` was the `bash -n` syntax sweep at the top. Syntax passing is
|
|
@@ -3126,6 +3226,17 @@ fi
|
|
|
3126
3226
|
# Lane-identity tripwire — record-only: a WARN line, never a FAIL (a hit is a past event in the
|
|
3127
3227
|
# repo, not this run's verdict). Runs AFTER the lanes, which is when a leaked commit would have just landed.
|
|
3128
3228
|
if [ -f scripts/lane_identity_tripwire.sh ]; then bash scripts/lane_identity_tripwire.sh . | grep -v '^LANE-TRIPWIRE ok' ; fi
|
|
3229
|
+
# fh-techwriter copy sync (2026-11-19) — record-only: an INFO line, never a FAIL. The copy lives in another
|
|
3230
|
+
# repository and is regenerated and pushed there by a human, so its state is not this tree's verdict. Shard 1
|
|
3231
|
+
# only, source tree only. Exit 2 (no copy here, export failed) prints «not measured», never «in sync».
|
|
3232
|
+
if [ -f scripts/fh_techwriter_sync_check.sh ] && [ "$_CONSUMER" -ne 1 ] && { [ -z "${_SHARD_N:-}" ] || [ "${_SHARD_I:-1}" = 1 ]; }; then
|
|
3233
|
+
_tw=$(bash scripts/fh_techwriter_sync_check.sh </dev/null 2>&1); _twrc=$?
|
|
3234
|
+
case "$_twrc" in
|
|
3235
|
+
0) echo "INFO fh-techwriter copy: in sync — $(printf '%s\n' "$_tw" | grep '^fh-techwriter sync:' | cut -c21-)";;
|
|
3236
|
+
1) printf '%s\n' "$_tw" | sed 's/^/INFO fh-techwriter copy: /';;
|
|
3237
|
+
*) echo "INFO fh-techwriter copy: not measured — $(printf '%s\n' "$_tw" | tail -1)";;
|
|
3238
|
+
esac
|
|
3239
|
+
fi
|
|
3129
3240
|
if [ "$_CONSUMER" -eq 1 ]; then
|
|
3130
3241
|
_n=$(printf '%s\n' $CONSUMER_SKIPPED | grep -c .)
|
|
3131
3242
|
echo "CONSUMER PROFILE — $_n checkout-only suite(s) NOT measured here (not a pass):$CONSUMER_SKIPPED"
|
|
@@ -57,6 +57,8 @@
|
|
|
57
57
|
4 test_degrade_scan_shell_probes.sh
|
|
58
58
|
4 test_destructive_pre_gate_lanes.sh
|
|
59
59
|
4 test_fh_module_check_lanes.sh
|
|
60
|
+
3 test_heavy_skill_smell_lanes.sh
|
|
61
|
+
4 test_cartridge_loader_lanes.sh
|
|
60
62
|
4 test_heavy_classifier_lanes.sh
|
|
61
63
|
4 test_marker_first_use_lanes.sh
|
|
62
64
|
4 test_memory_link_check.sh
|
|
@@ -59,11 +59,13 @@ command -v gtimeout >/dev/null 2>&1 && TIMEOUT_BIN="gtimeout"
|
|
|
59
59
|
# No coreutils timeout on stock macOS. perl's alarm is the portable watchdog; if perl is missing too,
|
|
60
60
|
# run WITHOUT a deadline rather than skipping the probe — a missing watchdog must never become a
|
|
61
61
|
# silently skipped measurement reported as absence (the same rule fh_session_load.sh applies).
|
|
62
|
+
# Every probe passes its prompt as an argument, so the runtime gets a closed stdin: inheriting the caller's
|
|
63
|
+
# stdin let codex_launch_guard.sh wait on an agent shell's never-ending one (2026-11-20, 2 h 30 min).
|
|
62
64
|
_run() {
|
|
63
65
|
local secs="$1"; shift
|
|
64
|
-
if [ -n "$TIMEOUT_BIN" ]; then "$TIMEOUT_BIN" "$secs" "$@"
|
|
65
|
-
elif command -v perl >/dev/null 2>&1; then perl -e 'alarm shift @ARGV; exec @ARGV' "$secs" "$@"
|
|
66
|
-
else "$@"; fi
|
|
66
|
+
if [ -n "$TIMEOUT_BIN" ]; then "$TIMEOUT_BIN" "$secs" "$@" < /dev/null
|
|
67
|
+
elif command -v perl >/dev/null 2>&1; then perl -e 'alarm shift @ARGV; exec @ARGV' "$secs" "$@" < /dev/null
|
|
68
|
+
else "$@" < /dev/null; fi
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
# _answer — reduce a runtime's stdout to THE MODEL'S ANSWER.
|
|
@@ -104,7 +106,7 @@ CODEX_GUARD="$(cd "$(dirname "$0")" && pwd)/codex_launch_guard.sh"
|
|
|
104
106
|
build_cmd() {
|
|
105
107
|
case "$1" in
|
|
106
108
|
codex) CMD=(bash "$CODEX_GUARD" codex exec -m "$2" -c model_reasoning_effort=high --skip-git-repo-check "$3") ;; # company-root paths refused
|
|
107
|
-
agy) CMD=(bash "$AGY_GUARD" agy -p "$3" --model "$2" --print-timeout 170s) ;; # refuses unless FH_AGY_ISOLATION=container|os-user
|
|
109
|
+
agy) CMD=(bash "$AGY_GUARD" agy -p "$3" --model "$2" --print-timeout 170s) ;; # refuses unless FH_AGY_ISOLATION=container|os-user|no-tools-agent
|
|
108
110
|
*) CMD=("$1" "$3") ;;
|
|
109
111
|
esac
|
|
110
112
|
}
|
|
@@ -130,7 +132,7 @@ probe_runtime() {
|
|
|
130
132
|
# The isolation guard refused before agy started: nothing was measured. Say so instead of reading
|
|
131
133
|
# the refusal text as the model's answer (it rendered REACHABLE · control: rejects-bogus before).
|
|
132
134
|
if [ "$id_rc" -eq 3 ] && printf '%s\n' "$id_raw" | grep -q '^AGY-REFUSED'; then
|
|
133
|
-
printf '%-6s REFUSED — agy_launch_guard: FH_AGY_ISOLATION is not container|os-user, agy not started, nothing measured\n' "$rt"
|
|
135
|
+
printf '%-6s REFUSED — agy_launch_guard: FH_AGY_ISOLATION is not container|os-user|no-tools-agent (or that route refused), agy not started, nothing measured\n' "$rt"
|
|
134
136
|
return 0
|
|
135
137
|
fi
|
|
136
138
|
|