@chrono-meta/fh-gate 1.0.3 → 1.2.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 (69) hide show
  1. package/.claude/agents/challenger.md +169 -0
  2. package/AGENTS.md +160 -0
  3. package/CATALOG.md +256 -0
  4. package/CHEATSHEET.md +367 -0
  5. package/CLAUDE.md +331 -0
  6. package/CONTRIBUTING.md +198 -0
  7. package/LICENSE +21 -0
  8. package/README.md +131 -418
  9. package/bin/fh-goal.js +9 -0
  10. package/bin/fh-run.js +9 -0
  11. package/docs/banner.png +0 -0
  12. package/docs/codex-compat.md +123 -0
  13. package/docs/pillars.svg +70 -0
  14. package/knowledge/shared/harness-core/fh_integration_contract.md +48 -29
  15. package/package.json +31 -6
  16. package/plugins/fh-commons/README.md +37 -0
  17. package/plugins/fh-commons/agents/quench-challenger.md +373 -0
  18. package/plugins/fh-commons/skills/convergence-loop/SKILL.md +155 -0
  19. package/plugins/fh-commons/skills/deliberation/SKILL.md +288 -0
  20. package/plugins/fh-commons/skills/mcp-circuit-breaker/SKILL.md +196 -0
  21. package/plugins/fh-commons/skills/token-budget-gate/SKILL.md +175 -0
  22. package/plugins/fh-meta/agents/fact-checker.md +121 -0
  23. package/plugins/fh-meta/agents/hub-persona-auditor.md +109 -0
  24. package/plugins/fh-meta/agents/persona-innovator.md +195 -0
  25. package/plugins/fh-meta/skills/agent-composer/SKILL.md +461 -0
  26. package/plugins/fh-meta/skills/agent-composer/SKILL_detail.md +464 -0
  27. package/plugins/fh-meta/skills/apex-review/SKILL.md +185 -0
  28. package/plugins/fh-meta/skills/asset-placement-gate/SKILL.md +135 -0
  29. package/plugins/fh-meta/skills/contention-layer/SKILL.md +127 -0
  30. package/plugins/fh-meta/skills/context-bridge-dispatch/SKILL.md +30 -0
  31. package/plugins/fh-meta/skills/context-bridge-dispatch/SKILL_detail.md +144 -0
  32. package/plugins/fh-meta/skills/context-doctor/SKILL.md +341 -0
  33. package/plugins/fh-meta/skills/cross-ecosystem-synergy-detection/SKILL.md +202 -0
  34. package/plugins/fh-meta/skills/deep-clarify/SKILL.md +144 -0
  35. package/plugins/fh-meta/skills/edit-manifest/SKILL.md +210 -0
  36. package/plugins/fh-meta/skills/field-harvest/SKILL.md +384 -0
  37. package/plugins/fh-meta/skills/frontier-digest/SKILL.md +272 -0
  38. package/plugins/fh-meta/skills/goal-quench/SKILL.md +509 -0
  39. package/plugins/fh-meta/skills/harness-doctor/SKILL.md +277 -0
  40. package/plugins/fh-meta/skills/harness-doctor/SKILL_detail.md +484 -0
  41. package/plugins/fh-meta/skills/harvest-loop/SKILL.md +231 -0
  42. package/plugins/fh-meta/skills/harvest-loop/SKILL_detail.md +201 -0
  43. package/plugins/fh-meta/skills/hub-cc-pr-reviewer/SKILL.md +129 -0
  44. package/plugins/fh-meta/skills/hub-cc-pr-reviewer/SKILL_detail.md +158 -0
  45. package/plugins/fh-meta/skills/install-doctor/SKILL.md +207 -0
  46. package/plugins/fh-meta/skills/install-wizard/SKILL.md +613 -0
  47. package/plugins/fh-meta/skills/marketplace-gate/SKILL.md +193 -0
  48. package/plugins/fh-meta/skills/memory-hygiene/SKILL.md +143 -0
  49. package/plugins/fh-meta/skills/meta-prompt-builder/SKILL.md +167 -0
  50. package/plugins/fh-meta/skills/meta-prompt-builder/SKILL_detail.md +37 -0
  51. package/plugins/fh-meta/skills/pipeline-conductor/SKILL.md +430 -0
  52. package/plugins/fh-meta/skills/plugin-recommender/SKILL.md +221 -0
  53. package/plugins/fh-meta/skills/plugin-recommender/SKILL_detail.md +220 -0
  54. package/plugins/fh-meta/skills/prompt-regression/SKILL.md +178 -0
  55. package/plugins/fh-meta/skills/public-surface-audit/SKILL.md +224 -0
  56. package/plugins/fh-meta/skills/return-path-gate/SKILL.md +257 -0
  57. package/plugins/fh-meta/skills/self-marketing-lint/SKILL.md +129 -0
  58. package/plugins/fh-meta/skills/sim-conductor/SKILL.md +364 -0
  59. package/plugins/fh-meta/skills/sim-conductor/SKILL_detail.md +337 -0
  60. package/plugins/fh-meta/skills/skill-splitter/SKILL.md +126 -0
  61. package/plugins/fh-meta/skills/skill-splitter/SKILL_detail.md +185 -0
  62. package/plugins/fh-meta/skills/source-grounding-audit/SKILL.md +230 -0
  63. package/plugins/fh-meta/skills/source-grounding-audit/SKILL_detail.md +182 -0
  64. package/plugins/fh-meta/skills/steel-quench/SKILL.md +226 -0
  65. package/plugins/fh-meta/skills/steel-quench/SKILL_detail.md +453 -0
  66. package/plugins/fh-meta/skills/verify-bidirectional/SKILL.md +238 -0
  67. package/scripts/fh-gate.sh +175 -40
  68. package/scripts/fh-goal.sh +182 -0
  69. package/scripts/fh-run.sh +269 -0
package/bin/fh-goal.js ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const { execFileSync } = require('child_process');
4
+ const path = require('path');
5
+ execFileSync(
6
+ path.join(__dirname, '..', 'scripts', 'fh-goal.sh'),
7
+ process.argv.slice(2),
8
+ { stdio: 'inherit' }
9
+ );
package/bin/fh-run.js ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const { execFileSync } = require('child_process');
4
+ const path = require('path');
5
+ execFileSync(
6
+ path.join(__dirname, '..', 'scripts', 'fh-run.sh'),
7
+ process.argv.slice(2),
8
+ { stdio: 'inherit' }
9
+ );
Binary file
@@ -0,0 +1,123 @@
1
+ # Codex Compatibility — Known Limitations & Validated Patterns
2
+
3
+ > Status: **beta**. This document is beta-removal condition #2 (see `AGENTS.md` → Codex Compatibility → Beta removal conditions). It lists what works, what breaks, and what to expect when applying forge-harness (FH) methodology through OpenAI Codex (`codex exec`) instead of Claude Code.
4
+
5
+ FH is a 2-layer system: a **methodology layer** (`tracks/`, `knowledge/`, `SKILL.md` docs) that is model-agnostic, and an **automation layer** (Claude Code hooks, `.claude/agents/`, `/model`, settings.json) that is Claude-native. Codex users run the methodology layer by reading `SKILL.md` files directly; automation steps either run through runtime adapters (`fh-gate`, `fh-run`) or require manual substitution.
6
+
7
+ ## Validated invocation pattern
8
+
9
+ ```bash
10
+ # headless, stdin — codex-cli >= 0.135.0
11
+ cat plugins/fh-meta/skills/<skill>/SKILL.md path/to/artifact \
12
+ | codex exec -m gpt-5.5 -
13
+ ```
14
+
15
+ - `codex exec -m gpt-5.5 -` reads the combined prompt from stdin and runs headless.
16
+ - `npx @openai/codex` (interactive) requires a TTY and is **not** suitable for piped skill application.
17
+ - Inside a git repository (e.g. a clone of this repo) no extra flag is needed. **Outside** a git repo (e.g. running from `/tmp`), add `--skip-git-repo-check`.
18
+ - `codex exec` has its own file-read tools, so a skill that back-traces claims to source files (e.g. `source-grounding-audit`) can verify paths itself — it produced real `file:line` citations in validation.
19
+
20
+ ## Runtime adapters
21
+
22
+ ### `fh-gate`
23
+
24
+ `fh-gate` supports both Claude and Codex backends with the same governance prompt and verdict parser:
25
+
26
+ ```bash
27
+ # Default, backward-compatible Claude path
28
+ npx --package @chrono-meta/fh-gate fh-gate "src/foo.ts" quick ci
29
+
30
+ # Codex as the primary reviewer
31
+ FH_BACKEND=codex npx --package @chrono-meta/fh-gate fh-gate "src/foo.ts" quick ci
32
+
33
+ # Prefer Codex if installed, otherwise fall back to Claude
34
+ FH_BACKEND=auto npx --package @chrono-meta/fh-gate fh-gate "src/foo.ts" quick ci
35
+ ```
36
+
37
+ Backend defaults:
38
+
39
+ | `FH_BACKEND` | Command | Default model |
40
+ |---|---|---|
41
+ | `claude` | `claude --print --model "$FH_MODEL"` | `claude-sonnet-4-6` |
42
+ | `codex` | `codex exec -m "$FH_MODEL" -` | `gpt-5.5` |
43
+ | `auto` | `codex` if present, otherwise `claude` | backend default |
44
+
45
+ ### `fh-run`
46
+
47
+ `fh-run` bridges skill and agent execution that previously assumed Claude Code slash commands or `Agent(...)` dispatch:
48
+
49
+ ```bash
50
+ FH_BACKEND=codex npx --package @chrono-meta/fh-gate fh-run \
51
+ --skill source-grounding-audit \
52
+ --file docs/foo.md
53
+
54
+ FH_BACKEND=codex npx --package @chrono-meta/fh-gate fh-run \
55
+ --agent fh-commons:quench-challenger \
56
+ --file plugins/fh-meta/skills/foo/SKILL.md
57
+ ```
58
+
59
+ Resolution order:
60
+
61
+ | Unit type | Lookup |
62
+ |---|---|
63
+ | `--skill name` | `plugins/fh-meta/skills/name/SKILL.md`, then `plugins/fh-commons/skills/name/SKILL.md` |
64
+ | `--agent name` | `.claude/agents/name.md`, then `plugins/fh-meta/agents/name.md`, then `plugins/fh-commons/agents/name.md` |
65
+ | `--agent plugin:name` | `plugins/plugin/agents/name.md` first |
66
+ | `--unit path` | explicit file path |
67
+
68
+ ### `fh-goal`
69
+
70
+ Codex has native goal/session features. Use those directly when they fit. `fh-goal` is not a replacement for Codex goal; it is a non-interactive wrapper for "run backend task, then run FH governance on changed files":
71
+
72
+ ```bash
73
+ FH_BACKEND=codex npx --package @chrono-meta/fh-gate fh-goal \
74
+ --prompt "Implement X and update tests" \
75
+ --gate quick
76
+ ```
77
+
78
+ ## Author-run M1 validations (2026-06-04)
79
+
80
+ These are **author** runs — they confirm the M1 tier assignments are accurate and ground the limitations below. They do **not** count toward the external-validation gate (conditions #1 and #3 below), which by definition requires non-author users.
81
+
82
+ | Skill | Tier | Method | Result |
83
+ |---|---|---|---|
84
+ | `source-grounding-audit` | M1 | Fed a fixture with 2 real + 2 phantom claims (a non-existent skill path, a fabricated "47 M1 skills" count) | **4/4 correct** — both real claims Grounded with `file:line` citations, both phantoms caught (the fabricated count corrected against the actual `AGENTS.md`) |
85
+ | `asset-placement-gate` | M1 | Fed a proposed `phantom-checker` skill that duplicates `source-grounding-audit` | **Correct** — applied the 4-criteria bar, flagged criterion ④ overlap, routed to **Drop** with "route intent to source-grounding-audit" |
86
+
87
+ Both ran end-to-end with no Claude-native dependency. The M1 tier claim holds for the two skills tested.
88
+
89
+ ## Known limitations
90
+
91
+ ### 1. CC-native hooks fire and fail (noise, not breakage)
92
+ When `codex exec` runs **inside this repo**, FH's Claude-native git/Stop/PostToolUse hooks attempt to fire and emit `hook: Stop Failed` / `hook: PostToolUse Failed` lines interleaved with output. These are **harmless to the skill result** — the skill's verdict is produced correctly — but they are visible noise. Running from a directory **without** FH's `.claude/settings.json` (the normal Codex-user case) avoids them entirely. Filter with `grep -vE "^hook:"` if needed.
93
+
94
+ ### 2. M2 skills need manual agent substitution
95
+ M2 skills (`steel-quench`, `harness-doctor`, `context-doctor`, `sim-conductor`, `harvest-loop`) have a core workflow that runs under Codex, but any step that dispatches `Agent(subagent_type=...)` or a slash command must be replaced by `fh-run` or a direct `codex exec` call reading the sub-agent's `SKILL.md`/agent `.md` — same workflow, different runtime (the "M2 adaptation pattern" in `AGENTS.md`). Example: `steel-quench` Waves 1–3 run; the `quench-challenger` agent step becomes `fh-run --agent fh-commons:quench-challenger`.
96
+
97
+ ### 3. M3 skills do not run automatically under Codex
98
+ M3 skills (`goal-quench` Phase-3 Stop hook, `hub-cc-pr-reviewer` CC session context, `install-wizard` settings.json write) require Claude-Code-native runtime and are **methodology reference only** under Codex unless a dedicated adapter exists. Use Codex's native goal/session features for goal control, and use `fh-gate` after completion for FH quality gating.
99
+
100
+ ### 4. No token accounting
101
+ Codex token usage is billed in the Codex CLI quota and is **not** recorded in any FH session log or orchestrator measurement. Cross-family runs (Gemini/Codex) are invisible to FH's token-budget tooling by construction.
102
+
103
+ ### 5. Cross-family sibling note (Gemini)
104
+ The sibling pattern for Gemini is `gemini -p "$(cat <skill+artifact>)"`. Outside a trusted directory Gemini requires `--skip-trust` (or `GEMINI_CLI_TRUST_WORKSPACE=true`). Gemini's headless output may bracket identifiers (`[ID]:`) where Codex does not — parse tolerantly.
105
+
106
+ ## Per-tier expectation summary
107
+
108
+ | Tier | Under Codex | Action |
109
+ |---|---|---|
110
+ | **M1** | Runs fully | `cat SKILL.md artifact \| codex exec -m gpt-5.5 -` |
111
+ | **M2** | Core runs; agent/slash steps via adapter | Substitute each dispatch with `fh-run` or a direct `codex exec` on the sub-agent's `.md` |
112
+ | **M3** | Does not run automatically | Use native Codex session features where available; otherwise read as methodology reference or use a dedicated adapter |
113
+
114
+ ## Beta removal — remaining (external-blocked)
115
+
116
+ | Condition | Status |
117
+ |---|---|
118
+ | Known limitation list published (this doc) | ✅ done (2026-06-04) |
119
+ | 5+ externally validated M1 skill runs (not FH author) | ⬜ pending — needs external Codex users |
120
+ | At least 1 external Codex user confirms methodology reproduces | ⬜ pending — needs external Codex users |
121
+ | README badge updated (`Codex-compatible` without `beta`) | ⬜ blocked on the two above |
122
+
123
+ To report a validated run, open an issue at `chrono-meta/forge-harness` with label `codex-validation`.
@@ -0,0 +1,70 @@
1
+ <svg viewBox="0 0 680 100" width="680" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" y1="0" x2="0" y2="1">
4
+ <stop offset="0%" stop-color="#1e1108"/>
5
+ <stop offset="100%" stop-color="#0d0803"/>
6
+ </linearGradient>
7
+ <linearGradient id="cd" x1="0" y1="0" x2="0" y2="1">
8
+ <stop offset="0%" stop-color="#2c1c0c"/>
9
+ <stop offset="100%" stop-color="#181005"/>
10
+ </linearGradient>
11
+ <filter id="glow">
12
+ <feGaussianBlur stdDeviation="1.5" result="blur"/>
13
+ <feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge>
14
+ </filter>
15
+ </defs>
16
+
17
+ <!-- Background -->
18
+ <rect width="680" height="100" fill="url(#bg)"/>
19
+
20
+ <!-- Top hot-metal accent -->
21
+ <rect width="680" height="3" fill="#e07d2a" filter="url(#glow)"/>
22
+ <rect y="3" width="680" height="5" fill="#e07d2a" fill-opacity="0.10"/>
23
+
24
+ <!-- ═══ FORK (x=8, cx=88) ═══ -->
25
+ <rect x="8" y="10" width="160" height="84" rx="5" fill="url(#cd)" stroke="#c46820" stroke-width="0.8"/>
26
+ <!-- Chain link icon -->
27
+ <ellipse cx="81" cy="34" rx="10" ry="6" fill="none" stroke="#e07d2a" stroke-width="2" transform="rotate(-35 81 34)"/>
28
+ <ellipse cx="95" cy="44" rx="10" ry="6" fill="none" stroke="#e07d2a" stroke-width="2" transform="rotate(-35 95 44)"/>
29
+ <text x="88" y="63" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="13" font-weight="bold" fill="#f5943a" letter-spacing="2">FORK</text>
30
+ <text x="88" y="76" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="9.5" fill="#9e7040">Fork the harness</text>
31
+ <text x="88" y="88" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="9.5" fill="#9e7040">for your team</text>
32
+
33
+ <!-- ═══ ADAPT (x=176, cx=256) ═══ -->
34
+ <rect x="176" y="10" width="160" height="84" rx="5" fill="url(#cd)" stroke="#c46820" stroke-width="0.8"/>
35
+ <!-- Gear icon (hexagon + inner circle) -->
36
+ <polygon points="256,25 267,31 267,43 256,49 245,43 245,31" fill="none" stroke="#e07d2a" stroke-width="2" stroke-linejoin="round"/>
37
+ <circle cx="256" cy="37" r="6" fill="none" stroke="#e07d2a" stroke-width="2"/>
38
+ <circle cx="256" cy="37" r="1.5" fill="#e07d2a"/>
39
+ <text x="256" y="63" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="13" font-weight="bold" fill="#f5943a" letter-spacing="2">ADAPT</text>
40
+ <text x="256" y="76" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="9.5" fill="#9e7040">Rename, configure,</text>
41
+ <text x="256" y="88" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="9.5" fill="#9e7040">and extend</text>
42
+
43
+ <!-- ═══ COLLABORATE (x=344, cx=424) ═══ -->
44
+ <rect x="344" y="10" width="160" height="84" rx="5" fill="url(#cd)" stroke="#c46820" stroke-width="0.8"/>
45
+ <!-- Two people -->
46
+ <circle cx="416" cy="29" r="7" fill="none" stroke="#e07d2a" stroke-width="1.8"/>
47
+ <path d="M404,49 C404,39 428,39 428,49" fill="none" stroke="#e07d2a" stroke-width="1.8" stroke-linecap="round"/>
48
+ <circle cx="432" cy="32" r="6" fill="none" stroke="#e07d2a" stroke-width="1.5"/>
49
+ <path d="M421,50 C421,42 443,42 443,50" fill="none" stroke="#e07d2a" stroke-width="1.5" stroke-linecap="round"/>
50
+ <text x="424" y="63" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="11" font-weight="bold" fill="#f5943a" letter-spacing="0.8">COLLABORATE</text>
51
+ <text x="424" y="76" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="9.5" fill="#9e7040">Multi-project teams.</text>
52
+ <text x="424" y="88" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="9.5" fill="#9e7040">One shared backbone.</text>
53
+
54
+ <!-- ═══ EMPOWER (x=512, cx=592) ═══ -->
55
+ <rect x="512" y="10" width="160" height="84" rx="5" fill="url(#cd)" stroke="#c46820" stroke-width="0.8"/>
56
+ <!-- Shield + checkmark -->
57
+ <path d="M592,24 L605,30 L605,41 L592,50 L579,41 L579,30 Z" fill="none" stroke="#e07d2a" stroke-width="2" stroke-linejoin="round"/>
58
+ <path d="M585,37 L590,43 L599,33" fill="none" stroke="#e07d2a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
59
+ <text x="592" y="63" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="12" font-weight="bold" fill="#f5943a" letter-spacing="1">EMPOWER</text>
60
+ <text x="592" y="76" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="9.5" fill="#9e7040">Build, ship, and</text>
61
+ <text x="592" y="88" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="9.5" fill="#9e7040">iterate faster.</text>
62
+
63
+ <!-- Subtle vertical dividers -->
64
+ <line x1="176" y1="18" x2="176" y2="86" stroke="#c46820" stroke-width="0.5" stroke-opacity="0.35"/>
65
+ <line x1="344" y1="18" x2="344" y2="86" stroke="#c46820" stroke-width="0.5" stroke-opacity="0.35"/>
66
+ <line x1="512" y1="18" x2="512" y2="86" stroke="#c46820" stroke-width="0.5" stroke-opacity="0.35"/>
67
+
68
+ <!-- Bottom ember line -->
69
+ <rect y="97" width="680" height="3" fill="#c46820" fill-opacity="0.45"/>
70
+ </svg>
@@ -9,7 +9,7 @@ tags: [integration-contract, governance, opencode, hermes, openhuman, bridge-lay
9
9
 
10
10
  ## Status
11
11
 
12
- **v1.0 — Binary available.** `scripts/fh-gate.sh` executes governance review end-to-end via `claude --print`.
12
+ **v1.2 — Binary available.** `scripts/fh-gate.sh` executes governance review end-to-end via a selectable backend: `claude --print` or `codex exec`.
13
13
  CI-ready: machine-parseable verdict + exit codes (0=PASS / 1=PENDING / 2=BLOCKED / 3=ESCALATE / 10=harness error).
14
14
  Backward-compatible: `FH_DRY_RUN=1` restores prompt-only (v0.1) behavior.
15
15
 
@@ -45,9 +45,11 @@ Caller reads verdict, decides: merge / hold / escalate
45
45
 
46
46
  | Input | Form | Description |
47
47
  |---|---|---|
48
- | `FH_DIFF_PATH` | file path | Pre-generated diff file (skips Step 1 if provided) |
48
+ | `FH_DIFF_PATH` | file path | Pre-generated diff file included as additional caller context |
49
49
  | `FH_TASK_DESCRIPTION` | string | What the caller was trying to accomplish (context for adversarial pass) |
50
50
  | `FH_SECURITY_LENS` | `on` or `off` (default `off`) | Force security-adjacent focus in steel-quench |
51
+ | `FH_BACKEND` | `claude`, `codex`, or `auto` (default `claude`) | Runtime backend. `auto` prefers Codex if installed, otherwise Claude |
52
+ | `FH_MODEL` | model id | Overrides backend default (`claude-sonnet-4-6` for Claude, `gpt-5.5` for Codex) |
51
53
 
52
54
  ### Capture pattern (caller's responsibility)
53
55
 
@@ -158,7 +160,7 @@ Steps:
158
160
 
159
161
  set -euo pipefail
160
162
 
161
- FH_TARGET_FILES="${1:-$(git diff main..HEAD --name-only | tr '\n' ' ')}"
163
+ FH_TARGET_FILES="${FH_TARGET_FILES:-${1:-$(git diff main..HEAD --name-only)}}"
162
164
  FH_GATE_LEVEL="${2:-quick}"
163
165
  FH_CALLER="${3:-unknown}"
164
166
 
@@ -176,6 +178,30 @@ EOF
176
178
 
177
179
  Usage: `./scripts/fh-gate.sh "src/permission/arity.ts" quick opencode`
178
180
 
181
+ ### Pattern 2-b — Binary wrapper with runtime backend
182
+
183
+ ```bash
184
+ # Claude backend, backward-compatible default
185
+ npx --package @chrono-meta/fh-gate fh-gate "src/permission/arity.ts" quick ci
186
+
187
+ # Codex backend as primary reviewer
188
+ FH_BACKEND=codex npx --package @chrono-meta/fh-gate fh-gate "src/permission/arity.ts" quick ci
189
+
190
+ # Portable wrapper: prefer Codex when installed, otherwise Claude
191
+ FH_BACKEND=auto npx --package @chrono-meta/fh-gate fh-gate "src/permission/arity.ts" quick ci
192
+ ```
193
+
194
+ All backends must produce the same `FH_STATUS` / `FH_GATE_VERDICT` header. Missing or malformed output is a harness failure and must be treated as blocked by the caller.
195
+
196
+ ### Pattern 2-c — Direct skill or agent run
197
+
198
+ ```bash
199
+ FH_BACKEND=codex npx --package @chrono-meta/fh-gate fh-run --skill source-grounding-audit --file docs/foo.md
200
+ FH_BACKEND=codex npx --package @chrono-meta/fh-gate fh-run --agent fh-commons:quench-challenger --file plugins/fh-meta/skills/foo/SKILL.md
201
+ ```
202
+
203
+ Use `fh-run` when a FH workflow references a Claude Code slash command or `Agent(...)` dispatch and the current orchestrator is Codex.
204
+
179
205
  ### Pattern 3 — Stop hook (automated post-session)
180
206
 
181
207
  Add to project's `.claude/settings.json`:
@@ -187,7 +213,7 @@ Add to project's `.claude/settings.json`:
187
213
  "matcher": "",
188
214
  "hooks": [{
189
215
  "type": "command",
190
- "command": "bash ~/projects/forge-harness/scripts/fh-gate.sh \"$(git diff main..HEAD --name-only | tr '\\n' ' ')\" quick auto >> /tmp/fh-governance-queue.txt"
216
+ "command": "FH_BACKEND=auto FH_TARGET_FILES=\"$(git diff main..HEAD --name-only)\" bash ~/projects/forge-harness/scripts/fh-gate.sh \"\" quick stop-hook >> /tmp/fh-governance-queue.txt"
191
217
  }]
192
218
  }]
193
219
  }
@@ -206,7 +232,7 @@ OpenCode generates code fast. FH governance runs after generation, before review
206
232
 
207
233
  ```bash
208
234
  # After opencode run completes:
209
- FH_TARGET_FILES=$(git diff main..HEAD --name-only | tr '\n' ' ')
235
+ FH_TARGET_FILES=$(git diff main..HEAD --name-only)
210
236
  FH_SECURITY_LENS=on # OpenCode touches broad surfaces; security lens default on
211
237
  FH_GATE_LEVEL=quick
212
238
  ```
@@ -257,51 +283,41 @@ jobs:
257
283
  - uses: actions/checkout@v4
258
284
  - name: FH governance gate
259
285
  run: |
260
- CHANGED=$(git diff origin/main..HEAD --name-only | tr '\n' ' ')
261
- bash scripts/fh-gate.sh "$CHANGED" quick ci
286
+ FH_TARGET_FILES="$(git diff origin/main..HEAD --name-only)" \
287
+ bash scripts/fh-gate.sh "" quick ci
262
288
  ```
263
289
 
264
290
  ---
265
291
 
266
292
  ## Record Specification
267
293
 
268
- Every governance pass writes a record entry:
294
+ Every binary governance pass writes a compact record entry for calibration and audit indexing. The complete findings block remains in stdout and should be captured by the caller or CI artifact when full detail is required.
269
295
 
270
296
  ```yaml
271
297
  # tracks/_meta/governance_log_YYYY-MM-DD.yaml
272
298
  - timestamp: 2026-05-31T12:00:00Z
273
299
  caller: opencode
300
+ backend: codex
301
+ model: gpt-5.5
274
302
  gate_level: quick
275
- target_files:
303
+ verdict: BLOCKED
304
+ findings_total: 3
305
+ findings_a: 2
306
+ findings_b: 1
307
+ files:
276
308
  - packages/opencode/src/permission/arity.ts
277
- verdict: PENDING
278
- findings:
279
- - grade: A
280
- location: "prefix() lines 1-9"
281
- title: "Short-token overflow"
282
- - grade: A
283
- location: "ARITY table lines 24-161"
284
- title: "npx/opencode/claude absent"
285
- - grade: B
286
- location: "ARITY table + generation comment"
287
- title: "No maintenance protocol"
288
- calibration:
289
- predicted_findings: 2
290
- actual_findings: 3
291
- delta: +1
292
309
  ```
293
310
 
294
- Record path is included in every verdict output as `FH_RECORD_PATH`. This feeds `harvest-loop` calibration.
311
+ Record path is included in every verdict output as `FH_RECORD_PATH`. This feeds `harvest-loop` calibration; full finding text should be retained from stdout when needed.
295
312
 
296
313
  ---
297
314
 
298
- ## What This Contract Does NOT Specify (Bridge Layer v1.0)
315
+ ## What This Contract Does NOT Specify (Bridge Layer)
299
316
 
300
- The following require the bridge layer and are out of scope for v0.1:
317
+ The following require a bridge/runtime layer beyond the file-based gate:
301
318
 
302
319
  | Feature | Why deferred |
303
320
  |---|---|
304
- | Binary / installable package | FH is methodology layer; no runtime distribution yet |
305
321
  | REST API or webhook | Would require a server process — FH is file-based |
306
322
  | Streaming verdict updates | Requires runtime; methodology layer is synchronous |
307
323
  | Multi-file parallel governance | Possible via agent dispatch today; not formalized here |
@@ -316,6 +332,9 @@ The bridge layer (v1.0) will implement these. This contract is the specification
316
332
  | Version | Date | Change |
317
333
  |---|---|---|
318
334
  | v0.1 | 2026-05-31 | Initial specification. Bash invocation patterns + structured verdict format. Empirical basis: arity.ts controlled trial. |
335
+ | v1.0 | 2026-06-01 | Binary available as `@chrono-meta/fh-gate` on npm. JS wrapper + fh-gate.sh CI-ready binary. |
336
+ | v1.1 | 2026-06-03 | Large-scale harness improvements. Banner update. Version alignment. |
337
+ | v1.2 | 2026-06-04 | Selectable Claude/Codex backend, `fh-run`/`fh-goal` runtime adapters, newline-preserving `FH_TARGET_FILES`, and implemented task/diff/security-lens inputs. |
319
338
 
320
339
  ---
321
340
 
@@ -323,6 +342,6 @@ The bridge layer (v1.0) will implement these. This contract is the specification
323
342
 
324
343
  - `fh_opencode_governance_wrapper.md` — step-by-step usage guide (less formal, more tutorial)
325
344
  - `fh_ecosystem_positioning.md` — ecosystem context + synergy map + v2 paper connection
326
- - `tracks/_meta/fh_opencode_governance_experiment_2026_05_31.md`empirical basis for verdict format
345
+ - `tracks/_meta/`governance logs written here on each gate run
327
346
  - `multi_model_sidecar_strategy.md` — multi-model orchestration (related pattern)
328
347
  - FH paper (Zenodo: 10.5281/zenodo.20397566) — harness-as-durable-layer thesis this contract operationalizes
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@chrono-meta/fh-gate",
3
- "version": "1.0.3",
4
- "description": "FH governance gateruns structured AI code review via claude --print and returns machine-parseable verdicts (PASS/PENDING/BLOCKED/ESCALATE).",
3
+ "version": "1.2.0",
4
+ "description": "FH runtime adaptersrun FH governance, skills, and agents via Claude or Codex with machine-parseable gates.",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "ai-governance",
8
8
  "code-review",
9
9
  "claude",
10
10
  "claude-code",
11
+ "codex",
12
+ "openai-codex",
11
13
  "ci",
12
14
  "harness"
13
15
  ],
@@ -16,25 +18,48 @@
16
18
  "url": "git+https://github.com/chrono-meta/forge-harness.git"
17
19
  },
18
20
  "bin": {
19
- "fh-gate": "bin/fh-gate.js"
21
+ "fh-gate": "bin/fh-gate.js",
22
+ "fh-run": "bin/fh-run.js",
23
+ "fh-goal": "bin/fh-goal.js"
20
24
  },
21
25
  "scripts": {
22
- "prepare": "chmod +x bin/fh-gate.js scripts/fh-gate.sh"
26
+ "prepare": "chmod +x bin/fh-gate.js bin/fh-run.js bin/fh-goal.js scripts/fh-gate.sh scripts/fh-run.sh scripts/fh-goal.sh"
23
27
  },
24
28
  "engines": {
25
29
  "node": ">=16"
26
30
  },
27
31
  "peerDependencies": {
28
- "@anthropic-ai/claude-code": "*"
32
+ "@anthropic-ai/claude-code": "*",
33
+ "@openai/codex": "*"
29
34
  },
30
35
  "peerDependenciesMeta": {
31
36
  "@anthropic-ai/claude-code": {
32
- "optional": false
37
+ "optional": true
38
+ },
39
+ "@openai/codex": {
40
+ "optional": true
33
41
  }
34
42
  },
35
43
  "files": [
44
+ ".claude/agents/challenger.md",
45
+ "AGENTS.md",
46
+ "CATALOG.md",
47
+ "CHEATSHEET.md",
48
+ "CLAUDE.md",
49
+ "CONTRIBUTING.md",
36
50
  "bin/fh-gate.js",
51
+ "bin/fh-run.js",
52
+ "bin/fh-goal.js",
53
+ "docs/banner.png",
54
+ "docs/codex-compat.md",
55
+ "docs/pillars.svg",
37
56
  "scripts/fh-gate.sh",
57
+ "scripts/fh-run.sh",
58
+ "scripts/fh-goal.sh",
59
+ "plugins/fh-meta/skills",
60
+ "plugins/fh-meta/agents",
61
+ "plugins/fh-commons/skills",
62
+ "plugins/fh-commons/agents",
38
63
  "knowledge/shared/harness-core/fh_integration_contract.md",
39
64
  "README.md"
40
65
  ]
@@ -0,0 +1,37 @@
1
+ # fh-commons — Contention-Born Skill Habitat
2
+
3
+ **A different layer of plugin from fh-meta.**
4
+
5
+ fh-meta = meta-engineering skills for operating, diagnosing, and improving the harness itself
6
+ fh-commons = general-purpose utility skills born from the contention layer, transplantable to any project
7
+
8
+ ## Placement Criteria
9
+
10
+ When the `contention-layer` skill harvests contentions and generates new skill candidates:
11
+
12
+ | Determination | Destination |
13
+ |---|---|
14
+ | Harness engineering in nature | `fh-meta` |
15
+ | Project-general · domain-agnostic | **`fh-commons`** (this plugin) |
16
+ | Domain/team specific | field harvest (decided by the field team) |
17
+
18
+ ## Skill List
19
+
20
+ | Skill | Description | Contention Parent |
21
+ |---|---|---|
22
+ | `convergence-loop` | General-purpose gate reinforcement that replaces single-pass structures with a convergence loop of up to N rounds | harvest-loop (recurring single-pass-distrust pattern across hub gates) |
23
+ | `deliberation` | Innovator → Devil-Advocate → Mediator 3-layer multi-perspective synthesis. Generates conditional verdicts without binary win/loss | Migrated from fh-meta (2026-05-23 — domain-agnostic general decision structure) |
24
+
25
+ ## The `origin` Field
26
+
27
+ Commons skills include the following fields in their SKILL.md frontmatter:
28
+
29
+ ```yaml
30
+ # Contention-born (extracted by contention-layer)
31
+ origin: contention-layer
32
+ contention-parents: [skill-A, skill-B]
33
+
34
+ # Migrated from fh-meta (reclassified as general-purpose)
35
+ origin: fh-meta
36
+ migration: "YYYY-MM-DD — reason for migration"
37
+ ```