@chrono-meta/fh-gate 2.13.0 → 2.15.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 +50 -0
- package/CLAUDE.md +14 -1
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +4 -4
- package/README.zh.md +3 -3
- package/docs/ETHOS.md +21 -0
- package/docs/IDENTITIES.md +83 -0
- package/knowledge/shared/harness-core/fh_detail_protocols.md +77 -1
- package/knowledge/shared/harness-core/measurement-integrity-checklist.md +80 -0
- package/knowledge/shared/harness-core/ship_readiness_gate.md +199 -5
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +173 -0
- package/knowledge/shared/rules/multi_session_close_protocol.md +7 -1
- package/package.json +23 -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 +789 -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 +140 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL.md +39 -0
- package/scripts/com.forge-harness.daily-report.plist +44 -0
- package/scripts/context_continuity_score.sh +894 -0
- package/scripts/daily_report.sh +208 -0
- package/scripts/digest_landing_check.sh +71 -0
- package/scripts/directional_diff_gate.sh +11 -4
- package/scripts/fh_session_load.sh +19 -0
- package/scripts/field_canon_preload.sh +44 -0
- package/scripts/fixture_guard_lib.sh +55 -0
- 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/novelty_claim_check.sh +5 -1
- package/scripts/package_coverage_check.sh +39 -0
- package/scripts/portability_lint.sh +117 -0
- package/scripts/prepush_guard_check.sh +2 -2
- package/scripts/public_surface_scan_files.sh +36 -1
- package/scripts/selfcheck.sh +171 -1
- package/scripts/session_close_check.sh +17 -0
- package/scripts/shell_name_boundary_scan.sh +30 -0
- package/scripts/sim_isolated_run.sh +484 -0
- package/scripts/test_branch_claim_lanes.sh +8 -3
- package/scripts/test_env_purity_lanes.sh +4 -1
- package/scripts/test_lane_runner_lanes.sh +75 -0
- package/scripts/test_mapped_tracks_lanes.sh +64 -2
- package/scripts/test_marker_address_lanes.sh +78 -0
- package/scripts/test_marker_soul_check_lanes.sh +36 -0
- package/scripts/test_memory_link_check.sh +3 -1
- package/scripts/test_node_check_lanes.sh +5 -2
- package/scripts/test_node_infra_delta_lanes.sh +3 -1
- package/scripts/test_peer_worktree_detect_lanes.sh +3 -1
- 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_prepush_destructive_lanes.sh +5 -2
- package/scripts/test_prepush_stdin_integrity.sh +2 -2
- package/scripts/test_regression_guard_ci_lanes.sh +4 -1
- package/scripts/test_selfcheck_state_lanes.sh +19 -4
- package/scripts/test_session_close_lanes.sh +5 -5
- package/scripts/test_sim_isolated_run_lanes.sh +265 -0
- package/scripts/test_skill_canon_preload_lanes.sh +58 -0
- package/scripts/test_target_freeze_lanes.sh +3 -1
- package/scripts/test_verdict_watermark_lanes.sh +427 -0
- package/scripts/test_wizard_snippet_merge_lanes.sh +4 -1
- package/scripts/universal_guard_check.sh +1 -1
- package/templates/.git-hooks/pre-commit +426 -8
- package/templates/.git-hooks/pre-push +8 -3
- package/templates/predelete_check.sh +4 -2
- package/templates/regression_guard.sh +7 -1
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
# `_meta` — LEADING underscore, the only thing that should be excluded.
|
|
19
19
|
|
|
20
20
|
set -uo pipefail
|
|
21
|
+
. "$(dirname "${BASH_SOURCE[0]}")/fixture_guard_lib.sh" # 픽스처는 실레포에 쓰지 않는다
|
|
21
22
|
cd "$(dirname "$0")/.." || exit 1
|
|
22
23
|
SUT="$(pwd -P)/scripts/mapped_tracks.sh"
|
|
23
24
|
PASS=0; FAIL=0
|
|
@@ -33,7 +34,8 @@ ng() { echo "❌ $1"; FAIL=$((FAIL+1)); }
|
|
|
33
34
|
# 그건 수리가 아니라 레인 사망이다(레인 P-4 가 그걸 지킨다).
|
|
34
35
|
[ -f "$SUT" ] || { echo "ⓘ mapped_tracks.sh absent — subject missing when we looked (NOT a pass)"; exit 2; }
|
|
35
36
|
|
|
36
|
-
TMP="$(mktemp -d 2>/dev/null)" || { echo "ⓘ mktemp failed — this suite's own setup broke (NOT a pass)"; exit 10; }
|
|
37
|
+
TMP="$(fh_fixture_root "$(mktemp -d 2>/dev/null)")" || { echo "ⓘ mktemp failed — this suite's own setup broke (NOT a pass)"; exit 10; }
|
|
38
|
+
: "${TMP:?fixture root unset — refusing to run git in cwd}"
|
|
37
39
|
trap 'rm -rf "$TMP"' EXIT INT TERM
|
|
38
40
|
|
|
39
41
|
git init -q "$TMP/main" 2>/dev/null || { echo "ⓘ git init failed — this suite's own setup broke (NOT a pass)"; exit 10; }
|
|
@@ -108,7 +110,9 @@ CO=$(cd "$TMP/wt" && bash "$SUT" --count-only 2>&1)
|
|
|
108
110
|
if [ "$(id -u)" = "0" ]; then
|
|
109
111
|
echo " ⓘ root 로 실행 중 — 권한 레인 UNMEASURED (root 는 퍼미션을 우회한다, 통과 아님)"
|
|
110
112
|
else
|
|
111
|
-
PD
|
|
113
|
+
PD="$(fh_fixture_root "$(mktemp -d)")"
|
|
114
|
+
: "${PD:?fixture root unset — refusing to run git in cwd}"
|
|
115
|
+
git init -q "$PD" 2>/dev/null
|
|
112
116
|
git -C "$PD" -c user.email=t@t -c user.name=t commit -q --allow-empty -m i 2>/dev/null
|
|
113
117
|
mkdir -p "$PD/tracks/qasp" "$PD/tracks/pmh"
|
|
114
118
|
_perm_run() { ( cd "$PD" 2>/dev/null && bash "$SUT" 2>&1 ); }
|
|
@@ -152,6 +156,64 @@ if [ -z "${MT_LANES_NESTED:-}" ]; then
|
|
|
152
156
|
fi
|
|
153
157
|
|
|
154
158
|
echo "──────────────────────────────────────────────"
|
|
159
|
+
# ── B-1 … B-5 — THE ONBOARDING BRANCH VERDICT ────────────────────────────────────────────────
|
|
160
|
+
# WHY THESE EXIST. The branch test has two halves: ⓑ (mapped tracks, the lanes above) and ⓐ
|
|
161
|
+
# (session files). ⓑ has been mechanical since 2026-08-22; ⓐ was a SENTENCE the session judged —
|
|
162
|
+
# and the sentence counted files that SHIP WITH THE REPO. Measured 2026-08-30 with a control
|
|
163
|
+
# (nonsense pattern = 0 hits): two tracked files satisfied ⓐ, so `git clone` alone rendered the
|
|
164
|
+
# RETURNING menu and the NEW-USER branch was unreachable for anyone who clones.
|
|
165
|
+
# The rule is now one sentence — **ⓐ counts only files that did NOT ship** — and these lanes pin
|
|
166
|
+
# BOTH directions, because a rule that answers `new` to everything would pass B-1 alone.
|
|
167
|
+
BR="$TMP/branch"; mkdir -p "$BR/scripts"
|
|
168
|
+
git init -q "$BR" 2>/dev/null || { echo "ⓘ git init failed (branch fixtures) — NOT a pass"; exit 10; }
|
|
169
|
+
cp "$SUT" "$BR/scripts/mapped_tracks.sh"
|
|
170
|
+
mkdir -p "$BR/tracks/_meta" "$BR/tracks/_contrib"
|
|
171
|
+
: > "$BR/tracks/.gitkeep"; : > "$BR/tracks/_meta/.gitkeep"
|
|
172
|
+
# The two SHIPPED shapes that caused the defect, committed exactly as the real repo carries them.
|
|
173
|
+
printf '# monitor\n' > "$BR/tracks/_meta/harness_bench_issue_monitor.md"
|
|
174
|
+
printf '# contrib\n' > "$BR/tracks/_contrib/session_2026_06_27_cross-audit.md"
|
|
175
|
+
git -C "$BR" add -A >/dev/null 2>&1
|
|
176
|
+
git -C "$BR" -c user.email=t@t -c user.name=t commit -q -m ship 2>/dev/null
|
|
177
|
+
|
|
178
|
+
_bv() { ( cd "$1" && bash scripts/mapped_tracks.sh 2>&1 | sed -n 's/^onboarding_branch=//p' ); }
|
|
179
|
+
|
|
180
|
+
v=$(_bv "$BR")
|
|
181
|
+
[ "$v" = "new" ] && ok "B-1 shipped files do NOT make a clone look returning (got new)" \
|
|
182
|
+
|| ng "B-1 a fresh clone reported '$v' — shipped content is being counted as prior use"
|
|
183
|
+
|
|
184
|
+
# 🟥 CONTROL — without this, a rule that always answers `new` passes B-1. A file the USER made
|
|
185
|
+
# must still flip the verdict.
|
|
186
|
+
mkdir -p "$BR/tracks/myproj"; printf '# s\n' > "$BR/tracks/myproj/session_2026-08-30.md"
|
|
187
|
+
v=$(_bv "$BR")
|
|
188
|
+
[ "$v" = "returning" ] && ok "B-2 control — a user-made session file DOES make it returning" \
|
|
189
|
+
|| ng "B-2 control — user file ignored (got '$v'); the rule is too wide"
|
|
190
|
+
rm -rf "$BR/tracks/myproj"
|
|
191
|
+
|
|
192
|
+
# ⓐ's own half: an UNTRACKED file in _meta counts (someone who worked and quit without closing).
|
|
193
|
+
printf '# c\n' > "$BR/tracks/_meta/fh_completed_2026-08-30.md"
|
|
194
|
+
v=$(_bv "$BR")
|
|
195
|
+
[ "$v" = "returning" ] && ok "B-3 an untracked _meta file counts (worked, never closed)" \
|
|
196
|
+
|| ng "B-3 untracked _meta file ignored (got '$v')"
|
|
197
|
+
rm -f "$BR/tracks/_meta/fh_completed_2026-08-30.md"
|
|
198
|
+
|
|
199
|
+
# THREE-VALUED. Outside a git tree the two classes cannot be separated, and that is UNKNOWN —
|
|
200
|
+
# never the friendlier value. Rendering it as `new` tells a returning user they look new.
|
|
201
|
+
NG="$TMP/nogit"; mkdir -p "$NG/scripts" "$NG/tracks/_meta"
|
|
202
|
+
cp "$SUT" "$NG/scripts/mapped_tracks.sh"; : > "$NG/tracks/.gitkeep"; : > "$NG/tracks/_meta/.gitkeep"
|
|
203
|
+
v=$(_bv "$NG")
|
|
204
|
+
[ "$v" = "UNKNOWN" ] && ok "B-4 non-git tree → UNKNOWN (not 'new')" \
|
|
205
|
+
|| ng "B-4 non-git tree reported '$v' — an unmeasured state took a real value"
|
|
206
|
+
|
|
207
|
+
# The key must be present on EVERY path, including the UNMEASURED exit. A consumer that greps for
|
|
208
|
+
# it and finds silence fills the blank in with the friendlier branch.
|
|
209
|
+
# 🟥 CAPTURE FIRST, THEN GREP. The subject exits 3 on this path, and under `pipefail` that exit
|
|
210
|
+
# code becomes the pipeline's — so `subject | grep -q` reports the SUBJECT's failure, not grep's.
|
|
211
|
+
# The repo's own pre-commit hook warns about this shape; this lane reproduced it on the first try.
|
|
212
|
+
_ngout=$( cd "$NG" && bash scripts/mapped_tracks.sh 2>&1 ) || true
|
|
213
|
+
printf '%s' "$_ngout" | grep -q '^onboarding_branch=' \
|
|
214
|
+
&& ok "B-5 the branch key is emitted even on the UNMEASURED path" \
|
|
215
|
+
|| ng "B-5 UNMEASURED path emits no branch key — silence is not an answer"
|
|
216
|
+
|
|
155
217
|
if [ "$FAIL" -eq 0 ]; then
|
|
156
218
|
echo "MAPPED-TRACKS LANES: PASS ($PASS/$PASS)"
|
|
157
219
|
echo " NOT covered: whether the synergy skill (or any other consumer) actually CALLS this."
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_marker_address_lanes.sh — fixtures for pre-commit's `unread_markers`.
|
|
3
|
+
#
|
|
4
|
+
# WHAT IT GUARDS. The Axes 2+3 gate reads exactly ONE file:
|
|
5
|
+
# `.axes_23_passed_<BRANCH_SLUG>_<TODAY>.marker`. A marker written under any other name is a valid
|
|
6
|
+
# RECORD and gets ZERO validation — yet its author believes "I wrote a marker" means "the evidence
|
|
7
|
+
# was checked". Measured 2026-08-30: one session wrote **8** markers at addresses the hook never
|
|
8
|
+
# reads; all 8 carried `floor-status: opus-tier`, which is not in the enum, and nothing caught it.
|
|
9
|
+
# The moment the name matched, the gate rejected two format errors in two attempts.
|
|
10
|
+
# This is [[feedback_half_externalization_slot_without_consumer]] applied to the gate's own evidence.
|
|
11
|
+
#
|
|
12
|
+
# 🟥 SCOPE — channel, never conclusion. The advisory asks "is your evidence at the address the
|
|
13
|
+
# reader uses", never "is that marker any good". It must NEVER block: writing extra records under
|
|
14
|
+
# descriptive names is legitimate practice, and blocking it would push authors toward writing
|
|
15
|
+
# fewer records, which is the opposite of the goal. L4 pins the non-blocking property.
|
|
16
|
+
#
|
|
17
|
+
# Usage: bash scripts/test_marker_address_lanes.sh Exit: 0 = all behave; 1 = regression.
|
|
18
|
+
|
|
19
|
+
set -uo pipefail
|
|
20
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
21
|
+
HOOK="$REPO_ROOT/templates/.git-hooks/pre-commit"
|
|
22
|
+
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
|
|
23
|
+
|
|
24
|
+
sed -n '/^unread_markers()/,/^}/p' "$HOOK" > "$T/fn.sh"
|
|
25
|
+
|
|
26
|
+
# 🟥 CALIBRATE THE EXTRACTION FIRST. An empty function would let every lane below pass against
|
|
27
|
+
# nothing — the false-green this repo keeps closing elsewhere.
|
|
28
|
+
if ! grep -q 'grep -vxF' "$T/fn.sh"; then
|
|
29
|
+
echo "❌ HARNESS-ERROR — unread_markers did not extract from $HOOK."
|
|
30
|
+
echo " The lanes would measure an empty function. Aborting rather than reporting green."
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
# shellcheck disable=SC1090
|
|
34
|
+
. "$T/fn.sh"
|
|
35
|
+
|
|
36
|
+
pass=0; fail=0
|
|
37
|
+
ok() { pass=$((pass+1)); printf 'PASS %s\n' "$1"; }
|
|
38
|
+
no() { fail=$((fail+1)); printf 'FAIL %s\n' "$1"; [ -n "${2:-}" ] && printf ' got: %s\n' "$(printf '%s' "${2:-}" | tr '\n' '|')"; }
|
|
39
|
+
|
|
40
|
+
ADDR=".axes_23_passed_docs_branch_2026-08-30.marker"
|
|
41
|
+
|
|
42
|
+
# L1 — the real shape: the read address plus two strays
|
|
43
|
+
o=$(unread_markers ".axes_23_passed_docs_branch_2026-08-30.marker
|
|
44
|
+
.axes_23_passed_fix_something_2026-08-30.marker
|
|
45
|
+
.axes_23_passed_feat_other_2026-08-30.marker" "$ADDR")
|
|
46
|
+
[ "$(printf '%s\n' "$o" | grep -c .)" = "2" ] && ok "L1 two strays reported, the read address excluded" || no "L1" "$o"
|
|
47
|
+
|
|
48
|
+
# L2 — known-negative: only the read address exists → silence. Without this the lane could pass
|
|
49
|
+
# by always printing everything.
|
|
50
|
+
o=$(unread_markers "$ADDR" "$ADDR")
|
|
51
|
+
[ -z "$o" ] && ok "L2 control — only the read address present reports nothing" || no "L2" "$o"
|
|
52
|
+
|
|
53
|
+
# L3 — empty list. "No markers at all" is already said by NOT CONFIRMED below the call site;
|
|
54
|
+
# repeating it here would be a duplicate, so empty must stay empty.
|
|
55
|
+
o=$(unread_markers "" "$ADDR")
|
|
56
|
+
[ -z "$o" ] && ok "L3 empty list is empty (no duplicate of NOT CONFIRMED)" || no "L3" "$o"
|
|
57
|
+
|
|
58
|
+
# L4 — THE ADVISORY MUST NOT BLOCK. Pinned in the source, because the whole design rests on it:
|
|
59
|
+
# a blocking version would push authors to write FEWER records, inverting the intent.
|
|
60
|
+
if sed -n '/_MK_UNREAD=/,/^ fi$/p' "$HOOK" | grep -qE 'FAILED=1|exit 1'; then
|
|
61
|
+
no "L4 the unread-marker advisory sets FAILED/exit — it must stay advisory"
|
|
62
|
+
else
|
|
63
|
+
ok "L4 the unread-marker advisory never blocks"
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
# L5 — EXACT match, not substring. A prefix must not silence a longer name, or a stray whose name
|
|
67
|
+
# begins with the read address would vanish — the exact class the `-x` flag exists for.
|
|
68
|
+
o=$(unread_markers "$ADDR
|
|
69
|
+
${ADDR}.bak" "$ADDR")
|
|
70
|
+
[ "$o" = "${ADDR}.bak" ] && ok "L5 matching is exact — a superstring name is still reported" || no "L5" "$o"
|
|
71
|
+
|
|
72
|
+
# L6 — duplicates collapse; a doubled line would read as two separate strays.
|
|
73
|
+
o=$(unread_markers ".axes_23_passed_fix_x_2026-08-30.marker
|
|
74
|
+
.axes_23_passed_fix_x_2026-08-30.marker" "$ADDR")
|
|
75
|
+
[ "$(printf '%s\n' "$o" | grep -c .)" = "1" ] && ok "L6 duplicate stray reported once" || no "L6" "$o"
|
|
76
|
+
|
|
77
|
+
echo "marker-address lanes: $pass passed, $fail failed"
|
|
78
|
+
[ "$fail" -eq 0 ] || exit 1
|
|
@@ -30,6 +30,12 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
30
30
|
HOOK="$REPO_ROOT/templates/.git-hooks/pre-commit"
|
|
31
31
|
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
|
|
32
32
|
|
|
33
|
+
# 🟥 헬퍼도 같이 추출한다 — 안 하면 다리가 fail-open 이 되고 레인이 거짓 PASS 를 낸다
|
|
34
|
+
# (실측 2026-08-30: R1 이 BLOCK 기대에 PASS). 훅은 이제 헬퍼 부재를 HARNESS-ERROR 로 낸다.
|
|
35
|
+
# 🟥 v3 부터 `_marker_template_residue` 는 `marker_recreate_hint` 를 **부른다**(템플릿에서 파생).
|
|
36
|
+
# 헬퍼 하나만 뽑으면 미정의로 죽고, 그러면 이 검사는 SKIPPED 를 낸다(통과 아님).
|
|
37
|
+
sed -n '/^marker_recreate_hint()/,/^}/p' "$HOOK" > "$T/_helpers.sh"
|
|
38
|
+
sed -n '/^_marker_template_residue()/,/^}/p' "$HOOK" >> "$T/_helpers.sh"
|
|
33
39
|
sed -n '/^validate_soul_check_leg()/,/^}/p' "$HOOK" > "$T/fn.sh"
|
|
34
40
|
|
|
35
41
|
# Instrument calibration — an empty extraction would let every fixture "pass" against nothing.
|
|
@@ -106,6 +112,11 @@ soul-check: reflected(codex 가 성공정의 대조 — 어긋남 없음) — 20
|
|
|
106
112
|
|
|
107
113
|
# ── ①영혼 presence lane (validate_soul_present_leg) ───────────────────────────
|
|
108
114
|
sed -n '/^validate_soul_present_leg()/,/^}/p' "$HOOK" > "$T/fnp.sh"
|
|
115
|
+
cat "$T/_helpers.sh" "$T/fnp.sh" > "$T/fnp2.sh" && mv "$T/fnp2.sh" "$T/fnp.sh"
|
|
116
|
+
cat "$T/_helpers.sh" "$T/fn.sh" > "$T/fn2.sh" && mv "$T/fn2.sh" "$T/fn.sh"
|
|
117
|
+
# 🟥 계기 캘리브레이션 — 헬퍼가 실제로 붙었나. 안 붙으면 다리가 HARNESS-ERROR 를 내고
|
|
118
|
+
# 모든 레인이 BLOCK 으로 쏠려 «잘 막는다»처럼 보인다. 그건 판별력이 아니다.
|
|
119
|
+
grep -q '^_marker_template_residue()' "$T/fnp.sh" || { echo "❌ HARNESS-ERROR — 헬퍼 미결합"; exit 1; }
|
|
109
120
|
if ! grep -q 'SOUL_PRESENT_GRACE' "$T/fnp.sh" && ! grep -q '①영혼 line' "$T/fnp.sh"; then
|
|
110
121
|
echo "❌ HARNESS-ERROR — validate_soul_present_leg did not extract. Aborting."
|
|
111
122
|
exit 1
|
|
@@ -206,6 +217,31 @@ soul-check: DEGRADED_NO_SOUL(설계 전에 성공 정의를 쓰지 않았다 —
|
|
|
206
217
|
lane N3-padded-confession PASS 'soul: 없음 — 설계 전에 안 썼다. 사후 재구성이 아니라 그 사실을 적는다. 붙잡고 있던 것은 범위 결정 하나였다
|
|
207
218
|
axes-run: ⓐ=codex'
|
|
208
219
|
|
|
220
|
+
# ── R1/R2 — 템플릿 잔여 (2026-08-30, 블라인드 sim 이 자기 힌트에 걸렸다) ──────────
|
|
221
|
+
# 힌트에 `soul:` 예시를 넣자마자 플로어 티어 3/3 이 **자리표시자를 그대로** 복사했고
|
|
222
|
+
# 비공허성 검사를 통과했다. 채널 검사로 닫았다: «이 기록이 템플릿 자신인가».
|
|
223
|
+
# 🟥 이 둘은 `planep`(presence 다리)로 돌려야 한다. 초판은 `lane`(soul-check 다리)로 짜서
|
|
224
|
+
# **틀린 함수를 겨눴고**, BLOCK 기대에 PASS 가 나왔다. 초록/적색이 아니라 «무엇을 겨눴나»였다.
|
|
225
|
+
# 🟥 **이 레인의 기대값이 v3 에서 바뀐다. 결과에 맞춘 게 아니라 범위가 좁아진 것이고,
|
|
226
|
+
# 그 좁아짐이 의도다.** v2 는 「꺾쇠+공백/비-ASCII」로 일반화해 이 문장을 잡았는데,
|
|
227
|
+
# 같은 규칙이 `Map<String, Object>` 와 `<사용자_ID>` 를 **과차단**했다(두 계열 독립 지적).
|
|
228
|
+
# 「이 꺾쇠가 자리표시자인가 타입인가」는 판단이고, 판단은 코드로 안 굳힌다.
|
|
229
|
+
# v3 는 «우리가 배포한 템플릿과 같은가»만 본다 — 아래 문장은 힌트에 없으므로 통과한다.
|
|
230
|
+
# ⚠️ 이것은 **명명된 잔여**다: 모델이 힌트를 자기 말로 바꿔 쓰면 안 잡힌다.
|
|
231
|
+
planep R1-nonhint-paraphrase-not-blocked PASS 2026-09-05 "soul: 성공 정의 = <이 fix가 통과했다고 판단할 관측 가능한 결과> · 절대 안 함 = <이번 수정에서 하지 않기로 정한 것>"
|
|
232
|
+
# 🟥 컨트롤 — 실제로 채운 줄은 통과해야 한다. 없으면 R1 은 «presence 검사를 통째로 껐다»와 구분 안 된다.
|
|
233
|
+
# 🟥 cross-family 가 잡은 우회 — 내 힌트의 자리표시자 `<...>` 가 잔여 목록에 없었다
|
|
234
|
+
# (codex #3 · agy 2-b 독립 수렴). 픽스처는 «가장 쉬운 표기»가 아니라 «뚫리는 표기»여야 한다.
|
|
235
|
+
planep R3-hint-placeholder-blocks BLOCK 2026-09-05 "soul: 성공 정의 = <...> · 절대 안 함 = <...>"
|
|
236
|
+
# 🟥 2라운드(agy 결함1): 잔여 목록이 «손목록»이라 규칙 문서가 새 자리표시자를 실을 때마다
|
|
237
|
+
# 어긋났다. 규칙으로 일반화했고, 아래가 그 양방향 고정이다. 차단 5 · 과차단 0 을 잰 뒤 박았다.
|
|
238
|
+
# 🟥 v3 는 «힌트가 실제로 주는» 자리표시자만 본다. 스펙 문서에만 있는 표기는 안 잡히고,
|
|
239
|
+
# 그건 명명된 잔여다(판단을 코드로 굳히는 것보다 낫다는 결정).
|
|
240
|
+
planep R4-hint-derived-placeholder-blocks BLOCK 2026-09-05 "soul-check: reflected(<무엇이 되돌아왔나>)"
|
|
241
|
+
planep R5-generic-type-not-blocked PASS 2026-09-05 "soul: 성공 정의 = Map<String, Object> 가 직렬화된다 · 절대 안 함 = 공개 API 깨기"
|
|
242
|
+
planep R6-inequality-not-blocked PASS 2026-09-05 "soul: 성공 정의 = n < 3 이면 판정 보류하고 n > 5 면 채점한다 · 절대 안 함 = 바 미달로 결론내기"
|
|
243
|
+
planep R2-real-content-still-passes PASS 2026-09-05 "soul: 성공 정의 = 레인 28개가 초록이고 되돌림에서 자기 레인만 적색 · 절대 안 함 = 결과에 맞춰 기대값 바꾸기"
|
|
244
|
+
|
|
209
245
|
echo
|
|
210
246
|
if [ $FAIL -eq 0 ]; then echo "SOUL LANES: PASS"; else echo "SOUL LANES: FAIL"; fi
|
|
211
247
|
exit $FAIL
|
|
@@ -116,7 +116,9 @@ fi
|
|
|
116
116
|
before_n=$(out=$(_run); printf '%s\n' "$out" | awk '$1=="separator" && $2 ~ /^[0-9]+$/ {print $2; exit}')
|
|
117
117
|
_run --fix-separators --quiet >/dev/null
|
|
118
118
|
after_n=$(out=$(_run); printf '%s\n' "$out" | awk '$1=="separator" && $2 ~ /^[0-9]+$/ {print $2; exit}')
|
|
119
|
-
|
|
119
|
+
# 🟥 awk 가 `separator` 줄을 못 찾으면 양변이 빈다 → ""="" 로 통과. 바로 위 주석이
|
|
120
|
+
# «zero 를 단언한 게 초판의 계기 오류»라고 적는데, 0 은 생각했고 «빈 값»은 안 했다.
|
|
121
|
+
if [ -n "$before_n" ] && [ -n "$after_n" ] && [ "$before_n" = "$after_n" ]; then
|
|
120
122
|
ok "H1b idempotent with anchor forms present (count stable at $after_n — the fenced example)"
|
|
121
123
|
else
|
|
122
124
|
bad "H1b count moved $before_n → $after_n across a second fix pass"
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
# Exit: 0 = all lanes pass; 1 = at least one lane failed (prints which and why).
|
|
12
12
|
|
|
13
13
|
set -uo pipefail
|
|
14
|
+
. "$(dirname "${BASH_SOURCE[0]}")/fixture_guard_lib.sh" # 픽스처는 실레포에 쓰지 않는다
|
|
14
15
|
|
|
15
16
|
FH_REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
16
17
|
CHECK="$FH_REPO/scripts/fh_node_check.sh"
|
|
17
|
-
TMP="$(mktemp -d)"
|
|
18
|
+
TMP="$(fh_fixture_root "$(mktemp -d)")"
|
|
19
|
+
: "${TMP:?fixture root unset — refusing to run git in cwd}"
|
|
18
20
|
trap 'rm -rf "$TMP"' EXIT
|
|
19
21
|
|
|
20
22
|
PASS=0; FAIL=0
|
|
@@ -182,7 +184,8 @@ done
|
|
|
182
184
|
# 🟥 The load-bearing one is lane10-b: in a shared checkout a branch switch yanks the ground out
|
|
183
185
|
# from under a peer session (measured 2026-08-09, two sessions/one worktree). If this feature ever
|
|
184
186
|
# switches branches, that lane is what says so.
|
|
185
|
-
_ap_root="$(mktemp -d)"
|
|
187
|
+
_ap_root="$(fh_fixture_root "$(mktemp -d)")"
|
|
188
|
+
: "${_ap_root:?fixture root unset — refusing to run git in cwd}"
|
|
186
189
|
(
|
|
187
190
|
cd "$_ap_root" || exit 1
|
|
188
191
|
# Pin the branch name: `git init` uses init.defaultBranch, which is main on this
|
|
@@ -19,11 +19,13 @@
|
|
|
19
19
|
# Exit 0 = every asserting lane calibrated · 1 = the instrument is wrong.
|
|
20
20
|
|
|
21
21
|
set -uo pipefail
|
|
22
|
+
. "$(dirname "${BASH_SOURCE[0]}")/fixture_guard_lib.sh" # 픽스처는 실레포에 쓰지 않는다
|
|
22
23
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
23
24
|
CHECK="$SCRIPT_DIR/fh_node_check.sh"
|
|
24
25
|
[ -f "$CHECK" ] || { echo "FAIL subject missing: $CHECK"; exit 1; }
|
|
25
26
|
|
|
26
|
-
TMPROOT
|
|
27
|
+
TMPROOT="$(fh_fixture_root "$(mktemp -d "${TMPDIR:-/tmp}/fh_infra_lanes.XXXXXX")")"
|
|
28
|
+
: "${TMPROOT:?fixture root unset — refusing to run git in cwd}"
|
|
27
29
|
trap 'rm -rf "$TMPROOT"' EXIT
|
|
28
30
|
FAILED=0; PASSED=0; GAPS=0
|
|
29
31
|
|
|
@@ -121,7 +121,9 @@ esac
|
|
|
121
121
|
mkdir -p "$TMP/socks_empty"
|
|
122
122
|
FH_PEER_SCAN_FORCE=1 FH_PEER_SOCK_DIR="$TMP/socks" bash "$CC" "$TMP/wt" >/dev/null 2>&1; RC_LOUD=$?
|
|
123
123
|
FH_PEER_SCAN_FORCE=1 FH_PEER_SOCK_DIR="$TMP/socks_empty" bash "$CC" "$TMP/wt" >/dev/null 2>&1; RC_QUIET=$?
|
|
124
|
-
|
|
124
|
+
# 🟥 «둘 다 같은 이유로 죽으면» 동일해서 통과한다(예: 스크립트 부재 → 둘 다 127).
|
|
125
|
+
# advisory 를 주장하려면 두 실행이 «실제로 돌았어야» 한다. 127 은 실행 실패다.
|
|
126
|
+
[ "$RC_LOUD" != "127" ] && [ "$RC_QUIET" != "127" ] && [ "$RC_LOUD" = "$RC_QUIET" ] \
|
|
125
127
|
&& ok "W-7 ①-c is advisory — exit code identical with peers ($RC_LOUD) and without ($RC_QUIET)" \
|
|
126
128
|
|| ng "W-7 ①-c CHANGED the exit code ($RC_QUIET → $RC_LOUD) — it must not block a close"
|
|
127
129
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_precommit_staged_drift_lanes.sh — fixtures for pre-commit's `staged_worktree_drift`.
|
|
3
|
+
#
|
|
4
|
+
# WHAT IT GUARDS. "The tree you verified is not the tree you commit" happened FOUR times in one
|
|
5
|
+
# day (2026-08-29/30) and a DIFFERENT instrument caught each one — which is luck, not coverage:
|
|
6
|
+
# ⑴ a pathspec failure was ignored and the verification credited to the commit anyway
|
|
7
|
+
# ⑵ a file was edited AFTER `git add`
|
|
8
|
+
# ⑶ a detector read the git index while the author ran it against the worktree
|
|
9
|
+
# ⑷ the caller-ratchet could not see new wiring until it was staged
|
|
10
|
+
# Only shape ⑵ is computable at commit time, and it is: `git diff` ∩ `git diff --cached`.
|
|
11
|
+
# This suite pins that computation, not the judgement about whether the drift matters.
|
|
12
|
+
#
|
|
13
|
+
# 🟥 SCOPE — channel, never conclusion. The gate says "these two byte streams diverged" and stops.
|
|
14
|
+
# It must NEVER block: partial/hunk staging is legitimate practice, and a gate that fires on it
|
|
15
|
+
# trains `--no-verify`, which disarms the Destructive-Op gate living in the same hook. So there is
|
|
16
|
+
# no BLOCK lane here on purpose — the absence is the design, and L5 pins it.
|
|
17
|
+
#
|
|
18
|
+
# Usage: bash scripts/test_precommit_staged_drift_lanes.sh Exit: 0 = all behave; 1 = regression.
|
|
19
|
+
|
|
20
|
+
set -uo pipefail
|
|
21
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
22
|
+
HOOK="$REPO_ROOT/templates/.git-hooks/pre-commit"
|
|
23
|
+
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
|
|
24
|
+
|
|
25
|
+
sed -n '/^staged_worktree_drift()/,/^}/p' "$HOOK" > "$T/fn.sh"
|
|
26
|
+
|
|
27
|
+
# 🟥 INSTRUMENT CALIBRATION FIRST. An empty extraction would let every fixture below "pass"
|
|
28
|
+
# against nothing — the exact false-green this repo keeps closing elsewhere.
|
|
29
|
+
if ! grep -q 'comm -12' "$T/fn.sh"; then
|
|
30
|
+
echo "❌ HARNESS-ERROR — staged_worktree_drift did not extract from $HOOK."
|
|
31
|
+
echo " The fixtures would measure an empty function. Aborting rather than reporting green."
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
# shellcheck disable=SC1090
|
|
35
|
+
. "$T/fn.sh"
|
|
36
|
+
|
|
37
|
+
pass=0; fail=0
|
|
38
|
+
ok() { pass=$((pass+1)); printf 'PASS %s\n' "$1"; }
|
|
39
|
+
no() { fail=$((fail+1)); printf 'FAIL %s\n' "$1"; [ -n "${2:-}" ] && printf ' got: %s\n' "$(printf '%s' "${2:-}" | tr '\n' '|')"; }
|
|
40
|
+
|
|
41
|
+
# L1 — the real shape: a file both staged and further modified
|
|
42
|
+
o=$(staged_worktree_drift "a.sh
|
|
43
|
+
b.md" "b.md")
|
|
44
|
+
[ "$o" = "b.md" ] && ok "L1 a path in BOTH lists is reported" || no "L1" "$o"
|
|
45
|
+
|
|
46
|
+
# L2 — known-negative: staged only, no worktree edit → silent
|
|
47
|
+
o=$(staged_worktree_drift "a.sh
|
|
48
|
+
b.md" "c.txt")
|
|
49
|
+
[ -z "$o" ] && ok "L2 control — disjoint lists report nothing (no false positive)" || no "L2" "$o"
|
|
50
|
+
|
|
51
|
+
# L3 — worktree-only changes are NOT drift. A file you never staged is not "verified ≠ committed";
|
|
52
|
+
# it is simply not in this commit. Reporting it would make the gate noisy on every partial commit
|
|
53
|
+
# and that noise is how an advisory gets ignored.
|
|
54
|
+
o=$(staged_worktree_drift "a.sh" "b.md
|
|
55
|
+
c.txt")
|
|
56
|
+
[ -z "$o" ] && ok "L3 control — unstaged-only paths are not reported" || no "L3" "$o"
|
|
57
|
+
|
|
58
|
+
# L4 — empty inputs. Both directions, because "nothing to compare" and "nothing diverged" take the
|
|
59
|
+
# same action here (do nothing), and the lane records that the collapse is deliberate.
|
|
60
|
+
o=$(staged_worktree_drift "" "")
|
|
61
|
+
[ -z "$o" ] && ok "L4 empty ∩ empty is empty" || no "L4" "$o"
|
|
62
|
+
o=$(staged_worktree_drift "" "a.sh")
|
|
63
|
+
[ -z "$o" ] && ok "L4b empty staged ∩ nonempty worktree is empty" || no "L4b" "$o"
|
|
64
|
+
|
|
65
|
+
# L5 — THE GATE MUST NOT BLOCK. Pinned as a lane because the whole design rests on it: a blocking
|
|
66
|
+
# version would fire on legitimate hunk staging and train `--no-verify`.
|
|
67
|
+
if grep -A14 '^_DRIFT=' "$HOOK" | grep -qE 'FAILED=1|exit 1'; then
|
|
68
|
+
no "L5 the drift gate sets FAILED/exit — it must stay advisory"
|
|
69
|
+
else
|
|
70
|
+
ok "L5 the drift gate never blocks (advisory by construction)"
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
# L6 — ordering must not matter; the function sorts. A caller handing git's raw output in a
|
|
74
|
+
# different order must get the same verdict.
|
|
75
|
+
o1=$(staged_worktree_drift "b.md
|
|
76
|
+
a.sh" "a.sh
|
|
77
|
+
b.md")
|
|
78
|
+
o2=$(staged_worktree_drift "a.sh
|
|
79
|
+
b.md" "b.md
|
|
80
|
+
a.sh")
|
|
81
|
+
[ "$o1" = "$o2" ] && [ -n "$o1" ] && ok "L6 order-independent (both orders agree, non-empty)" \
|
|
82
|
+
|| no "L6" "$o1 // $o2"
|
|
83
|
+
|
|
84
|
+
# L7 — duplicates collapse. `git diff` can list a path twice across modes; a doubled report line
|
|
85
|
+
# would read as two problems.
|
|
86
|
+
o=$(staged_worktree_drift "a.sh
|
|
87
|
+
a.sh" "a.sh")
|
|
88
|
+
[ "$(printf '%s\n' "$o" | grep -c .)" = "1" ] && ok "L7 duplicate input reports once" || no "L7" "$o"
|
|
89
|
+
|
|
90
|
+
echo "staged-drift lanes: $pass passed, $fail failed"
|
|
91
|
+
[ "$fail" -eq 0 ] || exit 1
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_preprep_adjacent_dup_lanes.sh — L10 인접 장 중복 낭독 앵커.
|
|
3
|
+
#
|
|
4
|
+
# 실사고: 한 장을 두 프레임으로 쪼갤 때 뒤 프레임에 원본을 **통째로** 남겨
|
|
5
|
+
# 117자 중 82자(70%)가 중복이었다. 앞 장에서 이미 읽은 문장을 다시 읽는다.
|
|
6
|
+
#
|
|
7
|
+
# 재는 것 넷:
|
|
8
|
+
# J1 판별력 원본을 통째로 남기면 잡나
|
|
9
|
+
# J2 오탐 0 제대로 쪼개면 조용한가
|
|
10
|
+
# J3 임계분리 임계 미기재면 «재기만 하고 판정 안 함» 인가 (구조=A · 값=B 분리)
|
|
11
|
+
# J4 처방 몇 자 / 몇 % / 어느 문장인지를 내나 — 숫자 없는 지적은 처방이 아니다
|
|
12
|
+
set -uo pipefail
|
|
13
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
14
|
+
SKILL="$HERE/plugins/fh-commons/skills/preprep"
|
|
15
|
+
PASS=0; FAIL=0
|
|
16
|
+
ok(){ echo " ✅ $1"; PASS=$((PASS+1)); }
|
|
17
|
+
ng(){ echo " ❌ $1"; FAIL=$((FAIL+1)); }
|
|
18
|
+
command -v python3 >/dev/null 2>&1 || {
|
|
19
|
+
echo " ⚠️ UNMEASURED — python3 unavailable; adjacent-dup lanes NOT run (this is not a pass)"
|
|
20
|
+
echo "adjacent-dup lanes: SKIPPED (not passed)"; exit 0; }
|
|
21
|
+
|
|
22
|
+
out=$(cd "$SKILL" && python3 - <<'PY' 2>&1
|
|
23
|
+
import sys, json, importlib.util as ilu
|
|
24
|
+
sys.path.insert(0, '.')
|
|
25
|
+
import lane_adjacent_dup as L
|
|
26
|
+
sp = ilu.spec_from_file_location('i', 'interslide_deps.py'); im = ilu.module_from_spec(sp); sp.loader.exec_module(im)
|
|
27
|
+
lim = {'adjacent_dup': {'max_dup_chars': 30}}
|
|
28
|
+
r = {}
|
|
29
|
+
for k, f, cfg in (('pos', 'fixtures/adjdup_known_positive.md', lim),
|
|
30
|
+
('neg', 'fixtures/adjdup_known_negative.md', lim),
|
|
31
|
+
('nolim', 'fixtures/adjdup_known_positive.md', {})):
|
|
32
|
+
t = open(f, encoding='utf-8').read()
|
|
33
|
+
fi, no = L.scan(cfg, {'s': (t, 'markdown')}, {'s': {'spoken': True}}, im)
|
|
34
|
+
r[k] = {'n': len(fi), 'msg': ' '.join(x[4] for x in fi),
|
|
35
|
+
'nolim_note': any('임계 미기재' in x for x in no)}
|
|
36
|
+
print(json.dumps(r, ensure_ascii=False))
|
|
37
|
+
PY
|
|
38
|
+
); rc=$?
|
|
39
|
+
[ $rc -eq 0 ] || { echo " ❌ INSTRUMENT ERROR — lane_adjacent_dup 실행 실패 (rc=$rc): $out"; exit 1; }
|
|
40
|
+
g(){ python3 -c "import json,sys;d=json.loads(sys.argv[1]);print(d[sys.argv[2]][sys.argv[3]])" "$out" "$1" "$2"; }
|
|
41
|
+
|
|
42
|
+
[ "$(g pos n)" = "1" ] && ok "J1 판별력: 원본 통째 남김을 잡는다" || ng "J1 판별력 없음: $(g pos n)건"
|
|
43
|
+
[ "$(g neg n)" = "0" ] && ok "J2 오탐 0: 제대로 쪼개면 조용" || ng "J2 오탐 $(g neg n)건"
|
|
44
|
+
{ [ "$(g nolim n)" = "0" ] && [ "$(g nolim nolim_note)" = "True" ]; } \
|
|
45
|
+
&& ok "J3 임계분리: 미기재면 재기만 하고 판정 안 한다" \
|
|
46
|
+
|| ng "J3 실패 — 임계를 코드에 박았거나, 미기재를 조용히 통과시킨다"
|
|
47
|
+
# 🟥 J4 의 초판은 glob `*%*자*` 였는데 **되돌림 프로브가 그걸 뚫었다** — 숫자를 지워도 남은
|
|
48
|
+
# 문자열에 «자» 와 «%» 가 우연히 들어 있어 통과했다. 장식 앵커였다.
|
|
49
|
+
# 지금은 «숫자 + 단위» 를 정규식으로 요구한다: `NN자` 와 `NN%` 가 둘 다 있어야 한다.
|
|
50
|
+
if printf '%s' "$(g pos msg)" | grep -qE '[0-9]+자' && printf '%s' "$(g pos msg)" | grep -qE '[0-9]+%'; then
|
|
51
|
+
ok "J4 처방: «NN자»·«NN%» 를 실제 숫자로 낸다"
|
|
52
|
+
else
|
|
53
|
+
ng "J4 실패 — 숫자 없는 지적은 처방이 아니다: $(g pos msg)"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
echo "adjacent-dup lanes: $PASS passed, $FAIL failed"
|
|
57
|
+
[ "$FAIL" -eq 0 ] || exit 1
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_preprep_drift_anchor.sh — 이원화의 단일-소스 앵커.
|
|
3
|
+
#
|
|
4
|
+
# preprep 은 두 진입점을 갖는다: FH 안의 스킬(plugins/fh-commons/skills/preprep/)과,
|
|
5
|
+
# 거기서 뽑아 세우는 standalone 현장 하네스. 🟥 **코드 사본이 둘이면 갈린다** —
|
|
6
|
+
# FH 자신의 규칙이 그것을 «single source of truth collapse · double maintenance burden»
|
|
7
|
+
# 이라 부른다. 그래서 이원화는 «복사본 둘»이 아니라 «단일 소스 + 얇은 두 진입점»이어야 하고,
|
|
8
|
+
# 이 앵커가 그 «단일»을 기계로 지킨다.
|
|
9
|
+
#
|
|
10
|
+
# 재는 것:
|
|
11
|
+
# D1 단일 소스가 실재하고 실행 가능한가 (부재를 통과로 렌더하지 않는다)
|
|
12
|
+
# D2 standalone 배포본이 있다면, 그 코드가 단일 소스와 «바이트 동일»한가
|
|
13
|
+
# — 없으면 SKIP 이고 SKIP 은 PASS 가 아니다. 있는데 다르면 FAIL
|
|
14
|
+
# D3 진입점 문서가 단일 소스를 가리키나 (죽은 포인터 금지)
|
|
15
|
+
set -uo pipefail
|
|
16
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
17
|
+
SRC="$HERE/plugins/fh-commons/skills/preprep"
|
|
18
|
+
# standalone 배포 위치는 환경변수로 받는다. 기본값을 박으면 다른 머신에서 거짓 SKIP 이 된다.
|
|
19
|
+
DIST="${PREPREP_STANDALONE_DIR:-}"
|
|
20
|
+
PASS=0; FAIL=0; SKIP=0
|
|
21
|
+
ok(){ echo " ✅ $1"; PASS=$((PASS+1)); }
|
|
22
|
+
ng(){ echo " ❌ $1"; FAIL=$((FAIL+1)); }
|
|
23
|
+
sk(){ echo " ⏭ $1 — SKIPPED (**통과 아님**)"; SKIP=$((SKIP+1)); }
|
|
24
|
+
|
|
25
|
+
# D1 — 단일 소스
|
|
26
|
+
missing=""
|
|
27
|
+
for f in preprep.py interslide_deps.py lane_progression.py lane_adjacent_dup.py lane_promise.py SKILL.md README.md surfaces.example.yaml; do
|
|
28
|
+
[ -f "$SRC/$f" ] || missing="$missing $f"
|
|
29
|
+
done
|
|
30
|
+
if [ -n "$missing" ]; then ng "D1 단일 소스 결손:$missing"
|
|
31
|
+
elif ! command -v python3 >/dev/null 2>&1; then
|
|
32
|
+
sk "D1 구문 검사 — python3 부재라 «돌 수 있나»를 못 쟀다(UNMEASURED)"
|
|
33
|
+
else
|
|
34
|
+
synerr=""
|
|
35
|
+
for f in preprep.py interslide_deps.py lane_progression.py lane_adjacent_dup.py lane_promise.py; do
|
|
36
|
+
python3 -c "import ast,sys;ast.parse(open(sys.argv[1],encoding='utf-8').read())" "$SRC/$f" 2>/dev/null || synerr="$synerr $f"
|
|
37
|
+
done
|
|
38
|
+
[ -z "$synerr" ] && ok "D1 단일 소스 8파일 실재 + python 5파일 구문 통과" \
|
|
39
|
+
|| ng "D1 구문 실패:$synerr"
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
# D2 — standalone 대조
|
|
43
|
+
if [ -z "$DIST" ]; then
|
|
44
|
+
sk "D2 standalone 대조 — PREPREP_STANDALONE_DIR 미설정이라 배포본을 못 찾았다"
|
|
45
|
+
elif [ ! -d "$DIST" ]; then
|
|
46
|
+
ng "D2 PREPREP_STANDALONE_DIR 이 가리키는 곳이 없다: $DIST (설정됐는데 부재 = 드리프트 아니라 배선 결함)"
|
|
47
|
+
else
|
|
48
|
+
drift=""
|
|
49
|
+
for f in preprep.py interslide_deps.py lane_progression.py lane_adjacent_dup.py; do
|
|
50
|
+
if [ ! -f "$DIST/$f" ]; then drift="$drift $f(부재)"
|
|
51
|
+
elif ! cmp -s "$SRC/$f" "$DIST/$f"; then drift="$drift $f(갈림)"; fi
|
|
52
|
+
done
|
|
53
|
+
[ -z "$drift" ] && ok "D2 standalone 코드 5파일이 단일 소스와 바이트 동일" \
|
|
54
|
+
|| ng "D2 드리프트:$drift ⇒ 사본이 둘이 됐다. 단일 소스에서 다시 뽑아라"
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# D3 — 진입점 포인터가 죽었나
|
|
58
|
+
if grep -q "ko-tech-writer" "$SRC/SKILL.md" 2>/dev/null; then
|
|
59
|
+
if [ -f "$HERE/plugins/fh-commons/skills/ko-tech-writer/SKILL.md" ]; then
|
|
60
|
+
ok "D3 SKILL.md 가 가리키는 ko-tech-writer 가 실재"
|
|
61
|
+
else ng "D3 죽은 포인터 — SKILL.md 가 ko-tech-writer 를 가리키는데 그 스킬이 없다"; fi
|
|
62
|
+
else ng "D3 SKILL.md 가 ko-tech-writer 라우팅을 잃었다 — L9 는 절반만 덮는데 나머지 절반의 출구가 사라졌다"; fi
|
|
63
|
+
|
|
64
|
+
echo "preprep drift anchor: $PASS passed, $FAIL failed, $SKIP skipped (skip != pass)"
|
|
65
|
+
[ "$FAIL" -eq 0 ] || exit 1
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_preprep_progression_lanes.sh — L9 progression 레인의 회귀 앵커.
|
|
3
|
+
#
|
|
4
|
+
# 재는 것 셋:
|
|
5
|
+
# P1 판별력 실사고 재현(①이 화면에서 빠짐) → 그 단계를 «이름으로» 지목하나
|
|
6
|
+
# P2 오탐 0 네 칸이 다 있으면 findings 0
|
|
7
|
+
# P3 부재≠0 선언이 없으면 NOT_CONFIGURED 이고 «통과»로 렌더하지 않나
|
|
8
|
+
# 🟥 P3 이 없으면 선언을 지우는 것만으로 이 레인이 조용해진다(가장 싼 무마 경로).
|
|
9
|
+
set -uo pipefail
|
|
10
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
+
SKILL="$HERE/plugins/fh-commons/skills/preprep"
|
|
12
|
+
PASS=0; FAIL=0
|
|
13
|
+
ok(){ echo " ✅ $1"; PASS=$((PASS+1)); }
|
|
14
|
+
ng(){ echo " ❌ $1"; FAIL=$((FAIL+1)); }
|
|
15
|
+
|
|
16
|
+
if ! command -v python3 >/dev/null 2>&1; then
|
|
17
|
+
echo " ⚠️ UNMEASURED — python3 unavailable; progression lanes NOT run (this is not a pass)"
|
|
18
|
+
echo "progression lanes: SKIPPED (not passed)"; exit 0
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
out=$(cd "$SKILL" && python3 - <<'PY' 2>&1
|
|
22
|
+
import sys, json
|
|
23
|
+
sys.path.insert(0, '.')
|
|
24
|
+
import lane_progression as LP
|
|
25
|
+
cfg = {'progressions': [{'id': 'escalation', 'steps': [
|
|
26
|
+
{'anchor': '좋아집니다'}, {'anchor': '그래도 남는'},
|
|
27
|
+
{'anchor': '더 늘려도'}, {'anchor': '입장을 바꾸면'}], 'screens': ['deck']}]}
|
|
28
|
+
r = {}
|
|
29
|
+
for k, f in (('pos', 'fixtures/progression_known_positive.md'),
|
|
30
|
+
('neg', 'fixtures/progression_known_negative.md')):
|
|
31
|
+
t = open(f, encoding='utf-8').read()
|
|
32
|
+
fi, _ = LP.scan(cfg, {'deck': (t, 'markdown')}, {'deck': {}})
|
|
33
|
+
r[k] = {'n': len(fi), 'named': [x[2] for x in fi]}
|
|
34
|
+
fi, no = LP.scan({}, {'deck': ('x', 'markdown')}, {'deck': {}})
|
|
35
|
+
r['unconf'] = {'n': len(fi), 'nc': any('NOT_CONFIGURED' in s for s in no)}
|
|
36
|
+
print(json.dumps(r, ensure_ascii=False))
|
|
37
|
+
PY
|
|
38
|
+
); rc=$?
|
|
39
|
+
[ $rc -eq 0 ] || { echo " ❌ INSTRUMENT ERROR — lane_progression 실행 실패 (rc=$rc): $out"; exit 1; }
|
|
40
|
+
pn=$(python3 -c "import json,sys;print(json.loads(sys.argv[1])['pos']['n'])" "$out")
|
|
41
|
+
pnm=$(python3 -c "import json,sys;print(','.join(json.loads(sys.argv[1])['pos']['named']))" "$out")
|
|
42
|
+
nn=$(python3 -c "import json,sys;print(json.loads(sys.argv[1])['neg']['n'])" "$out")
|
|
43
|
+
un=$(python3 -c "import json,sys;print(json.loads(sys.argv[1])['unconf']['n'])" "$out")
|
|
44
|
+
uc=$(python3 -c "import json,sys;print(json.loads(sys.argv[1])['unconf']['nc'])" "$out")
|
|
45
|
+
|
|
46
|
+
[ "$pn" = "1" ] && ok "P1 판별력: ①이 빠지면 1건 적발" || ng "P1 판별력 없음: ${pn}건 (기대 1)"
|
|
47
|
+
[ "$pnm" = "step1" ] && ok "P1-b 이름 지목: step1 을 «이름으로» 짚는다" || ng "P1-b 지목 실패: '$pnm' — 판정은 맞고 처방이 틀린 게이트다"
|
|
48
|
+
[ "$nn" = "0" ] && ok "P2 오탐 0" || ng "P2 오탐 ${nn}건"
|
|
49
|
+
{ [ "$un" = "0" ] && [ "$uc" = "True" ]; } && ok "P3 부재≠0: 선언 없으면 NOT_CONFIGURED 명시" \
|
|
50
|
+
|| ng "P3 실패 — 선언 없음이 «통과»로 렌더된다. 선언을 지우면 조용해지는 게이트다"
|
|
51
|
+
|
|
52
|
+
echo "progression lanes: $PASS passed, $FAIL failed"
|
|
53
|
+
[ "$FAIL" -eq 0 ] || exit 1
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_preprep_promise_lanes.sh — L11 예고↔상환 후보 레인의 앵커.
|
|
3
|
+
#
|
|
4
|
+
# 실사고: S6 이 «세 번» 을 예고했는데 본편 상환이 1건이었다. 기존 검사는 «결론이 첫 질문에
|
|
5
|
+
# 답하는가»만 봐서 **중반 티저의 미상환**을 구조적으로 못 잡았다.
|
|
6
|
+
#
|
|
7
|
+
# 🟥 재는 것은 «후보를 내는가» 가 아니라 **«가르는가»** 다. 둘 다 후보를 내면 판별력이 0 이고,
|
|
8
|
+
# 초판이 실제로 그랬다(대상어에 조사가 붙어 양쪽 다 «0회»가 나왔다).
|
|
9
|
+
# Q1 판별력 같은 예고에 대해 상환 1회 vs 3회를 «다른 수»로 낸다
|
|
10
|
+
# Q2 서수배제 「두 번째 …」 같은 **상환 문장**을 예고로 세지 않는다
|
|
11
|
+
# — 안 거르면 방향이 거꾸로 된다(상환을 미상환 후보로 계상)
|
|
12
|
+
# Q3 advisory findings 는 언제나 0 (종료코드 오염 금지)
|
|
13
|
+
# Q4 판정보류 «맞나» 로 사람에게 넘기지 «틀렸다» 고 단정하지 않는다
|
|
14
|
+
set -uo pipefail
|
|
15
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
16
|
+
SKILL="$HERE/plugins/fh-commons/skills/preprep"
|
|
17
|
+
PASS=0; FAIL=0
|
|
18
|
+
ok(){ echo " ✅ $1"; PASS=$((PASS+1)); }
|
|
19
|
+
ng(){ echo " ❌ $1"; FAIL=$((FAIL+1)); }
|
|
20
|
+
command -v python3 >/dev/null 2>&1 || {
|
|
21
|
+
echo " ⚠️ UNMEASURED — python3 unavailable; promise lanes NOT run (this is not a pass)"
|
|
22
|
+
echo "promise lanes: SKIPPED (not passed)"; exit 0; }
|
|
23
|
+
|
|
24
|
+
out=$(cd "$SKILL" && python3 - <<'PY' 2>&1
|
|
25
|
+
import sys, json, re
|
|
26
|
+
sys.path.insert(0, '.')
|
|
27
|
+
import lane_promise as L
|
|
28
|
+
r = {}
|
|
29
|
+
for k, f in (('pos', 'fixtures/promise_known_positive.md'),
|
|
30
|
+
('neg', 'fixtures/promise_known_negative.md')):
|
|
31
|
+
t = open(f, encoding='utf-8').read()
|
|
32
|
+
fi, no = L.scan({'s': (t, 'markdown')}, {'s': {'spoken': True}})
|
|
33
|
+
rows = [x.strip() for x in no if x.strip().startswith('·')]
|
|
34
|
+
cnts = [int(m.group(1)) for x in rows for m in [re.search(r'»\s*([0-9]+)회', x)] if m]
|
|
35
|
+
r[k] = {'n_find': len(fi), 'n_rows': len(rows), 'counts': cnts,
|
|
36
|
+
'body': ' '.join(rows)}
|
|
37
|
+
print(json.dumps(r, ensure_ascii=False))
|
|
38
|
+
PY
|
|
39
|
+
); rc=$?
|
|
40
|
+
[ $rc -eq 0 ] || { echo " ❌ INSTRUMENT ERROR — lane_promise 실행 실패 (rc=$rc): $out"; exit 1; }
|
|
41
|
+
g(){ python3 -c "import json,sys;d=json.loads(sys.argv[1]);print(d[sys.argv[2]][sys.argv[3]])" "$out" "$1" "$2"; }
|
|
42
|
+
|
|
43
|
+
pc=$(g pos counts); nc=$(g neg counts)
|
|
44
|
+
{ [ "$pc" = "[1]" ] && [ "$nc" = "[3]" ]; } \
|
|
45
|
+
&& ok "Q1 판별력: 상환 1회 vs 3회를 «다른 수»로 낸다 (pos=$pc neg=$nc)" \
|
|
46
|
+
|| ng "Q1 판별력 없음 — pos=$pc neg=$nc. 같으면 이 레인은 아무것도 안 가른다"
|
|
47
|
+
{ [ "$(g pos n_rows)" = "1" ] && [ "$(g neg n_rows)" = "1" ]; } \
|
|
48
|
+
&& ok "Q2 서수배제: 「N 번째 …」 상환 문장을 예고로 안 센다" \
|
|
49
|
+
|| ng "Q2 실패 — pos=$(g pos n_rows) neg=$(g neg n_rows). 상환을 미상환 후보로 계상하면 방향이 거꾸로다"
|
|
50
|
+
{ [ "$(g pos n_find)" = "0" ] && [ "$(g neg n_find)" = "0" ]; } \
|
|
51
|
+
&& ok "Q3 advisory 불변: findings 0" || ng "Q3 깨짐 — 종료코드를 오염시킨다"
|
|
52
|
+
case "$(g pos body)" in *맞나*) ok "Q4 판정보류: «맞나» 로 사람에게 넘긴다" ;;
|
|
53
|
+
*) ng "Q4 실패 — 단정하면 결론을 코드로 굳히는 것이다: $(g pos body)" ;; esac
|
|
54
|
+
|
|
55
|
+
echo "promise lanes: $PASS passed, $FAIL failed"
|
|
56
|
+
[ "$FAIL" -eq 0 ] || exit 1
|