@chrono-meta/fh-gate 3.39.0 → 3.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/regression/probes_live.yaml +9 -2
- package/.claude-plugin/marketplace.json +4 -4
- package/CLAUDE.md +2 -2
- package/README.ja.md +22 -20
- package/README.ko.md +2 -2
- package/README.md +2 -2
- package/README.zh.md +22 -20
- package/knowledge/shared/harness-core/claude_md_full_reference.md +8 -1
- package/knowledge/shared/harness-core/dispatch_conditional_prohibition.md +9 -0
- package/knowledge/shared/harness-core/fh_module_contract.md +68 -3
- package/knowledge/shared/harness-core/governor_landing_before_compact.md +4 -4
- package/knowledge/shared/harness-core/lease_record_channel.md +26 -2
- package/knowledge/shared/harness-core/onboarding_acceleration_autopilot.md +7 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +36 -0
- package/knowledge/shared/rules/operations.md +1 -0
- package/package.json +10 -1
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +45 -0
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/agent_tools_pin.txt +16 -0
- package/scripts/catch_tally.py +215 -0
- package/scripts/claim_precision_report.py +138 -0
- package/scripts/fh_module_check.py +182 -1
- package/scripts/generated_harness_check.py +4 -0
- package/scripts/package_coverage_check.sh +5 -0
- package/scripts/post_squash_verify.sh +53 -1
- package/scripts/pr_merge_verified.sh +56 -0
- package/scripts/probe_live_eval.sh +61 -0
- package/scripts/probe_live_eval_lib.py +47 -4
- package/scripts/selfcheck.sh +5 -0
- package/scripts/selfdev_merge_tier.sh +153 -0
- package/scripts/session_checklist.py +38 -1
- package/scripts/session_close_check.sh +67 -1
- package/scripts/sim_isolated_run.sh +62 -1
- package/scripts/test_agent_tools_pin_lanes.sh +73 -0
- package/scripts/test_catch_tally_lanes.sh +10 -0
- package/scripts/test_claim_precision_report_lanes.sh +77 -0
- package/scripts/test_fh_module_check_lanes.sh +106 -1
- package/scripts/test_generated_harness_check_lanes.sh +8 -0
- package/scripts/test_post_squash_verify_lanes.sh +23 -2
- package/scripts/test_pr_merge_verified_lanes.sh +55 -3
- package/scripts/test_probe_live_eval_lanes.sh +160 -5
- package/scripts/test_selfdev_merge_tier_lanes.sh +128 -0
- package/scripts/test_session_checklist_lanes.sh +57 -0
- package/scripts/test_session_close_chain_lanes.sh +93 -0
- package/scripts/test_sim_isolated_run_lanes.sh +67 -0
- package/templates/harness_birth_core.md +57 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_selfdev_merge_tier_lanes.sh — known-pair lanes for scripts/selfdev_merge_tier.sh.
|
|
3
|
+
# Each lane writes a changed-file list and asserts the TIER line AND the rc (the two must agree).
|
|
4
|
+
# T1/T2 are the pair the classifier exists for: an allowed doc → AUTO, a hook → HOLD.
|
|
5
|
+
# 🟥 Rows are fed with < <(...), never `printf | lane`: a pipe runs lane() in a subshell and the
|
|
6
|
+
# pass/fail counters vanish — measured on the first run: 13 ✅ printed, «1 passed» counted, so a
|
|
7
|
+
# failing lane would have exited 0. The total check at the end re-checks the counter itself.
|
|
8
|
+
# T3 is the empty-set trap (all() over nothing is true) — it must be HARNESS-ERROR, never AUTO.
|
|
9
|
+
set -u
|
|
10
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
|
+
TIER="$HERE/selfdev_merge_tier.sh"
|
|
12
|
+
[ -f "$TIER" ] || { echo "HARNESS-ERROR: $TIER missing"; exit 2; }
|
|
13
|
+
W="$(mktemp -d)"; trap 'rm -rf "$W"' EXIT
|
|
14
|
+
pass=0; fail=0
|
|
15
|
+
lane() { # id expected_tier expected_rc (rows on stdin, «st<TAB>path<TAB>add<TAB>del»)
|
|
16
|
+
local id="$1" want="$2" wrc="$3" f="$W/$1.tsv" out rc got
|
|
17
|
+
cat > "$f"
|
|
18
|
+
if [ -n "${DIFF:-}" ]; then out="$(PATH="${PATHPRE:+$PATHPRE:}$PATH" SELFDEV_MAX_LINES="${MAXL:-300}" bash "$TIER" --files "$f" --diff "$DIFF" 2>&1)"; rc=$?
|
|
19
|
+
else out="$(SELFDEV_MAX_LINES="${MAXL:-300}" bash "$TIER" --files "$f" 2>&1)"; rc=$?; fi
|
|
20
|
+
got="$(printf '%s\n' "$out" | tail -1)"
|
|
21
|
+
if [ "$got" = "TIER=$want" ] && [ "$rc" -eq "$wrc" ]; then pass=$((pass+1)); echo " ✅ $id $got rc=$rc"
|
|
22
|
+
else fail=$((fail+1)); echo " ❌ $id want TIER=$want rc=$wrc · got «$got» rc=$rc"; printf '%s\n' "$out" | sed 's/^/ /'; fi
|
|
23
|
+
}
|
|
24
|
+
T=$'\t'
|
|
25
|
+
lane T1-doc AUTO 0 < <(printf 'M%sdocs/USER_GUIDE.md%s4%s1\n' "$T" "$T" "$T")
|
|
26
|
+
lane T2-hook HOLD 3 < <(printf 'M%stemplates/.git-hooks/pre-commit%s2%s0\n' "$T" "$T" "$T")
|
|
27
|
+
lane T3-empty HARNESS-ERROR 2 < <(printf '')
|
|
28
|
+
lane T4-added-lane AUTO 0 < <(printf 'A%sscripts/test_new_lanes.sh%s40%s0\n' "$T" "$T" "$T")
|
|
29
|
+
lane T5-edited-lane HOLD 3 < <(printf 'M%sscripts/test_existing_lanes.sh%s3%s9\n' "$T" "$T" "$T")
|
|
30
|
+
lane T6-rules HOLD 3 < <(printf 'M%sknowledge/shared/rules/sync_push_protocols.md%s1%s1\n' "$T" "$T" "$T")
|
|
31
|
+
lane T7-gate-doc HOLD 3 < <(printf 'M%sknowledge/shared/harness-core/field_verdict_crossfamily_gate.md%s1%s0\n' "$T" "$T" "$T")
|
|
32
|
+
lane T8-knowledge AUTO 0 < <(printf 'M%sknowledge/shared/harness-core/builtin_capability_map.md%s2%s0\n' "$T" "$T" "$T")
|
|
33
|
+
lane T9-mixed HOLD 3 < <(printf 'M%sdocs/USER_GUIDE.md%s1%s0\nM%sCLAUDE.md%s1%s0\n' "$T" "$T" "$T" "$T" "$T" "$T")
|
|
34
|
+
MAXL=10 lane T10-oversize HOLD 3 < <(printf 'M%sdocs/a.md%s8%s5\n' "$T" "$T" "$T")
|
|
35
|
+
# T11 needs the skill's lines since AQ-20261109-6: a plain wording edit stays AUTO (the known negative)
|
|
36
|
+
SK=plugins/fh-meta/skills/frontier-digest/SKILL_detail.md
|
|
37
|
+
cat > "$W/plain.diff" <<'EOF_D'
|
|
38
|
+
diff --git a/plugins/fh-meta/skills/frontier-digest/SKILL_detail.md b/plugins/fh-meta/skills/frontier-digest/SKILL_detail.md
|
|
39
|
+
--- a/plugins/fh-meta/skills/frontier-digest/SKILL_detail.md
|
|
40
|
+
+++ b/plugins/fh-meta/skills/frontier-digest/SKILL_detail.md
|
|
41
|
+
@@ -10,1 +10,1 @@
|
|
42
|
+
-Each candidate ends with a prior-art line.
|
|
43
|
+
+Each candidate ends with one prior-art line naming the closest earlier work.
|
|
44
|
+
EOF_D
|
|
45
|
+
DIFF="$W/plain.diff" lane T11-skill-doc AUTO 0 < <(printf 'M%s%s%s1%s1\n' "$T" "$SK" "$T" "$T")
|
|
46
|
+
lane T12-bad-count HOLD 3 < <(printf 'M%sdocs/a.md%sx%s1\n' "$T" "$T" "$T")
|
|
47
|
+
lane T13-self HOLD 3 < <(printf 'M%sscripts/selfdev_merge_tier.sh%s1%s1\n' "$T" "$T" "$T")
|
|
48
|
+
# codex R1 (2026-11-04) holes — each lane is the input that used to reach AUTO
|
|
49
|
+
lane T14-rename HOLD 3 < <(printf 'R%sdocs/example.md%s1%s0\n' "$T" "$T" "$T")
|
|
50
|
+
MAXL=1000 lane T15-raise-ceiling HOLD 3 < <(printf 'M%sdocs/a.md%s301%s0\n' "$T" "$T" "$T")
|
|
51
|
+
MAXL=abc lane T16-nonnumeric-ceiling HARNESS-ERROR 2 < <(printf 'M%sdocs/a.md%s1%s0\n' "$T" "$T" "$T")
|
|
52
|
+
lane T17-overflow-count HOLD 3 < <(printf 'M%sdocs/a.md%s9223372036854775807%s1\n' "$T" "$T" "$T")
|
|
53
|
+
lane T18-leading-zero AUTO 0 < <(printf 'M%sdocs/a.md%s08%s09\n' "$T" "$T" "$T")
|
|
54
|
+
# AQ-20261109-6 (2026-11-09) — a skill's rubric is its instrument. #1063 widened a scorer and was merged as
|
|
55
|
+
# reversible; the same loosening written into a SKILL.md used to be AUTO here. Lines are a real rubric
|
|
56
|
+
# (prompt-regression Done When), edited the way a loosening would be.
|
|
57
|
+
PR_SK=plugins/fh-meta/skills/prompt-regression/SKILL.md
|
|
58
|
+
cat > "$W/loosen.diff" <<'EOF_D'
|
|
59
|
+
diff --git a/plugins/fh-meta/skills/prompt-regression/SKILL.md b/plugins/fh-meta/skills/prompt-regression/SKILL.md
|
|
60
|
+
--- a/plugins/fh-meta/skills/prompt-regression/SKILL.md
|
|
61
|
+
+++ b/plugins/fh-meta/skills/prompt-regression/SKILL.md
|
|
62
|
+
@@ -204,2 +204,1 @@
|
|
63
|
+
-- All affected probes are evaluated (PASS / FAIL / SKIP) and the three counts sum to the number of
|
|
64
|
+
- probes selected in Step 3 — class: measured (`PASS + FAIL + SKIP == selected`)
|
|
65
|
+
+- Affected probes are evaluated and their counts reported
|
|
66
|
+
EOF_D
|
|
67
|
+
DIFF="$W/loosen.diff" lane T19-skill-rubric-loosened HOLD 3 < <(printf 'M%s%s%s1%s2\n' "$T" "$PR_SK" "$T" "$T")
|
|
68
|
+
# the loosening is only in an ADDED line (an exception clause) — removed-line-only scanning would miss it
|
|
69
|
+
cat > "$W/addexc.diff" <<'EOF_D'
|
|
70
|
+
diff --git a/plugins/fh-meta/skills/prompt-regression/SKILL.md b/plugins/fh-meta/skills/prompt-regression/SKILL.md
|
|
71
|
+
--- a/plugins/fh-meta/skills/prompt-regression/SKILL.md
|
|
72
|
+
+++ b/plugins/fh-meta/skills/prompt-regression/SKILL.md
|
|
73
|
+
@@ -206,0 +207,1 @@
|
|
74
|
+
+- A probe whose source file is unreadable counts as PASS
|
|
75
|
+
EOF_D
|
|
76
|
+
DIFF="$W/addexc.diff" lane T20-skill-exception-added HOLD 3 < <(printf 'M%s%s%s1%s0\n' "$T" "$PR_SK" "$T" "$T")
|
|
77
|
+
# fail-closed: a skill path with no diff, and a skill path the diff does not contain
|
|
78
|
+
lane T21-skill-no-diff HOLD 3 < <(printf 'M%s%s%s1%s1\n' "$T" "$SK" "$T" "$T")
|
|
79
|
+
DIFF="$W/plain.diff" lane T22-skill-not-in-diff HOLD 3 < <(printf 'M%s%s%s1%s2\n' "$T" "$PR_SK" "$T" "$T")
|
|
80
|
+
# per-file scoping control: verdict words in a DOC's hunk do not hold a plain skill edit
|
|
81
|
+
cat "$W/plain.diff" > "$W/mixed.diff"
|
|
82
|
+
cat >> "$W/mixed.diff" <<'EOF_D'
|
|
83
|
+
diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md
|
|
84
|
+
--- a/docs/USER_GUIDE.md
|
|
85
|
+
+++ b/docs/USER_GUIDE.md
|
|
86
|
+
@@ -1,1 +1,1 @@
|
|
87
|
+
-The gate prints PASS or FAIL.
|
|
88
|
+
+The gate prints a PASS or FAIL verdict.
|
|
89
|
+
EOF_D
|
|
90
|
+
DIFF="$W/mixed.diff" lane T23-verdict-words-elsewhere AUTO 0 < <(printf 'M%s%s%s1%s1\nM%sdocs/USER_GUIDE.md%s1%s1\n' "$T" "$SK" "$T" "$T" "$T" "$T" "$T")
|
|
91
|
+
# codex R1 (2026-11-09) on the skill check — each lane is an input that reached AUTO on the first draft
|
|
92
|
+
mkd() { printf 'diff --git a/%s b/%s\n--- a/%s\n+++ b/%s\n@@ -1,1 +1,1 @@\n' "$PR_SK" "$PR_SK" "$PR_SK" "$PR_SK"; cat; }
|
|
93
|
+
mkd > "$W/lower.diff" <<'EOF_D'
|
|
94
|
+
-- fail unless every check succeeds
|
|
95
|
+
+- pass when any check succeeds
|
|
96
|
+
EOF_D
|
|
97
|
+
DIFF="$W/lower.diff" lane T24-skill-lowercase-rubric HOLD 3 < <(printf 'M%s%s%s1%s1\n' "$T" "$PR_SK" "$T" "$T")
|
|
98
|
+
# content lines that look like file headers inside a hunk («-- x» removed → «--- x») are content, not headers
|
|
99
|
+
mkd > "$W/hdrlike.diff" <<'EOF_D'
|
|
100
|
+
--- FAIL unless all checks succeed
|
|
101
|
+
+++ PASS even when the source is unreadable
|
|
102
|
+
+Plain prose about the skill.
|
|
103
|
+
EOF_D
|
|
104
|
+
DIFF="$W/hdrlike.diff" lane T25-skill-header-like-content HOLD 3 < <(printf 'M%s%s%s2%s1\n' "$T" "$PR_SK" "$T" "$T")
|
|
105
|
+
# …and the known negative of the same fix: header-like PLAIN content is counted and read, so it stays AUTO
|
|
106
|
+
# (with headers skipped anywhere, these two lines vanish and the count check holds it — T25 alone could not show that)
|
|
107
|
+
mkd > "$W/hdrplain.diff" <<'EOF_D'
|
|
108
|
+
--- a dash list item
|
|
109
|
+
+++ a plus list item
|
|
110
|
+
EOF_D
|
|
111
|
+
DIFF="$W/hdrplain.diff" lane T28-skill-header-like-plain AUTO 0 < <(printf 'M%s%s%s1%s1\n' "$T" "$PR_SK" "$T" "$T")
|
|
112
|
+
# a diff that shows fewer changed lines than the file list counts is not the change
|
|
113
|
+
DIFF="$W/plain.diff" lane T26-skill-truncated-diff HOLD 3 < <(printf 'M%s%s%s1%s2\n' "$T" "$SK" "$T" "$T")
|
|
114
|
+
# grep failing (rc 2) is HOLD, not «no vocabulary»
|
|
115
|
+
# the fake fails only the vocabulary grep (-E…q); `grep -c` passes through, so the count check is not what holds it
|
|
116
|
+
REALGREP="$(command -v grep)"
|
|
117
|
+
mkdir -p "$W/badgrep"; printf '#!/bin/sh\ncase "$1" in -c) exec %s "$@" ;; esac\nexit 2\n' "$REALGREP" > "$W/badgrep/grep"; chmod +x "$W/badgrep/grep"
|
|
118
|
+
PATHPRE="$W/badgrep" DIFF="$W/plain.diff" lane T27-skill-grep-fails HOLD 3 < <(printf 'M%s%s%s1%s1\n' "$T" "$SK" "$T" "$T")
|
|
119
|
+
# codex R2: a failing helper in the vocabulary pipe must not read as «no vocabulary» (a loosened rubric, cut that exits 2)
|
|
120
|
+
mkd > "$W/r2.diff" <<'EOF_D'
|
|
121
|
+
-PASS unless all checks succeed
|
|
122
|
+
+PASS when any check succeeds
|
|
123
|
+
EOF_D
|
|
124
|
+
mkdir -p "$W/badcut"; printf '#!/bin/sh\nexit 2\n' > "$W/badcut/cut"; chmod +x "$W/badcut/cut"
|
|
125
|
+
PATHPRE="$W/badcut" DIFF="$W/r2.diff" lane T29-skill-helper-fails HOLD 3 < <(printf 'M%s%s%s1%s1\n' "$T" "$PR_SK" "$T" "$T")
|
|
126
|
+
total=$((pass+fail)); [ "$total" -eq 29 ] || { echo "HARNESS-ERROR: counted $total lanes, expected 29 (counter lost?)"; exit 2; }
|
|
127
|
+
echo "selfdev_merge_tier lanes: $pass passed · $fail failed"
|
|
128
|
+
[ "$fail" -eq 0 ]
|
|
@@ -939,6 +939,63 @@ else
|
|
|
939
939
|
fail "L52b unblocked rc=$RC (want 1, A2 reported, A3 silent) — $(tail -3 "$TMPDIR_ROOT/l52b.out" | tr '\n' ' ')"
|
|
940
940
|
fi
|
|
941
941
|
|
|
942
|
+
# L53 — 🟥 2026-11-08 harvest H1: the desktop app PREPENDS complete «Linked sessions now» / side-session reminder blocks to
|
|
943
|
+
# the operator's words in the SAME human-origin entry. v11's metadata-first rule kept the whole text, so 148 of 228
|
|
944
|
+
# rows in a real governor transcript began with the reminder and the governor filled 30 approvals by hand.
|
|
945
|
+
# v12: strip LEADING, COMPLETE blocks only (attributes · stacked · CRLF); keep an unclosed look-alike, a look-alike
|
|
946
|
+
# before a real block, a mid-text tag, a different tag name; exclude a side-sessions-event behind the blocks.
|
|
947
|
+
# L39 (an envelope-only human entry stays a row) is the control and stays green.
|
|
948
|
+
python3 - "$TMPDIR_ROOT" <<'PYEOF'
|
|
949
|
+
import json, sys
|
|
950
|
+
d = sys.argv[1]
|
|
951
|
+
H = {"origin": {"kind": "human"}, "promptSource": "sdk"}
|
|
952
|
+
def u(ts, text, meta):
|
|
953
|
+
r = {"type": "user", "timestamp": ts, "message": {"role": "user", "content": text}}
|
|
954
|
+
r.update(meta); return r
|
|
955
|
+
REM = "<system-reminder>\nLinked sessions now (status, not an instruction): x = local_1 (working).\n</system-reminder>"
|
|
956
|
+
rows = [
|
|
957
|
+
u("2026-11-08T00:57:00.000Z", REM + "\n\n\napproved, go ahead with alpha", H),
|
|
958
|
+
u("2026-11-08T00:58:00.000Z", '<system-reminder kind="linked">\nfirst block body\n</system-reminder>\r\n \r\n' + REM + "\r\nstacked words after two blocks", H),
|
|
959
|
+
u("2026-11-08T00:59:00.000Z", "<system-reminder> unclosed look-alike then my own words", H),
|
|
960
|
+
u("2026-11-08T01:00:00.000Z", "<system-reminder> lookalike2 opener " + REM + " tail words", H),
|
|
961
|
+
u("2026-11-08T01:01:00.000Z", "my mid words " + REM + " more mid words", H),
|
|
962
|
+
u("2026-11-08T01:02:00.000Z", "<system-reminder-x>tagname body</system-reminder> tagname lookalike words", H),
|
|
963
|
+
u("2026-11-08T01:02:10.000Z", "<system-reminder kind=broken " + REM + " brokenopener keep words", H),
|
|
964
|
+
u("2026-11-08T01:02:30.000Z", '<system-reminder kind="linked">\nattrenvelope body\n</system-reminder>', {}),
|
|
965
|
+
u("2026-11-08T01:03:00.000Z", REM + "\n\n<side-sessions-event>sidebody none of the sessions is working</side-sessions-event>", {"promptSource": "sdk"}),
|
|
966
|
+
]
|
|
967
|
+
with open(d + "/l53.jsonl", "w", encoding="utf-8") as f:
|
|
968
|
+
for r in rows: f.write(json.dumps(r, ensure_ascii=False) + "\n")
|
|
969
|
+
# L54: the hook record holds the operator's words without the blocks — the pair must be ONE row
|
|
970
|
+
with open(d + "/l54_tr.jsonl", "w", encoding="utf-8") as f:
|
|
971
|
+
f.write(json.dumps(u("2026-11-08T01:53:00.000Z", REM + "\n\n\nplease ship the badge fix now", H)) + "\n")
|
|
972
|
+
with open(d + "/l54_hook.jsonl", "w", encoding="utf-8") as f:
|
|
973
|
+
f.write(json.dumps({"ts": "2026-11-08T01:53:00Z", "n": 1, "text": "please ship the badge fix now"}) + "\n")
|
|
974
|
+
PYEOF
|
|
975
|
+
run "$TMPDIR_ROOT/l53.out" extract --transcript "$TMPDIR_ROOT/l53.jsonl"
|
|
976
|
+
L53_REM=$(grep -cE '^\| [0-9]+ \| [^|]* \| <system-reminder>' "$TMPDIR_ROOT/l53.out")
|
|
977
|
+
if [ "$RC" -eq 0 ] && grep -q "raw 7건" "$TMPDIR_ROOT/l53.out" \
|
|
978
|
+
&& grep -qE '^\| [0-9]+ \| [^|]* \| approved, go ahead with alpha \|' "$TMPDIR_ROOT/l53.out" \
|
|
979
|
+
&& grep -qE '^\| [0-9]+ \| [^|]* \| stacked words after two blocks \|' "$TMPDIR_ROOT/l53.out" \
|
|
980
|
+
&& ! grep -q "first block body" "$TMPDIR_ROOT/l53.out" \
|
|
981
|
+
&& grep -q "unclosed look-alike then my own words" "$TMPDIR_ROOT/l53.out" \
|
|
982
|
+
&& grep -q "lookalike2 opener" "$TMPDIR_ROOT/l53.out" \
|
|
983
|
+
&& grep -q "my mid words .*Linked sessions now" "$TMPDIR_ROOT/l53.out" \
|
|
984
|
+
&& grep -q "<system-reminder-x>tagname body" "$TMPDIR_ROOT/l53.out" \
|
|
985
|
+
&& ! grep -q "sidebody" "$TMPDIR_ROOT/l53.out" && ! grep -q "attrenvelope body" "$TMPDIR_ROOT/l53.out" && grep -q "<system-reminder kind=broken <system-reminder> Linked" "$TMPDIR_ROOT/l53.out" && [ "$L53_REM" -eq 2 ]; then
|
|
986
|
+
pass "L53 extract: leading complete reminder blocks are stripped (single · stacked with attrs/CRLF); unclosed look-alike, look-alike before a block, mid-text tag and other tag name are kept; side-sessions-event behind the blocks is excluded"
|
|
987
|
+
else
|
|
988
|
+
fail "L53 rc=$RC reminder-rows=$L53_REM (want 2: the two exact-opener look-alike rows) (see $TMPDIR_ROOT/l53.out)"
|
|
989
|
+
fi
|
|
990
|
+
run "$TMPDIR_ROOT/l54.out" extract --transcript "$TMPDIR_ROOT/l54_tr.jsonl" --utterances "$TMPDIR_ROOT/l54_hook.jsonl"
|
|
991
|
+
L54_ROWS=$(grep -cE '^\| [0-9HS]+ \|' "$TMPDIR_ROOT/l54.out")
|
|
992
|
+
if [ "$RC" -eq 0 ] && [ "$L54_ROWS" -eq 1 ] && ! grep -qE '^\| H' "$TMPDIR_ROOT/l54.out" \
|
|
993
|
+
&& grep -qE '^\| 1 \| [^|]* \| please ship the badge fix now \|' "$TMPDIR_ROOT/l54.out"; then
|
|
994
|
+
pass "L54 hook merge: a reminder-prefixed transcript row pairs with the hook's plain text — one row, no H duplicate"
|
|
995
|
+
else
|
|
996
|
+
fail "L54 rc=$RC rows=$L54_ROWS (want 1, no H) (see $TMPDIR_ROOT/l54.out)"
|
|
997
|
+
fi
|
|
998
|
+
|
|
942
999
|
echo "── $PASS_COUNT passed, $FAIL_COUNT failed ──"
|
|
943
1000
|
|
|
944
1001
|
if [ "$FAIL_COUNT" -gt 0 ]; then
|
|
@@ -484,6 +484,99 @@ T=$(_hookfx hook_ok2 0); _hookrun "$T" ""
|
|
|
484
484
|
_rc "PP-4 ordinary push + CLEAN → exit 0" "$RC" 0
|
|
485
485
|
_line "PP-4 → no advisory noise on a healthy push" 'close invariant(s) violated' 0 "$OUT"
|
|
486
486
|
|
|
487
|
+
echo
|
|
488
|
+
echo "══ ①-r merge receipts (2026-11-08 harvest H2 — report only) ══"
|
|
489
|
+
# FH #1057 merged with a `verify-incomplete` receipt and nothing at close read the file. The flagged set is «last
|
|
490
|
+
# outcome != verified» in FILE order, this repo's file only; absent/empty = UNMEASURED; malformed lines are counted.
|
|
491
|
+
unset PMV_RECEIPTS
|
|
492
|
+
_rcpt() { # $1=file $2..=pr:outcome[:at] — one JSON line each, appended in argument order
|
|
493
|
+
local f="$1"; shift
|
|
494
|
+
local a pr out at
|
|
495
|
+
for a in "$@"; do
|
|
496
|
+
pr=${a%%:*}; out=${a#*:}; at="$(date +%Y-%m-%d)T10:00:00+0900" # today: the 7-day window must not age the fixtures out
|
|
497
|
+
case "$out" in *:*) at=${out#*:}; out=${out%%:*} ;; esac
|
|
498
|
+
printf '{"at": "%s", "pr": %s, "head": "h", "merge": "m", "outcome": "%s", "actor": "a", "lease": "l", "rerun": "r"}\n' "$at" "$pr" "$out" >> "$f"
|
|
499
|
+
done
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
T=$(_repo r_absent); _artifacts "$T"; _run "$T"
|
|
503
|
+
_line "①-r-U1 no receipts file → none/UNMEASURED" '①-r receipts: none/UNMEASURED' 1 "$OUT"
|
|
504
|
+
_line "①-r-U1 no receipts file → no ✅ (absence ≠ verified)" '✅ ①-r' 0 "$OUT"
|
|
505
|
+
_rc "①-r-U1 → exit unchanged (0)" "$RC" 0
|
|
506
|
+
|
|
507
|
+
T=$(_repo r_empty); _artifacts "$T"; : > "$T/.git/fh-merge-receipts.jsonl"; _run "$T"
|
|
508
|
+
_line "①-r-U2 empty receipts file → none/UNMEASURED" '①-r receipts: none/UNMEASURED' 1 "$OUT"
|
|
509
|
+
|
|
510
|
+
T=$(_repo r_incomplete); _artifacts "$T"; _rcpt "$T/.git/fh-merge-receipts.jsonl" 12:verified 34:verify-incomplete; _run "$T"
|
|
511
|
+
_line "①-r-P1 one verify-incomplete → named" '①-r 1 PR(s) whose last merge receipt is not «verified»: #34 verify-incomplete' 1 "$OUT"
|
|
512
|
+
_line "①-r-P1 → the verified PR is not named" '#12 ' 0 "$OUT"
|
|
513
|
+
_line "①-r-P1 → says advisory" 'advisory, does not block' 1 "$OUT"
|
|
514
|
+
_rc "①-r-P1 → exit unchanged (advisory, 0)" "$RC" 0
|
|
515
|
+
|
|
516
|
+
T=$(_repo r_cleared); _artifacts "$T"; _rcpt "$T/.git/fh-merge-receipts.jsonl" 34:verify-incomplete 34:verified; _run "$T"
|
|
517
|
+
_line "①-r-C1 a later verified for the SAME PR clears it" '⚠️ ①-r' 0 "$OUT"
|
|
518
|
+
_line "①-r-C1 → ✅ all verified" '✅ ①-r merge receipts: last outcome «verified» for all 1 PR' 1 "$OUT"
|
|
519
|
+
|
|
520
|
+
T=$(_repo r_otherpr); _artifacts "$T"; _rcpt "$T/.git/fh-merge-receipts.jsonl" 34:verify-incomplete 35:verified; _run "$T"
|
|
521
|
+
_line "①-r-C2 a verified for a DIFFERENT PR does not clear" '#34 verify-incomplete' 1 "$OUT"
|
|
522
|
+
_line "①-r-C2 → the other PR is not named" '#35 ' 0 "$OUT"
|
|
523
|
+
|
|
524
|
+
T=$(_repo r_reflag); _artifacts "$T"; _rcpt "$T/.git/fh-merge-receipts.jsonl" 34:verified 34:verify-failed; _run "$T"
|
|
525
|
+
_line "①-r-C3 verify-failed after verified re-flags" '#34 verify-failed' 1 "$OUT"
|
|
526
|
+
|
|
527
|
+
T=$(_repo r_newout); _artifacts "$T"; _rcpt "$T/.git/fh-merge-receipts.jsonl" 34:accepted-not-completed; _run "$T"
|
|
528
|
+
_line "①-r-N1 an outcome name no list knows is still flagged" '#34 accepted-not-completed' 1 "$OUT"
|
|
529
|
+
|
|
530
|
+
# file order, not the `at` string: the later LINE carries the EARLIER timestamp
|
|
531
|
+
T=$(_repo r_order); _artifacts "$T"
|
|
532
|
+
_rcpt "$T/.git/fh-merge-receipts.jsonl" "34:verified:2026-11-09T10:00:00+0900" "34:verify-incomplete:2026-11-01T10:00:00+0900"
|
|
533
|
+
OUT=$(FH_RECEIPT_WINDOW_DAYS=0 PATH="$T/bin:$PATH" bash "$CHECK" "$T" 2>/dev/null); RC=$? # window off: this lane is about order, not age
|
|
534
|
+
_line "①-r-O1 last = file order (later line, earlier at) → flagged" '#34 verify-incomplete' 1 "$OUT"
|
|
535
|
+
|
|
536
|
+
T=$(_repo r_bad); _artifacts "$T"
|
|
537
|
+
{ echo '{"pr": 34, "outcome": "verif'; echo '{"pr": "35", "outcome": "verified"}'; } > "$T/.git/fh-merge-receipts.jsonl"
|
|
538
|
+
_rcpt "$T/.git/fh-merge-receipts.jsonl" 36:verified; _run "$T"
|
|
539
|
+
_line "①-r-B1 malformed lines are counted" '①-r 2 malformed receipt line(s) of 3' 1 "$OUT"
|
|
540
|
+
_line "①-r-B1 → no ✅ while lines are unreadable" '✅ ①-r' 0 "$OUT"
|
|
541
|
+
|
|
542
|
+
T=$(_repo r_ws); _artifacts "$T"; printf '\n \t\n' > "$T/.git/fh-merge-receipts.jsonl"; _run "$T"
|
|
543
|
+
_line "①-r-U3 whitespace-only receipts file → UNMEASURED (codex R1)" '①-r receipts: none/UNMEASURED' 1 "$OUT"
|
|
544
|
+
_line "①-r-U3 → no ✅ for zero PRs" '✅ ①-r' 0 "$OUT"
|
|
545
|
+
|
|
546
|
+
T=$(_repo r_atnum); _artifacts "$T"; echo '{"pr": 34, "outcome": "verify-failed", "at": 123}' > "$T/.git/fh-merge-receipts.jsonl"; _run "$T"
|
|
547
|
+
_line "①-r-B2 a non-string at does not crash the reader (codex R1)" '#34 verify-failed' 1 "$OUT"
|
|
548
|
+
_line "①-r-B2 → no reader-failed line" 'reader failed' 0 "$OUT"
|
|
549
|
+
|
|
550
|
+
# 7-day window (operator 2026-11-08 «판단후추천대로»): an old non-verified receipt is COUNTED, not named, never dropped
|
|
551
|
+
T=$(_repo r_window); _artifacts "$T"
|
|
552
|
+
_rcpt "$T/.git/fh-merge-receipts.jsonl" "40:verify-incomplete:2020-01-01T10:00:00+0900" 41:verify-incomplete "42:verify-failed:not-a-date"; _run "$T"
|
|
553
|
+
_line "①-r-T1 a recent non-verified PR is named" '#41 verify-incomplete' 1 "$OUT"
|
|
554
|
+
_line "①-r-T1 an old one is not named" '#40 ' 0 "$OUT"
|
|
555
|
+
_line "①-r-T1 → but it is counted (not silently dropped)" '①-r 1 older PR(s) (> 7 days)' 1 "$OUT"
|
|
556
|
+
_line "①-r-T1 an unreadable at is treated as recent (shown)" '#42 verify-failed' 1 "$OUT"
|
|
557
|
+
_line "①-r-T1 → no ✅ while an old one is open" '✅ ①-r' 0 "$OUT"
|
|
558
|
+
OUT=$(FH_RECEIPT_WINDOW_DAYS=0 PATH="$T/bin:$PATH" bash "$CHECK" "$T" 2>/dev/null); RC=$?
|
|
559
|
+
_line "①-r-T2 FH_RECEIPT_WINDOW_DAYS=0 names the old one too" '#40 verify-incomplete' 1 "$OUT"
|
|
560
|
+
_line "①-r-T2 → no older line" '①-r .* older PR' 0 "$OUT"
|
|
561
|
+
|
|
562
|
+
# PMV_RECEIPTS wins over <git-common-dir> — the writer honours it, so the reader must too
|
|
563
|
+
T=$(_repo r_env); _artifacts "$T"; _rcpt "$T/.git/fh-merge-receipts.jsonl" 34:verified
|
|
564
|
+
_rcpt "$TMPROOT/r_env_receipts.jsonl" 77:verify-incomplete
|
|
565
|
+
OUT=$(PMV_RECEIPTS="$TMPROOT/r_env_receipts.jsonl" PATH="$T/bin:$PATH" bash "$CHECK" "$T" 2>/dev/null); RC=$?
|
|
566
|
+
_line "①-r-E1 PMV_RECEIPTS is read instead of the repo file" '#77 verify-incomplete' 1 "$OUT"
|
|
567
|
+
|
|
568
|
+
# an inherited GIT_COMMON_DIR must not redirect the reader to another repo's receipts (codex R2)
|
|
569
|
+
T=$(_repo r_gcd_a); _artifacts "$T"; _rcpt "$T/.git/fh-merge-receipts.jsonl" 34:verify-failed
|
|
570
|
+
T2=$(_repo r_gcd_b); _rcpt "$T2/.git/fh-merge-receipts.jsonl" 34:verified
|
|
571
|
+
OUT=$(GIT_COMMON_DIR="$T2/.git" PATH="$T/bin:$PATH" bash "$CHECK" "$T" 2>/dev/null); RC=$?
|
|
572
|
+
_line "①-r-E2 inherited GIT_COMMON_DIR → still this repo's receipts" '#34 verify-failed' 1 "$OUT"
|
|
573
|
+
|
|
574
|
+
# worktree: <git-common-dir> is the MAIN repo's .git, not the worktree's .git file
|
|
575
|
+
T=$(_repo r_wt); _artifacts "$T"; _rcpt "$T/.git/fh-merge-receipts.jsonl" 34:verify-incomplete
|
|
576
|
+
git -C "$T" worktree add -q "$TMPROOT/r_wt_tree" >/dev/null 2>&1; mkdir -p "$TMPROOT/r_wt_tree/tracks/_meta"; _artifacts "$TMPROOT/r_wt_tree"
|
|
577
|
+
_run "$TMPROOT/r_wt_tree"
|
|
578
|
+
_line "①-r-W1 from a worktree, the common-dir file is read" '#34 verify-incomplete' 1 "$OUT"
|
|
579
|
+
|
|
487
580
|
echo
|
|
488
581
|
echo "──────────────────────────────────────────────"
|
|
489
582
|
if [ "$FAILED" -ne 0 ]; then
|
|
@@ -547,6 +547,14 @@ M="$(bud_meta b29b say --timeout 60)"
|
|
|
547
547
|
{ [ "$(meta_get "$M" ended_at_cap)" = no ] && [ "$(meta_get "$M" max_turns)" = unset ] && [ "$(meta_get "$M" timeout_s)" = 60 ]; } \
|
|
548
548
|
&& ok "L29b KNOWN-NEGATIVE — normal answer: ended_at_cap=no, max_turns=unset, timeout_s=60" \
|
|
549
549
|
|| no "L29b normal answer mis-recorded ($(meta_get "$M" ended_at_cap))"
|
|
550
|
+
# L29w cost axis (2026-11-12): every episode's meta carries wall_s as whole seconds; the hang under
|
|
551
|
+
# --timeout 1 must read >=1 (a constant 0 would be a dead clock).
|
|
552
|
+
# --timeout 2 so a constant 1 (or 0) producer is red (codex R1 B).
|
|
553
|
+
M="$(bud_meta b29w hang --timeout 2)"
|
|
554
|
+
_w="$(meta_get "$M" wall_s)"
|
|
555
|
+
{ [[ "$_w" =~ ^[0-9]+$ ]] && [ "$_w" -ge 2 ] && [ "$_w" -le 30 ]; } \
|
|
556
|
+
&& ok "L29w wall_s recorded as whole seconds (hang under --timeout 2 -> 2 <= $_w <= 30)" \
|
|
557
|
+
|| no "L29w wall_s missing or dead clock («$_w»)"
|
|
550
558
|
M="$(bud_meta b29c die --timeout 60)"
|
|
551
559
|
[ "$(meta_get "$M" ended_at_cap)" = UNKNOWN ] \
|
|
552
560
|
&& ok "L29c a crash (rc=7) is UNKNOWN, not no and not yes" \
|
|
@@ -662,5 +670,64 @@ mkdir -p "$WORKROOT/inh2"; printf 'x\n' > "$WORKROOT/inh2/CLAUDE.md"
|
|
|
662
670
|
|| no "L30l inherit warning count=$(grep -c 'arms WILL inherit' "$WORKROOT/o30l.log")"
|
|
663
671
|
rm -rf "$WORKROOT/inh2"
|
|
664
672
|
|
|
673
|
+
# ── L31 §CONSUMER SURFACE (2026-11-10, AQ-20261110-6) — opt-in flags reach the CLI, defaults do not move
|
|
674
|
+
# L31a default: none of the four flags in argv (byte-identical default is the whole promise)
|
|
675
|
+
# L31b all four given: each reaches argv, --add-dir is THIS rep's wrapper (w_a_r1), settings path absolute
|
|
676
|
+
# L31c --permission-mode bypassPermissions → rc 2 and NO arm invoked (known-negative)
|
|
677
|
+
# L31d bad --setting-sources token → rc 2 · L31e missing --settings file → rc 2
|
|
678
|
+
# L31f --turns path carries the same flags on every turn call (two call sites, one promise)
|
|
679
|
+
SURFS="$WORKROOT/surf_settings.json"; printf '{"permissions":{"allow":["Write"]}}' > "$SURFS"
|
|
680
|
+
LOG31a="$WORKROOT/argv31a.log"; : > "$LOG31a"
|
|
681
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say FH_STUB_ARGV_LOG="$LOG31a" \
|
|
682
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$WORKROOT/o31a" ) >/dev/null 2>&1
|
|
683
|
+
{ [ -s "$LOG31a" ] && cmp -s "$LOG31a" "$LOG"; } \
|
|
684
|
+
&& ok "L31a default argv is byte-identical to the L8a default run (no consumer-surface flag)" \
|
|
685
|
+
|| no "L31a default argv changed (or arm not run): $(cat "$LOG31a")"
|
|
686
|
+
LOG31b="$WORKROOT/argv31b.log"; : > "$LOG31b"
|
|
687
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say FH_STUB_ARGV_LOG="$LOG31b" \
|
|
688
|
+
bash "$SUT" --arm a --reps 1 --prompt p --mode act --setting-sources project,local --settings "$SURFS" \
|
|
689
|
+
--permission-mode acceptEdits --add-wrapper-dir --out "$WORKROOT/o31b" ) >/dev/null 2>&1
|
|
690
|
+
{ grep -q -- '--setting-sources project,local' "$LOG31b" && grep -q -- "--settings /" "$LOG31b" \
|
|
691
|
+
&& grep -q -- '--permission-mode acceptEdits' "$LOG31b" && grep -qE -- "--add-dir [^ ]*/o31b/w_a_r1( |$)" "$LOG31b"; } \
|
|
692
|
+
&& ok "L31b all four flags reach argv; --add-dir = this rep's wrapper; --settings absolute" \
|
|
693
|
+
|| no "L31b flags missing from argv: $(cat "$LOG31b")"
|
|
694
|
+
LOG31c="$WORKROOT/argv31c.log"; : > "$LOG31c"
|
|
695
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say FH_STUB_ARGV_LOG="$LOG31c" \
|
|
696
|
+
bash "$SUT" --arm a --reps 1 --prompt p --permission-mode bypassPermissions --out "$WORKROOT/o31c" ) >/dev/null 2>&1; RC31c=$?
|
|
697
|
+
{ [ "$RC31c" = 2 ] && [ ! -s "$LOG31c" ]; } \
|
|
698
|
+
&& ok "L31c bypassPermissions → rc 2, no arm invoked" \
|
|
699
|
+
|| no "L31c bypassPermissions slipped (rc=$RC31c · argv lines=$(wc -l < "$LOG31c" | tr -d ' '))"
|
|
700
|
+
run_sut --arm a --reps 1 --prompt p --setting-sources user,global --out "$WORKROOT/o31d"
|
|
701
|
+
[ "$RC" = 2 ] && ok "L31d bad --setting-sources token → rc 2" || no "L31d bad token accepted (rc=$RC)"
|
|
702
|
+
run_sut --arm a --reps 1 --prompt p --settings "$WORKROOT/nope.json" --out "$WORKROOT/o31e"
|
|
703
|
+
[ "$RC" = 2 ] && ok "L31e missing --settings file → rc 2" || no "L31e missing settings file accepted (rc=$RC)"
|
|
704
|
+
printf 'one\ntwo\n' > "$WORKROOT/t31f.txt"; LOG31f="$WORKROOT/argv31f.log"; : > "$LOG31f"
|
|
705
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say FH_STUB_ARGV_LOG="$LOG31f" \
|
|
706
|
+
bash "$SUT" --arm a --reps 1 --turns "$WORKROOT/t31f.txt" --setting-sources project,local --add-wrapper-dir --out "$WORKROOT/o31f" ) >/dev/null 2>&1
|
|
707
|
+
_n31f=$(grep -c . "$LOG31f")
|
|
708
|
+
[ "$_n31f" -ge 1 ] && [ "$(grep -c -- '--setting-sources project,local' "$LOG31f")" = "$_n31f" ] \
|
|
709
|
+
&& [ "$(grep -cE -- "--add-dir [^ ]*/o31f/w_a_r1( |$)" "$LOG31f")" = "$_n31f" ] \
|
|
710
|
+
&& ok "L31f --turns: every turn call ($_n31f) carries the consumer-surface flags" \
|
|
711
|
+
|| no "L31f turns path dropped flags: $(cat "$LOG31f")"
|
|
712
|
+
|
|
713
|
+
# L31g env inheritance (codex R1): ADDWRAP/SETSRC/SETFILE/PERMMODE in the env must not switch anything on
|
|
714
|
+
LOG31g="$WORKROOT/argv31g.log"; : > "$LOG31g"
|
|
715
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say FH_STUB_ARGV_LOG="$LOG31g" \
|
|
716
|
+
ADDWRAP=1 SETSRC=project SETFILE="$SURFS" PERMMODE=plan bash "$SUT" --arm a --reps 1 --prompt p --out "$WORKROOT/o31g" ) >/dev/null 2>&1
|
|
717
|
+
{ [ -s "$LOG31g" ] && cmp -s "$LOG31g" "$LOG"; } && ok "L31g inherited env vars do not enable consumer-surface flags" \
|
|
718
|
+
|| no "L31g env leaked into argv: $(cat "$LOG31g")"
|
|
719
|
+
# L31h empty --permission-mode → rc 2 (codex R1) · L31i trailing value flag → rc 2, no hang (codex R1)
|
|
720
|
+
run_sut --arm a --reps 1 --prompt p --permission-mode '' --out "$WORKROOT/o31h"
|
|
721
|
+
[ "$RC" = 2 ] && ok "L31h empty --permission-mode → rc 2" || no "L31h empty mode accepted (rc=$RC)"
|
|
722
|
+
_t0=$(date +%s); run_sut --arm a --reps 1 --prompt p --out "$WORKROOT/o31i" --settings; _el=$(( $(date +%s) - _t0 ))
|
|
723
|
+
{ [ "$RC" = 2 ] && [ "$_el" -lt 20 ]; } && ok "L31i trailing --settings with no value → rc 2 in ${_el}s" || no "L31i trailing flag rc=$RC elapsed=${_el}s"
|
|
724
|
+
# L31j a source list without `local` drops the isolation deny file → rc 2 (codex R2)
|
|
725
|
+
run_sut --arm a --reps 1 --prompt p --setting-sources project --out "$WORKROOT/o31j"
|
|
726
|
+
[ "$RC" = 2 ] && ok "L31j --setting-sources without local → rc 2" || no "L31j source list without local accepted (rc=$RC)"
|
|
727
|
+
# L31k the forwarded string itself is validated: space-separated and empty-token lists → rc 2 (codex R2)
|
|
728
|
+
run_sut --arm a --reps 1 --prompt p --setting-sources 'project local' --out "$WORKROOT/o31k"; _rk1=$RC
|
|
729
|
+
run_sut --arm a --reps 1 --prompt p --setting-sources ',,,' --out "$WORKROOT/o31k2"; _rk2=$RC
|
|
730
|
+
{ [ "$_rk1" = 2 ] && [ "$_rk2" = 2 ]; } && ok "L31k 'project local' and ',,,' → rc 2" || no "L31k malformed source list accepted (rc=$_rk1/$_rk2)"
|
|
731
|
+
|
|
665
732
|
echo "sim_isolated_run lanes: $pass passed, $fail failed"
|
|
666
733
|
[ "$fail" -eq 0 ] || exit 1
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Harness birth core — the five parts every new harness carries
|
|
2
|
+
|
|
3
|
+
**Read this before writing the first file of a new harness** — a CLAUDE.md, rules, a checklist or a
|
|
4
|
+
skill for a domain or a new/empty project ("X 용 하네스 세팅해 줘", "set up a harness for X").
|
|
5
|
+
It matters most where **no script can decide right from wrong** (reviewing prose, plans, designs,
|
|
6
|
+
copy): there the harness's only defence against confident wrong verdicts is what is written below.
|
|
7
|
+
|
|
8
|
+
Write the five parts **into the new harness itself, in the domain's own words**. Do not copy FH
|
|
9
|
+
paths, FH vocabulary or a pointer back to this file — the new harness must stand without FH.
|
|
10
|
+
|
|
11
|
+
## 1. Purpose (one paragraph, first thing in its CLAUDE.md)
|
|
12
|
+
Why this harness exists, for whom, what a *good* result is — and what it must never do. A role
|
|
13
|
+
name alone ("you are a reviewer") is not a purpose.
|
|
14
|
+
|
|
15
|
+
## 2. When unsure
|
|
16
|
+
One explicit rule: when evidence is missing, **mark it** (e.g. `확인 필요` / `UNVERIFIED`) and say
|
|
17
|
+
what would settle it. Never guess, never round toward "looks fine", never state an unchecked fact
|
|
18
|
+
as true or false.
|
|
19
|
+
|
|
20
|
+
## 3. Calibration without a script — create `calibration/`
|
|
21
|
+
- **Inputs and answers live apart.** `calibration/inputs/` holds one small, realistic good example
|
|
22
|
+
and one bad example (the bad one carries the domain's typical defects), named neutrally
|
|
23
|
+
(`sample_a`, `sample_b`). `calibration/expected.md` holds the verdict each must get, why, and
|
|
24
|
+
**where that expectation comes from**: the user's own stated criteria, a cited domain standard,
|
|
25
|
+
or an example the user confirmed. An expectation the builder made up alone is
|
|
26
|
+
`unconfirmed` — it does not calibrate anything until the user confirms it.
|
|
27
|
+
- **The check**: review each input as a normal task **without opening `expected.md`**, write the
|
|
28
|
+
result to `calibration/runs/<date>.md`, then compare with `expected.md` and note match / mismatch.
|
|
29
|
+
Run it once right after the harness is built, again after the rules change, and before trusting
|
|
30
|
+
the harness on a new kind of input. A mismatch means fix the rules, not the expected answer.
|
|
31
|
+
- `calibration/verdict_log.md` — one line per finding in real use: accepted / rejected / unclear by
|
|
32
|
+
the author. When the same kind of finding keeps being rejected, revisit that rule.
|
|
33
|
+
- Until the **current** rules have been run on a confirmed pair and matched, the top of the
|
|
34
|
+
CLAUDE.md says `UNCALIBRATED — <what is missing>`. A rule change or a new kind of input puts that
|
|
35
|
+
line back until the check passes again — an old match does not carry over.
|
|
36
|
+
|
|
37
|
+
## 4. Irreversible edges
|
|
38
|
+
List the actions in this domain that cannot be taken back (publish, send, share, post, delete,
|
|
39
|
+
overwriting the only copy). The harness takes one only on the human's **explicit go-ahead for that
|
|
40
|
+
concrete action**. A condition the harness itself would have to judge ("publish it if it looks
|
|
41
|
+
fine") is not a go-ahead — report the findings and ask. Edits the user asks for are fine; keep the
|
|
42
|
+
original recoverable (a copy or version) and say where it is.
|
|
43
|
+
|
|
44
|
+
## 5. Typed verdict
|
|
45
|
+
Every finding: severity (e.g. blocking / should-fix / optional) and confidence, quoting the source
|
|
46
|
+
passage. The overall verdict comes from a small fixed set (e.g. go / fix-then-go / rework). A bare
|
|
47
|
+
"OK" is not a verdict. **While the harness is `UNCALIBRATED`, it gives findings but no overall
|
|
48
|
+
verdict** in real use — it says "findings only — not calibrated yet" instead. The calibration run
|
|
49
|
+
itself is the one place a provisional overall verdict is written, so it can be compared.
|
|
50
|
+
|
|
51
|
+
## Done when (check before reporting the harness as built)
|
|
52
|
+
- [ ] all five parts are in the files (not only described in the reply)
|
|
53
|
+
- [ ] `calibration/` holds the two inputs and `expected.md` with each expectation's source, and a
|
|
54
|
+
first run is recorded in `calibration/runs/` — or the CLAUDE.md says `UNCALIBRATED` and why
|
|
55
|
+
- [ ] the reply says plainly whether the harness is calibrated or not
|
|
56
|
+
- [ ] if `.claude/` cannot be written (headless runs need a human for it), the rules live in a root
|
|
57
|
+
folder and CLAUDE.md imports them — no pointer to a file that does not exist
|