@chrono-meta/fh-gate 1.4.40 → 1.4.42

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 (33) hide show
  1. package/AGENTS.md +2 -2
  2. package/CLAUDE.md +74 -131
  3. package/docs/CONTRIBUTING.md +2 -2
  4. package/knowledge/shared/dialogue/ai_dialogue_playbook.md +137 -0
  5. package/knowledge/shared/dialogue/claude_code_runtime_flow.md +170 -0
  6. package/knowledge/shared/dialogue/memory_intent_recall.md +209 -0
  7. package/knowledge/shared/harness-core/claude_md_gate_details.md +170 -0
  8. package/knowledge/shared/harness-core/companion_store_pluggable_cross_audit_2026-06-11.md +118 -0
  9. package/knowledge/shared/harness-core/crucible_mode.md +112 -0
  10. package/knowledge/shared/harness-core/deep_research_capability_ladder.md +122 -0
  11. package/knowledge/shared/harness-core/fh_detail_protocols.md +163 -0
  12. package/knowledge/shared/harness-core/fh_ecosystem_positioning.md +147 -0
  13. package/knowledge/shared/harness-core/fh_opencode_governance_wrapper.md +163 -0
  14. package/knowledge/shared/harness-core/fh_synergy_playbook.md +217 -0
  15. package/knowledge/shared/harness-core/gate_locality_principle.md +57 -0
  16. package/knowledge/shared/harness-core/goal_quench_anthropic_issue.md +104 -0
  17. package/knowledge/shared/harness-core/harness_6axis_framework.md +136 -0
  18. package/knowledge/shared/harness-core/harness_design_decision_lens.md +108 -0
  19. package/knowledge/shared/harness-core/harness_frontier_diagnosis_2026-06-02.md +102 -0
  20. package/knowledge/shared/harness-core/hub_compounding_loop.md +109 -0
  21. package/knowledge/shared/harness-core/hub_maturity_roadmap.md +201 -0
  22. package/knowledge/shared/harness-core/hybrid_orchestration_architecture_roadmap.md +196 -0
  23. package/knowledge/shared/harness-core/live_surface_automation_pattern.md +110 -0
  24. package/knowledge/shared/harness-core/measurement-integrity-checklist.md +54 -0
  25. package/knowledge/shared/harness-core/meta_harness_engineering_definition.md +116 -0
  26. package/knowledge/shared/harness-core/multi_model_sidecar_strategy.md +650 -0
  27. package/knowledge/shared/harness-core/persona_container_schema.md +172 -0
  28. package/knowledge/shared/harness-core/return_path_gate.md +120 -0
  29. package/knowledge/shared/harness-core/self_evolution_routine.md +268 -0
  30. package/knowledge/shared/harness-core/skill_quality_rubric.md +71 -0
  31. package/knowledge/shared/harness-core/tpa_schema.md +136 -0
  32. package/package.json +3 -2
  33. package/plugins/fh-meta/skills/context-doctor/SKILL.md +4 -0
package/AGENTS.md CHANGED
@@ -53,7 +53,7 @@ forge-harness is structured as two distinct layers:
53
53
  | Layer | Contents | AI compatibility |
54
54
  |---|---|---|
55
55
  | **Methodology layer** (model-agnostic) | `tracks/`, `knowledge/`, `SKILL.md` documents, session protocols | Any AI model |
56
- | **Automation layer** (Claude-native) | `.claude/agents/`, hooks, slash commands, `CLAUDE.md` rules | Claude Code only |
56
+ | **Automation layer** (Claude-native) | `plugins/*/agents/` (plugin channel — FH's own agents, auto-loaded when the plugin is enabled), hooks, slash commands, `CLAUDE.md` rules; `.claude/agents/` is the field-project local/override slot, unused by FH itself | Claude Code only |
57
57
 
58
58
  Agents in this registry belong to the **Automation layer**. Skills (in `plugins/`) straddle both layers — their methodology is model-agnostic, but their invocation mechanism is Claude Code-native.
59
59
 
@@ -100,7 +100,7 @@ For complex multi-step tasks, run `/agent-composer` first to plan which agents t
100
100
 
101
101
  ## Codex Compatibility (beta)
102
102
 
103
- The methodology layer (`tracks/`, `knowledge/`, `SKILL.md` docs) is Codex-compatible beta. Any AI model can follow skill workflows by reading SKILL.md files directly; the automation layer (hooks, `.claude/agents/`, `/model`) is Claude Code-native and requires manual adaptation.
103
+ The methodology layer (`tracks/`, `knowledge/`, `SKILL.md` docs) is Codex-compatible beta. Any AI model can follow skill workflows by reading SKILL.md files directly; the automation layer (hooks, plugin-channel agents under `plugins/*/agents/`, `/model`) is Claude Code-native and requires manual adaptation. FH's own agents are auto-loaded via the plugin channel when the plugin is enabled — `.claude/agents/` is the field-project override slot, not where FH ships its agents. Non-Claude runtimes use this `AGENTS.md`, `plugins/*/agents/*.md`, and `scripts/fh-run.sh` to apply the same methodology via adapter.
104
104
 
105
105
  ### Entry point for Codex users
106
106
 
package/CLAUDE.md CHANGED
@@ -160,19 +160,14 @@ All 6 items below must pass before committing a new SKILL.md. If any fails, fix
160
160
 
161
161
  Skills without a Done When definition automatically qualify as harness-doctor L2 M-tier.
162
162
  Check-class declaration applies to **new** skills; existing skills backfill opportunistically
163
- (when next edited), not retroactively. **Trigger-accuracy probe backfill** follows the same
164
- opportunistic rule but scoped to **routing/gate skills only**: when an existing router/gate skill is
165
- edited (especially when its trigger phrases change), run steel-quench `Step 0.5 — Trigger-Accuracy
166
- Probe` on the changed trigger surface and record the fire-count turning "do these triggers collide?"
167
- from a guess into a number. Not a retroactive sweep of all routers (that would be decorative
168
- over-work); it rides the edit that touches the router. **One-time baseline floor** (closes the
169
- never-edited-router gap a stable router accumulates the most un-probed traffic): existing
170
- routing/gate skills get **one** baseline Step-0.5 probe at the next `harness-doctor` run (the 30-day
171
- cadence already enumerates skills), then opportunistic-on-edit thereafter — a single baseline pass,
172
- not a recurring sweep. **"routing/gate skill" (mechanical test)**: a skill whose *primary output is a
173
- dispatch decision or a pass/block verdict* — e.g. `agent-composer`, `goal-quench`, `asset-placement-gate`,
174
- `return-path-gate`, `phantom-quench` — NOT a skill that merely calls others as sub-steps (e.g.
175
- `harvest-loop`).
163
+ (when next edited), not retroactively. **Obligation (always-loaded):** a **routing/gate skill** (primary
164
+ output = a dispatch decision or pass/block verdict) owes a **one-time `Step 0.5` baseline trigger-probe**
165
+ at the next `harness-doctor` run **and a re-probe whenever its trigger phrases change** not optional for
166
+ that skill class, and not a retroactive sweep of all routers.
167
+
168
+ > **Detail**: See `knowledge/shared/harness-core/claude_md_gate_details.md §New-Skill-Backfill` the
169
+ > probe mechanics (fire-count procedure), the baseline-floor rationale, and the mechanical "routing/gate
170
+ > skill" test read when editing a router/gate skill.
176
171
 
177
172
  ---
178
173
 
@@ -188,21 +183,14 @@ No user request is needed — this is a mandatory autonomous step, not a proposa
188
183
  FH asset modified → Axis 1 (regression_guard.sh --pr {BRANCH})
189
184
  → Axis 2 (/steel-quench) → Axis 3 (/phantom-quench)
190
185
  → marker: tracks/_meta/.axes_23_passed_{branch}_{date}.marker
191
- (structured — required fields: axis2-engine / axis2-model / floor-status / axis2-evidence;
192
- hook validates mechanically: below-floor blocks without below-floor-ack, and
193
- axis2-evidence must be non-vacuous — a recorded verdict/count, not "it ran". Honest
194
- scope: form + non-vacuity + auditability, NOT provenance — a fabricated marker is the
195
- weekly audit's + operator's residual by design, judge-robustness swarm 2026-06-13.
196
- The below-floor-ack rubber-stamp is **structurally IRREDUCIBLE for an autonomous runner**: the
197
- runner writes both the marker AND any transcript the hook could cross-check, so any in-boundary
198
- check it can satisfy it can also forge (a runner-computed signature is false security). The one
199
- genuine close needs a secret the runner does NOT hold — an **operator-present hard-close**: a
200
- GPG-signed trailer **whose key requires a fresh interactive passphrase** (NOT an agent-cached
201
- gpg-agent key, and NOT operator-git-identity alone — `user.email` is config the runner already
202
- writes, forgeable, not a secret). The real guarantee is *uncached private-key access*, not commit
203
- identity; optional, breaks full autonomy, use only when the operator is at the keyboard. Autonomous mode keeps the honest
204
- residual + weekly-audit backstop — do NOT fake-close it. Gemini cross-analysis 2026-06-16 reached
205
- this verdict independently, converging with the existing FH stance)
186
+ (required fields: axis2-engine / axis2-model / floor-status / axis2-evidence;
187
+ hook validates mechanically: below-floor blocks without below-floor-ack, and axis2-evidence
188
+ must be non-vacuous — a recorded verdict/count, not "it ran". Marker scope is form +
189
+ non-vacuity + auditability, NOT provenance — a fabricated marker is the weekly-audit + operator
190
+ residual by design, do NOT fake-close it.
191
+ **Detail**: See `knowledge/shared/harness-core/claude_md_gate_details.md §Marker-Irreducibility`
192
+ why the below-floor-ack is structurally irreducible for an autonomous runner + the
193
+ operator-present GPG hard-close option read when auditing or attempting to harden the marker.)
206
194
  → Axis 4 (/edit-manifest RECORD, today's entry in edit_manifest.yaml)
207
195
  → All 4 PASS → git commit allowed | Any FAIL → fix inline, re-run
208
196
  ```
@@ -236,32 +224,29 @@ path, exempt)? For salience-dependent changes, verify with a **blind simulation
236
224
  only at opus-tier or above. A below-floor orchestrator does not silently skip: it runs the sim or asks
237
225
  the operator (one line), mirroring §Floor governance.
238
226
 
239
- If `model:`-pinned dispatch is unavailable (plan/billing gate), fall back to a cross-session headless
240
- run (`claude -p "<trigger>" --model <tier>` in the target cwd) — stronger isolation, zero instruction
241
- contamination. **Saturation disguise (N=2, 2026-06-11/12)**: the same "Usage credits required for 1M
242
- context" error also fires when the *session* is near context saturation, not the plan gate — in a
243
- long-running session, compact (flush handoff state to disk first) and retry the dispatch once before
244
- concluding the gate is closed (identical opus-pinned dispatch failed pre-compaction, succeeded
245
- post-compaction 2026-06-12). 2026-06-15+: headless `claude -p` draws from the hard-capped credit pool, not the
246
- subscription prefer in-session Agent dispatch when the plan gate allows; take the headless fallback
247
- knowingly. Record sim results in the Axes 2–3 marker + sub-agent invocation log.
248
-
249
- **Floor-tier canary (optional pre-screen token-free, *below* the Sonnet sim)**: a local model weaker
250
- than or comparable to Sonnet (e.g. `ollama run qwen3:8b` on the local host today; a cross-family local
251
- panel qwen3.x:27b / gemma4:12b-qat / gpt-oss:20b / devstral — on a GPU host once its remote-exec path
252
- is live) can pre-screen a salience-dependent edit *before* the Sonnet dispatch is spent: a rule that
253
- fires correctly on the floor model is *evidence of* robustness below Sonnet (one floor sample, not proof
254
- hold the asymmetric-skepticism discipline). Blind probe feed the verbatim rule text + a scenario,
255
- demand a strict YES/NO + one-line reason, judge whether the rule fired (mechanism dogfood-verified
256
- 2026-06-20: a local `qwen3:8b` correctly gated the public install-wizard local-LLM-offload item in both
257
- directions a claim checkable against that skill — re-validating that day's salience-binding fix at a
258
- sub-Sonnet tier). **Canary, NOT gate**: a PASS adds cheap floor confidence and you still run the Sonnet
259
- sim; a FAIL never blocks alone — the opus orchestrator triages it as a *real salience gap* (fix the
260
- rule) vs a *floor-model quirk* (small-model loop/hallucination, per the public "Local AI is not Opus"
261
- finding + the cheap-oracle ceilinga small model adds nothing where one grep already settles the
262
- check). The terminal verdict stays with the frontier (Sonnet sim + opus judge) — no judge-only path, no
263
- weak-local-judge regression of the judge-robustness principle (mechanical anchor over judge-only verdict).
264
- The cross-family-panel upgrade spec lives in the private companion store's `handoff/` design note.
227
+ Record sim results in the Axes 2–3 marker + sub-agent invocation log.
228
+
229
+ > **Detail**: See `knowledge/shared/harness-core/claude_md_gate_details.md §Sim-Dispatch-Fallback` the
230
+ > headless `claude -p --model` fallback when in-session model-pin is unavailable, the saturation-disguise
231
+ > retry (compact-then-retry once), and the credit-pool caveat read when a model-pinned dispatch fails.
232
+
233
+ **Measurement-integrity pre-flight** (when the sim/dispatch is a *cross-model measurement* pinned to
234
+ a specific tier, comparing model behaviors, or feeding a paper/published claim): consult
235
+ `knowledge/shared/harness-core/measurement-integrity-checklist.md` first pin the **display name** not
236
+ a slug (silent fallback to a weaker model is a measured failure), take **reps ≥ 3** on any
237
+ borderline/contested verdict (single draw = noise), and use a **discriminating** identity probe (a
238
+ generic "OK" proves nothing about which model answered). The instrument must be verified before the
239
+ measurement is trusted.
240
+
241
+ **Floor-tier canary (optional pre-screen token-free, *below* the Sonnet sim)**: a local model ≤ Sonnet
242
+ can blind-pre-screen a salience-dependent edit *before* the Sonnet dispatch is spent. **Canary, NOT gate**:
243
+ a PASS adds cheap floor confidence and you still run the Sonnet sim; a FAIL never blocks alone. The terminal
244
+ verdict stays with the frontier (Sonnet sim + opus judge) — **no judge-only path**, no weak-local-judge
245
+ regression of the judge-robustness principle (mechanical anchor over judge-only verdict).
246
+
247
+ > **Detail**: See `knowledge/shared/harness-core/claude_md_gate_details.md §Floor-Tier-Canary` — the local
248
+ > model/panel options, the blind-probe procedure, dogfood evidence, and the FAIL-triage (real salience gap
249
+ > vs floor-model quirk)read when running a floor canary.
265
250
 
266
251
  **Axis ownership** (each skill is already complete — orchestrator only coordinates):
267
252
 
@@ -317,32 +302,18 @@ not marketplace-gate alone:
317
302
  `LICENSE`/`README` contains a **private harness name or internal codename** · **module paths encode
318
303
  internal acronyms**.
319
304
 
320
- **Hook coverage — two distinct actions (refined 2026-06-17)**:
321
- - **(a) repo-go-public** (`gh repo create --public` / a visibility flip) is irreversible and usually in a
322
- **separate repo** — the FH pre-commit hook **cannot** catch it. That stays **AI-behavioral** (proactive
323
- trigger below) **+ a portable checklist** (`templates/PRE-PUBLISH-CHECKLIST.md`), run on any repo/machine.
324
- - **(b) committing operator-private tokens into public-tracked content of THIS repo IS an effective
325
- publish of that content** and that the pre-commit hook **now catches mechanically**: a
326
- **confidentiality scan** of staged tracked *added* lines against the gitignored
327
- `.public-surface-patterns` (companion-store names · corp-context framing · home paths · company assets),
328
- blocking HIGH/MED + non-allowlisted LOW drift; `PUBLIC_SURFACE_OK=1` overrides for a deliberate reviewed
329
- mention. **Two-layer** (mirrors `/public-surface-audit`): the literal tokens live ONLY in the gitignored
330
- source CLAUDE.md and the hook name **only categories**, never the literals (they would leak what they
331
- guard). This closes the gap where the prose publish-trigger was **missed on a weaker-tier session**
332
- (PR #109: a companion-store name + corp-context framing reached a public PR; the Sonnet session trusted a
333
- PR comment over the file content). The scan fires at commit time and is **tier-independent — but only as
334
- strong as the loaded patterns**: a COMMITTED `.public-surface-patterns.defaults` (universal patterns:
335
- home paths) keeps it from ever being fully blind, while the company-specific literals require the
336
- GITIGNORED override to be populated in each authoring env (esp. the company env, where company-origin
337
- public PRs are written; absent override → only defaults run, with a loud warning). **Honest scope**:
338
- plaintext only (encoded tokens out of scope); a line-split backstop catches a token wrapped across
339
- lines; `PUBLIC_SURFACE_OK=1` overrides and is logged to a gitignored audit trail for the weekly audit.
340
- Residuals (split-encoding, override-not-populated, override abuse) are documented, not silent.
341
-
342
- > Origin: 2026-06-05 `phantom-gate` shipped public, then needed a private→de-company-scrub→re-public
343
- > round-trip (`fh_signal_2026-06-05_fh-direct`). PSA existed but nothing forced it pre-publish. 2026-06-17
344
- > (PR #109): the commit-time half (b) became a mechanical hook after a weaker-tier session leaked a
345
- > companion-store name onto a public PR (`fh_signal_2026-06-17` Wave 4).
305
+ **Hook coverage — two distinct actions**: **(a) repo-go-public** (`gh repo create --public` / visibility
306
+ flip) is irreversible and usually in a **separate repo** the pre-commit hook **cannot** catch it, so it
307
+ stays **AI-behavioral** (proactive trigger below) **+ a portable checklist** (`templates/PRE-PUBLISH-CHECKLIST.md`).
308
+ **(b) committing operator-private tokens into public-tracked content of THIS repo IS an effective publish** —
309
+ caught mechanically by the pre-commit **confidentiality scan** (staged added lines vs the gitignored
310
+ `.public-surface-patterns`; HIGH/MED block, `PUBLIC_SURFACE_OK=1` overrides + logs). Tier-independent but
311
+ **only as strong as the loaded patterns** (committed `.defaults` keep it non-blind; company literals need
312
+ the gitignored override populated per env).
313
+
314
+ > **Detail**: See `knowledge/shared/harness-core/claude_md_gate_details.md §Pre-Publish-Hook-Coverage` the
315
+ > two-layer pattern (literals only in the gitignored source), honest scope + residuals, and the PR #109
316
+ > (`fh_signal_2026-06-17` Wave 4) / phantom-gate origin read when configuring or auditing the scan.
346
317
 
347
318
  ---
348
319
 
@@ -455,6 +426,8 @@ Self-healing is not only FH-self-dev (Mode D 4-axis) and reactive (`verify-bidir
455
426
 
456
427
  ## Agent Dispatch Operation (FH cwd-Based)
457
428
 
429
+ > **Runtime authority (canonical):** one explicit governor per context + capability-routed sidecars; sidecar findings are evidence candidates, not terminal verdicts, until source-closed by the governor *via a mechanical anchor* — never governor agreement alone. CC=action/governor · Codex=repo-grounded audit sidecar · Gemini/agy=breadth/multimodal sidecar · other runtimes=portable `AGENTS.md` entrypoint only. Full doctrine + Maintenance-Cost Rule: `knowledge/shared/harness-core/multi_model_sidecar_strategy.md §Runtime Authority`.
430
+
458
431
  Default operation is a **standard interactive session**. Agent dispatch (single or parallel) is used when the task warrants it — not as a default mode. Three execution paths:
459
432
 
460
433
  | Path | Situation | Method |
@@ -540,63 +513,33 @@ harvest-loop Step 0-b uses this file as its source — relying on LLM memory aft
540
513
  Closing phrase detected ("wrap up", "done", "good work", "end session", etc.)
541
514
  → ① Check git diff + unpushed commits (status snapshot)
542
515
  → ①-b Open-PR sweep — `gh pr list --author @me --state open` (+ `gh search prs --author @me
543
- --state open` for cross-repo). Classify, **surface-not-auto**: a **self-mergeable** PR
544
- (operator's own repo, checks green) → *propose merge now* (never auto-merge — HITL); an
545
- **awaiting-external** PR (other repos / corp review)*surface for tracking only*. Why here:
546
- the harness's "마감" ≠ the operator's "마감" — a self-authored PR (PR #111) sat open across
547
- sessions with un-integrated skills + count drift because no close step surfaced it. Pairs with
548
- the count-consistency check (which now runs at BOTH the local pre-commit hook AND the plugins/**
549
- PR-CI merge boundary): the sweep surfaces the PR → merging it → the count-check catches any
550
- drift at the merge (fh_signal_2026-06-21, gate-locality paired fix).
516
+ --state open` cross-repo). Classify, **surface-not-auto**: **self-mergeable** PR (own repo,
517
+ checks green) → *propose merge now* (never auto-merge — HITL); **awaiting-external** →
518
+ *surface for tracking only*. (Origin PR#111 + count-consistency pairing§detail below.)
551
519
  → ② If FH assets changed: harvest-loop
552
520
  → ③ Sync local/gitignored session state to your durable companion store, if you keep one
553
521
  → ④ Memory hygiene — update stale entries + record new session findings
554
- → ④-b npm freshness — if any npm-shipped asset changed this session (the `package.json` `files[]`
555
- surface: skills · agents · README · AGENTS.md · CLAUDE.md · CHEATSHEET), **propose an npm
556
- republish**: version bump and the **same bump MUST propagate in lockstep to every
557
- `.claude-plugin/plugin.json` + `.claude-plugin/marketplace.json` version** (single-source =
558
- `package.json`). The Codex plugin loader keys its cache path on the *plugin.json* version
559
- (`~/.codex/plugins/cache/forge-harness/{plugin}/{version}/`), so a frozen plugin.json serves
560
- **stale cached skills to Codex/AGENTS.md users** even after content ships (this exact 3-way
561
- drift fh-meta 1.4.1/1.4.11 vs npm 1.4.32 was found + fixed 2026-06-17). Then Pre-Publish
562
- Surface Gate (`/public-surface-audit` + `/marketplace-gate`
563
- Check 5) + `npm publish` + **`git tag vX.Y.Z` on the bump commit + `git push origin vX.Y.Z`**
564
- (tag at publish time, in lockstep with the version keeps git tags aligned with npmjs.com so
565
- Releases/Tags never drift). The npm-served README and shipped skills/agents freeze at publish
566
- time, so updating FH assets without republishing leaves the package stale. **Propose, don't
567
- auto-publish.** Tag drift caveat: when a bump rides inside a functional commit (no explicit
568
- "bump" commit), tag *that* commit — otherwise the version ships to npm untagged (e.g. 1.4.4/1.4.5
569
- shipped untagged, backfilled 2026-06-08).
570
- → ④-c Handoff lifecycle (durable-artifact reconciliation — cross-machine continuity) — when a
571
- durable **result artifact lands** this session, reconcile the *pointer* artifacts so a fresh
572
- machine doesn't re-read pre-run state. **Trigger (mechanical hint, not pure judgment)**: a new
573
- file matching a result/signal pattern (`*result*` · `*signal*` · `*_run_*`) written to your
574
- companion store or `tracks/` this session — when unsure, diff `git status` + companion-store
575
- mtime against session start. On a hit, do two things:
576
- **(a) Stamp the run-handoff (④-c owns this write)** — any `"run this / start here"` run-handoff
577
- whose result has now landed gets a header `STATUS: SUPERSEDED by <repo-relative-or-companion
578
- path> (<date>)` (path resolvable from a fresh checkout; or retire the file). Not a
579
- Destructive-Op — a one-line header edit, no deletion.
580
- **(b) Flag the matching card carry item as resolved** — note it for ⑤ to act on. ⑤ **owns the
581
- card write** (card-last guard): a finished run must not survive as a pending *carry/priority*
582
- item — ⑤ removes it from the active carry list (recording it under "done this session" if the
583
- card keeps a done log). ④-c does **not** edit the card itself (avoids a double-write / a
584
- flip-vs-remove conflict with ⑤'s removal obligation) — it surfaces the resolution so ⑤ closes it.
585
- **First-run no-op**: if no matching carry item or handoff exists, ④-c records nothing and
586
- creates no artifact to supersede.
587
- **Why its own step**: cross-machine continuity works only when *durable* artifacts are current —
588
- the session that ran the work holds completion as **live context**, but a fresh machine inherits
589
- only the durable card + handoff, never that live context (origin: 2026-06-21 — a Windows session
590
- re-entered a finished A6 run as "to run" because the Mac session that ran it never retired the
591
- NEXT_ACTION handoff / flagged the carry item; live context didn't transfer, the stale artifacts
592
- did). The reader-side half — read *result* files at session start, not only handoffs — lives in
593
- `modes_and_value.md` §Session-start freshness + each operator's local session-start binding.
594
- **Salience-dependent** — prose, not hook-enforced; on a weaker tier may silently not fire.
595
- Backstops: ⑤'s removal obligation + the reader-side result-file read. A hook-enforced writer-side
596
- is a future hardening candidate, not built today (keep the surface thin).
522
+ → ④-b npm freshness — if any npm-shipped asset changed (`package.json` `files[]`: skills · agents ·
523
+ README · AGENTS.md · CLAUDE.md · CHEATSHEET), **propose republish**: version bump **in lockstep**
524
+ across `package.json` + every `.claude-plugin/plugin.json` + `marketplace.json` (single-source =
525
+ `package.json`) Pre-Publish gate → `npm publish` → `git tag vX.Y.Z` at publish. **Propose, don't
526
+ auto-publish.** (Why lockstep — Codex caches on plugin.json version + tag-drift caveat §detail below.)
527
+ → ④-c Handoff lifecycle (cross-machine continuity) when a durable **result artifact lands** this
528
+ session (mechanical hint: a new `*result*`/`*signal*`/`*_run_*` file in your companion store or
529
+ `tracks/`), do two things: **(a) ④-c stamps** any `"run this/start here"` run-handoff whose
530
+ result landed with `STATUS: SUPERSEDED by <path> (<date>)` (one-line edit, not a Destructive-Op);
531
+ **(b) flag the matching card carry item resolved for ⑤** owns the card write (card-last
532
+ guard), ④-c never edits the card. **First-run no-op** if no matching handoff/carry exists.
533
+ (Why-its-own-step origin + ownership split + salience/backstops §detail below.)
597
534
  → ⑤ Card update ← ABSOLUTE LAST: must capture ①–④-c outcomes
598
535
  → ⑥ Commit card + push
599
536
  ```
537
+
538
+ > **Detail**: See `knowledge/shared/harness-core/claude_md_gate_details.md` — `§Session-Close-npm-Freshness`
539
+ > (④-b: Codex cache-path drift, the 3-way drift example, tag-drift caveat) · `§Session-Close-Handoff-Lifecycle`
540
+ > (④-c: why-its-own-step origin, ownership split, salience/backstops) · `§Open-PR-Sweep-Origin` (①-b) — read
541
+ > when executing that close step.
542
+
600
543
  **Card-last guard**: ①–④-c (incl. ①-b open-PR sweep, ④-c handoff lifecycle) must ALL complete before
601
544
  ⑤ runs. Any new information produced during ①–④ (new commits from a merged self-PR, model changes,
602
545
  new findings, a carry item flipped to DONE) feeds INTO ⑤ — card is never written mid-sequence and
@@ -8,7 +8,7 @@ If you'd like to make forge-harness better, pull requests are welcome.
8
8
  |---|---|
9
9
  | **New skill** | You've discovered a repeating pattern and want to turn it into a skill |
10
10
  | **Improve existing skill** | Bug fix, external environment adaptation, adding triggers |
11
- | **Add agent** | New persona (`.claude/agents/` or `plugins/.../agents/`) |
11
+ | **Add agent** | New persona (canonical: `plugins/*/agents/`; `.claude/agents/` only for project-local override) |
12
12
  | **Templates** | Common files to add under `templates/` |
13
13
  | **Documentation** | README, skill description refinement, typo fixes |
14
14
  | **Field pattern harvest** | Proposing a pattern discovered in real use as a skill (see `/field-harvest`) |
@@ -43,7 +43,7 @@ into shared knowledge/skills — your session becomes compound interest for ever
43
43
  ## PR Rules (Short Version)
44
44
 
45
45
  1. **New skill** → Create `plugins/fh-meta/skills/{name}/SKILL.md` + add version line to `plugins/fh-meta/CHANGELOG.md`
46
- 2. **New agent** → Register in both `.claude/agents/{name}.md` + `plugins/fh-meta/agents/{name}.md`
46
+ 2. **New agent** → Register the canonical file under `plugins/fh-meta/agents/{name}.md` (or `plugins/fh-commons/agents/{name}.md` for commons), then update `AGENTS.md` + `.claude/registry/agent_cards.json`. Use `.claude/agents/{name}.md` only for project-local / non-plugin override agents.
47
47
  3. **Description must be plain text** — no markdown bold, emphasis words, version mentions, or embedded names (removes self-marketing tone)
48
48
  4. **Simplification guard** — verify that existing assets cannot cover the use case before creating something new
49
49
  5. **External environment adaptation section** — recommend explicitly noting `Mode A/C` branches in skills and agents
@@ -0,0 +1,137 @@
1
+ # AI Dialogue Playbook
2
+
3
+ > Dialogue principles for forge-harness sessions — the "should" layer. Governs how to ask, delegate, and record when working with Claude Code.
4
+
5
+ **Companion**: `claude_code_runtime_flow.md` is the "does" layer — what actually happens chronologically in a session.
6
+
7
+ **Voice**: the Control Tower's tone — soft charisma, delivery-layer-only — is defined once in `CLAUDE.md §Voice / Tone` (single source). Warm in word-choice, not length; tone never relaxes judgment rigor (orthogonality guard).
8
+
9
+ ---
10
+
11
+ ## Session Start Protocol
12
+
13
+ 1. **Greet or signal intent** → FH Active Onboarding triggers (see CLAUDE.md)
14
+ 2. **AI reads automatically**: `reference_next_session_starter.md`, CATALOG.md, LOCAL_SKILL_REGISTRY
15
+ 3. **Returning user**: AI proposes top 3 priorities from session card + cadence overdue notices
16
+ 4. **New user**: 2-sentence FH intro → project connect offer
17
+
18
+ **Don't front-load**: avoid dumping context manually. FH auto-reads the right files. Start with intent, not background.
19
+
20
+ ---
21
+
22
+ ## Token Efficiency Principles
23
+
24
+ | Principle | Implementation |
25
+ |---|---|
26
+ | **CATALOG first** | Read CATALOG.md → identify candidate files → open only those files. Never scan session files sequentially. |
27
+ | **Execution tier** | Match tier to task scope (see CLAUDE.md Execution Tier table). FH default: standard (~15K tokens). |
28
+ | **`.claudeignore`** | Apply `templates/.claudeignore` to project to exclude build artifacts, test fixtures, binaries from context. |
29
+ | **`/context-doctor`** | Propose when: "context is getting long", "token limit", "/clear", "slow". Auto-generates `.claudeignore`. |
30
+ | **Agent dispatch** | Use sub-agents to protect main context from excessive tool output. |
31
+ | **Two-layer storage** | `tracks/` = local work history. Critical cross-session state → also write to `memory/` (durable). |
32
+
33
+ ---
34
+
35
+ ## Rule Hierarchy (Scope Precedence)
36
+
37
+ ```
38
+ Hub CLAUDE.md (hub common principles) — highest
39
+ └── Project CLAUDE.md
40
+ └── Domain .claude/rules/session.md — lowest
41
+ ```
42
+
43
+ Lower levels cannot override higher. Conflicts → higher scope wins.
44
+
45
+ **AI contribution model**: AI proposes (drafts all changes, prepares commits, creates PR draft) — user approves final push/PR. Human-in-the-loop is non-negotiable for shared repos.
46
+
47
+ ---
48
+
49
+ ## Amplifier / Coach Dual Mode
50
+
51
+ The AI operates in two modes simultaneously:
52
+
53
+ | Mode | When | Behavior |
54
+ |---|---|---|
55
+ | **Amplifier** | User has a clear intent and task | Execute with minimal friction. Don't block, don't ask for confirmation beyond once. |
56
+ | **Coach** | User is exploring, unsure, or new to FH | 2-sentence explanations, skill proposals, one-line options. Don't overwhelm. |
57
+
58
+ **Signal detection**:
59
+ - Explicit task ("debug this") → Amplifier
60
+ - Greeting, "what can you do", "how should I" → Coach intro, then Amplifier
61
+ - Friction in session → note as FH signal, continue as Amplifier
62
+
63
+ ---
64
+
65
+ ## Advanced Patterns (2026-06-17 추가)
66
+
67
+ ### Multi-Model Ensemble (rotating-adjudicator)
68
+ 단일 LLM 반복 → 같은 오류 반복 문제 해결. 서로 다른 모델 병렬 호출 + 투표 전략 (majority/plurality/unanimous/weighted). A 모델 오류 → B 모델 catch.
69
+
70
+ ### REST API 우회 Push (restricted-network git block 대응)
71
+ 네트워크-제한 환경(corp/restricted)에서 `git push`가 차단될 때 GitHub REST API Git Database 직접 조작 (5-step: Blob → Tree → Commit → Ref → PR). 네트워크 제약 우회 + 외부 공개 리포 기여 가능. (상세 5-step 절차는 비공개 companion store의 핸드오프 노트에 정리.)
72
+
73
+ ### API 키 영속화 (gitignore + .env 패턴)
74
+ API 키 대화창 기록 방지 — Write 툴로 `.env` 직접 생성 (대화창 기록 없이). `.gitignore` 확인 + `git add -A` 전 `git reset HEAD .env` (accidentally staged 시). Credential leakage 방지 + 영속화.
75
+
76
+ ### 네트워크-제한 환경 컨텍스트 복구 패턴
77
+ 외부 환경 → 네트워크-제한(corp) 환경 전환 시 그 환경의 구조 기억 필요. 핸드오프 파일에 "환경 메모" 카드 포함 (그 환경의 Git 구조 · API 엔드포인트 · 도구 구조). 환경 전환 시 컨텍스트 손실 0, 외부에서 `git pull` 후 1개 파일 읽으면 즉시 복구.
78
+
79
+ ---
80
+
81
+ ## Delegation Principles
82
+
83
+ **When to use Agent dispatch** (not direct tools):
84
+ - Task requires work in a different project's cwd
85
+ - Task is broad enough to pollute main context with tool output
86
+ - 2+ independent tasks → parallel dispatch without asking
87
+
88
+ **Forbidden response**: "I can't do that — I'm not in that project's cwd." Always check if Agent dispatch covers it first.
89
+
90
+ **Context Card** (required for non-trivial dispatch):
91
+ ```
92
+ [Session Context Card]
93
+ Purpose: {why}
94
+ Completed: {what's already done}
95
+ This agent's task: {specific target}
96
+ Note: {constraints the agent must know}
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Recording Principles
102
+
103
+ **What to record** (session end / knowledge push):
104
+ - New pattern or rule discovered ✅
105
+ - Architecture decision ✅
106
+ - Lessons from failures ✅
107
+ - Roadmap / strategy change ✅
108
+
109
+ **What NOT to record**:
110
+ - 1-line bug fix ❌
111
+ - Routine test run ❌
112
+ - Already-recorded content ❌
113
+ - Session with only exploration, no conclusion ❌
114
+
115
+ **Format**: `tracks/{project}/session_YYYY_MM_DD_{slug}.md` with YAML frontmatter. See `sync_push_protocols.md`.
116
+
117
+ ---
118
+
119
+ ## Counter-Argument Protocol
120
+
121
+ When the user pushes back on an AI recommendation ("is that right?", "something seems off"):
122
+
123
+ 1. Treat the counter-argument as a **data point**, not a challenge
124
+ 2. Re-examine the reasoning independently
125
+ 3. If the counter-argument is valid → update the baseline, record in `verify-bidirectional`
126
+ 4. If the original recommendation holds → explain why with evidence, not assertion
127
+
128
+ Skill: `/verify-bidirectional`
129
+
130
+ ---
131
+
132
+ ## Related
133
+
134
+ - `claude_code_runtime_flow.md` — What actually happens (the "does" layer)
135
+ - `harness_6axis_framework.md` — The 6-axis framework (Axes 2 and 3 govern context/plan)
136
+ - `.claude/rules/sync_push_protocols.md` — Recording procedure
137
+ - `CHEATSHEET.md` — Command reference
@@ -0,0 +1,170 @@
1
+ # Claude Code Runtime Flow
2
+
3
+ > What actually happens chronologically during a forge-harness session — the "does" layer. Companion to `ai_dialogue_playbook.md` (the "should" layer).
4
+
5
+ ---
6
+
7
+ ## Session Lifecycle (Chronological)
8
+
9
+ ```
10
+ 1. User opens session in forge-harness cwd
11
+
12
+
13
+ 2. CLAUDE.md loaded → Control Tower mode activated
14
+
15
+
16
+ 3. Session-start auto-read (Active Onboarding Protocol)
17
+ ├── CLAUDE.md (already loaded)
18
+ ├── CATALOG.md
19
+ ├── tracks/_meta/reference_next_session_starter.md (if exists)
20
+ └── LOCAL_SKILL_REGISTRY.md (if fresh — <7 days)
21
+
22
+
23
+ 4. Cadence checks (automatic)
24
+ ├── frontier_digest_*.md → if 7+ days → propose /frontier-digest
25
+ └── *harness_doctor*.md → if 30+ days → propose /harness-doctor
26
+
27
+
28
+ 5. User gives first utterance → Onboarding branch decision
29
+ ├── Greeting / session-start → Active Onboarding (5-skill cascade)
30
+ ├── Explicit task → skip onboarding, enter task directly
31
+ └── Exploratory → 2-sentence intro + What would you like to work on?
32
+
33
+
34
+ 6. Task execution loop
35
+ ├── Simple known-file edit → Read/Edit with absolute path (no cwd switch)
36
+ ├── Field project task → Context Card → Agent dispatch
37
+ └── 2+ independent tasks → Parallel Agent dispatch (no asking)
38
+
39
+
40
+ 7. Real-time tracking
41
+ ├── S-tier/A-tier completed → append to tracks/_meta/fh_completed_{date}.md immediately
42
+ └── FH asset modified → 4-axis auto-gate runs (see harness_6axis_framework.md)
43
+
44
+
45
+ 8. Closing phrase detected ("wrap up", "done", "good work", "end session")
46
+ ├── ① git diff check
47
+ ├── ② if diff → harvest-loop
48
+ ├── ③ card update (reference_next_session_starter.md) — mandatory, independent
49
+ └── ④ unpushed commits → propose "push?"
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Sub-Agent Delegation Flowchart
55
+
56
+ ```
57
+ Main session receives task
58
+
59
+ ├── Can I do this directly with Read/Edit?
60
+ │ (known path, simple change, no cwd switch needed)
61
+ │ YES → do it directly
62
+ │ NO → ↓
63
+
64
+ ├── Is it a field project task?
65
+ │ YES → inject Context Card → Agent dispatch (absolute path)
66
+ │ NO → ↓
67
+
68
+ ├── Are there 2+ independent sub-tasks?
69
+ │ YES → Parallel Agent dispatch (single message, multiple tool calls)
70
+ │ NO → Single Agent dispatch
71
+
72
+ └── Does the task need a FH skill from another project?
73
+ → Check LOCAL_SKILL_REGISTRY → propose + dispatch
74
+ ```
75
+
76
+ **Forbidden**: "I can't do that — I'm not in that project's cwd."
77
+ Self-check Agent dispatch first.
78
+
79
+ ---
80
+
81
+ ## FH 4-Axis Auto-Gate (Runtime Detail)
82
+
83
+ Triggered automatically when any FH asset is modified:
84
+
85
+ ```
86
+ FH asset modified (SKILL.md / rules / templates / CLAUDE.md / substantive knowledge/)
87
+
88
+
89
+ Axis 1 — Backward: bash templates/regression_guard.sh --pr {BRANCH}
90
+ │ (git pre-commit hook runs this directly)
91
+
92
+ Axis 2 — Adversarial: /steel-quench
93
+
94
+
95
+ Axis 3 — Forward: /phantom-quench
96
+
97
+ ← After Axes 2+3 both PASS:
98
+ AI creates structured marker: tracks/_meta/.axes_23_passed_{branch}_{date}.marker
99
+ (required fields: axis2-engine / axis2-model / floor-status — the hook
100
+ validates them; below-floor blocks without an operator below-floor-ack)
101
+
102
+ Axis 4 — Record: /edit-manifest RECORD (or manual append to edit_manifest.yaml)
103
+
104
+
105
+ All 4 PASS → git commit allowed
106
+ Any FAIL → fix inline → re-run failed axis → proceed
107
+ ```
108
+
109
+ **Lightweight exception** (Axis 1 + 4 only): sessions where zero SKILL.md/rules/templates changed.
110
+
111
+ **Substantive knowledge/ carve-out**: a knowledge/ doc that adds a code fence (` ``` `) or citation (`arXiv:` / `DOI` / `http`) → Axes 2+3 required. Prose-only edits stay light.
112
+
113
+ ---
114
+
115
+ ## Agent View Operation (from FH cwd)
116
+
117
+ | Path | When | Method |
118
+ |---|---|---|
119
+ | **Direct edit** | Known file, simple change | Read/Edit with absolute path |
120
+ | **Agent dispatch** | Field project work, one task | Context Card → Agent |
121
+ | **Parallel dispatch** | 2+ independent tasks | Single message, multiple Agent tool calls |
122
+
123
+ **Context Card format** (required for non-trivial dispatch):
124
+ ```
125
+ [Session Context Card]
126
+ Purpose: {purpose}
127
+ Completed: {already done}
128
+ This agent's task: {specific task + target files}
129
+ Note: {constraints}
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Memory System Flow
135
+
136
+ ```
137
+ User utterance / insight detected
138
+
139
+
140
+ Auto-memory trigger? (user_role, feedback, project state, reference)
141
+
142
+ YES → Write to ~/.claude/projects/.../memory/{slug}.md
143
+ Update MEMORY.md index
144
+ NO → continue
145
+
146
+
147
+ MEMORY.md loaded at session start as system context (always-on)
148
+ Specific memory files recalled on-demand (intent-based + 1-hop associative recall from the MEMORY.md index — memory_intent_recall.md)
149
+ ```
150
+
151
+ **Two-layer storage rule**: `tracks/` = local detailed history (survives session, not machine change).
152
+ Critical cross-session state → also write to `memory/` (survives re-clone + machine change).
153
+
154
+ ---
155
+
156
+ ## Skill Proposal Cadence (Autonomous Initiative)
157
+
158
+ Throughout the session, when conversation signals match the table in CLAUDE.md:
159
+ - Propose relevant skill in one line: `"I see [X]. Want me to run /[skill] to [description]?"`
160
+ - One signal = one proposal (no pressure)
161
+ - Do not re-propose a skill already running
162
+
163
+ ---
164
+
165
+ ## Related
166
+
167
+ - `ai_dialogue_playbook.md` — The "should" layer (principles)
168
+ - `harness_6axis_framework.md` — Full 6-axis decision tree
169
+ - `hub_compounding_loop.md` — Session close → harvest-loop → weekly cycle
170
+ - `.claude/rules/operations.md` — Sub-agent invocation log format + weekly scanner