@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
|
@@ -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
|
|
@@ -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
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_preprep_retired_lanes.sh โ L1-c ํ์ด(retired) ๊ฐ๋์ ํ๊ท ์ต์ปค.
|
|
3
|
+
#
|
|
4
|
+
# ์ค์ฌ๊ณ : ๋ฆฌ๋ทฐ๊ฐ ๋ช
์์ ์ผ๋ก ๊ฑท์ด๋ธ ใ์ฌ๋คใ๊ฐ 4๊ฐ์ ๋ค ์ฌ์ ์
๋๊ณ **์๋ฌด ๊ฒ์ฌ๋ ์ ์ธ๋ ธ๋ค**
|
|
5
|
+
# (์ด์์๊ฐ ์ก์๋ค). jargon_terms=์กฐ์ดโํ์ด, banned=์์น ์ธ์ฉ ๊ธ์ง๋ผ ยซ๊ฑท์ด๋ธ ๋งยป ์๋ฆฌ๊ฐ ์์๋ค.
|
|
6
|
+
#
|
|
7
|
+
# ์ฌ๋ ๊ฒ ๋ท:
|
|
8
|
+
# R1 ํ๋ณ๋ ฅ ํ์ด๊ฐ ์ฐ์ถ๋ฌผ์ ยซ์ฐ์ด๋ฉดยป RETIRED ๋ก ์ก๋
|
|
9
|
+
# R2 ์คํ 0 ๋์ฒด์ด๋ก ๋ฐ๊พธ๋ฉด ์กฐ์ฉํ๊ฐ
|
|
10
|
+
# R3 ์๊ธฐ์ ๊ณ ๐ฅ ยซใ์ฌ๋คใ๋ ๊ฑท์ด๋ธ ๋ฑ๋ง์ด๋คยป ๋ผ๊ณ ยซ์ ์ยป ์ค์ ์๋ฐ์ด ์๋๋ผ mention ์ธ๊ฐ
|
|
11
|
+
# โ ์ด๊ฒ ์์ผ๋ฉด ํ์ด ์์ฅ์ด ์๊ธฐ๋ฅผ ์๋ฐ์ผ๋ก ์ ๊ณ ํ๋ค
|
|
12
|
+
# R4 ์ฒ๋ฐฉ ๋์ฒด์ด๋ฅผ finding ์ ์ฃ๋ (์ฒ๋ฐฉ ์๋ ํ์ ์ ์ ๋ฐ์ด๋ค)
|
|
13
|
+
set -uo pipefail
|
|
14
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
15
|
+
SKILL="$HERE/plugins/fh-commons/skills/preprep"
|
|
16
|
+
PASS=0; FAIL=0
|
|
17
|
+
ok(){ echo " โ
$1"; PASS=$((PASS+1)); }
|
|
18
|
+
ng(){ echo " โ $1"; FAIL=$((FAIL+1)); }
|
|
19
|
+
command -v python3 >/dev/null 2>&1 || {
|
|
20
|
+
echo " โ ๏ธ UNMEASURED โ python3 unavailable; retired lanes NOT run (this is not a pass)"
|
|
21
|
+
echo "retired lanes: SKIPPED (not passed)"; exit 0; }
|
|
22
|
+
|
|
23
|
+
out=$(cd "$SKILL" && python3 - <<'PY' 2>&1
|
|
24
|
+
import sys, os, json, yaml, tempfile
|
|
25
|
+
sys.path.insert(0, '.')
|
|
26
|
+
import preprep as P
|
|
27
|
+
spec = {'banned': [], 'conditional': [], 'retired': [
|
|
28
|
+
{'id': 'measure-verb', 'literals': ['์ฌ๋ค'], 'replacement': '์ธก์ ํ๋ค',
|
|
29
|
+
'why': '๋ฆฌ๋ทฐ๊ฐ ๊ฑท์ด๋ธ ์ดํ', 'retired_by': 'review', 'retired_at': '2026-08-25'}]}
|
|
30
|
+
d = tempfile.mkdtemp(); sp = os.path.join(d, 't.yaml')
|
|
31
|
+
yaml.safe_dump(spec, open(sp, 'w', encoding='utf-8'), allow_unicode=True)
|
|
32
|
+
cfg = {'canon_terms': sp, 'canon_ledger': os.path.join(d, 'absent.md')}
|
|
33
|
+
r = {}
|
|
34
|
+
for k, body in (('use', '๐ฃ\n> ๊ทธ๊ฒ์ ์ฌ๋ค ๋ณด๋ฉด ์๋๋ค.\n'),
|
|
35
|
+
('repl', '๐ฃ\n> ๊ทธ๊ฒ์ ์ธก์ ํ๋ค ๋ณด๋ฉด ์๋๋ค.\n'),
|
|
36
|
+
('ment', '> ๐ซ ใ์ฌ๋คใ๋ ๊ฑท์ด๋ธ ๋ฑ๋ง์ด๋ค. ์ฐ์ง ๋ง๋ผ.\n')):
|
|
37
|
+
f, _ = P.lane_canon(cfg, '.', {'s': (body, 'markdown')}, {'s': {'spoken': True}})
|
|
38
|
+
r[k] = {'tags': [x[1] for x in f], 'msg': ' '.join(x[4] for x in f if x[1] == 'RETIRED')}
|
|
39
|
+
print(json.dumps(r, ensure_ascii=False))
|
|
40
|
+
PY
|
|
41
|
+
); rc=$?
|
|
42
|
+
[ $rc -eq 0 ] || { echo " โ INSTRUMENT ERROR โ lane_canon ์คํ ์คํจ (rc=$rc): $out"; exit 1; }
|
|
43
|
+
g(){ python3 -c "import json,sys;d=json.loads(sys.argv[1]);print(d[sys.argv[2]][sys.argv[3]])" "$out" "$1" "$2"; }
|
|
44
|
+
|
|
45
|
+
[ "$(g use tags)" = "['RETIRED']" ] && ok "R1 ํ๋ณ๋ ฅ: ํ์ด ์ฌ์ ์
์ RETIRED ๋ก ์ก๋๋ค" \
|
|
46
|
+
|| ng "R1 ํ๋ณ๋ ฅ ์์: $(g use tags)"
|
|
47
|
+
[ "$(g repl tags)" = "[]" ] && ok "R2 ์คํ 0: ๋์ฒด์ด๋ก ๋ฐ๊พธ๋ฉด ์กฐ์ฉ" || ng "R2 ์คํ: $(g repl tags)"
|
|
48
|
+
[ "$(g ment tags)" = "['mention']" ] && ok "R3 ์๊ธฐ์ ๊ณ ๋ฐฉ์ง: ํ์ด๋ฅผ ยซ์ ์ยป ์ค์ mention" \
|
|
49
|
+
|| ng "R3 ์คํจ: $(g ment tags) โ ํ์ด ์์ฅ์ด ์๊ธฐ๋ฅผ ์๋ฐ์ผ๋ก ์ ๊ณ ํ๋ค"
|
|
50
|
+
case "$(g use msg)" in *์ธก์ ํ๋ค*) ok "R4 ์ฒ๋ฐฉ: ๋์ฒด์ด๋ฅผ finding ์ ์ฃ๋๋ค" ;;
|
|
51
|
+
*) ng "R4 ์คํจ โ ์ฒ๋ฐฉ ์๋ ํ์ ์ด๋ค: $(g use msg)" ;; esac
|
|
52
|
+
|
|
53
|
+
echo "retired lanes: $PASS passed, $FAIL failed"
|
|
54
|
+
[ "$FAIL" -eq 0 ] || exit 1
|