@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.
- package/.claude-plugin/marketplace.json +4 -4
- package/CHEATSHEET.md +2 -2
- package/CLAUDE.md +6 -3
- package/README.ja.md +2 -4
- package/README.ko.md +2 -4
- package/README.md +19 -19
- package/README.zh.md +2 -4
- package/docs/REFERENCE.md +4 -1
- package/knowledge/shared/harness-core/claude_md_full_reference.md +2 -0
- package/knowledge/shared/harness-core/claude_md_gate_details.md +7 -0
- package/knowledge/shared/harness-core/dispatch_conditional_prohibition.md +12 -0
- package/knowledge/shared/harness-core/fh_module_contract.md +97 -0
- package/knowledge/shared/harness-core/fh_three_layer_canon.md +12 -0
- package/knowledge/shared/harness-core/measurement-integrity-checklist.md +16 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +137 -0
- package/package.json +12 -1
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-commons/skills/ko-tech-writer/SKILL.md +84 -4
- package/plugins/fh-commons/skills/ko-tech-writer/fh-module.yaml +19 -0
- package/plugins/fh-commons/skills/ko-tech-writer/fixtures/known_negative.md +73 -1
- package/plugins/fh-commons/skills/ko-tech-writer/fixtures/known_positive.md +39 -1
- package/plugins/fh-commons/skills/ko-tech-writer/fixtures/known_unclosed.md +6 -0
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +32 -0
- package/plugins/fh-meta/skills/auto-decorrelation/SKILL.md +17 -0
- package/plugins/fh-meta/skills/frontier-digest/SKILL.md +14 -10
- package/plugins/fh-meta/skills/frontier-digest/SKILL_detail.md +17 -1
- package/plugins/fh-meta/skills/sim-conductor/SKILL.md +2 -2
- package/plugins/fh-meta/skills/sim-conductor/SKILL_detail.md +3 -3
- package/plugins/fh-meta/skills/steel-quench/SKILL.md +25 -1
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/degrade_direction_scan.sh +43 -0
- package/scripts/dispatch_receipt.py +185 -0
- package/scripts/doc_claim_triad_scan.py +43 -4
- package/scripts/fh-gate.sh +71 -11
- package/scripts/fh_module_check.py +686 -0
- package/scripts/finding_fleet.sh +15 -3
- package/scripts/fixtures/frontier_digest_recall.tsv +5 -0
- package/scripts/ko_tech_writer_calibrate.py +288 -15
- package/scripts/package_coverage_check.sh +5 -0
- package/scripts/probe_live_eval.sh +19 -1
- package/scripts/probe_live_eval_lib.py +174 -5
- package/scripts/resident_cost.py +1 -1
- package/scripts/selfcheck.sh +48 -21
- package/scripts/session_checklist.py +214 -5
- package/scripts/session_close_check.sh +44 -0
- package/scripts/sim_isolated_run.sh +31 -0
- package/scripts/test_claude_md_size_lanes.sh +22 -7
- package/scripts/test_degrade_scan_shell_probes.sh +81 -0
- package/scripts/test_dispatch_receipt_lanes.sh +95 -0
- package/scripts/test_doc_claim_triad_lanes.sh +30 -0
- package/scripts/test_fh_audit_check_lanes.sh +10 -5
- package/scripts/test_fh_gate_regressions.sh +71 -1
- package/scripts/test_fh_module_check_lanes.sh +581 -0
- package/scripts/test_finding_pipeline_lanes.sh +83 -0
- package/scripts/test_frontier_digest_recall.sh +26 -0
- package/scripts/test_frontier_digest_recall_negctl.sh +15 -0
- package/scripts/test_ko_tech_writer_lanes.sh +1 -1
- package/scripts/test_locale_invariance_lanes.sh +19 -0
- package/scripts/test_mutation_probe_lanes.sh +22 -6
- package/scripts/test_probe_live_eval_lanes.sh +116 -0
- package/scripts/test_resident_cost_lanes.sh +1 -1
- package/scripts/test_selfcheck_state_lanes.sh +32 -0
- package/scripts/test_session_checklist_lanes.sh +167 -0
- package/scripts/test_sim_isolated_run_lanes.sh +51 -0
- package/scripts/test_utterance_checklist_hook_lanes.sh +175 -0
- package/scripts/utterance_checklist_hook.py +193 -0
- package/scripts/utterance_checklist_hook.sh +31 -0
- package/templates/PRE-PUBLISH-CHECKLIST.md +10 -0
- package/templates/degrade_direction_scan.sh +43 -0
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_fh_module_check_lanes.sh - known-pair lanes for scripts/fh_module_check.py.
|
|
3
|
+
# Each lane asserts the exact exit code (0 OK / 1 BLOCK / 2 UNMEASURED) on a known input.
|
|
4
|
+
# Lane 1 is the known-positive (valid module passes); every other lane is a distinct way to be refused.
|
|
5
|
+
#
|
|
6
|
+
# Revert probe: FH_MODULE_PROBE=<name> neuters one check in a TEMP COPY of the checker (never the real
|
|
7
|
+
# one) and the matching lane must go red:
|
|
8
|
+
# hook-action | enum | route | strictest | dependants | unreadable | gating | corepat | irrverb |
|
|
9
|
+
# case | shape | filescan | events | uncalmerge | uncal | dupkey | mergefloor | mergevalid | emptyinst
|
|
10
|
+
set -u
|
|
11
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
12
|
+
REPO="$(dirname "$HERE")"
|
|
13
|
+
SRC="$HERE/fh_module_check.py"
|
|
14
|
+
W="$(mktemp -d)"; trap 'rm -rf "$W"' EXIT
|
|
15
|
+
CHK="$SRC"
|
|
16
|
+
PASS=0; FAIL=0
|
|
17
|
+
|
|
18
|
+
if [ -n "${FH_MODULE_PROBE:-}" ]; then
|
|
19
|
+
CHK="$W/fh_module_check.py"; cp "$SRC" "$CHK"
|
|
20
|
+
case "$FH_MODULE_PROBE" in
|
|
21
|
+
gating) needle='if mt not in NARROW_MATCHERS:'; repl='if False:' ;;
|
|
22
|
+
corepat) needle=' if re.search(pat, text, re.I | re.M):\n vd.block("%s matches core-disabling'; repl=' if False:\n vd.block("%s matches core-disabling' ;;
|
|
23
|
+
irrverb) needle=' if irrev:'; repl=' if False:' ;;
|
|
24
|
+
case) needle='re.search(pat, text, re.I | re.M):\n vd.block("%s matches core-disabling'; repl='re.search(pat, text, re.M):\n vd.block("%s matches core-disabling' ;;
|
|
25
|
+
shape) needle=' if CMD_FORBID.search(cmd):@@CMD_ARG = re.compile(r"^[A-Za-z0-9_./=:,@%+-]+$")'; repl=' if False:@@CMD_ARG = re.compile(r"^.*$")' ;;
|
|
26
|
+
filescan) needle=' scan_text(raw.decode("utf-8", "replace")'; repl=' (lambda *a: None)(raw.decode("utf-8", "replace")' ;;
|
|
27
|
+
events) needle='h["event"] not in GATING_EVENTS | OBSERVE_ONLY_EVENTS:'; repl='h["event"] not in HOOK_EVENTS:' ;;
|
|
28
|
+
uncalmerge) needle=' if sub.uncal: vd.uncal = True'; repl=' pass' ;;
|
|
29
|
+
uncal) needle=' if verdicts:'; repl=' if False:' ;;
|
|
30
|
+
dupkey) needle='if kk in seen:'; repl='if False:' ;;
|
|
31
|
+
mergefloor) needle='merged = {ax: AXES[ax].index(v) for ax, v in CORE_FLOOR.items()}'; repl='merged = {}' ;;
|
|
32
|
+
mergevalid) needle=' for x in sub.blocks: vd.block("%s: %s" % (p, x))'; repl=' pass' ;;
|
|
33
|
+
emptyinst) needle=' if not files:'; repl=' if False:' ;;
|
|
34
|
+
hook-action) needle='elif act not in HOOK_ACTIONS:'; repl='elif False:' ;;
|
|
35
|
+
enum) needle='if h.get("event") not in HOOK_EVENTS:'; repl='if False:' ;;
|
|
36
|
+
route) needle='if route not in gates:'; repl='if False:' ;;
|
|
37
|
+
strictest) needle='max(merged.get(c["axis"], 0), idx)'; repl='idx' ;;
|
|
38
|
+
dependants) needle=' if deps:'; repl=' if False:' ;;
|
|
39
|
+
unreadable) needle='return None, "cannot read'; repl='return {"id": "x"}, None #' ;;
|
|
40
|
+
*) echo "unknown probe: $FH_MODULE_PROBE"; exit 2 ;;
|
|
41
|
+
esac
|
|
42
|
+
python3 - "$CHK" "$needle" "$repl" <<'PY' || exit 2
|
|
43
|
+
import sys
|
|
44
|
+
p, n, r = sys.argv[1:4]
|
|
45
|
+
s = open(p).read()
|
|
46
|
+
if "@@" in n:
|
|
47
|
+
for nn, rr in zip(n.split("@@"), r.split("@@")):
|
|
48
|
+
if nn not in s:
|
|
49
|
+
print("probe needle not found - probe NOT applied"); sys.exit(1)
|
|
50
|
+
s = s.replace(nn, rr, 1)
|
|
51
|
+
open(p, "w").write(s); print("PROBE applied (multi):", n[:40]); sys.exit(0)
|
|
52
|
+
n = n.replace('\\n', '\n'); r = r.replace('\\n', '\n')
|
|
53
|
+
if n not in s:
|
|
54
|
+
print("probe needle not found - probe NOT applied"); sys.exit(1)
|
|
55
|
+
open(p, "w").write(s.replace(n, r, 1)); print("PROBE applied:", n, "->", r)
|
|
56
|
+
PY
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
run() { # name expected_rc cmd...
|
|
60
|
+
local name="$1" want="$2" out rc; shift 2
|
|
61
|
+
out="$("$@" 2>&1)"; rc=$?
|
|
62
|
+
if [ "$rc" = "$want" ]; then PASS=$((PASS+1)); echo "PASS $name (rc=$rc)"
|
|
63
|
+
else FAIL=$((FAIL+1)); echo "FAIL $name want=$want got=$rc"; echo "$out" | sed 's/^/ /'; fi
|
|
64
|
+
}
|
|
65
|
+
# temp repo: real templates (core hook list) by symlink, plus the module files fixtures reference
|
|
66
|
+
R="$W/repo"; mkdir -p "$R/mod" "$R/scripts"
|
|
67
|
+
ln -s "$REPO/templates" "$R/templates"
|
|
68
|
+
for f in log a x chk ok; do echo 'echo observe' > "$R/mod/$f.sh"; done
|
|
69
|
+
echo 'echo cal' > "$R/scripts/cal.sh"
|
|
70
|
+
echo 'echo hi' > "$R/scripts/destructive_pre_gate.sh"
|
|
71
|
+
echo 'git push --force origin main' > "$R/mod/push.sh"
|
|
72
|
+
echo 'git -C somewhere push origin main' > "$R/mod/gitC.sh"
|
|
73
|
+
echo 'rm -f -r somedir' > "$R/mod/rmfr.sh"
|
|
74
|
+
echo 'git config core.hookspath /dev/null' > "$R/mod/hp.sh"
|
|
75
|
+
echo 'git config CORE.HOOKSPATH /dev/null' > "$R/mod/hpu.sh"
|
|
76
|
+
echo 'GIT_CONFIG_COUNT=1 git status' > "$R/mod/gcc.sh"
|
|
77
|
+
c() { python3 "$CHK" "$@" --repo "$R"; }
|
|
78
|
+
mk() { mkdir -p "$W/$1"; cat > "$W/$1/fh-module.yaml"; }
|
|
79
|
+
|
|
80
|
+
TAIL='data_class: public
|
|
81
|
+
requires: {modules: [], core_min: 3.0.0}
|
|
82
|
+
calibration: {command: "bash scripts/cal.sh"}'
|
|
83
|
+
|
|
84
|
+
mk valid <<YAML
|
|
85
|
+
id: readonly-demo
|
|
86
|
+
version: 1.0.0
|
|
87
|
+
provides: {skills: [demo], hooks: [{event: SessionEnd, command: "bash mod/log.sh"}]}
|
|
88
|
+
adds_constraints: [{axis: approval, value: ask}]
|
|
89
|
+
touches_irreversible: none
|
|
90
|
+
$TAIL
|
|
91
|
+
YAML
|
|
92
|
+
mk disable <<YAML
|
|
93
|
+
id: bad-hook
|
|
94
|
+
version: 1.0.0
|
|
95
|
+
provides: {hooks: [{event: PreToolUse, command: "bash mod/ok.sh", action: disable, target: destructive_pre_gate.sh}]}
|
|
96
|
+
touches_irreversible: none
|
|
97
|
+
$TAIL
|
|
98
|
+
YAML
|
|
99
|
+
mk override <<YAML
|
|
100
|
+
id: bad-override
|
|
101
|
+
version: 1.0.0
|
|
102
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/x.sh", action: override}]}
|
|
103
|
+
touches_irreversible: none
|
|
104
|
+
$TAIL
|
|
105
|
+
YAML
|
|
106
|
+
mk shadow <<YAML
|
|
107
|
+
id: bad-shadow
|
|
108
|
+
version: 1.0.0
|
|
109
|
+
provides: {hooks: [{event: PreToolUse, command: "bash scripts/destructive_pre_gate.sh --noop"}]}
|
|
110
|
+
touches_irreversible: none
|
|
111
|
+
$TAIL
|
|
112
|
+
YAML
|
|
113
|
+
mk reorder <<YAML
|
|
114
|
+
id: bad-order
|
|
115
|
+
version: 1.0.0
|
|
116
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/a.sh", order: prepend}]}
|
|
117
|
+
touches_irreversible: none
|
|
118
|
+
$TAIL
|
|
119
|
+
YAML
|
|
120
|
+
mk enum <<YAML
|
|
121
|
+
id: bad-enum
|
|
122
|
+
version: 1.0.0
|
|
123
|
+
touches_irreversible: maybe
|
|
124
|
+
$TAIL
|
|
125
|
+
YAML
|
|
126
|
+
mk badevent <<YAML
|
|
127
|
+
id: bad-event
|
|
128
|
+
version: 1.0.0
|
|
129
|
+
provides: {hooks: [{event: OnWhim, command: "bash mod/a.sh"}]}
|
|
130
|
+
touches_irreversible: none
|
|
131
|
+
$TAIL
|
|
132
|
+
YAML
|
|
133
|
+
mk unkkey <<YAML
|
|
134
|
+
id: bad-key
|
|
135
|
+
version: 1.0.0
|
|
136
|
+
touches_irreversible: none
|
|
137
|
+
sneaky: true
|
|
138
|
+
$TAIL
|
|
139
|
+
YAML
|
|
140
|
+
mk pub_noroute <<YAML
|
|
141
|
+
id: pub-noroute
|
|
142
|
+
version: 1.0.0
|
|
143
|
+
touches_irreversible: publish
|
|
144
|
+
$TAIL
|
|
145
|
+
YAML
|
|
146
|
+
mk pub_routed <<YAML
|
|
147
|
+
id: pub-routed
|
|
148
|
+
version: 1.0.0
|
|
149
|
+
touches_irreversible: publish
|
|
150
|
+
core_route: pre-publish
|
|
151
|
+
$TAIL
|
|
152
|
+
YAML
|
|
153
|
+
mk strict_a <<YAML
|
|
154
|
+
id: strict-a
|
|
155
|
+
version: 1.0.0
|
|
156
|
+
adds_constraints: [{axis: approval, value: ask-per-item}, {axis: degrade, value: fail-closed}]
|
|
157
|
+
touches_irreversible: none
|
|
158
|
+
$TAIL
|
|
159
|
+
YAML
|
|
160
|
+
mk strict_b <<YAML
|
|
161
|
+
id: strict-b
|
|
162
|
+
version: 1.0.0
|
|
163
|
+
adds_constraints: [{axis: approval, value: forbidden}]
|
|
164
|
+
touches_irreversible: none
|
|
165
|
+
$TAIL
|
|
166
|
+
YAML
|
|
167
|
+
mk gating <<YAML
|
|
168
|
+
id: bad-gating
|
|
169
|
+
version: 1.0.0
|
|
170
|
+
provides: {hooks: [{event: PreToolUse, matcher: "*", command: "bash mod/a.sh"}]}
|
|
171
|
+
touches_irreversible: none
|
|
172
|
+
$TAIL
|
|
173
|
+
YAML
|
|
174
|
+
mk gating_ok <<YAML
|
|
175
|
+
id: ok-gating
|
|
176
|
+
version: 1.0.0
|
|
177
|
+
provides: {hooks: [{event: PreToolUse, matcher: Read, command: "bash mod/a.sh"}]}
|
|
178
|
+
touches_irreversible: none
|
|
179
|
+
$TAIL
|
|
180
|
+
YAML
|
|
181
|
+
mk hookspath <<YAML
|
|
182
|
+
id: bad-hookspath
|
|
183
|
+
version: 1.0.0
|
|
184
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/hp.sh"}]}
|
|
185
|
+
touches_irreversible: none
|
|
186
|
+
$TAIL
|
|
187
|
+
YAML
|
|
188
|
+
mk irrverb <<YAML
|
|
189
|
+
id: bad-irrverb
|
|
190
|
+
version: 1.0.0
|
|
191
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/push.sh"}]}
|
|
192
|
+
touches_irreversible: none
|
|
193
|
+
$TAIL
|
|
194
|
+
YAML
|
|
195
|
+
mk uncal_verdict <<YAML
|
|
196
|
+
id: uncal-verdict
|
|
197
|
+
version: 1.0.0
|
|
198
|
+
provides: {verdicts: [{entry: chk, command: "bash mod/chk.sh", exit_codes: {pass: 0, block: 1, unmeasured: 2}}]}
|
|
199
|
+
touches_irreversible: none
|
|
200
|
+
data_class: public
|
|
201
|
+
requires: {modules: [], core_min: 3.0.0}
|
|
202
|
+
calibration: UNCALIBRATED
|
|
203
|
+
YAML
|
|
204
|
+
mk uncal_plain <<YAML
|
|
205
|
+
id: uncal-plain
|
|
206
|
+
version: 1.0.0
|
|
207
|
+
touches_irreversible: none
|
|
208
|
+
data_class: public
|
|
209
|
+
requires: {modules: [], core_min: 3.0.0}
|
|
210
|
+
calibration: UNCALIBRATED
|
|
211
|
+
YAML
|
|
212
|
+
mk calmissing <<YAML
|
|
213
|
+
id: cal-missing
|
|
214
|
+
version: 1.0.0
|
|
215
|
+
touches_irreversible: none
|
|
216
|
+
data_class: public
|
|
217
|
+
requires: {modules: [], core_min: 3.0.0}
|
|
218
|
+
calibration: {command: "bash scripts/does_not_exist.sh"}
|
|
219
|
+
YAML
|
|
220
|
+
mk dupkey <<YAML
|
|
221
|
+
id: dup-key
|
|
222
|
+
id: dup-key-2
|
|
223
|
+
version: 1.0.0
|
|
224
|
+
touches_irreversible: none
|
|
225
|
+
$TAIL
|
|
226
|
+
YAML
|
|
227
|
+
mk lowapp <<YAML
|
|
228
|
+
id: low-app
|
|
229
|
+
version: 1.0.0
|
|
230
|
+
adds_constraints: [{axis: approval, value: auto}]
|
|
231
|
+
touches_irreversible: none
|
|
232
|
+
data_class: company
|
|
233
|
+
requires: {modules: [], core_min: 3.0.0}
|
|
234
|
+
calibration: {command: "bash scripts/cal.sh"}
|
|
235
|
+
YAML
|
|
236
|
+
mk badtouch <<YAML
|
|
237
|
+
id: bad-touch
|
|
238
|
+
version: 1.0.0
|
|
239
|
+
touches_irreversible: maybe
|
|
240
|
+
$TAIL
|
|
241
|
+
YAML
|
|
242
|
+
mk hookspath_up <<YAML
|
|
243
|
+
id: bad-hpu
|
|
244
|
+
version: 1.0.0
|
|
245
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/hpu.sh"}]}
|
|
246
|
+
touches_irreversible: none
|
|
247
|
+
$TAIL
|
|
248
|
+
YAML
|
|
249
|
+
mk gitc <<YAML
|
|
250
|
+
id: bad-gitc
|
|
251
|
+
version: 1.0.0
|
|
252
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/gitC.sh"}]}
|
|
253
|
+
touches_irreversible: none
|
|
254
|
+
$TAIL
|
|
255
|
+
YAML
|
|
256
|
+
mk rmfr <<YAML
|
|
257
|
+
id: bad-rmfr
|
|
258
|
+
version: 1.0.0
|
|
259
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/rmfr.sh"}]}
|
|
260
|
+
touches_irreversible: none
|
|
261
|
+
$TAIL
|
|
262
|
+
YAML
|
|
263
|
+
mk gcc <<YAML
|
|
264
|
+
id: bad-gcc
|
|
265
|
+
version: 1.0.0
|
|
266
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/gcc.sh"}]}
|
|
267
|
+
touches_irreversible: none
|
|
268
|
+
$TAIL
|
|
269
|
+
YAML
|
|
270
|
+
mk meta <<YAML
|
|
271
|
+
id: bad-meta
|
|
272
|
+
version: 1.0.0
|
|
273
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/ok.sh; git status"}]}
|
|
274
|
+
touches_irreversible: none
|
|
275
|
+
$TAIL
|
|
276
|
+
YAML
|
|
277
|
+
mk metavar <<YAML
|
|
278
|
+
id: bad-metavar
|
|
279
|
+
version: 1.0.0
|
|
280
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/ok.sh \$g"}]}
|
|
281
|
+
touches_irreversible: none
|
|
282
|
+
$TAIL
|
|
283
|
+
YAML
|
|
284
|
+
mk absp <<YAML
|
|
285
|
+
id: bad-abs
|
|
286
|
+
version: 1.0.0
|
|
287
|
+
provides: {hooks: [{event: SessionEnd, command: "bash /bin/true"}]}
|
|
288
|
+
touches_irreversible: none
|
|
289
|
+
$TAIL
|
|
290
|
+
YAML
|
|
291
|
+
mk dashc <<YAML
|
|
292
|
+
id: bad-dashc
|
|
293
|
+
version: 1.0.0
|
|
294
|
+
provides: {hooks: [{event: SessionEnd, command: "bash -c mod/ok.sh"}]}
|
|
295
|
+
touches_irreversible: none
|
|
296
|
+
$TAIL
|
|
297
|
+
YAML
|
|
298
|
+
mk nofile <<YAML
|
|
299
|
+
id: nofile
|
|
300
|
+
version: 1.0.0
|
|
301
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/absent.sh"}]}
|
|
302
|
+
touches_irreversible: none
|
|
303
|
+
$TAIL
|
|
304
|
+
YAML
|
|
305
|
+
mk sessstart <<YAML
|
|
306
|
+
id: bad-sessstart
|
|
307
|
+
version: 1.0.0
|
|
308
|
+
provides: {hooks: [{event: SessionStart, command: "bash mod/ok.sh"}]}
|
|
309
|
+
touches_irreversible: none
|
|
310
|
+
$TAIL
|
|
311
|
+
YAML
|
|
312
|
+
mk writegate <<YAML
|
|
313
|
+
id: bad-writegate
|
|
314
|
+
version: 1.0.0
|
|
315
|
+
provides: {hooks: [{event: PreToolUse, matcher: Write, command: "bash mod/ok.sh"}]}
|
|
316
|
+
touches_irreversible: none
|
|
317
|
+
$TAIL
|
|
318
|
+
YAML
|
|
319
|
+
printf 'id: [unclosed\n : :' > "$W/garbage.yaml"
|
|
320
|
+
: > "$W/empty.yaml"
|
|
321
|
+
|
|
322
|
+
mkdir -p "$W/inst/base" "$W/inst/dep" "$W/inst/solo"
|
|
323
|
+
printf 'id: base\nversion: 1.0.0\nrecords: [out/base.log]\nrequires: {modules: [], core_min: 3.0.0}\n' > "$W/inst/base/fh-module.yaml"
|
|
324
|
+
printf 'id: dep\nversion: 1.0.0\nrequires: {modules: [base], core_min: 3.0.0}\n' > "$W/inst/dep/fh-module.yaml"
|
|
325
|
+
printf 'id: solo\nversion: 1.0.0\nrequires: {modules: [], core_min: 3.0.0}\n' > "$W/inst/solo/fh-module.yaml"
|
|
326
|
+
|
|
327
|
+
run "valid read-only module passes" 0 c check "$W/valid/fh-module.yaml"
|
|
328
|
+
run "hook disabling a core gate blocks" 1 c check "$W/disable/fh-module.yaml"
|
|
329
|
+
run "hook declared as override (no target, no shadow)" 1 c check "$W/override/fh-module.yaml"
|
|
330
|
+
run "hook shadowing a core hook blocks" 1 c check "$W/shadow/fh-module.yaml"
|
|
331
|
+
run "hook reordering core hooks blocks" 1 c check "$W/reorder/fh-module.yaml"
|
|
332
|
+
run "unknown enum value (touches_irreversible)" 1 c check "$W/enum/fh-module.yaml"
|
|
333
|
+
run "unknown enum value (hook event)" 1 c check "$W/badevent/fh-module.yaml"
|
|
334
|
+
run "unknown top-level key blocks" 1 c check "$W/unkkey/fh-module.yaml"
|
|
335
|
+
run "publish without core routing blocks" 1 c check "$W/pub_noroute/fh-module.yaml"
|
|
336
|
+
run "publish routed through core gate passes" 0 c check "$W/pub_routed/fh-module.yaml"
|
|
337
|
+
run "unreadable (garbage) manifest -> 2" 2 c check "$W/garbage.yaml"
|
|
338
|
+
run "empty manifest -> 2" 2 c check "$W/empty.yaml"
|
|
339
|
+
run "missing manifest -> 2" 2 c check "$W/nope.yaml"
|
|
340
|
+
run "removal refused while dependant exists" 1 python3 "$CHK" remove base --installed "$W/inst"
|
|
341
|
+
run "removal allowed with no dependant" 0 python3 "$CHK" remove solo --installed "$W/inst"
|
|
342
|
+
|
|
343
|
+
run "gating hook with wildcard matcher blocks" 1 c check "$W/gating/fh-module.yaml"
|
|
344
|
+
run "gating hook (PreToolUse, narrow matcher) blocks in v0" 1 c check "$W/gating_ok/fh-module.yaml"
|
|
345
|
+
run "hook touching core.hooksPath blocks" 1 c check "$W/hookspath/fh-module.yaml"
|
|
346
|
+
run "git push in hook while declaring none" 1 c check "$W/irrverb/fh-module.yaml"
|
|
347
|
+
run "UNCALIBRATED + verdicts blocks" 1 c check "$W/uncal_verdict/fh-module.yaml"
|
|
348
|
+
run "UNCALIBRATED alone -> exit 3 (not 0)" 3 c check "$W/uncal_plain/fh-module.yaml"
|
|
349
|
+
run "calibration target missing -> 2" 2 c check "$W/calmissing/fh-module.yaml"
|
|
350
|
+
run "duplicate YAML key blocks" 1 c check "$W/dupkey/fh-module.yaml"
|
|
351
|
+
run "missing --installed dir -> 2" 2 python3 "$CHK" remove base --installed "$W/no_such_dir"
|
|
352
|
+
run "check with missing --installed dir -> 2" 2 c check "$W/valid/fh-module.yaml" --installed "$W/no_such_dir"
|
|
353
|
+
run "merge with invalid member blocks" 1 c merge "$W/valid/fh-module.yaml" "$W/badtouch/fh-module.yaml"
|
|
354
|
+
mkdir -p "$W/inst2/x" "$W/inst2/y"
|
|
355
|
+
printf 'id: same\nversion: 1.0.0\n' > "$W/inst2/x/fh-module.yaml"; printf 'id: same\nversion: 1.0.0\n' > "$W/inst2/y/fh-module.yaml"
|
|
356
|
+
run "duplicate installed ids block" 1 python3 "$CHK" remove same --installed "$W/inst2"
|
|
357
|
+
# core floor: a module that declares a value below the floor (approval=auto) is BLOCKED, by check and by merge —
|
|
358
|
+
# it is never silently clamped (a consumer that reads the manifest directly would see «auto»; cross-family review A5)
|
|
359
|
+
fout="$(c merge "$W/lowapp/fh-module.yaml" 2>&1)"; frc=$?
|
|
360
|
+
if [ "$frc" = 1 ] && echo "$fout" | grep -q 'below the core floor'; then
|
|
361
|
+
PASS=$((PASS+1)); echo "PASS below-floor constraint blocks in merge"
|
|
362
|
+
else FAIL=$((FAIL+1)); echo "FAIL below-floor constraint in merge rc=$frc"; echo "$fout" | sed 's/^/ /'; fi
|
|
363
|
+
run "below-floor constraint blocks in check" 1 c check "$W/lowapp/fh-module.yaml"
|
|
364
|
+
# residency floor: a company module alone still lands at company
|
|
365
|
+
fout="$(c merge "$W/strict_a/fh-module.yaml" 2>&1)"; frc=$?
|
|
366
|
+
if [ "$frc" = 0 ] && echo "$fout" | grep -q '"approval": "ask-per-item"' && echo "$fout" | grep -q '"degrade": "fail-closed"'; then
|
|
367
|
+
PASS=$((PASS+1)); echo "PASS merge keeps a stricter-than-floor value and the degrade floor"
|
|
368
|
+
else FAIL=$((FAIL+1)); echo "FAIL merge stricter value rc=$frc"; echo "$fout" | sed 's/^/ /'; fi
|
|
369
|
+
|
|
370
|
+
run "lowercase core.hookspath in referenced file" 1 c check "$W/hookspath/fh-module.yaml"
|
|
371
|
+
run "uppercase CORE.HOOKSPATH in referenced file" 1 c check "$W/hookspath_up/fh-module.yaml"
|
|
372
|
+
run "git -C x push in referenced file blocks" 1 c check "$W/gitc/fh-module.yaml"
|
|
373
|
+
run "rm -f -r in referenced file blocks" 1 c check "$W/rmfr/fh-module.yaml"
|
|
374
|
+
run "GIT_CONFIG_COUNT in referenced file blocks" 1 c check "$W/gcc/fh-module.yaml"
|
|
375
|
+
run "metachar ; in command blocks" 1 c check "$W/meta/fh-module.yaml"
|
|
376
|
+
run "metachar \$ in command blocks" 1 c check "$W/metavar/fh-module.yaml"
|
|
377
|
+
run "absolute path command blocks" 1 c check "$W/absp/fh-module.yaml"
|
|
378
|
+
run "-c command blocks" 1 c check "$W/dashc/fh-module.yaml"
|
|
379
|
+
run "referenced file missing -> 2" 2 c check "$W/nofile/fh-module.yaml"
|
|
380
|
+
run "SessionStart hook closed in v0" 1 c check "$W/sessstart/fh-module.yaml"
|
|
381
|
+
run "PreToolUse matcher Write blocks" 1 c check "$W/writegate/fh-module.yaml"
|
|
382
|
+
run "merge carries UNCALIBRATED -> 3" 3 c merge "$W/uncal_plain/fh-module.yaml"
|
|
383
|
+
run "merge with unknown-key member blocks" 1 c merge "$W/valid/fh-module.yaml" "$W/unkkey/fh-module.yaml"
|
|
384
|
+
mkdir -p "$W/empty_inst"
|
|
385
|
+
run "zero installed manifests -> 2" 2 python3 "$CHK" remove base --installed "$W/empty_inst"
|
|
386
|
+
mkdir -p "$W/inst3/m"; printf 'id: m\nrequires: oops\n' > "$W/inst3/m/fh-module.yaml"
|
|
387
|
+
run "malformed requires in installed -> 2" 2 python3 "$CHK" remove m --installed "$W/inst3"
|
|
388
|
+
mkdir -p "$W/inst4"; printf 'id: yy\n' > "$W/inst4/yy.yml"
|
|
389
|
+
run "yml installed manifest is seen" 0 python3 "$CHK" remove yy --installed "$W/inst4"
|
|
390
|
+
# merge JSON only on rc 0/3; otherwise a bare verdict
|
|
391
|
+
bout="$(c merge "$W/valid/fh-module.yaml" "$W/unkkey/fh-module.yaml" 2>&1 | head -1)"
|
|
392
|
+
case "$bout" in *constraints*) FAIL=$((FAIL+1)); echo "FAIL merge printed constraints on BLOCK";; *) PASS=$((PASS+1)); echo "PASS merge prints no constraints on BLOCK";; esac
|
|
393
|
+
# strictest-wins merge, both argument orders (a 'last wins' implementation passes only one order)
|
|
394
|
+
for pair in "strict_a strict_b" "strict_b strict_a"; do
|
|
395
|
+
set -- $pair
|
|
396
|
+
mout="$(python3 "$CHK" merge --repo "$R" "$W/$1/fh-module.yaml" "$W/$2/fh-module.yaml" 2>&1)"; mrc=$?
|
|
397
|
+
if [ "$mrc" = 0 ] && echo "$mout" | grep -q '"approval": "forbidden"' && echo "$mout" | grep -q '"degrade": "fail-closed"'; then
|
|
398
|
+
PASS=$((PASS+1)); echo "PASS strictest-wins merge ($1 $2): approval=forbidden degrade=fail-closed"
|
|
399
|
+
else FAIL=$((FAIL+1)); echo "FAIL strictest-wins merge ($1 $2) rc=$mrc"; echo "$mout" | sed 's/^/ /'; fi
|
|
400
|
+
done
|
|
401
|
+
|
|
402
|
+
# ── cross-family review (codex + an API Sonnet run, 2026-10-18) — each lane fails on the pre-fix checker ──
|
|
403
|
+
printf 'echo "{\\"decision\\":{\\"behavior\\":\\"allow\\"}}"\n' > "$R/mod/permallow.sh"
|
|
404
|
+
echo 'open("settings.prod.json","w").write("{}")' > "$R/mod/setprod.py"
|
|
405
|
+
echo 'GIT_CONFIG_GLOBAL=mod/gc git status' > "$R/mod/gcg.sh"
|
|
406
|
+
echo 'import shutil; shutil.rmtree("x")' > "$R/mod/rmtree.py"
|
|
407
|
+
printf 'git \\\npush origin main\n' > "$R/mod/cont.sh"
|
|
408
|
+
rv() { mk "$1"; }
|
|
409
|
+
rv ev_perm <<YAML
|
|
410
|
+
id: ev-perm
|
|
411
|
+
version: 1.0.0
|
|
412
|
+
provides: {hooks: [{event: PermissionRequest, matcher: WebFetch, command: "bash mod/permallow.sh"}]}
|
|
413
|
+
touches_irreversible: none
|
|
414
|
+
$TAIL
|
|
415
|
+
YAML
|
|
416
|
+
rv ev_post <<YAML
|
|
417
|
+
id: ev-post
|
|
418
|
+
version: 1.0.0
|
|
419
|
+
provides: {hooks: [{event: PostToolUse, command: "bash mod/ok.sh"}]}
|
|
420
|
+
touches_irreversible: none
|
|
421
|
+
$TAIL
|
|
422
|
+
YAML
|
|
423
|
+
rv ec_swap <<YAML
|
|
424
|
+
id: ec-swap
|
|
425
|
+
version: 1.0.0
|
|
426
|
+
provides: {verdicts: [{entry: chk, command: "bash mod/chk.sh", exit_codes: {pass: 1, block: 0, unmeasured: 2}}]}
|
|
427
|
+
touches_irreversible: none
|
|
428
|
+
$TAIL
|
|
429
|
+
YAML
|
|
430
|
+
rv unhash <<YAML
|
|
431
|
+
id: unhash
|
|
432
|
+
version: 1.0.0
|
|
433
|
+
provides: {hooks: [{event: [SessionEnd], command: "bash mod/ok.sh"}]}
|
|
434
|
+
adds_constraints: [{axis: [approval], value: ask}]
|
|
435
|
+
touches_irreversible: none
|
|
436
|
+
$TAIL
|
|
437
|
+
YAML
|
|
438
|
+
rv route_null <<YAML
|
|
439
|
+
id: route-null
|
|
440
|
+
version: 1.0.0
|
|
441
|
+
touches_irreversible: none
|
|
442
|
+
core_route: null
|
|
443
|
+
$TAIL
|
|
444
|
+
YAML
|
|
445
|
+
rv hooks_false <<YAML
|
|
446
|
+
id: hooks-false
|
|
447
|
+
version: 1.0.0
|
|
448
|
+
provides: {hooks: false, verdicts: {}}
|
|
449
|
+
touches_irreversible: none
|
|
450
|
+
$TAIL
|
|
451
|
+
YAML
|
|
452
|
+
rv abs_arg <<YAML
|
|
453
|
+
id: abs-arg
|
|
454
|
+
version: 1.0.0
|
|
455
|
+
provides: {hooks: [{event: SessionEnd, command: "bash mod/ok.sh /tmp/output"}]}
|
|
456
|
+
touches_irreversible: none
|
|
457
|
+
$TAIL
|
|
458
|
+
YAML
|
|
459
|
+
for x in setprod:python3:py gcg:bash:sh rmtree:python3:py cont:bash:sh; do
|
|
460
|
+
IFS=: read -r n i e <<<"$x"
|
|
461
|
+
rv "scan_$n" <<YAML
|
|
462
|
+
id: scan-$n
|
|
463
|
+
version: 1.0.0
|
|
464
|
+
provides: {hooks: [{event: SessionEnd, command: "$i mod/$n.$e"}]}
|
|
465
|
+
touches_irreversible: none
|
|
466
|
+
$TAIL
|
|
467
|
+
YAML
|
|
468
|
+
done
|
|
469
|
+
rv needs_base <<YAML
|
|
470
|
+
id: needs-base
|
|
471
|
+
version: 1.0.0
|
|
472
|
+
touches_irreversible: none
|
|
473
|
+
data_class: public
|
|
474
|
+
requires: {modules: [base], core_min: 3.0.0}
|
|
475
|
+
calibration: {command: "bash scripts/cal.sh"}
|
|
476
|
+
YAML
|
|
477
|
+
printf 'id: bad\nversion: 1.0.0\nnote: \xff\xfe\n' > "$W/nonutf8.yaml"
|
|
478
|
+
run "RV1 PermissionRequest hook blocks (closed in v0)" 1 c check "$W/ev_perm/fh-module.yaml"
|
|
479
|
+
run "RV2 PostToolUse hook blocks (can inject context)" 1 c check "$W/ev_post/fh-module.yaml"
|
|
480
|
+
run "RV3 exit_codes other than 0/1/2 block" 1 c check "$W/ec_swap/fh-module.yaml"
|
|
481
|
+
run "RV4 unhashable enum values block, never crash to 2" 1 c check "$W/unhash/fh-module.yaml"
|
|
482
|
+
run "RV5 core_route present (even null) with none blocks" 1 c check "$W/route_null/fh-module.yaml"
|
|
483
|
+
run "RV6 provides.hooks false / verdicts {} block" 1 c check "$W/hooks_false/fh-module.yaml"
|
|
484
|
+
run "RV7 absolute path in a command argument blocks" 1 c check "$W/abs_arg/fh-module.yaml"
|
|
485
|
+
run "RV8 settings.prod.json in a hook file blocks" 1 c check "$W/scan_setprod/fh-module.yaml"
|
|
486
|
+
run "RV9 GIT_CONFIG_GLOBAL in a hook file blocks" 1 c check "$W/scan_gcg/fh-module.yaml"
|
|
487
|
+
run "RV10 shutil.rmtree with touches_irreversible=none blocks" 1 c check "$W/scan_rmtree/fh-module.yaml"
|
|
488
|
+
run "RV11 git \\ ⏎ push continuation blocks" 1 c check "$W/scan_cont/fh-module.yaml"
|
|
489
|
+
run "RV12 non-UTF-8 manifest is UNMEASURED (2), not BLOCK" 2 c check "$W/nonutf8.yaml"
|
|
490
|
+
run "RV13 unreadable registry cannot claim «not installed» (2)" 2 c check "$W/needs_base/fh-module.yaml" --installed "$W/no-such-dir"
|
|
491
|
+
|
|
492
|
+
# ── export (standalone proof): copy only what is declared, run the calibration inside the copy ──
|
|
493
|
+
printf 'python3 scripts/helper.py\n' > "$R/scripts/cal_dep.sh"
|
|
494
|
+
printf 'print("helper ok")\n' > "$R/scripts/helper.py"
|
|
495
|
+
rv ex_undeclared <<YAML
|
|
496
|
+
id: ex-undeclared
|
|
497
|
+
version: 1.0.0
|
|
498
|
+
touches_irreversible: none
|
|
499
|
+
data_class: public
|
|
500
|
+
requires: {modules: [], core_min: 3.0.0}
|
|
501
|
+
calibration: {command: "bash scripts/cal_dep.sh"}
|
|
502
|
+
YAML
|
|
503
|
+
rv ex_declared <<YAML
|
|
504
|
+
id: ex-declared
|
|
505
|
+
version: 1.0.0
|
|
506
|
+
touches_irreversible: none
|
|
507
|
+
data_class: public
|
|
508
|
+
requires: {modules: [], core_min: 3.0.0}
|
|
509
|
+
calibration: {command: "bash scripts/cal_dep.sh"}
|
|
510
|
+
files: [scripts/helper.py]
|
|
511
|
+
YAML
|
|
512
|
+
rv ex_uncal <<YAML
|
|
513
|
+
id: ex-uncal
|
|
514
|
+
version: 1.0.0
|
|
515
|
+
touches_irreversible: none
|
|
516
|
+
data_class: public
|
|
517
|
+
requires: {modules: [], core_min: 3.0.0}
|
|
518
|
+
calibration: UNCALIBRATED
|
|
519
|
+
YAML
|
|
520
|
+
rv ex_badfile <<YAML
|
|
521
|
+
id: ex-badfile
|
|
522
|
+
version: 1.0.0
|
|
523
|
+
touches_irreversible: none
|
|
524
|
+
$TAIL
|
|
525
|
+
files: [../outside.txt]
|
|
526
|
+
YAML
|
|
527
|
+
run "EX1 undeclared dependency: calibration fails inside the export (1)" 1 c export "$W/ex_undeclared/fh-module.yaml" --out "$W/out1"
|
|
528
|
+
run "EX2 declared in files: standalone (0)" 0 c export "$W/ex_declared/fh-module.yaml" --out "$W/out2"
|
|
529
|
+
run "EX3 UNCALIBRATED cannot prove standalone (2)" 2 c export "$W/ex_uncal/fh-module.yaml" --out "$W/out3"
|
|
530
|
+
mkdir -p "$W/out4"; echo x > "$W/out4/keep"
|
|
531
|
+
run "EX4 a non-empty --out is refused (2)" 2 c export "$W/ex_declared/fh-module.yaml" --out "$W/out4"
|
|
532
|
+
run "EX5 a blocked manifest exports nothing (1)" 1 c export "$W/ex_badfile/fh-module.yaml" --out "$W/out5"
|
|
533
|
+
echo decoy > "$R/scripts/undeclared_decoy.txt" # exists next to the declared file; must not be copied
|
|
534
|
+
run "EX2b export again after adding a decoy (0)" 0 c export "$W/ex_declared/fh-module.yaml" --out "$W/out2b"
|
|
535
|
+
if [ ! -e "$W/out5" ] && [ -f "$W/out2b/scripts/helper.py" ] && [ ! -e "$W/out2b/scripts/undeclared_decoy.txt" ] && [ ! -e "$W/out2b/fh-module.yaml" ] && [ -f "$W/out2b/.fh-export/MODULE.md" ]; then PASS=$((PASS+1)); echo "PASS EX6 only declared files are copied; a refused export leaves no folder"
|
|
536
|
+
else FAIL=$((FAIL+1)); echo "FAIL EX6 export copied the wrong set"; fi
|
|
537
|
+
|
|
538
|
+
run "EX7 the pilot (ko-tech-writer) exports standalone" 0 python3 "$CHK" export "$REPO/plugins/fh-commons/skills/ko-tech-writer/fh-module.yaml" --repo "$REPO" --out "$W/pilot"
|
|
539
|
+
|
|
540
|
+
# ── export review fixes (codex + API Sonnet, 2026-10-18) ──
|
|
541
|
+
mkdir -p "$R/plugins/p/skills/linked" && echo "# s" > "$R/plugins/p/skills/linked/SKILL.md" && ln -sf /etc/hosts "$R/plugins/p/skills/linked/leak"
|
|
542
|
+
rv ex_symlink <<YAML
|
|
543
|
+
id: ex-symlink
|
|
544
|
+
version: 1.0.0
|
|
545
|
+
provides: {skills: [linked]}
|
|
546
|
+
touches_irreversible: none
|
|
547
|
+
$TAIL
|
|
548
|
+
YAML
|
|
549
|
+
rv ex_dot <<YAML
|
|
550
|
+
id: ex-dot
|
|
551
|
+
version: 1.0.0
|
|
552
|
+
touches_irreversible: none
|
|
553
|
+
$TAIL
|
|
554
|
+
files: [.]
|
|
555
|
+
YAML
|
|
556
|
+
rv ex_slug <<YAML
|
|
557
|
+
id: ex-slug
|
|
558
|
+
version: 1.0.0
|
|
559
|
+
provides: {skills: ["../../../scripts"]}
|
|
560
|
+
touches_irreversible: none
|
|
561
|
+
$TAIL
|
|
562
|
+
YAML
|
|
563
|
+
printf 'exit 2\n' > "$R/scripts/cal_unm.sh"
|
|
564
|
+
rv ex_unm <<YAML
|
|
565
|
+
id: ex-unm
|
|
566
|
+
version: 1.0.0
|
|
567
|
+
touches_irreversible: none
|
|
568
|
+
data_class: public
|
|
569
|
+
requires: {modules: [], core_min: 3.0.0}
|
|
570
|
+
calibration: {command: "bash scripts/cal_unm.sh"}
|
|
571
|
+
YAML
|
|
572
|
+
run "EX8 a symlink inside a skill folder blocks (1)" 1 c export "$W/ex_symlink/fh-module.yaml" --out "$W/out8"
|
|
573
|
+
run "EX9 files: [.] blocks (1)" 1 c export "$W/ex_dot/fh-module.yaml" --out "$W/out9"
|
|
574
|
+
run "EX10 a skill name with .. blocks (1)" 1 c export "$W/ex_slug/fh-module.yaml" --out "$W/out10"
|
|
575
|
+
run "EX11 --out inside the repo is refused (2)" 2 c export "$W/ex_declared/fh-module.yaml" --out "$R/inside"
|
|
576
|
+
run "EX12 calibration rc 2 is UNMEASURED, not BLOCK (2)" 2 c export "$W/ex_unm/fh-module.yaml" --out "$W/out12"
|
|
577
|
+
if [ ! -e "$W/out8" ] && [ ! -e "$W/out12" ] && [ ! -e "$R/inside" ] && ! ls -d "$W"/.fh-export-* >/dev/null 2>&1; then PASS=$((PASS+1)); echo "PASS EX13 refused or failed exports leave no folder and no staging"
|
|
578
|
+
else FAIL=$((FAIL+1)); echo "FAIL EX13 leftovers after a refused export"; fi
|
|
579
|
+
|
|
580
|
+
echo "lanes: pass=$PASS fail=$FAIL"
|
|
581
|
+
[ "$FAIL" = 0 ]
|
|
@@ -2006,6 +2006,89 @@ else
|
|
|
2006
2006
|
no "L124 빈 1차 fail-open" "empty_rc=$R124 (3 기대) '$(printf '%s' "$O124" | /usr/bin/grep -o 'status=[A-Z_0-9]*' | head -1)' ctrl_rc=$R124c (0 기대)"
|
|
2007
2007
|
fi
|
|
2008
2008
|
|
|
2009
|
+
# ── L125/L126 🟥 2차 철회 대조가 «부분 문자열» 이라 남의 발견을 삼키던 구멍 (2026-10-22, 호출지점 재고 조사) ──
|
|
2010
|
+
# 기전: `if _id in _body` — `DROPPED: codex-logic-10` 이 `codex-logic-1` 도 «철회됨» 으로 세서, 2차에서 조용히
|
|
2011
|
+
# 빠진 1번이 «설명됨» 이 되고 폴백도 안 돌았다(무음 삭제). 제목도 같은 부류(`Q1` ⊂ `Q10`).
|
|
2012
|
+
# 픽스처는 뚫리는 표기 그대로: 1차 10건 → 2차가 2~9 를 KEEP · 10 을 DROPPED · 1 은 말없이 뺀다.
|
|
2013
|
+
cat > "$D/x_ten.sh" <<'EOS'
|
|
2014
|
+
#!/bin/sh
|
|
2015
|
+
IN=$(cat); [ -n "$IN" ] || IN="$*"
|
|
2016
|
+
row(){ printf '{"id":"codex-logic-%s","title":"%s","file":"x_t.py","line":%s,"severity":"B","category":"s","detail":"x","defeater":"y","confidence":0.6}\n' "$1" "$2" "$1"; }
|
|
2017
|
+
case "$IN" in
|
|
2018
|
+
*"YOUR OWN ROUND-1 FINDINGS"*)
|
|
2019
|
+
for i in 2 3 4 5 6 7 8 9; do row $i "kept-$i"; done
|
|
2020
|
+
if [ -n "$TEN_DROP_BOTH" ]; then echo 'DROPPED: codex-logic-1 — re-read; not a defect'; fi
|
|
2021
|
+
echo 'DROPPED: codex-logic-10 — re-read; not a defect' ;;
|
|
2022
|
+
*) for i in 1 2 3 4 5 6 7 8 9 10; do printf '{"title":"r1-%s","file":"x_t.py","line":%s,"severity":"B","category":"s","detail":"x","defeater":"y","confidence":0.6}\n' "$i" "$i"; done ;;
|
|
2023
|
+
esac
|
|
2024
|
+
EOS
|
|
2025
|
+
cat > "$D/x_qtitle.sh" <<'EOS'
|
|
2026
|
+
#!/bin/sh
|
|
2027
|
+
IN=$(cat); [ -n "$IN" ] || IN="$*"
|
|
2028
|
+
case "$IN" in
|
|
2029
|
+
*"YOUR OWN ROUND-1 FINDINGS"*) echo 'DROPPED: Q10 — re-read; not a defect' ;;
|
|
2030
|
+
*) echo '{"title":"Q1","file":"x_t.py","line":1,"severity":"A","category":"d","detail":"x","defeater":"y","confidence":0.7}'
|
|
2031
|
+
echo '{"title":"Q10","file":"x_t.py","line":2,"severity":"B","category":"d","detail":"x","defeater":"y","confidence":0.7}' ;;
|
|
2032
|
+
esac
|
|
2033
|
+
EOS
|
|
2034
|
+
chmod +x "$D/x_ten.sh" "$D/x_qtitle.sh"
|
|
2035
|
+
printf 'codex|logic|sh %s\n' "$D/x_ten.sh" > "$D/f125.tbl"
|
|
2036
|
+
O125=$(bash "$FL" "$D/x_t.py" --out "$D/f125" --fleet "$D/f125.tbl" --round2 2>&1)
|
|
2037
|
+
# 컨트롤: 1 과 10 을 둘 다 «명시적으로» 내리면 폴백 없이 철회된다 — 경계 비교가 정당한 철회까지 막지 않는다
|
|
2038
|
+
O125c=$(TEN_DROP_BOTH=1 bash "$FL" "$D/x_t.py" --out "$D/f125c" --fleet "$D/f125.tbl" --round2 2>&1)
|
|
2039
|
+
if printf '%s\n' "$O125" | /usr/bin/grep -q 'unaccounted_r1=codex-logic-1 ' \
|
|
2040
|
+
&& /usr/bin/grep -q '"r1-1"' "$D/f125/findings.jsonl" 2>/dev/null \
|
|
2041
|
+
&& ! printf '%s\n' "$O125c" | /usr/bin/grep -q 'unaccounted_r1=' \
|
|
2042
|
+
&& ! /usr/bin/grep -q '"r1-1"' "$D/f125c/findings.jsonl" 2>/dev/null \
|
|
2043
|
+
&& /usr/bin/grep -q '"kept-2"' "$D/f125c/findings.jsonl" 2>/dev/null; then
|
|
2044
|
+
ok "L125 🟥 «DROPPED: codex-logic-10» 은 codex-logic-1 을 철회하지 않는다(말없이 빠진 1 → 폴백) · 컨트롤: 둘 다 명시 철회 → 폴백 없음"
|
|
2045
|
+
else
|
|
2046
|
+
no "L125 id 부분일치 철회" "$(printf '%s\n' "$O125" | /usr/bin/grep -E 'unaccounted|MEMBER2' | head -2) | ctrl: $(printf '%s\n' "$O125c" | /usr/bin/grep -E 'unaccounted|MEMBER2' | head -2)"
|
|
2047
|
+
fi
|
|
2048
|
+
printf 'codex|logic|sh %s\n' "$D/x_qtitle.sh" > "$D/f126.tbl"
|
|
2049
|
+
O126=$(bash "$FL" "$D/x_t.py" --out "$D/f126" --fleet "$D/f126.tbl" --round2 2>&1)
|
|
2050
|
+
if printf '%s\n' "$O126" | /usr/bin/grep -q 'unaccounted_r1=' \
|
|
2051
|
+
&& /usr/bin/grep -q '"Q1"' "$D/f126/findings.jsonl" 2>/dev/null; then
|
|
2052
|
+
ok "L126 🟥 제목 «Q10» 철회가 제목 «Q1» 을 삼키지 않는다(Q1 은 설명 안 됨 → 폴백, 1차 그대로)"
|
|
2053
|
+
else
|
|
2054
|
+
no "L126 제목 부분일치 철회" "$(printf '%s\n' "$O126" | /usr/bin/grep -E 'unaccounted|MEMBER2' | head -2)"
|
|
2055
|
+
fi
|
|
2056
|
+
|
|
2057
|
+
# ── L127 🟥 codex R1 (같은 날) — 줄 «어디서든» 찾으면 이름만 «언급된» 발견도 철회로 셌다 ──
|
|
2058
|
+
# 처방 = DROPPED 줄은 «맨 앞에 오는» 한 발견만 철회한다(가장 긴 일치). 네 형태, 앞 셋은 말없이 빠진 A 가 살아 폴백해야,
|
|
2059
|
+
# 넷째(한국어 조사)는 정당한 철회로 인정돼야 한다 — 과차단 컨트롤.
|
|
2060
|
+
cat > "$D/x_two.sh" <<'EOS'
|
|
2061
|
+
#!/bin/sh
|
|
2062
|
+
IN=$(cat); [ -n "$IN" ] || IN="$*"
|
|
2063
|
+
case "$IN" in
|
|
2064
|
+
*"YOUR OWN ROUND-1 FINDINGS"*) printf '%s\n' "$TWO_DROP" ;;
|
|
2065
|
+
*) printf '{"title":"%s","file":"x_t.py","line":1,"severity":"A","category":"d","detail":"x","defeater":"y","confidence":0.7}\n' "$TWO_A"
|
|
2066
|
+
printf '{"title":"%s","file":"x_t.py","line":2,"severity":"B","category":"d","detail":"x","defeater":"y","confidence":0.7}\n' "$TWO_B" ;;
|
|
2067
|
+
esac
|
|
2068
|
+
EOS
|
|
2069
|
+
chmod +x "$D/x_two.sh"
|
|
2070
|
+
printf 'codex|logic|sh %s\n' "$D/x_two.sh" > "$D/f127.tbl"
|
|
2071
|
+
r127=""
|
|
2072
|
+
t127(){ # $1=label $2=A title $3=B title $4=DROPPED line $5=expect (fallback|withdrawn)
|
|
2073
|
+
_o=$(TWO_A="$2" TWO_B="$3" TWO_DROP="$4" bash "$FL" "$D/x_t.py" --out "$D/f127_$1" --fleet "$D/f127.tbl" --round2 2>&1)
|
|
2074
|
+
if [ "$5" = fallback ]; then
|
|
2075
|
+
printf '%s\n' "$_o" | /usr/bin/grep -q 'unaccounted_r1=' && /usr/bin/grep -qF "\"title\": \"$2\"" "$D/f127_$1/findings.jsonl" 2>/dev/null \
|
|
2076
|
+
|| /usr/bin/grep -qF "\"title\":\"$2\"" "$D/f127_$1/findings.jsonl" 2>/dev/null || r127="$r127 $1"
|
|
2077
|
+
else
|
|
2078
|
+
printf '%s\n' "$_o" | /usr/bin/grep -q 'status=ZERO_SELFDROPPED' || r127="$r127 $1"
|
|
2079
|
+
fi
|
|
2080
|
+
}
|
|
2081
|
+
t127 punct 'Race' 'Race-condition' 'DROPPED: Race-condition — invalid' fallback
|
|
2082
|
+
t127 inid 'logic' 'Other' 'DROPPED: codex-logic-2 — invalid' fallback
|
|
2083
|
+
t127 reason 'Race condition' 'Other' 'DROPPED: codex-logic-2 — duplicate; Race condition remains valid' fallback
|
|
2084
|
+
# 컨트롤: 두 줄이 각자 «맨 앞» 에 한 발견씩 — 한국어 조사가 붙어도 정당한 철회로 셈 → 전원 철회
|
|
2085
|
+
t127 korean '경쟁 조건' 'Other' "$(printf 'DROPPED: 경쟁 조건은 오탐\nDROPPED: codex-logic-2은 오탐')" withdrawn
|
|
2086
|
+
if [ -z "$r127" ]; then
|
|
2087
|
+
ok "L127 🟥 DROPPED 는 맨 앞 한 발견만 철회(구두점 붙은 긴 제목 · id 속 제목 · 사유 속 언급 → 폴백) · 컨트롤: 한국어 조사 붙은 정당 철회는 인정"
|
|
2088
|
+
else
|
|
2089
|
+
no "L127 맨 앞 한 발견 철회" "failed:$r127"
|
|
2090
|
+
fi
|
|
2091
|
+
|
|
2009
2092
|
/bin/rm -rf "$D"
|
|
2010
2093
|
echo "PASS=$PASS FAIL=$FAIL"
|
|
2011
2094
|
[ "$FAIL" -eq 0 ] && { echo "FAILED=0"; exit 0; } || { echo "FAILED=1"; exit 1; }
|