@chrono-meta/fh-gate 3.38.1 → 3.39.1
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 +36 -0
- package/.claude/rules/fh_4axis_gate.md +6 -1
- package/.claude-plugin/marketplace.json +4 -4
- package/AGENTS.md +1 -1
- package/README.ja.md +2 -2
- package/README.ko.md +2 -2
- package/README.md +5 -4
- package/README.zh.md +2 -2
- package/docs/ETHOS.md +3 -1
- package/docs/codex-compat.md +2 -2
- package/knowledge/shared/harness-core/agents_md_runtime_details.md +1 -1
- package/knowledge/shared/harness-core/fh_module_contract.md +15 -2
- package/knowledge/shared/harness-core/fh_three_layer_canon.md +7 -0
- package/knowledge/shared/harness-core/governance_engineering_definition.md +55 -0
- package/knowledge/shared/harness-core/governor_landing_before_compact.md +57 -0
- package/knowledge/shared/harness-core/lease_record_channel.md +32 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +36 -0
- package/knowledge/shared/rules/operations.md +16 -0
- package/package.json +9 -1
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-commons/skills/convergence-loop/SKILL.md +8 -0
- package/plugins/fh-commons/skills/convergence-loop/fh-module.yaml +22 -0
- package/plugins/fh-commons/skills/ko-tech-writer/SKILL.md +5 -0
- package/plugins/fh-commons/skills/persona-cast/SKILL.md +20 -4
- package/plugins/fh-commons/skills/persona-cast/fh-module.yaml +20 -0
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +28 -0
- package/plugins/fh-meta/skills/steel-quench/SKILL.md +8 -3
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/convergence_verdict.py +177 -0
- package/scripts/lane_gap_hint.py +166 -0
- package/scripts/lane_gap_hint.sh +7 -0
- package/scripts/package_coverage_check.sh +19 -0
- package/scripts/persona_cast_merge.py +235 -0
- package/scripts/probe_live_eval_lib.py +41 -0
- package/scripts/selfcheck.sh +12 -1
- package/scripts/test_convergence_verdict_lanes.sh +67 -0
- package/scripts/test_lane_gap_hint_lanes.sh +91 -0
- package/scripts/test_live_eval_construct_lanes.sh +70 -0
- package/scripts/test_persona_cast_merge_lanes.sh +108 -0
|
@@ -39,6 +39,9 @@ cd "$REPO_ROOT" || exit 1
|
|
|
39
39
|
# scripts/sync_to_be_lanes.sh — forward-path lane suite for sync-to-be.sh, itself
|
|
40
40
|
# ACCEPTED_ABSENT above; added 2026-08-14, pmh-dev#69.
|
|
41
41
|
ACCEPTED_ABSENT=(
|
|
42
|
+
# 2026-11-06 — the lane for validate.yml's shard-count step. It reads .github/workflows/validate.yml, which the
|
|
43
|
+
# package does not ship; selfcheck lists it in CHECKOUT_ONLY_SUITES, so a consumer tree skips it by name.
|
|
44
|
+
"scripts/test_ci_validate_shard_count_lanes.sh"
|
|
42
45
|
# 2026-11-04 — unattended self-dev loop. Operator-machine only, by the operator's own scope
|
|
43
46
|
# (CLAUDE.local.md §FH 자체개발 자율화: «일반 사용자는 이슈/PR 제안»): shipping it would put an
|
|
44
47
|
# auto-merging loop into every consumer install. self_evolution_routine.md §3b names these files to
|
|
@@ -49,6 +52,22 @@ ACCEPTED_ABSENT=(
|
|
|
49
52
|
"scripts/test_selfdev_merge_tier_lanes.sh"
|
|
50
53
|
"scripts/test_selfdev_queue_lanes.sh"
|
|
51
54
|
"scripts/test_selfdev_loop_lanes.sh"
|
|
55
|
+
# 2026-11-07 — the self-dev loop's ablation nominator and its lanes. Same loop, same scope as above; whether the
|
|
56
|
+
# public cycle (docs/ABLATION_CYCLE.md, not shipped either) goes to npm is an open operator decision.
|
|
57
|
+
"scripts/ablation_nominate.py"
|
|
58
|
+
"scripts/test_ablation_nominate_lanes.sh"
|
|
59
|
+
"docs/ABLATION_CYCLE.md"
|
|
60
|
+
# 2026-11-07 — lease-record channel (AQ-20261107-11). It writes this hub's operator-local lease file; a consumer
|
|
61
|
+
# has no such file and no such convention, so shipping it would ship a tool with nothing to act on.
|
|
62
|
+
"scripts/lease_line_apply.sh"
|
|
63
|
+
"scripts/test_lease_line_apply_lanes.sh"
|
|
64
|
+
# 2026-11-07 — context-continuity read half (AQ-20261107-10/-12). Governor tools for this hub: the hook reads the
|
|
65
|
+
# hub's lease-file convention (CLAUDE.local.md «utterance» lines) and its snippet is not shipped either, so
|
|
66
|
+
# shipping the script alone would hand consumers a hook nothing calls. Ship both together, or neither.
|
|
67
|
+
"scripts/state_claim_recheck_hook.sh"
|
|
68
|
+
"scripts/test_state_claim_recheck_lanes.sh"
|
|
69
|
+
"scripts/governor_landing_check.py"
|
|
70
|
+
"scripts/test_governor_landing_check_lanes.sh"
|
|
52
71
|
# 2026-10-19 — cartridge admission checker and its lanes. Not shipped yet on purpose: publishing cartridges
|
|
53
72
|
# (fh-cartridges) is an open operator decision, and shipping the checker would put it in the next npm
|
|
54
73
|
# release by default. selfcheck resolves its row as SKIP («not in files[], and absent») on a consumer tree.
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""persona_cast_merge.py — persona-cast Step 4 (merge with the marginal-coverage stop), as a program.
|
|
3
|
+
|
|
4
|
+
Usage:
|
|
5
|
+
python3 scripts/persona_cast_merge.py --artifact <path> [--artifact <path> ...] \
|
|
6
|
+
--lens designer=out/designer.md --lens qa=out/qa.md [...] [--cast web-review] [--stance neutral] [--json]
|
|
7
|
+
|
|
8
|
+
Reads each lens's parallax output (plugins/fh-commons/agents/*-lens.md «Output»), then:
|
|
9
|
+
1. drops every Concern line with no leading [location] and counts it per lens (no-loc) — never merged;
|
|
10
|
+
2. keys the kept Concerns by their normalized location (lower case, whitespace collapsed, quotes and
|
|
11
|
+
backticks stripped);
|
|
12
|
+
3. unique(lens) = kept keys this lens raised and no other lens raised;
|
|
13
|
+
4. self-tag-hit = self-tagged keys (### Unique-to-this-seat) that really were unique / self-tagged keys;
|
|
14
|
+
5. verdict = «earned» when unique ≥ 1, «decorative on this artifact» when unique = 0;
|
|
15
|
+
6. prints the per-lens table and the merged Concerns (highest severity wins, with the raising seats).
|
|
16
|
+
|
|
17
|
+
Keying on the location alone is STRICTER than the SKILL text («location + first noun phrase»): two different
|
|
18
|
+
concerns at one location merge. That direction under-counts unique (a lens reads decorative sooner), never
|
|
19
|
+
over-counts it — padding a lens into «earned» is the failure this stop exists to prevent. Named residual:
|
|
20
|
+
two lenses describing the same spot with different location strings stay apart (over-count).
|
|
21
|
+
|
|
22
|
+
Exit codes: 0 every lens measured · 2 UNMEASURED (a lens file missing/unreadable/without a «### Concerns»
|
|
23
|
+
section, no lens given, an artifact missing) — a lens we could not read is never «decorative» and never
|
|
24
|
+
«earned». Usage errors also exit 2.
|
|
25
|
+
"""
|
|
26
|
+
import argparse
|
|
27
|
+
import hashlib
|
|
28
|
+
import json
|
|
29
|
+
import re
|
|
30
|
+
import sys
|
|
31
|
+
|
|
32
|
+
SEVERITIES = ("Critical", "Important", "Suggestion")
|
|
33
|
+
RANK = {s: i for i, s in enumerate(SEVERITIES)}
|
|
34
|
+
BULLET = re.compile(r"^\s*(?:[-*+]\s+|\d+[.)]\s+)?")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class _Loc:
|
|
38
|
+
"""[location] at the start of a line, with nested brackets balanced (`input[name=cvc]`) — 2026-11-06 blind sim:
|
|
39
|
+
a first-«]» cut turned «[form#card input[name=cvc]]» into a truncated key and moved «]» into the text."""
|
|
40
|
+
def match(self, line):
|
|
41
|
+
rest = line[BULLET.match(line).end():]
|
|
42
|
+
if not rest.startswith("["):
|
|
43
|
+
return None
|
|
44
|
+
depth, quoted = 0, False
|
|
45
|
+
for i, ch in enumerate(rest):
|
|
46
|
+
if ch == '"':
|
|
47
|
+
quoted = not quoted # brackets inside a quoted label are text (codex R1: [button "Save ] now"])
|
|
48
|
+
if quoted:
|
|
49
|
+
continue
|
|
50
|
+
depth += ch == "["
|
|
51
|
+
depth -= ch == "]"
|
|
52
|
+
if depth == 0:
|
|
53
|
+
inner = rest[1:i].strip()
|
|
54
|
+
return _M(inner, rest[i + 1:].strip()) if inner else None
|
|
55
|
+
return None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class _M:
|
|
59
|
+
def __init__(self, a, b):
|
|
60
|
+
self._g = (None, a, b)
|
|
61
|
+
|
|
62
|
+
def group(self, i):
|
|
63
|
+
return self._g[i]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
LOC = _Loc()
|
|
67
|
+
ITEM = re.compile(r"^\s*(?:[-*+]\s+|\d+[.)]\s+)(\S.*)$")
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def unwrap(loc):
|
|
71
|
+
"""strip backticks, and one pair of quotes only when they wrap the WHOLE location (a quoted label inside stays)"""
|
|
72
|
+
s = loc.strip().replace("`", "").strip()
|
|
73
|
+
for a, b in ('""', "''", "«»", "“”", "‘’"):
|
|
74
|
+
if len(s) >= 2 and s[0] == a and s[-1] == b and b not in s[1:-1]:
|
|
75
|
+
s = s[1:-1].strip()
|
|
76
|
+
return re.sub(r"\s+", " ", s)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def norm(loc):
|
|
80
|
+
s = unwrap(loc)
|
|
81
|
+
return re.sub(r"\s+", " ", s).lower()
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def sections(text):
|
|
85
|
+
"""'### Name' → list of body lines (the heading line's own trailing text after the name is ignored)."""
|
|
86
|
+
out, cur, fence = {}, None, False
|
|
87
|
+
for line in text.splitlines():
|
|
88
|
+
if re.match(r"^\s*(```|~~~)", line):
|
|
89
|
+
fence = not fence # fenced examples are not findings (codex R2)
|
|
90
|
+
continue
|
|
91
|
+
if fence:
|
|
92
|
+
continue
|
|
93
|
+
m = re.match(r"^\s*###\s+(.+?)\s*(?:\(.*)?$", line)
|
|
94
|
+
if m:
|
|
95
|
+
cur = m.group(1).strip()
|
|
96
|
+
out.setdefault(cur, [])
|
|
97
|
+
continue
|
|
98
|
+
if re.match(r"^\s*#{1,6}\s", line):
|
|
99
|
+
cur = None # any other heading ends the section (codex R1: an «## Appendix» must not feed Concerns)
|
|
100
|
+
continue
|
|
101
|
+
if cur is not None:
|
|
102
|
+
out[cur].append(line)
|
|
103
|
+
return out
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def parse_lens(text):
|
|
107
|
+
secs = sections(text)
|
|
108
|
+
if "Concerns" not in secs:
|
|
109
|
+
return None
|
|
110
|
+
# the parallax shape puts «Absence check» after Concerns; a reply that stops before it is truncated, and an empty
|
|
111
|
+
# Concerns there would read as «0 concerns → decorative» (codex R1) — so it is unreadable, not zero
|
|
112
|
+
if not any(n.lower().startswith("absence check") for n in secs):
|
|
113
|
+
return None
|
|
114
|
+
kept, noloc, sev = [], [], None
|
|
115
|
+
SEV = re.compile(r"^(?:[-*+]\s+|\d+[.)]\s+)?\*\*\s*(Critical|Important|Suggestion)\b[^*]*\*\*\s*[—:–-]*\s*")
|
|
116
|
+
for line in secs["Concerns"]:
|
|
117
|
+
s = line.strip()
|
|
118
|
+
if not s:
|
|
119
|
+
continue
|
|
120
|
+
hm = SEV.match(s)
|
|
121
|
+
if hm: # «**Critical** — gloss», «- **Critical** — [loc] text», «1. **Important**: [loc] text» (codex R1)
|
|
122
|
+
sev = hm.group(1)
|
|
123
|
+
rest = s[hm.end():].strip()
|
|
124
|
+
if not LOC.match(rest):
|
|
125
|
+
if rest and re.match(r"^(?:[-*+]\s+|\d+[.)]\s+)", s):
|
|
126
|
+
noloc.append(s) # a list item «- **Critical** — text» with no location: dropped, counted
|
|
127
|
+
continue # otherwise a severity heading line (with or without its gloss), not a concern
|
|
128
|
+
s = rest
|
|
129
|
+
m = LOC.match(s)
|
|
130
|
+
if m and norm(m.group(1)) and m.group(2).strip():
|
|
131
|
+
kept.append({"key": norm(m.group(1)), "location": unwrap(m.group(1)), "text": m.group(2).strip(), "severity": sev or "Suggestion"})
|
|
132
|
+
elif m or ITEM.match(s) or sev is not None:
|
|
133
|
+
noloc.append(s) # no location, or an empty location / an empty concern (codex R1) — dropped and counted
|
|
134
|
+
tags = []
|
|
135
|
+
for name, body in secs.items():
|
|
136
|
+
if name.lower().startswith("unique-to-this-seat"):
|
|
137
|
+
for line in body:
|
|
138
|
+
m = LOC.match(line.strip())
|
|
139
|
+
if m:
|
|
140
|
+
tags.append(norm(m.group(1)))
|
|
141
|
+
return {"kept": kept, "noloc": noloc, "tags": sorted(set(tags))}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def main(argv):
|
|
145
|
+
ap = argparse.ArgumentParser(description="persona-cast Step 4 merge")
|
|
146
|
+
ap.add_argument("--artifact", action="append", default=[])
|
|
147
|
+
ap.add_argument("--lens", action="append", default=[], help="name=path")
|
|
148
|
+
ap.add_argument("--cast", default="web-review")
|
|
149
|
+
ap.add_argument("--stance", default="neutral")
|
|
150
|
+
ap.add_argument("--json", action="store_true")
|
|
151
|
+
try:
|
|
152
|
+
a = ap.parse_args(argv)
|
|
153
|
+
except SystemExit:
|
|
154
|
+
return 2
|
|
155
|
+
unmeasured = []
|
|
156
|
+
if not a.lens:
|
|
157
|
+
unmeasured.append("no --lens given")
|
|
158
|
+
shas = []
|
|
159
|
+
for p in a.artifact:
|
|
160
|
+
try:
|
|
161
|
+
with open(p, "rb") as f:
|
|
162
|
+
shas.append((p, hashlib.sha256(f.read()).hexdigest()[:12]))
|
|
163
|
+
except OSError as e:
|
|
164
|
+
unmeasured.append(f"artifact {p}: {e.strerror}")
|
|
165
|
+
if not a.artifact:
|
|
166
|
+
unmeasured.append("no --artifact given (the run header needs its sha256)")
|
|
167
|
+
lenses = {}
|
|
168
|
+
for spec in a.lens:
|
|
169
|
+
if "=" not in spec:
|
|
170
|
+
unmeasured.append(f"--lens {spec!r} is not name=path")
|
|
171
|
+
continue
|
|
172
|
+
name, path = spec.split("=", 1)
|
|
173
|
+
try:
|
|
174
|
+
with open(path, encoding="utf-8") as f:
|
|
175
|
+
parsed = parse_lens(f.read())
|
|
176
|
+
except (OSError, UnicodeDecodeError) as e:
|
|
177
|
+
unmeasured.append(f"lens {name}: unreadable ({getattr(e, 'strerror', None) or e.__class__.__name__})")
|
|
178
|
+
continue
|
|
179
|
+
if parsed is None:
|
|
180
|
+
unmeasured.append(f"lens {name}: no «### Concerns» section — not parallax output")
|
|
181
|
+
continue
|
|
182
|
+
if name in lenses:
|
|
183
|
+
unmeasured.append(f"lens {name}: given twice")
|
|
184
|
+
continue
|
|
185
|
+
lenses[name] = parsed
|
|
186
|
+
|
|
187
|
+
raisers = {}
|
|
188
|
+
for name, p in lenses.items():
|
|
189
|
+
for c in p["kept"]:
|
|
190
|
+
raisers.setdefault(c["key"], set()).add(name)
|
|
191
|
+
rows = []
|
|
192
|
+
for name, p in lenses.items():
|
|
193
|
+
keys = {c["key"] for c in p["kept"]}
|
|
194
|
+
uniq = sorted(k for k in keys if raisers[k] == {name})
|
|
195
|
+
hit = sum(1 for k in p["tags"] if k in uniq)
|
|
196
|
+
rows.append({"lens": name, "total": len(p["kept"]), "no_loc": len(p["noloc"]), "unique": len(uniq),
|
|
197
|
+
"self_tag_hit": f"{hit}/{len(p['tags'])}",
|
|
198
|
+
# a peer we could not read might share this lens's findings: no seat verdict without it (codex R2)
|
|
199
|
+
"verdict": "UNMEASURED (a peer lens was unreadable)" if unmeasured else ("earned" if uniq else "decorative on this artifact")})
|
|
200
|
+
merged = {}
|
|
201
|
+
for name, p in lenses.items():
|
|
202
|
+
for c in p["kept"]:
|
|
203
|
+
m = merged.setdefault(c["key"], {"location": c["location"], "severity": c["severity"], "seats": set(), "texts": []})
|
|
204
|
+
if RANK[c["severity"]] < RANK[m["severity"]]:
|
|
205
|
+
m["severity"] = c["severity"]
|
|
206
|
+
m["seats"].add(name)
|
|
207
|
+
m["texts"].append(f"{name}: {c['text']}")
|
|
208
|
+
|
|
209
|
+
verdict = "UNMEASURED" if unmeasured else "MEASURED"
|
|
210
|
+
if a.json:
|
|
211
|
+
print(json.dumps({"verdict": verdict, "unmeasured": unmeasured, "artifacts": shas, "rows": rows,
|
|
212
|
+
"merged": [{**v, "seats": sorted(v["seats"])} for v in merged.values()]}, ensure_ascii=False, indent=1))
|
|
213
|
+
else:
|
|
214
|
+
head = " ".join(f"artifact={p} sha256={h}" for p, h in shas) or "artifact=(none)"
|
|
215
|
+
print(f"persona-cast · cast={a.cast} · stance={a.stance} · {head}")
|
|
216
|
+
print(f"{'lens':<14}{'total':>6}{'no-loc':>8}{'unique':>8}{'self-tag-hit':>14} verdict")
|
|
217
|
+
for r in rows:
|
|
218
|
+
print(f"{r['lens']:<14}{r['total']:>6}{r['no_loc']:>8}{r['unique']:>8}{r['self_tag_hit']:>14} {r['verdict']}")
|
|
219
|
+
for sev in SEVERITIES:
|
|
220
|
+
items = [v for v in merged.values() if v["severity"] == sev]
|
|
221
|
+
if not items:
|
|
222
|
+
continue
|
|
223
|
+
print(f"\n{sev} (merged, with the seats that raised each)")
|
|
224
|
+
for v in sorted(items, key=lambda x: (-len(x["seats"]), x["location"])):
|
|
225
|
+
print(f"- [{v['location']}] seats={','.join(sorted(v['seats']))}")
|
|
226
|
+
for t in v["texts"]:
|
|
227
|
+
print(f" · {t}")
|
|
228
|
+
for u in unmeasured:
|
|
229
|
+
print(f"UNMEASURED: {u}")
|
|
230
|
+
print(f"verdict: {verdict}")
|
|
231
|
+
return 2 if unmeasured else 0
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
if __name__ == "__main__":
|
|
235
|
+
sys.exit(main(sys.argv[1:]))
|
|
@@ -194,6 +194,9 @@ def classify(id_, input_pat, class_tok):
|
|
|
194
194
|
return 'SELECTABLE', None
|
|
195
195
|
|
|
196
196
|
|
|
197
|
+
CONSTRUCT_VALUES = ('same', 'partial', 'proxy')
|
|
198
|
+
|
|
199
|
+
|
|
197
200
|
def build_selection(probes_md_rows, live_rows):
|
|
198
201
|
"""Cross-reference probes.md (source of truth for WHICH probes exist and their class) against
|
|
199
202
|
probes_live.yaml (source of truth for HOW to score the selected ones).
|
|
@@ -256,6 +259,23 @@ def build_selection(probes_md_rows, live_rows):
|
|
|
256
259
|
# row green does not also erase the residual the widening stopped seeing.
|
|
257
260
|
if spec.get('advisory_re'):
|
|
258
261
|
entry['advisory_re'] = spec['advisory_re']
|
|
262
|
+
# Construct validity — RECORD ONLY, never scored (2026-11-06, frontier digest arXiv:2611.05665):
|
|
263
|
+
# what the probe CLAIMS to measure vs what its pattern can actually SEE. A probe whose pattern
|
|
264
|
+
# reads a mention while it claims an order or a proposal is a proxy, and the report says so.
|
|
265
|
+
c = spec.get('construct')
|
|
266
|
+
if c is None:
|
|
267
|
+
entry['construct'] = 'UNDECLARED'
|
|
268
|
+
warnings.append("UNDECLARED-CONSTRUCT: %s has no construct/claims/unseen — the report cannot say "
|
|
269
|
+
"what its pattern misses" % row['id'])
|
|
270
|
+
elif c not in CONSTRUCT_VALUES:
|
|
271
|
+
entry['construct'] = 'UNDECLARED'
|
|
272
|
+
warnings.append("BAD-CONSTRUCT: %s declares construct=%r (must be %s) — recorded as UNDECLARED"
|
|
273
|
+
% (row['id'], c, '|'.join(CONSTRUCT_VALUES)))
|
|
274
|
+
else:
|
|
275
|
+
entry['construct'] = c
|
|
276
|
+
for k in ('claims', 'unseen'):
|
|
277
|
+
if spec.get(k):
|
|
278
|
+
entry[k] = spec[k]
|
|
259
279
|
selected.append(entry)
|
|
260
280
|
|
|
261
281
|
# Dead-pointer guard: an id in probes_live.yaml that does not exist in probes.md AT ALL.
|
|
@@ -788,6 +808,26 @@ def render_instrument_line(fp):
|
|
|
788
808
|
"(the Run heading names the model)")
|
|
789
809
|
|
|
790
810
|
|
|
811
|
+
def render_construct_md(selected):
|
|
812
|
+
"""Record only: per selected probe, construct (same|partial|proxy|UNDECLARED), its claim, and what
|
|
813
|
+
its pattern cannot see. An undeclared probe is counted, never read as «same»."""
|
|
814
|
+
if not selected:
|
|
815
|
+
return []
|
|
816
|
+
tally = {}
|
|
817
|
+
for e in selected:
|
|
818
|
+
tally[e.get('construct', 'UNDECLARED')] = tally.get(e.get('construct', 'UNDECLARED'), 0) + 1
|
|
819
|
+
out = ["## Construct validity (record only — no verdict depends on this)", "",
|
|
820
|
+
"A PASS says the pattern matched; this table says what the pattern can and cannot see. "
|
|
821
|
+
"`proxy` = the pattern reads a mention while the probe claims a behavior (an order, a proposal, a read).", "",
|
|
822
|
+
"- " + " · ".join("%s %d" % (k, tally[k]) for k in ('same', 'partial', 'proxy', 'UNDECLARED') if k in tally), "",
|
|
823
|
+
"| Probe | construct | claims | cannot see |", "|---|---|---|---|"]
|
|
824
|
+
for e in selected:
|
|
825
|
+
out.append("| %s | %s | %s | %s |" % (e['id'], e.get('construct', 'UNDECLARED'),
|
|
826
|
+
_md_escape(e.get('claims', '—')), _md_escape(e.get('unseen', '—'))))
|
|
827
|
+
out.append("")
|
|
828
|
+
return out
|
|
829
|
+
|
|
830
|
+
|
|
791
831
|
def render_report_md(select_result, score_result, run_date, instrument=None):
|
|
792
832
|
lines = []
|
|
793
833
|
lines.append("# live_eval — %s" % run_date)
|
|
@@ -840,6 +880,7 @@ def render_report_md(select_result, score_result, run_date, instrument=None):
|
|
|
840
880
|
"instrument failure produce this shape, and this file cannot tell them "
|
|
841
881
|
"apart; the preserved response bodies can.")
|
|
842
882
|
lines.append("")
|
|
883
|
+
lines.extend(render_construct_md(select_result['selected']))
|
|
843
884
|
if score_result is not None and score_result.get('target'):
|
|
844
885
|
lines.extend(render_target_md(score_result['target']))
|
|
845
886
|
if score_result is not None and score_result.get('transitions'):
|
package/scripts/selfcheck.sh
CHANGED
|
@@ -190,7 +190,7 @@ if [ "${FH_SELFCHECK_PROFILE:-full}" = consumer ]; then
|
|
|
190
190
|
if _package_mode; then _CONSUMER=1
|
|
191
191
|
else echo "⚠️ FH_SELFCHECK_PROFILE=consumer IGNORED — this tree is a git checkout; running the full suite"; fi
|
|
192
192
|
fi
|
|
193
|
-
CHECKOUT_ONLY_SUITES="test_package_coverage_lanes.sh test_files_manifest_shipping_lanes.sh test_map_postprocess_lanes.sh test_remote_marker_gate_lanes.sh test_worktree_reclaim_lanes.sh test_sim_isolated_run_lanes.sh test_utterance_intake_lanes.sh test_precommit_pointer_index_lanes.sh test_selfcheck_shard_lanes.sh"
|
|
193
|
+
CHECKOUT_ONLY_SUITES="test_package_coverage_lanes.sh test_files_manifest_shipping_lanes.sh test_map_postprocess_lanes.sh test_remote_marker_gate_lanes.sh test_worktree_reclaim_lanes.sh test_sim_isolated_run_lanes.sh test_utterance_intake_lanes.sh test_precommit_pointer_index_lanes.sh test_selfcheck_shard_lanes.sh test_ci_validate_shard_count_lanes.sh"
|
|
194
194
|
CONSUMER_SKIPPED=""
|
|
195
195
|
_consumer_skip() { # $1 = suite basename · rc 0 = skip it (and it has been named)
|
|
196
196
|
[ "$_CONSUMER" -eq 1 ] || return 1
|
|
@@ -1177,10 +1177,21 @@ for _pair in \
|
|
|
1177
1177
|
"scripts/destructive_pre_gate.sh|scripts/test_destructive_pre_gate_lanes.sh" \
|
|
1178
1178
|
"scripts/probe_live_eval_lib.py|scripts/test_live_eval_transitions_lanes.sh" \
|
|
1179
1179
|
"scripts/correction_moments.py|scripts/test_correction_moments_lanes.sh" \
|
|
1180
|
+
"scripts/probe_live_eval_lib.py|scripts/test_live_eval_construct_lanes.sh" \
|
|
1180
1181
|
`# 무인 자체개발 루프(2026-11-04, 운영자 상시 요청). 자동 머지 등급은 모델이 아니라 경로 허용 목록이 정한다 — 빈 목록은 AUTO 가 아니라 HARNESS-ERROR(실측: 가드를 지우면 빈 목록이 AUTO 로 통과).` \
|
|
1181
1182
|
"scripts/selfdev_merge_tier.sh|scripts/test_selfdev_merge_tier_lanes.sh" \
|
|
1182
1183
|
"scripts/selfdev_queue.py|scripts/test_selfdev_queue_lanes.sh" \
|
|
1184
|
+
"scripts/ablation_nominate.py|scripts/test_ablation_nominate_lanes.sh" \
|
|
1185
|
+
`# 리스 기록 채널(2026-11-07). 세션은 초안, 기록은 운영자 — 에이전트 셸 거부 · 코드 불일치 무기록 · 원자적 교체.` \
|
|
1186
|
+
"scripts/lease_line_apply.sh|scripts/test_lease_line_apply_lanes.sh" \
|
|
1187
|
+
`# 맥락 유지 읽는 절반(2026-11-07). 상태 주장 뒤 리스 줄 한 줄 · 착지 판정 — 못 읽음은 OK 가 아니다.` \
|
|
1188
|
+
"scripts/state_claim_recheck_hook.sh|scripts/test_state_claim_recheck_lanes.sh" \
|
|
1189
|
+
"scripts/governor_landing_check.py|scripts/test_governor_landing_check_lanes.sh" \
|
|
1183
1190
|
"scripts/selfdev_loop.sh|scripts/test_selfdev_loop_lanes.sh" \
|
|
1191
|
+
"scripts/lane_gap_hint.py|scripts/test_lane_gap_hint_lanes.sh" \
|
|
1192
|
+
"scripts/persona_cast_merge.py|scripts/test_persona_cast_merge_lanes.sh" \
|
|
1193
|
+
"scripts/convergence_verdict.py|scripts/test_convergence_verdict_lanes.sh" \
|
|
1194
|
+
".github/workflows/validate.yml|scripts/test_ci_validate_shard_count_lanes.sh" \
|
|
1184
1195
|
"scripts/card_status_tags.sh|scripts/test_card_status_tags_lanes.sh" \
|
|
1185
1196
|
"templates/.git-hooks/pre-push|scripts/test_prepush_destructive_lanes.sh" \
|
|
1186
1197
|
"templates/.git-hooks/pre-push|scripts/test_prepush_destructive_liveness.sh" \
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_convergence_verdict_lanes.sh — known-pair calibration for scripts/convergence_verdict.py
|
|
3
|
+
# (convergence-loop §Convergence Judgment: last round clean AND no repairs in response AND ≥ 2 rounds).
|
|
4
|
+
# C1 is the positive control (a vector that IS converged reads CONVERGED); every other lane is one way a vector
|
|
5
|
+
# must NOT read converged, or must read UNMEASURED instead of a guess.
|
|
6
|
+
set -u
|
|
7
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
V="$HERE/convergence_verdict.py"
|
|
9
|
+
[ -f "$V" ] || { echo "HARNESS-ERROR: $V missing"; exit 2; }
|
|
10
|
+
W="$(mktemp -d)"; trap 'rm -rf "$W"' EXIT
|
|
11
|
+
pass=0; fail=0
|
|
12
|
+
ok() { pass=$((pass+1)); echo " ✅ $1"; }
|
|
13
|
+
bad() { fail=$((fail+1)); echo " ❌ $1"; }
|
|
14
|
+
one() { # <label> <want rc> <want verdict word> <vector>
|
|
15
|
+
out=$(python3 "$V" --rounds "$4" 2>&1); rc=$?
|
|
16
|
+
if [ "$rc" = "$2" ] && printf '%s' "$out" | grep -q "^$3:"; then ok "$1"; else bad "$1 (rc=$rc · $out)"; fi
|
|
17
|
+
}
|
|
18
|
+
one "C1 control: R1 fixes, R2 clean with no repairs → CONVERGED" 0 CONVERGED 'R1 [new=3, fixed=3] → R2 [new=0, fixed=0]'
|
|
19
|
+
one "C2 one clean round → PROVISIONAL, rc 1 (condition 3: ≥ 2 rounds)" 1 PROVISIONAL 'R1 [new=0, fixed=0] → converged'
|
|
20
|
+
one "C3 last round triggered a fix → NOT-CONVERGED (the fix is unverified)" 1 NOT-CONVERGED 'R1 [new=2, fixed=2] → R2 [new=0, fixed=1]'
|
|
21
|
+
one "C4 last round found something new → NOT-CONVERGED" 1 NOT-CONVERGED 'R1 [new=2, fixed=2] → R2 [new=1, fixed=1]'
|
|
22
|
+
one "C5 S/A/B form: all-zero last round after a finding round → CONVERGED" 0 CONVERGED 'R1 S1A2B3 → R2 S0A0B0'
|
|
23
|
+
one "C6 S/A/B form: a B finding in the last round with no fix info → UNMEASURED" 2 UNMEASURED 'R1 S1A4B5 → R2 S0A0B3'
|
|
24
|
+
one "C7 free prose → UNMEASURED, never guessed" 2 UNMEASURED 'R1 0 and no change → converged'
|
|
25
|
+
one "C8 a bracketed round missing fixed= → UNMEASURED (not «judge R1»)" 2 UNMEASURED 'R1 [new=1, fixed=1] → R2 [new=0] → converged'
|
|
26
|
+
one "C9 rounds out of order → UNMEASURED" 2 UNMEASURED 'R2 [new=0, fixed=0] → R1 [new=1, fixed=1]'
|
|
27
|
+
one "C10 a note inside the brackets is allowed («new=1 (med1)»)" 0 CONVERGED 'R1 [new=1 (med1), fixed=1] · R2 [new=0, fixed=0] → converged'
|
|
28
|
+
# codex R1 counterexamples — each read CONVERGED (exit 0) before the strict per-round parser
|
|
29
|
+
one "C10b a trailing round in another shape is not skipped (R3 S1A0B0)" 2 UNMEASURED 'R1 [new=1, fixed=1] → R2 [new=0, fixed=0] → R3 S1A0B0'
|
|
30
|
+
one "C10c a trailing unreadable round is not skipped (R3 ???)" 2 UNMEASURED 'R1 [new=1, fixed=1] → R2 [new=0, fixed=0] → R3 ???'
|
|
31
|
+
one "C10d a decimal count is not read as its integer part" 2 UNMEASURED 'R1 [new=1, fixed=1] → R2 [new=0.5, fixed=0.5]'
|
|
32
|
+
one "C10e a repeated S/A/B key does not overwrite a count" 2 UNMEASURED 'R1 S1A0B0 → R2 S1S0A0'
|
|
33
|
+
one "C10f repairs written after an all-zero S/A/B round are not «no repairs»" 2 UNMEASURED 'R1 S1A0B0 → R2 S0A0B0 fixed=2'
|
|
34
|
+
# codex R2
|
|
35
|
+
one "C10g a second shape inside one round is not ignored" 2 UNMEASURED 'R1 [new=1, fixed=1] → R2 [new=0, fixed=0] [new=3, fixed=0]'
|
|
36
|
+
one "C10h a S/A/B tail inside a [new=,fixed=] round is not ignored" 2 UNMEASURED 'R1 [new=1, fixed=1] → R2 [new=0, fixed=0] S3A0B0'
|
|
37
|
+
one "C10i an S/A/B round without S and A says nothing about S/A" 2 UNMEASURED 'R1 S1A0B0 → R2 B0C0'
|
|
38
|
+
one "C10j repairs written outside the counts are not «fixed=0»" 2 UNMEASURED 'R1 [new=1, fixed=1] → R2 [new=0, fixed=0] (repaired two defects)'
|
|
39
|
+
mk() { printf 'date: x\naxis2-rounds: %s\n' "$2" > "$W/m/.axes_23_passed_$1_2026-11-06.marker"; }
|
|
40
|
+
mkdir -p "$W/m"
|
|
41
|
+
mk true_claim 'R1 [new=2, fixed=2] → R2 [new=0, fixed=0] → converged'
|
|
42
|
+
mk false_claim 'R1 [new=0, fixed=0] → converged'
|
|
43
|
+
mk unreadable 'R1 0 and no change → converged'
|
|
44
|
+
mk honest 'R1 [new=0, fixed=0] → not converged (one round only)'
|
|
45
|
+
mk ko_claim 'R1 [new=0, fixed=0] → 수렴'
|
|
46
|
+
mk ko_honest 'R1 [new=0, fixed=0] → 수렴 안 함(한 라운드)'
|
|
47
|
+
mk ko_done 'R1 [new=0, fixed=0] → 수렴 완료'
|
|
48
|
+
mk en_notyet 'R1 [new=0, fixed=0] → not yet converged'
|
|
49
|
+
mk ko_notdone 'R1 [new=0, fixed=0] → 수렴하지 않음'
|
|
50
|
+
mk en_underscore 'R1 [new=0, fixed=0] → converged_완료'
|
|
51
|
+
out=$(python3 "$V" --scan-markers "$W/m" 2>&1); rc=$?
|
|
52
|
+
if [ "$rc" = 1 ] && printf '%s' "$out" | grep -q 'contradicts it: 4 · claimed on a vector this tool cannot read: 1' \
|
|
53
|
+
&& printf '%s' "$out" | grep -q 'false_claim' && printf '%s' "$out" | grep -q 'ko_claim' && printf '%s' "$out" | grep -q 'ko_done' && printf '%s' "$out" | grep -q 'en_underscore' \
|
|
54
|
+
&& ! printf '%s' "$out" | grep -qE 'honest_2026|en_notyet|ko_notdone' && ! printf '%s' "$out" | grep -q 'true_claim_2026'; then
|
|
55
|
+
ok "C11 scan: false claims flagged in English and Korean («→ 수렴»), one unauditable; the true claim and «not converged» / «수렴 안 함» lines are not"
|
|
56
|
+
else bad "C11 (rc=$rc)"; printf '%s\n' "$out" | sed 's/^/ /'; fi
|
|
57
|
+
for f in false_claim ko_claim ko_done en_underscore; do rm "$W/m/.axes_23_passed_${f}_2026-11-06.marker"; done
|
|
58
|
+
out=$(python3 "$V" --scan-markers "$W/m" 2>&1); rc=$?
|
|
59
|
+
[ "$rc" = 2 ] && ok "C12 no false claim left but one claim this tool cannot read → rc 2, not a clean audit (codex R1)" || bad "C12 (rc=$rc)"
|
|
60
|
+
rm "$W/m/.axes_23_passed_unreadable_2026-11-06.marker"
|
|
61
|
+
out=$(python3 "$V" --scan-markers "$W/m" 2>&1); rc=$?
|
|
62
|
+
[ "$rc" = 0 ] && ok "C12b control: nothing false and nothing unreadable → rc 0" || bad "C12b (rc=$rc · $out)"
|
|
63
|
+
mkdir -p "$W/empty"; out=$(python3 "$V" --scan-markers "$W/empty" 2>&1); rc=$?
|
|
64
|
+
[ "$rc" = 2 ] && printf '%s' "$out" | grep -q UNMEASURED && ok "C13 a folder with no axis2-rounds line → UNMEASURED (rc 2), not «no false claims»" || bad "C13 (rc=$rc)"
|
|
65
|
+
[ $((pass+fail)) -eq 23 ] || { echo "HARNESS-ERROR: counted $((pass+fail)) lanes, expected 23"; exit 2; }
|
|
66
|
+
echo "convergence_verdict lanes: $pass passed · $fail failed"
|
|
67
|
+
[ "$fail" -eq 0 ]
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_lane_gap_hint_lanes.sh — scripts/lane_gap_hint.py (UserPromptSubmit, advisory). G1 is the positive control: a turn
|
|
3
|
+
# that edited code and ran nothing produces the line; every other lane is a turn that must stay silent, plus exit 0 always.
|
|
4
|
+
set -u
|
|
5
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
+
H="$HERE/lane_gap_hint.py"
|
|
7
|
+
[ -f "$H" ] || { echo "HARNESS-ERROR: $H missing"; exit 2; }
|
|
8
|
+
W="$(mktemp -d)"; trap 'rm -rf "$W"' EXIT
|
|
9
|
+
pass=0; fail=0
|
|
10
|
+
ok() { pass=$((pass+1)); echo " ✅ $1"; }
|
|
11
|
+
bad() { fail=$((fail+1)); echo " ❌ $1"; }
|
|
12
|
+
# transcript <name> <tool lines as name|arg ...> — one real user prompt, then the tool calls of that turn
|
|
13
|
+
mk() {
|
|
14
|
+
local f="$W/$1.jsonl"; shift
|
|
15
|
+
python3 - "$f" "$@" <<'PY'
|
|
16
|
+
import json, sys
|
|
17
|
+
f, specs = sys.argv[1], sys.argv[2:]
|
|
18
|
+
rows = [{"type": "user", "message": {"content": "earlier prompt"}},
|
|
19
|
+
{"type": "assistant", "message": {"content": [{"type": "tool_use", "id": "old", "name": "Edit", "input": {"file_path": "/r/scripts/old.sh"}}]}},
|
|
20
|
+
{"type": "user", "message": {"content": [{"type": "tool_result", "tool_use_id": "old"}]}},
|
|
21
|
+
{"type": "user", "message": {"content": [{"type": "text", "text": "do the thing"}]}}]
|
|
22
|
+
for i, s in enumerate(specs):
|
|
23
|
+
name, arg = s.split("|", 1)
|
|
24
|
+
if name == "ImgPrompt": # an image-only prompt typed by the person: a turn boundary
|
|
25
|
+
rows.append({"type": "user", "message": {"content": [{"type": "image", "source": {}}]}}); continue
|
|
26
|
+
side = name.startswith("Side") # a subagent's line
|
|
27
|
+
err = name.startswith("Fail") # a tool call whose result is an error
|
|
28
|
+
name = name.replace("Side", "").replace("Fail", "") or "Bash"
|
|
29
|
+
inp = {"command": arg} if name == "Bash" else ({"notebook_path": arg} if name == "NotebookEdit" else {"file_path": arg})
|
|
30
|
+
a = {"type": "assistant", "message": {"content": [{"type": "tool_use", "id": f"t{i}", "name": name, "input": inp}]}}
|
|
31
|
+
r = {"type": "user", "message": {"content": [{"type": "tool_result", "tool_use_id": f"t{i}", "is_error": err}]}}
|
|
32
|
+
if side:
|
|
33
|
+
a["isSidechain"] = r["isSidechain"] = True
|
|
34
|
+
rows += [a, r]
|
|
35
|
+
open(f, "w").write("\n".join(json.dumps(r) for r in rows) + "\n")
|
|
36
|
+
PY
|
|
37
|
+
}
|
|
38
|
+
run() { OUT=$(printf '{"transcript_path":"%s"}' "$1" | env ${2:-} python3 "$H" 2>&1); RC=$?; }
|
|
39
|
+
mk gap "Edit|/r/scripts/a.sh" "Write|/r/src/b.py" "Bash|git status"
|
|
40
|
+
run "$W/gap.jsonl"
|
|
41
|
+
[ "$RC" = 0 ] && printf '%s' "$OUT" | grep -q '코드 파일 2개(a.sh, b.py)' && ok "G1 control: code edited, nothing ran → one line naming the files" || bad "G1 (rc=$RC · $OUT)"
|
|
42
|
+
for spec in "bash scripts/test_x_lanes.sh" "python3 -m pytest -q tests/" "node --test" "npm test" "bash scripts/selfcheck.sh"; do
|
|
43
|
+
mk ran "Edit|/r/scripts/a.sh" "Bash|$spec"; run "$W/ran.jsonl"
|
|
44
|
+
[ "$RC" = 0 ] && [ -z "$OUT" ] || { bad "G2 a run ($spec) silences it (rc=$RC · $OUT)"; continue; }
|
|
45
|
+
done
|
|
46
|
+
[ "$fail" = 0 ] && ok "G2 any test/lane run in the same turn silences it (test_*_lanes · pytest · node --test · npm test · selfcheck)"
|
|
47
|
+
mk prose "Edit|/r/README.md" "Write|/r/docs/x.md"; run "$W/prose.jsonl"
|
|
48
|
+
[ -z "$OUT" ] && ok "G3 prose-only edits stay silent" || bad "G3 ($OUT)"
|
|
49
|
+
mk none "Bash|ls"; run "$W/none.jsonl"
|
|
50
|
+
[ -z "$OUT" ] && ok "G4 a turn with no edit stays silent — the older turn's edit (old.sh) is not counted" || bad "G4 ($OUT)"
|
|
51
|
+
run "$W/missing.jsonl"; R1="$RC$OUT"; OUT2=$(printf '{"transcript_path":"rel/x.jsonl"}' | python3 "$H" 2>&1); R2="$?$OUT2"; OUT3=$(printf 'not json' | python3 "$H" 2>&1); R3="$?$OUT3"
|
|
52
|
+
[ "$R1" = 0 ] && [ "$R2" = 0 ] && [ "$R3" = 0 ] && ok "G5 unreadable/relative/garbage input: exit 0, no output" || bad "G5 ($R1 | $R2 | $R3)"
|
|
53
|
+
run "$W/gap.jsonl" FH_LANE_GAP_HINT=0
|
|
54
|
+
[ "$RC" = 0 ] && [ -z "$OUT" ] && ok "G6 FH_LANE_GAP_HINT=0 turns it off (control: G1 speaks on the same file)" || bad "G6 ($OUT)"
|
|
55
|
+
# codex R1 (2026-11-06) — each was a false silence or a false alarm
|
|
56
|
+
say() { [ -n "$OUT" ]; }
|
|
57
|
+
mk men "Edit|/r/scripts/a.sh" "Bash|git diff scripts/test_x_lanes.sh" "Bash|echo pytest"; run "$W/men.jsonl"
|
|
58
|
+
say && ok "G7 a command that only MENTIONS a test (git diff test_x · echo pytest) does not silence it" || bad "G7 silent"
|
|
59
|
+
mk q "Edit|/r/src/a.py" "Bash|cd /r && \"pytest\" -q"; run "$W/q.jsonl"
|
|
60
|
+
! say && ok "G8 a quoted program name still counts as a run («\"pytest\" -q» after cd)" || bad "G8 ($OUT)"
|
|
61
|
+
mk side "Edit|/r/scripts/a.sh" "SideBash|bash scripts/test_y_lanes.sh"; run "$W/side.jsonl"
|
|
62
|
+
say && ok "G9 a subagent's (sidechain) test run does not count for this session" || bad "G9 silent"
|
|
63
|
+
mk img "Bash|bash scripts/test_z_lanes.sh" "ImgPrompt|" "Edit|/r/scripts/a.sh"; run "$W/img.jsonl"
|
|
64
|
+
say && ok "G10 an image-only prompt is a turn boundary — the earlier turn's test run does not silence the new edit" || bad "G10 silent"
|
|
65
|
+
mk failed "FailEdit|/r/scripts/a.sh"; run "$W/failed.jsonl"
|
|
66
|
+
! say && ok "G11 a failed edit changed nothing → silent" || bad "G11 ($OUT)"
|
|
67
|
+
mk nb "NotebookEdit|/r/analysis.ipynb"; run "$W/nb.jsonl"
|
|
68
|
+
say && ok "G12 a notebook edit counts" || bad "G12 silent"
|
|
69
|
+
python3 - "$W/gap.jsonl" "$W/cut.jsonl" <<'PY'
|
|
70
|
+
import sys
|
|
71
|
+
rows = open(sys.argv[1]).read().splitlines()
|
|
72
|
+
open(sys.argv[2], "w").write("\n".join(r for r in rows if '"do the thing"' not in r and '"earlier prompt"' not in r) + "\n")
|
|
73
|
+
PY
|
|
74
|
+
run "$W/cut.jsonl"
|
|
75
|
+
! say && ok "G13 a transcript tail with no prompt in it (turn start cut off) → no statement, silent" || bad "G13 ($OUT)"
|
|
76
|
+
SNIP="$HERE/../templates/settings.LaneGap.snippet.json"
|
|
77
|
+
CMD=$(python3 -c "import json,sys;print(json.load(open(sys.argv[1]))['project_settings_json']['hooks']['UserPromptSubmit'][0]['hooks'][0]['command'])" "$SNIP")
|
|
78
|
+
O1=$(cd "$W" && env CLAUDE_PROJECT_DIR="$W" FH_LANE_GAP_HINT=0 sh -c "$CMD" 2>&1 </dev/null); O2=$(cd "$W" && env CLAUDE_PROJECT_DIR="$W" sh -c "$CMD" 2>&1 </dev/null)
|
|
79
|
+
[ -z "$O1" ] && printf '%s' "$O2" | grep -q 'lane-gap' && ok "G14 the wrapper honours FH_LANE_GAP_HINT=0 even when the script is missing (control: without it, it warns)" || bad "G14 (off=«$O1» on=«$O2»)"
|
|
80
|
+
mk cm "Edit|/r/scripts/a.sh" "Bash|echo done # note; pytest -q" "Bash|cat <<EOF
|
|
81
|
+
pytest -q
|
|
82
|
+
EOF"; run "$W/cm.jsonl"
|
|
83
|
+
say && ok "G15 a test named inside a comment or a heredoc body is text, not a run (codex R2)" || bad "G15 silent"
|
|
84
|
+
# G16: the .sh entry point the snippet calls passes stdin through and keeps the opt-out (install-wizard keys on scripts/<name>.sh)
|
|
85
|
+
O3=$(printf '{"transcript_path":"%s"}' "$W/gap.jsonl" | bash "$HERE/lane_gap_hint.sh"); R3=$?
|
|
86
|
+
O4=$(printf '{"transcript_path":"%s"}' "$W/gap.jsonl" | FH_LANE_GAP_HINT=0 bash "$HERE/lane_gap_hint.sh")
|
|
87
|
+
[ "$R3" = 0 ] && printf '%s' "$O3" | grep -q 'lane-gap' && [ -z "$O4" ] && grep -q 'scripts/lane_gap_hint.sh' "$HERE/../templates/settings.LaneGap.snippet.json" \
|
|
88
|
+
&& ok "G16 the snippet calls the .sh wrapper, which passes stdin to the hint and honours the opt-out" || bad "G16 (rc=$R3 · on=«$O3» · off=«$O4»)"
|
|
89
|
+
[ $((pass+fail)) -eq 16 ] || { echo "HARNESS-ERROR: counted $((pass+fail)) lanes, expected 16"; exit 2; }
|
|
90
|
+
echo "lane_gap_hint lanes: $pass passed · $fail failed"
|
|
91
|
+
[ "$fail" -eq 0 ]
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_live_eval_construct_lanes.sh — the live-eval «construct validity» record (2026-11-06).
|
|
3
|
+
# Record only: what a probe CLAIMS vs what its pattern can SEE. These lanes pin that the record is carried,
|
|
4
|
+
# that a missing or unknown value is UNDECLARED (never read as «same»), that a bad value does not drop the
|
|
5
|
+
# probe from the run (scoring is untouched), and that the real probes_live.yaml declares every selected probe.
|
|
6
|
+
set -u
|
|
7
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
[ -f "$HERE/probe_live_eval_lib.py" ] || { echo "HARNESS-ERROR: probe_live_eval_lib.py missing"; exit 2; }
|
|
9
|
+
W="$(mktemp -d)"; trap 'rm -rf "$W"' EXIT
|
|
10
|
+
cat > "$W/probes.md" <<'EOF'
|
|
11
|
+
| ID | Input | Expected | Source | Class |
|
|
12
|
+
|---|---|---|---|---|
|
|
13
|
+
| `G-A-01` | "안녕" | x | y | mandatory-pass |
|
|
14
|
+
| `G-B-01` | "hello there" | x | y | mandatory-pass |
|
|
15
|
+
| `G-C-01` | "hi again" | x | y | mandatory-pass |
|
|
16
|
+
EOF
|
|
17
|
+
cat > "$W/live.yaml" <<'EOF'
|
|
18
|
+
probes:
|
|
19
|
+
- id: G-A-01
|
|
20
|
+
polarity: present
|
|
21
|
+
input: "안녕"
|
|
22
|
+
expect_re: "x"
|
|
23
|
+
control_input: "y"
|
|
24
|
+
construct: proxy
|
|
25
|
+
claims: "a claim"
|
|
26
|
+
unseen: "the order"
|
|
27
|
+
- id: G-B-01
|
|
28
|
+
polarity: present
|
|
29
|
+
input: "hello there"
|
|
30
|
+
expect_re: "x"
|
|
31
|
+
control_input: "y"
|
|
32
|
+
- id: G-C-01
|
|
33
|
+
polarity: present
|
|
34
|
+
input: "hi again"
|
|
35
|
+
expect_re: "x"
|
|
36
|
+
control_input: "y"
|
|
37
|
+
construct: obviously-fine
|
|
38
|
+
EOF
|
|
39
|
+
python3 - "$HERE" "$W" <<'PY'
|
|
40
|
+
import sys; sys.path.insert(0, sys.argv[1])
|
|
41
|
+
import probe_live_eval_lib as L
|
|
42
|
+
W = sys.argv[2]
|
|
43
|
+
md, live = L.parse_probes_md(W + "/probes.md"), L.parse_probes_live(W + "/live.yaml")
|
|
44
|
+
r = L.build_selection(md, live)
|
|
45
|
+
sel = {e["id"]: e for e in r["selected"]}
|
|
46
|
+
fails = 0
|
|
47
|
+
def lane(name, ok):
|
|
48
|
+
global fails
|
|
49
|
+
print((" ✅ " if ok else " ❌ ") + name)
|
|
50
|
+
fails += 0 if ok else 1
|
|
51
|
+
lane("K1 a declared probe carries construct/claims/unseen", sel.get("G-A-01", {}).get("construct") == "proxy" and sel["G-A-01"].get("unseen") == "the order")
|
|
52
|
+
lane("K2 a probe with no declaration is UNDECLARED, not «same», and is warned about", sel.get("G-B-01", {}).get("construct") == "UNDECLARED" and any("UNDECLARED-CONSTRUCT: G-B-01" in w for w in r["warnings"]))
|
|
53
|
+
lane("K3 an unknown value is UNDECLARED with a BAD-CONSTRUCT warning — and the probe still runs", sel.get("G-C-01", {}).get("construct") == "UNDECLARED" and any("BAD-CONSTRUCT: G-C-01" in w for w in r["warnings"]))
|
|
54
|
+
md_out = "\n".join(L.render_construct_md(r["selected"]))
|
|
55
|
+
lane("K4 the report section counts each class and names what each probe cannot see", "proxy 1 · UNDECLARED 2" in md_out and "| G-A-01 | proxy | a claim | the order |" in md_out)
|
|
56
|
+
# K5: the same probes with every construct/claims/unseen line removed select the same ids with identical scoring fields
|
|
57
|
+
import re as _re
|
|
58
|
+
bare = W + "/bare.yaml"
|
|
59
|
+
open(bare, "w").write("\n".join(l for l in open(W + "/live.yaml").read().split("\n") if not _re.match(r"^\s+(construct|claims|unseen):", l)))
|
|
60
|
+
rb = L.build_selection(md, L.parse_probes_live(bare))
|
|
61
|
+
keys = ("id", "input", "control_input", "polarity", "expect_re", "control_input_b", "advisory_re")
|
|
62
|
+
strip = lambda es: [{k: e.get(k) for k in keys} for e in es]
|
|
63
|
+
lane("K5 record only — with and without the declarations, the selection and every scoring field are identical", strip(r["selected"]) == strip(rb["selected"]) and [e["id"] for e in r["excluded"]] == [e["id"] for e in rb["excluded"]])
|
|
64
|
+
lane("K7 the nightly report itself carries the section (not only the helper)", "## Construct validity (record only" in L.render_report_md(r, None, "2026-11-06"))
|
|
65
|
+
real = L.build_selection(L.parse_probes_md(sys.argv[1] + "/../.claude/regression/probes.md"), L.parse_probes_live(sys.argv[1] + "/../.claude/regression/probes_live.yaml"))
|
|
66
|
+
und = [e["id"] for e in real["selected"] if e.get("construct") == "UNDECLARED"]
|
|
67
|
+
lane("K6 the real probes_live.yaml declares every selected probe (%d selected, undeclared=%s)" % (len(real["selected"]), und or 0), len(real["selected"]) > 0 and not und)
|
|
68
|
+
print("live-eval construct lanes: %d passed · %d failed" % (7 - fails, fails))
|
|
69
|
+
sys.exit(1 if fails else 0)
|
|
70
|
+
PY
|