@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.
Files changed (76) hide show
  1. package/.claude/rules/fh_4axis_gate.md +35 -1
  2. package/.claude-plugin/marketplace.json +2 -2
  3. package/AGENTS.md +17 -0
  4. package/CHEATSHEET.md +19 -1
  5. package/CLAUDE.md +34 -9
  6. package/README.ja.md +186 -649
  7. package/README.ko.md +207 -698
  8. package/README.md +186 -698
  9. package/README.zh.md +167 -601
  10. package/docs/ETHOS.md +73 -1
  11. package/docs/IDENTITIES.md +83 -0
  12. package/docs/MODEL_SETUP.md +111 -0
  13. package/docs/OUTPUT_EVIDENCE.md +10 -2
  14. package/knowledge/shared/harness-core/fh_detail_protocols.md +131 -1
  15. package/knowledge/shared/harness-core/fh_three_layer_canon.md +15 -0
  16. package/knowledge/shared/harness-core/field_harness_diagnostic.md +30 -0
  17. package/knowledge/shared/harness-core/gate_locality_principle.md +29 -0
  18. package/knowledge/shared/harness-core/measurement-integrity-checklist.md +80 -0
  19. package/knowledge/shared/harness-core/ship_readiness_gate.md +103 -15
  20. package/knowledge/shared/learnings/subagent_invocations_log.yaml +120 -0
  21. package/knowledge/shared/rules/multi_session_close_protocol.md +7 -1
  22. package/package.json +22 -2
  23. package/plugins/fh-commons/.claude-plugin/plugin.json +2 -2
  24. package/plugins/fh-commons/skills/preprep/README.md +45 -0
  25. package/plugins/fh-commons/skills/preprep/SKILL.md +214 -0
  26. package/plugins/fh-commons/skills/preprep/canon_terms.example.yaml +36 -0
  27. package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_negative.md +7 -0
  28. package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_positive.md +8 -0
  29. package/plugins/fh-commons/skills/preprep/fixtures/progression_known_negative.md +13 -0
  30. package/plugins/fh-commons/skills/preprep/fixtures/progression_known_positive.md +13 -0
  31. package/plugins/fh-commons/skills/preprep/fixtures/promise_known_negative.md +9 -0
  32. package/plugins/fh-commons/skills/preprep/fixtures/promise_known_positive.md +7 -0
  33. package/plugins/fh-commons/skills/preprep/interslide_deps.py +223 -0
  34. package/plugins/fh-commons/skills/preprep/jargon_terms.example.yaml +40 -0
  35. package/plugins/fh-commons/skills/preprep/lane_adjacent_dup.py +86 -0
  36. package/plugins/fh-commons/skills/preprep/lane_progression.py +81 -0
  37. package/plugins/fh-commons/skills/preprep/lane_promise.py +121 -0
  38. package/plugins/fh-commons/skills/preprep/ooxml/c1_baseline.txt +12 -0
  39. package/plugins/fh-commons/skills/preprep/ooxml/gate.py +164 -0
  40. package/plugins/fh-commons/skills/preprep/preprep.py +776 -0
  41. package/plugins/fh-commons/skills/preprep/presentation_checklist.md +310 -0
  42. package/plugins/fh-commons/skills/preprep/surfaces.example.yaml +148 -0
  43. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  44. package/plugins/fh-meta/CHANGELOG.md +150 -0
  45. package/plugins/fh-meta/skills/install-wizard/SKILL.md +39 -0
  46. package/scripts/activity_log.sh +144 -0
  47. package/scripts/com.forge-harness.daily-report.plist +44 -0
  48. package/scripts/context_continuity_score.sh +435 -0
  49. package/scripts/daily_report.sh +208 -0
  50. package/scripts/digest_landing_check.sh +71 -0
  51. package/scripts/fh_session_load.sh +71 -2
  52. package/scripts/field_canon_preload.sh +44 -0
  53. package/scripts/gate_pathspec_check.sh +10 -4
  54. package/scripts/lane_runner_check.sh +34 -1
  55. package/scripts/launchd_wiring_check.sh +182 -0
  56. package/scripts/mapped_tracks.sh +69 -0
  57. package/scripts/package_coverage_check.sh +28 -11
  58. package/scripts/portability_lint.sh +30 -0
  59. package/scripts/selfcheck.sh +98 -1
  60. package/scripts/sim_isolated_run.sh +339 -0
  61. package/scripts/test_heavy_classifier_lanes.sh +4 -1
  62. package/scripts/test_lane_runner_lanes.sh +75 -0
  63. package/scripts/test_mapped_tracks_lanes.sh +58 -0
  64. package/scripts/test_marker_address_lanes.sh +78 -0
  65. package/scripts/test_marker_soul_check_lanes.sh +36 -0
  66. package/scripts/test_precommit_staged_drift_lanes.sh +91 -0
  67. package/scripts/test_preprep_adjacent_dup_lanes.sh +57 -0
  68. package/scripts/test_preprep_drift_anchor.sh +65 -0
  69. package/scripts/test_preprep_progression_lanes.sh +53 -0
  70. package/scripts/test_preprep_promise_lanes.sh +56 -0
  71. package/scripts/test_preprep_retired_lanes.sh +54 -0
  72. package/scripts/test_sim_isolated_run_lanes.sh +219 -0
  73. package/scripts/test_skill_canon_preload_lanes.sh +58 -0
  74. package/scripts/universal_guard_check.sh +20 -8
  75. package/templates/.git-hooks/pre-commit +465 -8
  76. 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