@chrono-meta/fh-gate 2.12.1 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/rules/fh_4axis_gate.md +35 -1
- package/.claude-plugin/marketplace.json +2 -2
- package/AGENTS.md +17 -0
- package/CHEATSHEET.md +19 -1
- package/CLAUDE.md +34 -9
- package/README.ja.md +186 -649
- package/README.ko.md +207 -698
- package/README.md +186 -698
- package/README.zh.md +167 -601
- package/docs/ETHOS.md +73 -1
- package/docs/IDENTITIES.md +83 -0
- package/docs/MODEL_SETUP.md +111 -0
- package/docs/OUTPUT_EVIDENCE.md +10 -2
- package/knowledge/shared/harness-core/fh_detail_protocols.md +131 -1
- package/knowledge/shared/harness-core/fh_three_layer_canon.md +15 -0
- package/knowledge/shared/harness-core/field_harness_diagnostic.md +30 -0
- package/knowledge/shared/harness-core/gate_locality_principle.md +29 -0
- package/knowledge/shared/harness-core/measurement-integrity-checklist.md +80 -0
- package/knowledge/shared/harness-core/ship_readiness_gate.md +103 -15
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +120 -0
- package/knowledge/shared/rules/multi_session_close_protocol.md +7 -1
- package/package.json +22 -2
- package/plugins/fh-commons/.claude-plugin/plugin.json +2 -2
- package/plugins/fh-commons/skills/preprep/README.md +45 -0
- package/plugins/fh-commons/skills/preprep/SKILL.md +214 -0
- package/plugins/fh-commons/skills/preprep/canon_terms.example.yaml +36 -0
- package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_negative.md +7 -0
- package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_positive.md +8 -0
- package/plugins/fh-commons/skills/preprep/fixtures/progression_known_negative.md +13 -0
- package/plugins/fh-commons/skills/preprep/fixtures/progression_known_positive.md +13 -0
- package/plugins/fh-commons/skills/preprep/fixtures/promise_known_negative.md +9 -0
- package/plugins/fh-commons/skills/preprep/fixtures/promise_known_positive.md +7 -0
- package/plugins/fh-commons/skills/preprep/interslide_deps.py +223 -0
- package/plugins/fh-commons/skills/preprep/jargon_terms.example.yaml +40 -0
- package/plugins/fh-commons/skills/preprep/lane_adjacent_dup.py +86 -0
- package/plugins/fh-commons/skills/preprep/lane_progression.py +81 -0
- package/plugins/fh-commons/skills/preprep/lane_promise.py +121 -0
- package/plugins/fh-commons/skills/preprep/ooxml/c1_baseline.txt +12 -0
- package/plugins/fh-commons/skills/preprep/ooxml/gate.py +164 -0
- package/plugins/fh-commons/skills/preprep/preprep.py +776 -0
- package/plugins/fh-commons/skills/preprep/presentation_checklist.md +310 -0
- package/plugins/fh-commons/skills/preprep/surfaces.example.yaml +148 -0
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +150 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL.md +39 -0
- package/scripts/activity_log.sh +144 -0
- package/scripts/com.forge-harness.daily-report.plist +44 -0
- package/scripts/context_continuity_score.sh +435 -0
- package/scripts/daily_report.sh +208 -0
- package/scripts/digest_landing_check.sh +71 -0
- package/scripts/fh_session_load.sh +71 -2
- package/scripts/field_canon_preload.sh +44 -0
- package/scripts/gate_pathspec_check.sh +10 -4
- package/scripts/lane_runner_check.sh +34 -1
- package/scripts/launchd_wiring_check.sh +182 -0
- package/scripts/mapped_tracks.sh +69 -0
- package/scripts/package_coverage_check.sh +28 -11
- package/scripts/portability_lint.sh +30 -0
- package/scripts/selfcheck.sh +98 -1
- package/scripts/sim_isolated_run.sh +339 -0
- package/scripts/test_heavy_classifier_lanes.sh +4 -1
- package/scripts/test_lane_runner_lanes.sh +75 -0
- package/scripts/test_mapped_tracks_lanes.sh +58 -0
- package/scripts/test_marker_address_lanes.sh +78 -0
- package/scripts/test_marker_soul_check_lanes.sh +36 -0
- package/scripts/test_precommit_staged_drift_lanes.sh +91 -0
- package/scripts/test_preprep_adjacent_dup_lanes.sh +57 -0
- package/scripts/test_preprep_drift_anchor.sh +65 -0
- package/scripts/test_preprep_progression_lanes.sh +53 -0
- package/scripts/test_preprep_promise_lanes.sh +56 -0
- package/scripts/test_preprep_retired_lanes.sh +54 -0
- package/scripts/test_sim_isolated_run_lanes.sh +219 -0
- package/scripts/test_skill_canon_preload_lanes.sh +58 -0
- package/scripts/universal_guard_check.sh +20 -8
- package/templates/.git-hooks/pre-commit +465 -8
- package/templates/regression_guard.sh +40 -1
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_sim_isolated_run_lanes.sh — behavioural known-pair lanes for scripts/sim_isolated_run.sh
|
|
3
|
+
#
|
|
4
|
+
# WHY THESE LANES AND NOT OTHERS. The runner exists because a sim became an agent fleet
|
|
5
|
+
# (2026-08-29: corpus self-contamination + a launchd agent written to the operator's machine +
|
|
6
|
+
# a false positive pointing at the desired conclusion). So the lanes pin the properties that
|
|
7
|
+
# failure would have needed, not the ones that are easy to assert:
|
|
8
|
+
# L1–L3 usage guards — a runner that silently accepts a bad mode runs the wrong thing
|
|
9
|
+
# L4 ABSENT, never empty — a missing surface and an empty one must not collapse
|
|
10
|
+
# L5 THREE-valued verdict — the first runner's `timeout 300` killed exactly the heavy arms
|
|
11
|
+
# and left 0-byte files that read as "the identity did not fire".
|
|
12
|
+
# A false RED manufactured by the instrument. `UNMEASURED` and
|
|
13
|
+
# `EMPTY` must stay distinguishable from each other AND from a no.
|
|
14
|
+
# L6 observe-mode VOID — if the read-only tool set leaks, the run is void, not "clean"
|
|
15
|
+
# L7 machine-surface diff — the launchd class. Detector, not gate — but it must FIRE.
|
|
16
|
+
# L8 --no-harness is opt-in — `--restricted` drops the project CLAUDE.md, i.e. it measures
|
|
17
|
+
# the BASE MODEL. If it ever became the default again, every
|
|
18
|
+
# salience measurement would silently be of the wrong thing.
|
|
19
|
+
# L9 always exit 0 — a detector that can block gets skipped; then it detects nothing
|
|
20
|
+
#
|
|
21
|
+
# The `claude` CLI is STUBBED. That is deliberate and it is the only way these lanes can carry a
|
|
22
|
+
# known pair: a real call is nondeterministic and costs money, so its output could never be a
|
|
23
|
+
# fixture. What is under test here is the runner's OWN logic — verdict classification, isolation
|
|
24
|
+
# bookkeeping, flag plumbing — never the model's answer.
|
|
25
|
+
#
|
|
26
|
+
# Usage: bash scripts/test_sim_isolated_run_lanes.sh
|
|
27
|
+
|
|
28
|
+
set -uo pipefail
|
|
29
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
30
|
+
SUT="${FH_SIM_RUNNER_BIN:-$ROOT/scripts/sim_isolated_run.sh}"
|
|
31
|
+
pass=0; fail=0
|
|
32
|
+
ok() { printf ' ✅ %s\n' "$1"; pass=$((pass+1)); }
|
|
33
|
+
no() { printf ' ❌ %s\n' "$1"; fail=$((fail+1)); }
|
|
34
|
+
|
|
35
|
+
if [ ! -f "$SUT" ]; then
|
|
36
|
+
echo "FAIL test_sim_isolated_run_lanes.sh: subject absent ($SUT) — skipped is not passed"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
WORKROOT="$(mktemp -d "${TMPDIR:-/tmp}/simlane-XXXXXX")"
|
|
41
|
+
trap 'rm -rf "$WORKROOT"' EXIT
|
|
42
|
+
|
|
43
|
+
# ── stub `claude` — behaviour selected by FH_STUB_MODE, read at call time ─────────────────────
|
|
44
|
+
STUBBIN="$WORKROOT/bin"; mkdir -p "$STUBBIN"
|
|
45
|
+
cat > "$STUBBIN/claude" <<'STUB'
|
|
46
|
+
#!/usr/bin/env bash
|
|
47
|
+
# Records the argv it was handed so a lane can assert on flag plumbing.
|
|
48
|
+
printf '%s\n' "$*" >> "${FH_STUB_ARGV_LOG:-/dev/null}"
|
|
49
|
+
case "${FH_STUB_MODE:-say}" in
|
|
50
|
+
say) echo "stub answer" ;;
|
|
51
|
+
silent) : ;; # rc 0, no output → EMPTY
|
|
52
|
+
die) exit 7 ;; # rc!=0, no output → UNMEASURED
|
|
53
|
+
write) echo "wrote"; : > "./LANE_SIDE_EFFECT.txt" ;; # dirties its own clone
|
|
54
|
+
machine) echo "ok"; mkdir -p "$HOME/Library/LaunchAgents"
|
|
55
|
+
: > "$HOME/Library/LaunchAgents/com.lane.probe.plist" ;;
|
|
56
|
+
esac
|
|
57
|
+
exit 0
|
|
58
|
+
STUB
|
|
59
|
+
chmod +x "$STUBBIN/claude"
|
|
60
|
+
|
|
61
|
+
# A throwaway git repo for the runner to clone. `--local` needs a real repo with a commit.
|
|
62
|
+
SRC="$WORKROOT/src"; mkdir -p "$SRC"
|
|
63
|
+
( cd "$SRC" && git init -q . && git config user.email l@l && git config user.name l \
|
|
64
|
+
&& echo hi > f.txt && git add f.txt && git commit -qm init ) >/dev/null 2>&1
|
|
65
|
+
|
|
66
|
+
run_sut() { # env is set by the caller; echoes combined output, sets RC
|
|
67
|
+
OUT="$( cd "$SRC" && PATH="$STUBBIN:$PATH" bash "$SUT" "$@" 2>&1 )"; RC=$?
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
echo "── sim_isolated_run known-pair lanes ─────────────────────────────────"
|
|
71
|
+
|
|
72
|
+
# L1/L2/L3 — usage guards (known-negative: a bad invocation must NOT proceed)
|
|
73
|
+
run_sut --reps 1 --prompt p
|
|
74
|
+
[ "$RC" -eq 2 ] && ok "L1 missing --arm → exit 2" || no "L1 missing --arm: rc=$RC"
|
|
75
|
+
run_sut --arm a --reps 1
|
|
76
|
+
[ "$RC" -eq 2 ] && ok "L2 missing --prompt → exit 2" || no "L2 missing --prompt: rc=$RC"
|
|
77
|
+
run_sut --arm a --prompt p --mode bogus
|
|
78
|
+
[ "$RC" -eq 2 ] && ok "L3 bogus --mode → exit 2" || no "L3 bogus --mode: rc=$RC"
|
|
79
|
+
|
|
80
|
+
# L4 — ABSENT, never an empty line, for a surface that does not exist
|
|
81
|
+
FAKEHOME="$WORKROOT/home"; mkdir -p "$FAKEHOME"
|
|
82
|
+
OUTDIR="$WORKROOT/o4"
|
|
83
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say \
|
|
84
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$OUTDIR" ) >/dev/null 2>&1
|
|
85
|
+
if grep -q '^ABSENT$' "$OUTDIR/_machine_before.txt" 2>/dev/null; then
|
|
86
|
+
ok "L4 missing surface recorded as ABSENT (not an empty line)"
|
|
87
|
+
else no "L4 ABSENT token missing from snapshot"; fi
|
|
88
|
+
|
|
89
|
+
# L5 — THREE-valued verdict. This is the lane the false-RED incident bought.
|
|
90
|
+
OUTDIR="$WORKROOT/o5a"
|
|
91
|
+
OUT=$( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=die \
|
|
92
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$OUTDIR" 2>&1 )
|
|
93
|
+
printf '%s' "$OUT" | grep -q "UNMEASURED" \
|
|
94
|
+
&& ok "L5a rc!=0 + 0 bytes → UNMEASURED (not a negative result)" \
|
|
95
|
+
|| no "L5a expected UNMEASURED, got: $(printf '%s' "$OUT" | grep -E 'r1' | head -1)"
|
|
96
|
+
OUTDIR="$WORKROOT/o5b"
|
|
97
|
+
OUT=$( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=silent \
|
|
98
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$OUTDIR" 2>&1 )
|
|
99
|
+
printf '%s' "$OUT" | grep -q "EMPTY" \
|
|
100
|
+
&& ok "L5b rc=0 + 0 bytes → EMPTY (distinct from UNMEASURED)" \
|
|
101
|
+
|| no "L5b expected EMPTY"
|
|
102
|
+
# known-POSITIVE for the pair: a normal answer must be neither
|
|
103
|
+
OUTDIR="$WORKROOT/o5c"
|
|
104
|
+
OUT=$( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say \
|
|
105
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$OUTDIR" 2>&1 )
|
|
106
|
+
if printf '%s' "$OUT" | grep -q "captured" && ! printf '%s' "$OUT" | grep -qE "EMPTY|UNMEASURED"; then
|
|
107
|
+
ok "L5c control — a real answer is captured, not classified as empty/unmeasured"
|
|
108
|
+
else no "L5c control failed (the three-way split does not discriminate)"; fi
|
|
109
|
+
|
|
110
|
+
# L6 — observe mode must call a write VOID, not clean
|
|
111
|
+
OUTDIR="$WORKROOT/o6"
|
|
112
|
+
OUT=$( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=write \
|
|
113
|
+
bash "$SUT" --arm a --reps 1 --prompt p --mode observe --out "$OUTDIR" 2>&1 )
|
|
114
|
+
printf '%s' "$OUT" | grep -q "VOID" && printf '%s' "$OUT" | grep -q "CONTAMINATED" \
|
|
115
|
+
&& ok "L6 observe-mode write → VOID + CONTAMINATED" || no "L6 write in observe not caught"
|
|
116
|
+
# control: the same write in act mode is CONTAINED, not VOID
|
|
117
|
+
OUTDIR="$WORKROOT/o6b"
|
|
118
|
+
OUT=$( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=write \
|
|
119
|
+
bash "$SUT" --arm a --reps 1 --prompt p --mode act --out "$OUTDIR" 2>&1 )
|
|
120
|
+
printf '%s' "$OUT" | grep -q "VOID" \
|
|
121
|
+
&& no "L6b control — act mode wrongly called VOID (the two modes are not separated)" \
|
|
122
|
+
|| ok "L6b control — same write in act mode is contained, not VOID"
|
|
123
|
+
|
|
124
|
+
# L7 — the launchd class. The detector must FIRE on a machine-surface delta.
|
|
125
|
+
OUTDIR="$WORKROOT/o7"
|
|
126
|
+
OUT=$( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=machine \
|
|
127
|
+
bash "$SUT" --arm a --reps 1 --prompt p --mode act --out "$OUTDIR" 2>&1 )
|
|
128
|
+
printf '%s' "$OUT" | grep -q "MACHINE SURFACE CHANGED" \
|
|
129
|
+
&& ok "L7 machine-surface delta → detected + CONTAMINATED" \
|
|
130
|
+
|| no "L7 launchd-class side effect NOT detected"
|
|
131
|
+
rm -f "$FAKEHOME/Library/LaunchAgents/com.lane.probe.plist"
|
|
132
|
+
|
|
133
|
+
# L8 — --restricted is opt-in only. Both directions, because only the pair proves the plumbing.
|
|
134
|
+
OUTDIR="$WORKROOT/o8"; LOG="$WORKROOT/argv8.log"; : > "$LOG"
|
|
135
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say FH_STUB_ARGV_LOG="$LOG" \
|
|
136
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$OUTDIR" ) >/dev/null 2>&1
|
|
137
|
+
grep -q -- "--restricted" "$LOG" \
|
|
138
|
+
&& no "L8a DEFAULT passed --restricted — the harness under test would not be loaded" \
|
|
139
|
+
|| ok "L8a default does NOT pass --restricted (project CLAUDE.md stays resident)"
|
|
140
|
+
OUTDIR="$WORKROOT/o8b"; LOG2="$WORKROOT/argv8b.log"; : > "$LOG2"
|
|
141
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say FH_STUB_ARGV_LOG="$LOG2" \
|
|
142
|
+
bash "$SUT" --arm a --reps 1 --prompt p --no-harness --out "$OUTDIR" ) >/dev/null 2>&1
|
|
143
|
+
grep -q -- "--restricted" "$LOG2" \
|
|
144
|
+
&& ok "L8b --no-harness DOES pass --restricted (control-arm generator works)" \
|
|
145
|
+
|| no "L8b --no-harness did not reach the CLI"
|
|
146
|
+
|
|
147
|
+
# L9 — detector, never a gate: even a contaminated run exits 0
|
|
148
|
+
OUTDIR="$WORKROOT/o9"
|
|
149
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=write \
|
|
150
|
+
bash "$SUT" --arm a --reps 1 --prompt p --mode observe --out "$OUTDIR" ) >/dev/null 2>&1
|
|
151
|
+
[ $? -eq 0 ] && ok "L9 always exit 0 (a detector that can block gets skipped)" \
|
|
152
|
+
|| no "L9 non-zero exit — callers will learn to skip it"
|
|
153
|
+
|
|
154
|
+
# L10 — the clone's PARENT must not expose sibling arms. Measured leak: an arm scanning `../`
|
|
155
|
+
# for mappable projects reported the other reps' work dirs by name.
|
|
156
|
+
OUTDIR="$WORKROOT/o10"
|
|
157
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say \
|
|
158
|
+
bash "$SUT" --arm a --reps 2 --prompt p --out "$OUTDIR" ) >/dev/null 2>&1
|
|
159
|
+
# 🟥 PROPERTY-BASED ON PURPOSE. A first draft asserted on the literal path
|
|
160
|
+
# `<out>/w_a_r1/...`; a revert probe then "failed" it for the wrong reason — the path simply no
|
|
161
|
+
# longer existed, so the lane detected a rename rather than the leak. Locate the clones by what
|
|
162
|
+
# they ARE (directories containing .git under the out dir) and ask the actual question:
|
|
163
|
+
# does any clone's PARENT contain another clone?
|
|
164
|
+
CLONES=$(find "$OUTDIR" -maxdepth 3 -type d -name .git 2>/dev/null | sed 's|/.git$||' | sort)
|
|
165
|
+
nclone=$(printf '%s\n' "$CLONES" | grep -c . )
|
|
166
|
+
leak=0
|
|
167
|
+
for c in $CLONES; do
|
|
168
|
+
par=$(dirname "$c")
|
|
169
|
+
# count OTHER clones that share this parent
|
|
170
|
+
others=$(printf '%s\n' "$CLONES" | grep -v "^$c$" | while read -r o; do
|
|
171
|
+
[ "$(dirname "$o")" = "$par" ] && echo x; done | grep -c x)
|
|
172
|
+
[ "$others" -gt 0 ] && leak=$((leak+1))
|
|
173
|
+
done
|
|
174
|
+
if [ "$nclone" -ge 2 ] && [ "$leak" -eq 0 ]; then
|
|
175
|
+
ok "L10 no clone shares a parent with another ($nclone clones, 0 co-parented)"
|
|
176
|
+
else no "L10 sibling clones share a parent (clones=$nclone co-parented=$leak)"; fi
|
|
177
|
+
# control: the lane must be able to SEE two clones, else L10 passes on an empty set
|
|
178
|
+
[ "$nclone" -ge 2 ] \
|
|
179
|
+
&& ok "L10b control — $nclone clones found (L10 did not pass on an empty set)" \
|
|
180
|
+
|| no "L10b control — found $nclone clone(s); L10 proves nothing"
|
|
181
|
+
|
|
182
|
+
# L11 — --setup builds the precondition INSIDE the clone, and a failing setup VOIDs the arm
|
|
183
|
+
# rather than letting the sim run in a state it was not meant to observe.
|
|
184
|
+
OUTDIR="$WORKROOT/o11"
|
|
185
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say \
|
|
186
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$OUTDIR" \
|
|
187
|
+
--setup 'mkdir -p tracks/demoproj' ) >/dev/null 2>&1
|
|
188
|
+
[ -d "$OUTDIR/w_a_r1/repo/tracks/demoproj" ] \
|
|
189
|
+
&& ok "L11 --setup ran inside the clone (precondition built)" \
|
|
190
|
+
|| no "L11 --setup did not take effect in the clone"
|
|
191
|
+
# and it must NOT have touched the source tree — the whole point of doing it in the clone
|
|
192
|
+
[ -d "$SRC/tracks/demoproj" ] \
|
|
193
|
+
&& no "L11b --setup leaked into the SOURCE tree" \
|
|
194
|
+
|| ok "L11b control — source tree untouched by --setup"
|
|
195
|
+
OUTDIR="$WORKROOT/o11c"
|
|
196
|
+
OUT=$( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say \
|
|
197
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$OUTDIR" --setup 'exit 3' 2>&1 )
|
|
198
|
+
printf '%s' "$OUT" | grep -q "SETUP FAILED" && printf '%s' "$OUT" | grep -q "CONTAMINATED" \
|
|
199
|
+
&& ok "L11c failing --setup → arm VOID, not a silent negative result" \
|
|
200
|
+
|| no "L11c failing setup did not void the arm"
|
|
201
|
+
|
|
202
|
+
# L12 — --extra-tools must reach the CLI, and must NOT be there by default. Both directions,
|
|
203
|
+
# because this flag decides what the arm can SEE, and a silently-dropped tool turns an
|
|
204
|
+
# enumeration failure into what looks like a session misjudging.
|
|
205
|
+
OUTDIR="$WORKROOT/o12"; LOG12="$WORKROOT/argv12.log"; : > "$LOG12"
|
|
206
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say FH_STUB_ARGV_LOG="$LOG12" \
|
|
207
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$OUTDIR" --extra-tools Bash ) >/dev/null 2>&1
|
|
208
|
+
grep -q "Read,Grep,Glob,Bash" "$LOG12" \
|
|
209
|
+
&& ok "L12 --extra-tools appended to the tool set" \
|
|
210
|
+
|| no "L12 --extra-tools did not reach the CLI ($(head -1 "$LOG12" 2>/dev/null))"
|
|
211
|
+
OUTDIR="$WORKROOT/o12b"; LOG12B="$WORKROOT/argv12b.log"; : > "$LOG12B"
|
|
212
|
+
( cd "$SRC" && PATH="$STUBBIN:$PATH" HOME="$FAKEHOME" FH_STUB_MODE=say FH_STUB_ARGV_LOG="$LOG12B" \
|
|
213
|
+
bash "$SUT" --arm a --reps 1 --prompt p --out "$OUTDIR" ) >/dev/null 2>&1
|
|
214
|
+
grep -q "Read,Grep,Glob,Bash" "$LOG12B" \
|
|
215
|
+
&& no "L12b control — Bash present WITHOUT --extra-tools (observe mode is not read-only)" \
|
|
216
|
+
|| ok "L12b control — no Bash without --extra-tools"
|
|
217
|
+
|
|
218
|
+
echo "sim_isolated_run lanes: $pass passed, $fail failed"
|
|
219
|
+
[ "$fail" -eq 0 ] || exit 1
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_skill_canon_preload_lanes.sh — field_canon_preload.sh 의 «스킬-정본» 분기 앵커.
|
|
3
|
+
#
|
|
4
|
+
# 이 분기가 존재하는 이유(실측 2026-08-28): 어느 세션이 preprep 의 정본 파일을 **하나도 안
|
|
5
|
+
# 열고 44판을 구웠고**, 선 굵기 토큰 위반이 388/907(43%) 났다. 자산이 없어서가 아니라
|
|
6
|
+
# **안 읽혀서**다. 훅은 이미 있었고 preprep 이 커버리지 경계 밖이었다.
|
|
7
|
+
#
|
|
8
|
+
# 재는 것 넷:
|
|
9
|
+
# S1 발화 발표 어휘가 오면 preprep 정본을 띄우나
|
|
10
|
+
# S2 오탐 0 무관한 프롬프트에는 조용한가
|
|
11
|
+
# S3 파일 이름 «정본을 읽어라» 훈계가 아니라 **파일 이름 + 줄 수**를 내나
|
|
12
|
+
# 🟥 이게 없으면 원 훅이 자기 헤더에서 금지한 «일반 훈계»가 된다
|
|
13
|
+
# S4 세션 1회 두 번째 호출은 조용한가 (반복 알림은 무시를 학습시킨다)
|
|
14
|
+
set -uo pipefail
|
|
15
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
16
|
+
HOOK="$HERE/scripts/field_canon_preload.sh"
|
|
17
|
+
PASS=0; FAIL=0
|
|
18
|
+
ok(){ echo " ✅ $1"; PASS=$((PASS+1)); }
|
|
19
|
+
ng(){ echo " ❌ $1"; FAIL=$((FAIL+1)); }
|
|
20
|
+
[ -f "$HOOK" ] || { echo " ❌ INSTRUMENT ERROR — 훅 부재: $HOOK"; exit 1; }
|
|
21
|
+
|
|
22
|
+
SD=$(mktemp -d); trap 'rm -rf "$SD"' EXIT
|
|
23
|
+
# 🟥 `CLAUDE_PROJECT_DIR` 을 «반드시» 준다. 안 주면 훅이 `$HOME/projects/forge-harness` 로
|
|
24
|
+
# 떨어지는데 CI 러너엔 그 경로가 없어 **조용히 침묵**한다 — 로컬 4/4 · CI 2/4 가 그렇게 났다.
|
|
25
|
+
# S2·S4 는 아무것도 안 나와도 통과하는 검사라, 그 조합이 «훅이 통째로 안 돈다»의 서명이다.
|
|
26
|
+
run(){ rm -rf "$SD/s"; mkdir -p "$SD/s"
|
|
27
|
+
CLAUDE_PROJECT_DIR="$HERE" FIELD_CANON_SENTINEL_DIR="$SD/s" bash "$HOOK" <<EOF 2>&1
|
|
28
|
+
{"prompt":"$1"}
|
|
29
|
+
EOF
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
pos=$(run "발표 자료 만들어줘")
|
|
33
|
+
neg=$(run "오늘 날씨 어때")
|
|
34
|
+
echo "$pos" | grep -q "skill-canon" && ok "S1 발화: 발표 어휘 → preprep 정본 안내" \
|
|
35
|
+
|| ng "S1 미발화 — 배선 안 된 코드는 산문이다"
|
|
36
|
+
# 🟥 S0 먼저 — «훅이 아예 안 돈다» 를 S2·S4 가 조용히 통과시키는 구멍을 막는다.
|
|
37
|
+
# 둘은 «아무 출력도 없음» 에서도 초록이라, 그 조합만으로는 침묵과 정상을 못 가른다.
|
|
38
|
+
[ -n "$pos" ] && ok "S0 훅이 출력을 냈다 (침묵을 통과로 안 읽는다)" \
|
|
39
|
+
|| ng "S0 훅이 아무것도 안 냈다 — 환경(CLAUDE_PROJECT_DIR)이나 배선을 봐라"
|
|
40
|
+
echo "$neg" | grep -q "skill-canon" && ng "S2 오탐: 무관한 프롬프트에도 뜬다" \
|
|
41
|
+
|| ok "S2 오탐 0"
|
|
42
|
+
echo "$pos" | grep -qE "presentation_checklist\.md \([0-9]+줄\)" \
|
|
43
|
+
&& ok "S3 파일 이름 + 줄 수를 낸다 (일반 훈계가 아니다)" \
|
|
44
|
+
|| ng "S3 실패 — 파일을 안 짚으면 «정본을 읽어라» 훈계이고, 그건 이 훅이 금지한 형태다"
|
|
45
|
+
|
|
46
|
+
rm -rf "$SD/t"; mkdir -p "$SD/t"
|
|
47
|
+
CLAUDE_PROJECT_DIR="$HERE" FIELD_CANON_SENTINEL_DIR="$SD/t" bash "$HOOK" <<'EOF' >/dev/null 2>&1
|
|
48
|
+
{"prompt":"발표 준비"}
|
|
49
|
+
EOF
|
|
50
|
+
again=$(CLAUDE_PROJECT_DIR="$HERE" FIELD_CANON_SENTINEL_DIR="$SD/t" bash "$HOOK" <<'EOF' 2>&1
|
|
51
|
+
{"prompt":"발표 준비"}
|
|
52
|
+
EOF
|
|
53
|
+
)
|
|
54
|
+
echo "$again" | grep -q "skill-canon" && ng "S4 재나그: 두 번째도 뜬다 — 무시를 학습시킨다" \
|
|
55
|
+
|| ok "S4 세션당 1회"
|
|
56
|
+
|
|
57
|
+
echo "skill-canon lanes: $PASS passed, $FAIL failed"
|
|
58
|
+
[ "$FAIL" -eq 0 ] || exit 1
|
|
@@ -135,17 +135,23 @@ run_case() {
|
|
|
135
135
|
echo "[universal-guard] known-pair anchor (throwaway repo: $SANDBOX)"
|
|
136
136
|
|
|
137
137
|
# ── Pair 1: the closed hole. Same private token, asset vs non-asset path. ──
|
|
138
|
-
#
|
|
139
|
-
#
|
|
140
|
-
#
|
|
138
|
+
# The non-asset case must use a path the 4-axis classifier does NOT claim — the pair's whole
|
|
139
|
+
# point is that the universal guards fire on BOTH classes, so if both sides are assets the
|
|
140
|
+
# contrast is gone and the pair stops discriminating.
|
|
141
|
+
# 🟥 It was README.md until 2026-08-28, which worked only while README matched no bucket. When
|
|
142
|
+
# README became a CARVEOUT that day the pair silently lost its non-asset half — and it stayed
|
|
143
|
+
# GREEN, because run_case scores the leak dimension (`hasleak`), not the exit code. A pair can
|
|
144
|
+
# keep passing after it has stopped measuring what it was built to measure.
|
|
145
|
+
# Before the 2026-07-26 fix this case produced zero output and exit 0. If the guards are ever
|
|
146
|
+
# moved back below the early exit, THIS is the case that goes clean and fails the anchor.
|
|
141
147
|
run_case "non-asset path, private token → BLOCK" \
|
|
142
|
-
"
|
|
148
|
+
"notes.md" "see zzsynthoperator/home" "leak"
|
|
143
149
|
run_case "asset path, private token → BLOCK" \
|
|
144
150
|
"CATALOG.md" "see zzsynthoperator/home" "leak"
|
|
145
151
|
|
|
146
152
|
# ── Pair 2: no over-blocking. Ordinary content on both path classes stays clean. ──
|
|
147
153
|
run_case "non-asset path, clean content → PASS " \
|
|
148
|
-
"
|
|
154
|
+
"notes.md" "ordinary documentation, nothing private" "clean"
|
|
149
155
|
run_case "asset path, clean content → PASS " \
|
|
150
156
|
"CATALOG.md" "ordinary catalog entry, nothing private" "clean"
|
|
151
157
|
|
|
@@ -202,15 +208,21 @@ run_state_case() { # <name> <override-content|__NONE__> <defaults:keep|drop> <e
|
|
|
202
208
|
# every layer ran. Identical verdicts for different amounts of measurement is the fail-open —
|
|
203
209
|
# so the anchor has to read the verdict LINE, not just the status.
|
|
204
210
|
local name="$1" ovc="$2" defmode="$3" expect="$4" want="${5:-}" out rc got
|
|
205
|
-
|
|
206
|
-
|
|
211
|
+
# 🟥 The carrier file must be a path the 4-axis gate does NOT classify — this lane is testing
|
|
212
|
+
# the public-surface scan, not the gate, so a HEAVY/CARVEOUT path would make every case here
|
|
213
|
+
# demand an Axes-2+3 marker and report "expected pass, got block".
|
|
214
|
+
# It used to be README.md, and that worked ONLY because README matched none of the gate's
|
|
215
|
+
# three buckets — i.e. this lane was green *because of* the blind spot closed on 2026-08-28.
|
|
216
|
+
# `notes.md` is deliberately unclassified: same extension (scan behaviour identical), no bucket.
|
|
217
|
+
printf 'operator literal zzsynthoperator\n' > "$SANDBOX/notes.md"
|
|
218
|
+
git -C "$SANDBOX" add -- notes.md >/dev/null 2>&1
|
|
207
219
|
local ov="$SANDBOX/.psa_state_override"
|
|
208
220
|
if [ "$ovc" = "__NONE__" ]; then rm -f "$ov"; else printf '%s\n' "$ovc" > "$ov"; fi
|
|
209
221
|
local defbak="$SANDBOX/.defaults.bak"
|
|
210
222
|
if [ "$defmode" = drop ]; then mv "$SANDBOX/.claude/rules/.public-surface-patterns.defaults" "$defbak" 2>/dev/null; fi
|
|
211
223
|
out=$(cd "$SANDBOX" && PSA_PATTERNS="$ov" bash "$HOOK" 2>&1); rc=$?
|
|
212
224
|
if [ "$defmode" = drop ]; then mv "$defbak" "$SANDBOX/.claude/rules/.public-surface-patterns.defaults" 2>/dev/null; fi
|
|
213
|
-
git -C "$SANDBOX" rm -q --cached --
|
|
225
|
+
git -C "$SANDBOX" rm -q --cached -- notes.md >/dev/null 2>&1; rm -f "$SANDBOX/notes.md" "$ov"
|
|
214
226
|
if [ "$rc" -ne 0 ]; then got=block; else got=pass; fi
|
|
215
227
|
if [ "$got" != "$expect" ]; then
|
|
216
228
|
echo " ❌ $name — expected $expect, got $got (exit $rc)"
|