@chrono-meta/fh-gate 3.29.0 → 3.31.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 (47) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/AGENTS.md +7 -2
  3. package/CLAUDE.md +1 -1
  4. package/README.ja.md +6 -5
  5. package/README.ko.md +6 -5
  6. package/README.md +15 -5
  7. package/README.zh.md +6 -5
  8. package/docs/REFERENCE.md +6 -5
  9. package/docs/USER_GUIDE.md +3 -0
  10. package/knowledge/shared/harness-core/claude_md_gate_details.md +1 -1
  11. package/knowledge/shared/harness-core/dispatch_conditional_prohibition.md +42 -0
  12. package/knowledge/shared/harness-core/sonnet_floor_doctrine.md +7 -0
  13. package/knowledge/shared/learnings/subagent_invocations_log.yaml +161 -0
  14. package/package.json +6 -1
  15. package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
  16. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  17. package/plugins/fh-meta/CHANGELOG.md +35 -0
  18. package/plugins/fh-meta/skills/install-wizard/SKILL.md +25 -0
  19. package/plugins/fh-meta/skills/install-wizard/SKILL_detail.md +24 -6
  20. package/plugins/fh-meta/skills/phantom-quench/SKILL.md +1 -1
  21. package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
  22. package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
  23. package/scripts/abstract_consult_check.py +573 -0
  24. package/scripts/fh_detach.py +444 -0
  25. package/scripts/mapped_tracks.sh +20 -13
  26. package/scripts/memory_gc_report.py +55 -5
  27. package/scripts/pr_merge_verified.sh +56 -8
  28. package/scripts/selfcheck.sh +85 -6
  29. package/scripts/session_checklist.py +3 -2
  30. package/scripts/session_close_check.sh +1 -1
  31. package/scripts/sim_isolated_run.sh +62 -0
  32. package/scripts/stale_ref_scan.py +47 -3
  33. package/scripts/test_abstract_consult_check_lanes.sh +201 -0
  34. package/scripts/test_fh_detach_lanes.sh +252 -0
  35. package/scripts/test_hook_source_gate_lanes.sh +16 -2
  36. package/scripts/test_mapped_tracks_lanes.sh +55 -1
  37. package/scripts/test_memory_gc_report_lanes.sh +91 -1
  38. package/scripts/test_mutation_probe_lanes.sh +86 -10
  39. package/scripts/test_ollama_panel_lanes.sh +107 -11
  40. package/scripts/test_pr_merge_verified_lanes.sh +48 -1
  41. package/scripts/test_prepush_real_fire_lanes.sh +215 -0
  42. package/scripts/test_selfcheck_state_lanes.sh +73 -1
  43. package/scripts/test_session_checklist_lanes.sh +34 -0
  44. package/scripts/test_sim_isolated_run_lanes.sh +88 -0
  45. package/scripts/test_stale_ref_scan_lanes.sh +11 -1
  46. package/templates/.git-hooks/pre-push +82 -1
  47. package/templates/CLAUDE.md +16 -0
@@ -564,11 +564,16 @@ elif [ "${FH_WIZARD_ZSHRC_CONSENT:-N}" != "Y" ]; then
564
564
  elif grep -q "fh_audit_check.zsh" "$ZSHRC" 2>/dev/null; then
565
565
  echo "zshrc hook: already present — no change"
566
566
  else
567
+ # Begin/end markers let scripts/fh_detach.py remove exactly this block and nothing else.
568
+ # A file without a trailing newline would glue our first line onto the user's last one.
569
+ [ -s "$ZSHRC" ] && [ -n "$(tail -c1 "$ZSHRC")" ] && printf '\n' >> "$ZSHRC"
567
570
  cat >> "$ZSHRC" <<EOF
571
+ # >>> forge-harness (install-wizard) >>>
568
572
  export FH_DIR="$FH_DIR"
569
573
  export CC_HUB_DIR="$CC_HUB_DIR"
570
574
  export CC_SENTINELS_DIR="\$HOME/.cc_sentinels"
571
575
  source "\$FH_DIR/templates/fh_audit_check.zsh"
576
+ # <<< forge-harness (install-wizard) <<<
572
577
  EOF
573
578
  echo "zshrc hook: appended"
574
579
  fi
@@ -665,8 +670,16 @@ for snip in snippets:
665
670
  # the loss: [my_telemetry.sh, fh_session_load.sh] lost my_telemetry.sh entirely).
666
671
  kept = []
667
672
  for g in hooks.get(event, []):
673
+ # A hook is FH's only when it names one of the snippet's scripts AND points into an FH hub
674
+ # ($CLAUDE_PROJECT_DIR or forge-harness). The path-form key alone still matched a user's own
675
+ # ~/tools/scripts/fh_node_check.sh and deleted it (scripts/test_fh_detach_lanes.sh D5b, 2026-10-26).
676
+ # A command byte-equal to one this snippet is about to write is ours whatever it points at — that keeps a
677
+ # re-run idempotent (scripts/test_wizard_snippet_merge_lanes.sh MS-4).
678
+ own = {h.get("command") for eg in entry for h in eg.get("hooks", [])}
668
679
  survivors = [h for h in g.get("hooks", [])
669
- if not any(k in h.get("command", "") for k in keys)]
680
+ if not (h.get("command", "") in own
681
+ or (any(k in h.get("command", "") for k in keys)
682
+ and re.search(r"CLAUDE_PROJECT_DIR|forge-harness", h.get("command", ""))))]
670
683
  if survivors:
671
684
  g = dict(g); g["hooks"] = survivors
672
685
  # `"matcher": ""` and an omitted matcher are the same thing in Claude Code (hooks doc,
@@ -737,10 +750,14 @@ FH_NODE_STATE="$_T" bash "$FH_DIR/scripts/fh_node_check.sh"; rm -f "$_T"
737
750
  # NEVER installed into field projects (see auto_project_mapping.md §6). Skip unless you develop FH itself.
738
751
  # Per Core Principles (Per-item approval + Double-confirm irreversible changes): this is NOT auto-run —
739
752
  # it is a separate explicit Y/N, not folded into the baseline-setup batch.
740
- if [ -d "$FH_DIR/templates/.git-hooks" ]; then
741
- echo "Enable the 4-axis pre-commit gate on your FH clone ($FH_DIR)? It will block commits there until"
742
- echo "markers pass (Mode D / FH-development only). Skip if you are not developing FH itself. (Y/N)"
743
- # → On explicit Y only:
753
+ # The Y/N used to be a COMMENT («On explicit Y only») — pasted or scripted, the block set hooksPath
754
+ # unconditionally, the same defect the zshrc block above had until 2026-08-12. Now a real conditional on
755
+ # FH_WIZARD_GATE_CONSENT, default N (fail-closed). Lane: scripts/test_fh_detach_lanes.sh (G1/G2).
756
+ if [ -d "$FH_DIR/templates/.git-hooks" ] && [ "${FH_WIZARD_GATE_CONSENT:-N}" != "Y" ]; then
757
+ echo "4-axis pre-commit gate: SKIPPED (no explicit Y) — set FH_WIZARD_GATE_CONSENT=Y after the user answers Y to:"
758
+ echo " Enable the 4-axis pre-commit gate on your FH clone ($FH_DIR)? It will block commits there until"
759
+ echo " markers pass (Mode D / FH-development only). Skip if you are not developing FH itself. (Y/N)"
760
+ elif [ -d "$FH_DIR/templates/.git-hooks" ]; then
744
761
  git -C "$FH_DIR" config core.hooksPath templates/.git-hooks
745
762
  chmod +x "$FH_DIR/templates/.git-hooks/pre-commit" 2>/dev/null
746
763
  echo "4-axis pre-commit gate: installed (core.hooksPath -> templates/.git-hooks)"
@@ -748,7 +765,8 @@ fi
748
765
 
749
766
  # sentinel initialization (per-project independent — prevent conflicts with other projects on same machine)
750
767
  mkdir -p ~/.cc_sentinels
751
- touch ~/.cc_sentinels/$(basename "$(pwd)")_wizard_done
768
+ # quoted: a project folder named «my project» used to create ~/.cc_sentinels/my and ./project_wizard_done (codex R2)
769
+ touch ~/.cc_sentinels/"$(basename "$(pwd)")"_wizard_done
752
770
 
753
771
  # Weekly audit cadence — NO cron needed (a session-scoped scheduler cannot fire on a later day).
754
772
  # Durable mechanism = the zshrc hook above (fh_audit_check.zsh warns on terminal start when 7+ days
@@ -22,7 +22,7 @@ model: sonnet
22
22
 
23
23
  > **Renamed from `source-grounding-audit` (2026-06-06)** — the grounding member of the quench series
24
24
  > (steel-quench · phantom-quench · goal-quench). Same skill, same ruleset; only the label changed to fit
25
- > the family. The **v1 paper (Zenodo 10.5281/zenodo.20397566) cites the old name** — that is the
25
+ > the family. The **v1 paper (Zenodo 10.5281/zenodo.20397566) cites the old name** — that is the <!-- stale-ref: pinned-line=20397566 -->
26
26
  > historical record, not a phantom (`paper/forge_harness_v1.0.html` is left unchanged by design; readers
27
27
  > map *source-grounding-audit (v1) = phantom-quench (current)*). The deprecated redirect stub directory
28
28
  > was removed 2026-06-12 — old-name utterances ("source grounding audit", "grounding audit") route here
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-preprep",
3
- "version": "3.29.0",
3
+ "version": "3.31.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-qp",
3
- "version": "3.29.0",
3
+ "version": "3.31.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },