@chrono-meta/fh-gate 3.16.0 → 3.17.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 (60) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/AGENTS.md +27 -0
  3. package/CATALOG.md +60 -0
  4. package/CLAUDE.md +5 -0
  5. package/README.ja.md +2 -2
  6. package/README.ko.md +2 -2
  7. package/README.md +2 -2
  8. package/README.zh.md +2 -2
  9. package/docs/OUTPUT_EVIDENCE.md +1 -1
  10. package/docs/codex-compat.md +24 -0
  11. package/knowledge/shared/harness-core/checkout_layer_drift.md +301 -0
  12. package/knowledge/shared/learnings/subagent_invocations_log.yaml +25 -0
  13. package/package.json +11 -1
  14. package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
  15. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  16. package/plugins/fh-meta/CHANGELOG.md +42 -0
  17. package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
  18. package/plugins/fh-preprep/skills/preprep/SKILL.md +5 -0
  19. package/plugins/fh-preprep/skills/preprep/lane_font_embed.py +235 -0
  20. package/plugins/fh-preprep/skills/preprep/ooxml/gate.py +67 -5
  21. package/plugins/fh-preprep/skills/preprep/ooxml/test_gate_exitcodes.py +136 -0
  22. package/plugins/fh-preprep/skills/preprep/preprep.py +16 -1
  23. package/plugins/fh-preprep/skills/preprep/presentation_checklist.md +108 -6
  24. package/plugins/fh-preprep/skills/preprep/safe_install.py +22 -3
  25. package/plugins/fh-preprep/skills/preprep/surfaces.example.yaml +11 -0
  26. package/plugins/fh-preprep/skills/preprep/test_lane_font_embed.py +117 -0
  27. package/plugins/fh-preprep/skills/preprep/test_safe_install_app_xml.py +77 -0
  28. package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
  29. package/scripts/count_check.sh +46 -14
  30. package/scripts/daily_report.sh +17 -1
  31. package/scripts/env_layer_fingerprint.sh +309 -0
  32. package/scripts/gate_bootstrap_ephemeral.sh +248 -0
  33. package/scripts/governor_board.sh +841 -0
  34. package/scripts/map_postprocess.py +89 -4
  35. package/scripts/multibyte_bracket_lint.sh +135 -0
  36. package/scripts/outbound_pr_gate.sh +12 -0
  37. package/scripts/package_coverage_check.sh +34 -0
  38. package/scripts/selfcheck.sh +245 -0
  39. package/scripts/session_close_check.sh +96 -1
  40. package/scripts/stale_ref_scan.py +2 -1
  41. package/scripts/test_count_check_decl_lanes.sh +176 -0
  42. package/scripts/test_env_layer_fingerprint_lanes.sh +192 -0
  43. package/scripts/test_gate_bootstrap_ephemeral_lanes.sh +262 -0
  44. package/scripts/test_locale_invariance_lanes.sh +581 -0
  45. package/scripts/test_map_postprocess_lanes.sh +84 -4
  46. package/scripts/test_marker_crossfamily_lanes.sh +5 -1
  47. package/scripts/test_marker_defense_lanes.sh +5 -1
  48. package/scripts/test_marker_standpoint_lanes.sh +5 -1
  49. package/scripts/test_marker_thirdparty_lanes.sh +5 -1
  50. package/scripts/test_multibyte_bracket_lint_lanes.sh +107 -0
  51. package/scripts/test_outbound_pr_gate_lanes.sh +133 -0
  52. package/scripts/test_preprep_drift_anchor.sh +34 -9
  53. package/scripts/test_preprep_drift_anchor_lanes.sh +64 -2
  54. package/scripts/test_session_close_chain_lanes.sh +45 -0
  55. package/scripts/test_stale_ref_close_lanes.sh +197 -0
  56. package/scripts/test_stale_ref_scan_lanes.sh +6 -1
  57. package/scripts/test_worktree_reclaim_lanes.sh +267 -1
  58. package/scripts/worktree_reclaim.sh +246 -11
  59. package/templates/.git-hooks/pre-commit +108 -27
  60. package/templates/settings.PreToolUse.snippet.json +54 -1
@@ -125,7 +125,55 @@
125
125
  " printf '%s' '{\"tool_name\":\"WebSearch\",\"tool_input\":{\"query\":\"bash printf portability\"}}' \\",
126
126
  " | bash scripts/outbound_query_hook.sh # expect: NO output (a clean query is silent)",
127
127
  " bash scripts/test_outbound_query_lanes.sh # the CLI twin, for outbound paths this hook",
128
- " # does NOT cover (curl / external CLIs via Bash)"
128
+ " # does NOT cover (curl / external CLIs via Bash)",
129
+ "",
130
+ "SEVENTH GUARD, Bash matcher — outbound_pr_gate.sh (added 2026-09-21; the script shipped in v3.13.0",
131
+ "and was registered NOWHERE until now — control: outbound_query_hook above hits this file, that one",
132
+ "hit zero settings). The SECOND hook here that can emit permissionDecision:\"deny\".",
133
+ "",
134
+ "WHAT IT GUARDS: a PR about to be OPENED on a repo we do not own. Measured on our outbound corpus",
135
+ "(2026-06-20..09-18): of 9 PRs, THREE carry a technical-defect finding — archify#328,",
136
+ "clawd-on-desk#1025 (closed), clawd-on-desk#1021 — and all three are ONE shape: our guard and our",
137
+ "test ran on OUR MODEL of the target, and the maintainer's evidence was an execution we had never",
138
+ "run. All three were submitted after a STATIC read of the target. The gate demands a record file",
139
+ "tracks/_meta/outbound_pr_<TODAY>_<slug>.md carrying three typed lines — standpoint: (CLAUDE.md §7's",
140
+ "existing closed enum, allow-listed to the strong rungs tier2/tier2b/tier3, so tier1b \"I read it and",
141
+ "ran nothing\" blocks), generated-path:, fixture-carries:.",
142
+ "",
143
+ "WHY A HOOK AND NOT PROSE: the rule already existed — CLAUDE.md §Skeleton-Not-Muscle explicitly scopes",
144
+ "\"code contributed upstream to someone else's repo\" — and had zero wiring. Measured precedent on this",
145
+ "exact substitution: the same rule as a CLAUDE.md table row fired 1/15 at floor tier; as a PreToolUse",
146
+ "hook, 9/9 (proposal_hook r3/r4). WHY NOT pre-commit: an outbound PR is authored in the TARGET's",
147
+ "clone under the TARGET's hooks — no FH commit occurs, so this repo's pre-commit/pre-push are",
148
+ "structurally not on that path. `gh pr create` is the outbound executor and PreToolUse sits on it.",
149
+ "",
150
+ "DEGRADE DIRECTION — split by what could be ESTABLISHED, and the split is the design:",
151
+ " target positively NON-OWNED -> deny (publish-class; §Irreversibility Gates fails CLOSED)",
152
+ " target positively OWNED -> silent (a gate that blocks our own PRs is a bypass trainer)",
153
+ " applicability UNDETERMINED -> advisory (denying here would block every bare `gh pr create`)",
154
+ " instrument incomplete,",
155
+ " NON-OWNED target -> deny (NOT SCANNED is not clean)",
156
+ " not an FH checkout -> silent (mechanical: is the tracked anchor file here?)",
157
+ "",
158
+ "UNLIKE THE SIXTH GUARD, THIS ONE WRITES NOTHING — no event log, no notice file, so there is nothing",
159
+ "to add to .gitignore when you wire it. Verified by grep for a write on any path in the script.",
160
+ "",
161
+ "Override, recorded by construction: put FH_OUTBOUND_PR_OK=1 in the COMMAND ITSELF. The hook reads",
162
+ "the command string (a session-exported env var is not in the hook's env), so the override lands in",
163
+ "the transcript, and the PR it lets out is swept post-hoc by session_close_check.sh ①-b.",
164
+ "",
165
+ "hook command absent -> the tool RUNS. Same fail-OPEN trap the sixth guard names: a PreToolUse command",
166
+ "that cannot be found is a non-blocking error, so on a consumer install where the script is not at",
167
+ "$CLAUDE_PROJECT_DIR/scripts/ the deny you think you wired is not there. VERIFY after wiring:",
168
+ " echo '{}' | bash \"$CLAUDE_PROJECT_DIR/scripts/outbound_pr_gate.sh\"; echo rc=$?",
169
+ " rc=0 and no output = resolved and silent on an empty payload; 'No such file' = not wired.",
170
+ "",
171
+ "Verify after wiring (known pair, both directions):",
172
+ " bash scripts/test_outbound_pr_gate_lanes.sh # expect: all known pairs hold (count self-reported).",
173
+ " # L17 reads THIS file and fails if the entry below",
174
+ " # is dropped, and runs the gate under the timeout",
175
+ " # configured here — a hook killed by its own timeout",
176
+ " # is a non-blocking error, i.e. fail-OPEN (H23's lesson)."
129
177
  ],
130
178
  "project_settings_json": {
131
179
  "hooks": {
@@ -147,6 +195,11 @@
147
195
  "type": "command",
148
196
  "command": "bash \"$CLAUDE_PROJECT_DIR/scripts/backtick_guard.sh\"",
149
197
  "timeout": 5
198
+ },
199
+ {
200
+ "type": "command",
201
+ "command": "bash \"$CLAUDE_PROJECT_DIR/scripts/outbound_pr_gate.sh\"",
202
+ "timeout": 5
150
203
  }
151
204
  ]
152
205
  },