@chrono-meta/fh-gate 1.4.53 → 1.4.55

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 (32) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CATALOG.md +4 -4
  3. package/CLAUDE.md +47 -11
  4. package/README.ja.md +443 -0
  5. package/README.ko.md +442 -0
  6. package/README.md +58 -4
  7. package/README.zh.md +425 -0
  8. package/knowledge/shared/dialogue/ai_dialogue_playbook.md +1 -1
  9. package/knowledge/shared/dialogue/claude_code_runtime_flow.md +1 -1
  10. package/knowledge/shared/dialogue/memory_intent_recall.md +1 -1
  11. package/knowledge/shared/harness-core/crucible_mode.md +1 -1
  12. package/knowledge/shared/harness-core/field_verdict_crossfamily_gate.md +1 -1
  13. package/knowledge/shared/harness-core/harness_6axis_framework.md +1 -1
  14. package/knowledge/shared/harness-core/harness_design_decision_lens.md +1 -1
  15. package/knowledge/shared/harness-core/harness_incubator_doctrine.md +139 -0
  16. package/knowledge/shared/harness-core/hub_compounding_loop.md +2 -2
  17. package/knowledge/shared/harness-core/hybrid_orchestration_architecture_roadmap.md +3 -3
  18. package/knowledge/shared/rules/auto_project_mapping.md +134 -0
  19. package/knowledge/shared/rules/modes_and_value.md +162 -0
  20. package/knowledge/shared/rules/operational_adaptation.md +73 -0
  21. package/knowledge/shared/rules/operations.md +48 -0
  22. package/knowledge/shared/rules/sister_asset_protocol.md +54 -0
  23. package/knowledge/shared/rules/sync_push_protocols.md +139 -0
  24. package/package.json +6 -2
  25. package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
  26. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  27. package/plugins/fh-meta/skills/contention-layer/SKILL.md +1 -1
  28. package/plugins/fh-meta/skills/field-harvest/SKILL.md +1 -1
  29. package/plugins/fh-meta/skills/field-harvest/SKILL_detail.md +1 -1
  30. package/plugins/fh-meta/skills/harness-doctor/SKILL.md +12 -0
  31. package/plugins/fh-meta/skills/harvest-loop/SKILL.md +2 -2
  32. package/plugins/fh-meta/skills/video-ingest/SKILL.md +1 -1
@@ -118,7 +118,7 @@ harness probes the live environment on-the-fly via the Tier 1→2→3 protocol a
118
118
  path. All probes failing → safe descent to Tier 3 (main model handles it).
119
119
 
120
120
  **5.3 Zero-Config standalone self-reliance** — the key requirement for **Mode C** (plugin/skill
121
- copied without the full framework, see `.claude/rules/modes_and_value.md`). With no
121
+ copied without the full framework, see `knowledge/shared/rules/modes_and_value.md`). With no
122
122
  `config.json`, the module must **not error** — it switches to Zero-Config standalone mode and
123
123
  JIT-probes for whatever local tools exist, then proceeds quietly. Falls back to Tier 3 if none.
124
124
 
@@ -191,6 +191,6 @@ component tagged ❌ Proposed above so this roadmap can never be mistaken for cu
191
191
 
192
192
  - `knowledge/shared/harness-core/multi_model_sidecar_strategy.md` — shipped sidecar mechanism + fallback chain (this roadmap extends, does not replace, it)
193
193
  - `plugins/fh-meta/skills/install-wizard/SKILL.md` — current install behavior (the topology extension would build on this)
194
- - `.claude/rules/modes_and_value.md` — Mode C (plugin/skill-only) that Zero-Config self-reliance targets
195
- - `.claude/rules/operations.md` — sub-agent boundary rules the built-in-injection item must respect
194
+ - `knowledge/shared/rules/modes_and_value.md` — Mode C (plugin/skill-only) that Zero-Config self-reliance targets
195
+ - `knowledge/shared/rules/operations.md` — sub-agent boundary rules the built-in-injection item must respect
196
196
  - `plugins/fh-meta/skills/frontier-digest/SKILL.md` — live source for current model capability/benchmark comparison (do not freeze numbers here)
@@ -0,0 +1,134 @@
1
+ ---
2
+ description: When the user requests "connect a project" or similar, automatically scans parent directories for candidates and handles the 5-step mapping flow (discovery, filtering, confirmation, mapping, summary). Also covers §6 opt-in Full-Harness Mode ("harness-ify this project") — installs project-local harness assets from templates/.
3
+ ---
4
+
5
+ # Auto Project Mapping Protocol
6
+
7
+ When the user requests **"connect a project"** · **"link hub"** · **"map project here"** · **"scan parent directory and connect"** or similar, follow this protocol instead of manual copy (cp).
8
+
9
+ ## 1. Scan
10
+
11
+ | Scenario | Search path | Condition |
12
+ |---|---|---|
13
+ | **A. Default inference** | Parent (`../`) of hub cwd | Default when user specifies no path |
14
+ | **B. User specified** | Path explicitly stated by user | Preferred when path keyword detected |
15
+ | **C. Multiple roots** | Both A + B as candidates | When user uses both |
16
+ | **D. 0 candidates** | — | Ask user: **"Please provide the project root path"** |
17
+
18
+ ## 2. Candidate filtering
19
+
20
+ Only directories meeting all of the following conditions qualify as candidates:
21
+
22
+ - `.git/` exists (real projects only, no empty directories)
23
+ - Exclude the hub itself and sibling hub cwds
24
+ - Exclude track names already mapped in `tracks/` (prevent duplicates)
25
+
26
+ ## 3. Mapping confirmation
27
+
28
+ | Candidate count | Action |
29
+ |---|---|
30
+ | **0** | Scenario D — ask user |
31
+ | **1** | Confirm: `"Map {name} project to tracks/{name}/?"` |
32
+ | **Multiple** | Show numbered list, accept multi-select (e.g., "map 1,3 only") |
33
+
34
+ ## 4. Mapping execution (for each selected project)
35
+
36
+ 1. Create `tracks/{project}/learnings/` directory (with `.gitkeep`)
37
+ 2. **If project root has no CLAUDE.md:**
38
+ - Copy `templates/CLAUDE.md` → `{project_root}/CLAUDE.md`
39
+ - Replace `{project_name}` placeholder with actual track name
40
+ 3. **If project root already has CLAUDE.md:**
41
+ - **Do not modify existing content**
42
+ - **Propose adding** the following hub reference block at the top (insert after user confirmation):
43
+
44
+ ```markdown
45
+ ## Knowledge Hub (forge-harness)
46
+
47
+ Persistent knowledge for this project is stored in `~/projects/forge-harness/`.
48
+
49
+ - **Search past work**: `~/projects/forge-harness/CATALOG.md`
50
+ - **Learnings/feedback source**: `~/projects/forge-harness/tracks/{project}/learnings/`
51
+ - **At session end**: `sync_push_protocols.md` (Session Sync Protocol)
52
+ ```
53
+ 4. Auto-add a row for the project in the **track mapping table** in CLAUDE.md
54
+ 5. Summarize git status changes (user decides whether to commit)
55
+
56
+ ## 5. Summary report (required)
57
+
58
+ ```
59
+ Mapping complete: N projects
60
+ - {proj-a}: tracks/proj_a/ created, CLAUDE.md newly written
61
+ - {proj-b}: tracks/proj_b/ created, hub block added to top of existing CLAUDE.md
62
+ - {proj-c}: tracks/proj_c/ created, CLAUDE.md unchanged (user declined block addition)
63
+ ```
64
+
65
+ ## 6. Full-Harness Mode (opt-in) — harness-ify the mapped project
66
+
67
+ Basic mapping (steps 1–5) registers a project *lightly* (tracks/ + a starter CLAUDE.md + hub link). **Full-Harness Mode adds the project-local harness assets** — identity ① (Control Tower) propagating harness structure to a connected project; the *how* is executed via the Core Axis.
68
+
69
+ **Scope**: target *mapped* projects only. For FH-self setup / acceleration baseline (zshrc, sentinels, the FH self-gate) use `/install-wizard` — do **not** run §6 on the FH hub itself. **Prerequisite**: the project is already mapped (steps 1–5); §6 is strictly additive.
70
+
71
+ **Triggers**: "harness-ify this project", "full harness setup", "프로젝트 하네스화", "promote to full harness", or an opt-in prompt offered right after a basic mapping (*"Promote {project} to a full harness now?"*).
72
+
73
+ **Harness litmus (pre-check — component lens, complements the 6-axis process lens)**: before promoting,
74
+ sanity-check the candidate actually *operates as (or will operate as) a runtime harness*, not a static
75
+ codebase. A runtime harness has four conditions (sister-asset, sanguinekim 2026 — cross-audit
76
+ `tracks/_audit/session_2026_06_22_sanguinekim-harness-definition.md`):
77
+
78
+ | # | Condition | Litmus question |
79
+ |---|---|---|
80
+ | 1 | **Loop** (infer→act→observe) | Does it iterate, or emit one response and stop? |
81
+ | 2 | **Tool interface** | Can it *modify* the environment, not just read? |
82
+ | 3 | **Context management** | Does it *select* what to feed back, not just truncate at overflow? |
83
+ | 4 | **Control** (verify + guardrails) | Are there checks that hold *independent of model cooperation*? |
84
+
85
+ This is a *should-we-even-harness-ify* gate, not an install: 0–1 conditions met → the project isn't yet
86
+ an agentic harness, so full-harness assets are premature (note it, offer light mapping only). 2+ met (or
87
+ clearly intended) → proceed. The component lens is orthogonal to FH's 6-axis (process); FH adds the
88
+ governance depth to condition 4 (mechanical-anchor / 4-axis gate) — the litmus just confirms the *shape*.
89
+
90
+ **Installs (each item approval-gated · never overwrite — propose skip/merge if it exists · all from `templates/`):**
91
+
92
+ | # | Item | Source → target | Effect |
93
+ |---|---|---|---|
94
+ | 1 | Session rules | `templates/.claude/rules/session.md` → `{project}/.claude/rules/session.md` | Session-start auto-read, backup, rule hierarchy |
95
+ | 2 | Context filter | `templates/.claudeignore` → `{project}/.claudeignore` | Token footprint control |
96
+ | 3 | Env card | `templates/fh_env_context.jsonc` → `{project}/.claude/rules/fh_env_context.jsonc` | Environment context for sessions |
97
+ | 4 | **MCP tool gating** (conditional — offered only when the project mounts an external MCP server: `.mcp.json`/`mcp.json` present, or the user is adding one) | `templates/.claude/rules/mcp_tool_gating.md` → `{project}/.claude/rules/mcp_tool_gating.md` | Name-keyed ask/allow tiers for external MCP tools — server annotations are unreliable (measured 2026-06-11: a live server shipped all-None hints incl. its irreversible send tool); §3 table filled at mount time |
98
+ | 5 | **Official-plugin scan** (recommend list only — **never auto-install**) | plugin-recommender Tier 0/1 pass on the project's stack | No-reinvention acceleration: matching `*-lsp` for the project's language + workflow plugins (code-review · commit-commands · feature-dev …) from `claude-plugins-official` — see `knowledge/shared/plugin-catalog/recommended_plugins.md` §Category 0.5. Each install user-approved |
99
+
100
+ **Field-asset scaffold (on-demand — NOT a `templates/` install)**: harness-ification surfaces field-specific skills/agents *as needed* — the field's domain work produces them. FH accelerates their *creation*: not the domain content (the field team authors that), but the **gate-compliant structure**. When a skill-worthy recurring pattern appears (3+ reps → `#skill-candidate` tag · `field-harvest` signal · a repeated manual workflow), offer to scaffold a skeleton:
101
+
102
+ - **Skill skeleton** — the frontmatter field set (`name`/`description`/`user-invocable`/`allowed-tools`) that is universal across active FH skills (regen: `grep -L user-invocable plugins/*/skills/*/SKILL.md` returns none; `model:` is deliberately NOT universal since 2026-07-10 — hard pins retired per `sonnet_floor_doctrine.md`, skills session-inherit and express depth as dispatch) + **four stubs, all mandatory in the skeleton**: ① Trigger stub (≥3 phrases — initiate) ② Done-When stub (with check-class — complete) ③ halt stub (budget/convergence guard) ④ persist stub (what state reaches the next run) + Step skeleton — the 5-question loop discipline by construction (`loop_engineering.md`; validate=#3 is the check-class declaration in ②). **Parameterizes** `contention-layer` Step 4's skeleton template (per its need-driven note — `origin: field-scaffold`, `contention-parents`→source-pattern pointer).
103
+ - **Agent skeleton** — `{project}/.claude/agents/{name}.md` with `name`/`description`/`tools` + a **self-contained** prompt stub (sub-agents don't see main context).
104
+ - **Route** via `asset-placement-gate` (its verdicts: `{project} local agent` / `FH meta-skill` / `Drop` — no commons path for an agent) · **harden** via `steel-quench` · the field team fills the **domain content** (FH never authors domain logic).
105
+
106
+ The scaffold **enforces the creation gate by construction** — a field skill is gate-compliant (description diet · ≥3 triggers · Done-When · check-class · independently-executable) *from the skeleton*, even if the field author doesn't know the gate. That is the governance value: the quality bar travels to the field. **Approval-gated like items 1–5** (offer, never auto-create). **Done When** (FH's own scope; the boundary the §New-Skill-Creation gate requires): (1) skeleton emitted with all gate fields *[mandatory-pass]* · (2) `asset-placement-gate` verdict recorded *[mandatory-pass]* · (3) `steel-quench` run, no S-tier *[measured]*. **FH scope ends here** — domain-content fill is the field team's, outside this Done When. **No-reinvention**: net-new is only the *need-driven entry + agent variant* — detection (`#skill-candidate`/`field-harvest`/`contention-layer`), routing (`asset-placement-gate`), hardening (`steel-quench`), and the skill-skeleton (`contention-layer` Step 4) already exist; Claude Code's built-in agent authoring does the mechanical file write, FH adds the governance scaffold.
107
+
108
+ **Plugin-bundle rung (deferred — measured-trigger, not built today)**: bundling skills+agents into a distributable plugin (`.claude-plugin/plugin.json` + `marketplace.json`) recurs far less than skill creation (a harness has many more skills than plugins), so its scaffold is added when the *bundling* friction is measured, reusing `marketplace-gate` (readiness) + the `package.json`↔plugin.json lockstep (CLAUDE.md §④-b). Not built speculatively.
109
+
110
+ **Not installed (deliberately)**: the FH 4-axis **pre-commit gate** (`templates/.git-hooks/`) is FH-*internal* infra — it hard-codes hub paths and requires hub markers (`tracks/_meta/.axes_23_passed_*`, `tracks/_meta/edit_manifest.yaml`), so dropping it into a target project would **block that project's commits**, not help. A project-generic regression gate is a future candidate, not shipped today.
111
+
112
+ **Loop linkage (honest — no autonomous daemon)**: `tracks/{project}/` (created in step 1, basic mapping) is what makes the project's **session-synced** learnings visible to the hub's `harvest-loop` weekly audit — *once the user runs the Session Sync Protocol from that project*. §6 adds project-local harness assets; it does **not** add loop automation inside the project, and the session-start cadence (frontier-digest 7d / harness-doctor 30d) runs in the **hub cwd**, not the project. "Acceleration" = the hub's compounding loop ingests the project on sync — not a process running in the project.
113
+
114
+ **Report (required)**: list each item as `installed` / `skipped (exists)` / `declined`, then state: *"{project}: mapped (light) → project-local harness installed; learnings feed the hub loop on sync."*
115
+
116
+ **Guards**: respects all Boundaries below (no overwrite, confirm-first). If the project already has its own `.claude/rules/`, propose side-by-side/merge — never clobber. Hub common principles outrank project rules (scope hierarchy); project-specific rules are preserved.
117
+
118
+ ## Boundaries and caution
119
+
120
+ - **Do not execute without confirmation** — present candidate list → user selects → execute mapping (3 steps)
121
+ - **Do not overwrite existing project files** — if CLAUDE.md exists, propose block addition only
122
+ - **Warn when large monorepo detected** — repos with 10+ subprojects: ask "Which subproject is the track unit?"
123
+ - **Name collision** — if track name already exists, ask user to specify a new track name
124
+ - **Pre-existing `.claude/` config is untrusted input, not a mapping detail** — a candidate project
125
+ (step 1 scan) may already carry a `.claude/settings.json` from a source FH did not author (a clone,
126
+ a fork, a prior contributor). Two disclosed Claude Code CVEs show that file class is a live RCE /
127
+ exfiltration surface *before* Claude Code's own trust dialog ever appears: `hooks` entries executing
128
+ shell commands pre-trust-prompt (CVE-2025-59536, CVSS 8.7) and an `ANTHROPIC_BASE_URL` override
129
+ silently redirecting API traffic pre-trust-prompt (CVE-2026-21852) — both patched upstream, but a
130
+ stale unpatched Claude Code build or an unreviewed pre-existing settings file reintroduces the same
131
+ exposure. Read any existing `.claude/settings.json` (`hooks`, env-var overrides) in the candidate
132
+ directory **before** running a mapping session inside it — do not rely on the trust dialog alone.
133
+ (Signal: [Check Point Research — CVE-2025-59536 / CVE-2026-21852](https://research.checkpoint.com/2026/rce-and-api-token-exfiltration-through-claude-code-project-files-cve-2025-59536/), surfaced via
134
+ the frontier-digest signal 2026-07-04 (issue #102) · cross-referenced via [obot.ai](https://obot.ai/blog/claude-code-mcp-governance-enterprise-security/) and [CyberDesserts](https://blog.cyberdesserts.com/ai-agent-security-risks/).)
@@ -0,0 +1,162 @@
1
+ ---
2
+ description: Defines the 4 harness usage modes (A canonical / B resident / C plugin-only / D developer) and the differentiated value automatically received on install (Layer 1 rules + Layer 2 skills).
3
+ ---
4
+
5
+ # Harness Usage Modes + Differentiated Value
6
+
7
+ ## Usage Modes — "Don't block those who come, don't block those who leave"
8
+
9
+ The forge-harness maintains **a reference asset identity** — user entry and exit are free. The AI guides and supports any mode without refusal.
10
+
11
+ ### 4 Mode branches
12
+
13
+ | Mode | Essence | AI guidance and support obligation | Contribution path |
14
+ |---|---|---|---|
15
+ | **A — Canonical** | Harness cwd setup → hand off to separate project cwd → field agent works | Active onboarding 5-skill cascade + cwd handoff guidance | Direct (bidirectional sync circuit active) |
16
+ | **B — Resident** | Create a **separate project directory** in the harness install environment and work there | Required to guide "separate project directory + proper `.gitignore`" | Indirect (harness itself maintains reference asset identity) |
17
+ | **C — Plugin/skill only** | Install only plugin/skill without cloning harness | Guide user to accumulate history on their own project side. Explicitly state no automatic harness signals expected | Indirect + dependent on user active invocation |
18
+ | **D — Developer/Researcher** | **Using FH while also developing/researching FH itself.** Public mirror (forge-harness) holds methodology; a private companion store (the `*-be` companion pattern) holds paper drafts, experiment logs, raw signals, and a mirror of gitignored local session data. | Guide companion-store setup (the `*-be` companion pattern). Mandatory: `.gitignore` keeps drafts local; `handoff/` enables cloud→local session continuity; a sync hook (e.g. a CC Stop hook) auto-mirrors gitignored local session data → the companion store. | Direct + private (gitignored local files auto-synced to companion store via Stop hook; explicit push for paper-drafts/signals) |
19
+
20
+ ### AI guidance principles
21
+
22
+ - If user explicitly states a mode, immediately guide that mode. Do not force canonical mode (Mode A).
23
+ - Mode B: **Mandatory check of separate project directory creation + `.gitignore` harness asset isolation**
24
+ - Mode C: Guide history accumulation mechanism on user's project side. Harness side actively absorbs via issue monitoring and PR audit cadence.
25
+ - Mode D: **Mandatory companion-store setup guidance** (backend pluggable — `*-be` repo · Obsidian vault · gbrain LLM-wiki; see *Pluggable backends* below). Public mirror = methodology only. Private store layout: `paper-drafts/` · `paper-signals/` · `digests/` · `handoff/` · `tracks-meta/`. `handoff/` files bridge cloud session → local session. `tracks-meta/` receives gitignored local session data via a sync hook (e.g. a CC Stop hook) so sync is automatic after setup. Field projects can use the same dual-repo pattern.
26
+ - In any mode: do not accumulate user personal work in the harness directory itself (protect reference asset identity)
27
+
28
+ ### Scope boundary — delivery surface is routed, not built
29
+
30
+ A self-improving agent's **delivery surface** (always-on messaging reach — Telegram / Slack / Discord
31
+ as a daily-driver channel, a standalone gateway process) is a *channel*, not methodology. FH is Claude
32
+ Code native and **deliberately does not build a messaging gateway or a self-running daemon**: messaging
33
+ reach is routed via a messaging MCP (`recommended_plugins.md`), and recurring automation stays a
34
+ **proposal/cadence surface, not a daemon** (`self_evolution_routine.md` §8). This is a chosen boundary,
35
+ not a missing feature — FH's differentiator is *governed* self-evolution (the 4-axis gate), and a
36
+ delivery channel adds reach without adding governance. **The positive half of the boundary
37
+ (operator doctrine, 2026-07-10): development's birthplace is code and the terminal — FH builds no UI
38
+ *because* it is terminal-native, and in exchange every non-UI axis (gates, loops, tier-floor
39
+ reliability, token/speed efficiency, cross-harness routing) must be strong. That strength is the
40
+ condition that lets a UI-less meta-harness embrace other harnesses and orchestrate them at
41
+ optimized token cost and speed — the boundary is an identity, funded by excellence everywhere else.** (Recorded 2026-06-27 from the Hermes Agent
42
+ sister-asset cross-audit, `tracks/_contrib/session_2026_06_27_hermes-agent-nous-self-improving-cross-audit.md`.)
43
+
44
+ ---
45
+
46
+ ## Companion-Store Recommendation + Ephemeral-Environment Handoff
47
+
48
+ > Two related, **non-coercive** guidances. FH is public and forces nothing — a user with no companion store and no ephemeral runs is never prompted by either.
49
+
50
+ ### When to recommend a companion store (conditional — never forced)
51
+
52
+ Recommend the private companion store (the `*-be` companion pattern) **only when both** hold:
53
+ - the user is **accumulating their own context/synergy into the meta-harness** — preparing a contribution, or building personal synergy on top of FH — **and**
54
+ - they keep **no separate local fork / project directory** for it.
55
+
56
+ In that state the accumulation would otherwise be **lost on an ephemeral reclaim** or **pollute the public reference asset** (drift). A private companion store gives the drafts / signals / handoffs a durable, separate home, keeping the public mirror methodology-only.
57
+
58
+ **Not prompted**: users with a local fork or separate project dir; Mode A/B/C users who do not accumulate personal context into FH. The companion store is a suggestion surfaced to those who would benefit — not a requirement, and not implied by any other rule.
59
+
60
+ ### Pluggable backends — the store's role is backend-agnostic
61
+
62
+ The companion store is a **role** (durable private home for drafts · signals · handoffs · gitignored-session mirror), not a fixed technology. Do **not** force a new `*-be` git repo on a user who already runs a durable knowledge store. At setup, offer the backend that fits their existing workflow:
63
+
64
+ **FH emits the same artifact for every backend — markdown output files.** The backend differs only in how it *consumes* them, so no per-backend writer needs building:
65
+
66
+ | Backend | When | Consumption (FH just writes markdown to a target path) |
67
+ |---|---|---|
68
+ | **`*-be` git repo** (default) | Operator wants git-versioned state + Stop-hook auto-mirror | markdown committed to the private repo |
69
+ | **Obsidian vault** | User already gardens knowledge in Obsidian | point the output path at the vault — Obsidian *is* markdown, so it's backlinked instantly, zero new infra (works today). Its **graph view is a near-free Observability surface** — FH's self-named weak ETCLOVG layer (`harnessfix_etclovg_sister`): the compounding link structure becomes *visible* for this backend at no added cost (imported from the 김효율 AX-Obsidian cross-audit, `tracks/_audit/session_2026_06_21_kim-hyoyul-ax-obsidian-wiki-harness.md` §4). |
70
+ | **LLM-wiki / gbrain** | User runs a queryable memory brain | the user's gbrain **ingests** the emitted markdown (`gbrain` ingest); a deeper FH→gbrain MCP integration is a future candidate, **not wired today** |
71
+
72
+ **Invariant across all backends** (unchanged): methodology stays in the public mirror (single-source guard); the store holds only *outputs*, never a rule copy; no domain-work pollution of the reference asset. Backend is a setup-time choice; the role, guards, and ephemeral-handoff rule below are identical regardless of backend. Rationale + import/propagate ledger: `knowledge/shared/harness-core/companion_store_pluggable_cross_audit_2026-06-11.md`.
73
+
74
+ ### Ephemeral-environment handoff (mode-agnostic — applies to anyone)
75
+
76
+ When FH work runs in an **ephemeral, git-invoked environment** (Claude Code on the web, a GitHub Action, any cloud sandbox reclaimed after the session) **and** an open next action can only run locally (machine-bound steps the cloud session cannot do — installing hooks, native CLI runs like `/goal`, long-lived processes), **leave a surfaced handoff in a durable location before the session ends**:
77
+ - **Mode D (companion store exists)** → the store's `handoff/` file.
78
+ - **Otherwise (default — anyone)** → a handoff note committed to the **working repo**, or a PR comment. Everyone has the working repo, so **no companion store is required** for this.
79
+
80
+ The handoff must be the obvious entry point a fresh local session lands on — its own file/comment carrying status + the single immediate next action + exact steps — not a footnote buried in a digest. **Never rely on gitignored / local-only files** (`.claude/settings.json`, and `tracks/_meta/*` unless you are Mode D with sync confirmed) for cross-session continuity in an ephemeral environment; they are wiped on reclaim. Mode D exception: gitignored local session data is auto-synced to the companion store via a Stop hook — durable for local-to-local continuity, but the sync hook itself does not run in cloud/ephemeral environments, so `handoff/` remains the correct channel there.
81
+
82
+ ### Session-start freshness — the card is a pointer, the committed store may be fresher (Mode D)
83
+
84
+ At session start, after loading the companion store (or, for non-Mode-D users, the working-repo handoff), **check the store's newest *committed* work, not only the session card**. The companion store is a **durable git-committed repo** — distinct from the gitignored local mirror the paragraph above warns against; reading its commit history is safe *because* it is committed. A session card is written at one moment, but another environment or a later session can commit **newer** work to the store *after* that card. So **"pull is up-to-date" ≠ "I have seen the latest work."**
85
+
86
+ - Concretely: compare the store's **newest commit date** to the card's date; if newer, read that content and reconcile it into the session plan/greeting *before* acting.
87
+ - Precedence is **reconcile, not override**: newer-by-date content *triggers a read-and-reconcile* — it never silently wins over the card. The card may have been deliberately edited *after* a mechanical auto-sync commit (the card is written last in the close chain; the Stop hook fires on every stop), so **commit-recency ≠ authoring-authority**. When card and recent commits disagree, surface both and reconcile — do not let the newer timestamp auto-win.
88
+ - Distinct from the Agent-View pre-read (in the hub `CLAUDE.md` §Session Wrap-up, which fires only in worktree/Agent-View sessions): this fires on **every** session start.
89
+
90
+ *Salience → mechanical (upgraded 2026-07-05)*: this load is prose (salience-dependent), and its
91
+ known failure mode is **task-first entry** — when the operator opens a session with an immediate task,
92
+ the prose load silently does not fire and the agent runs on stale local memory (measured miss
93
+ 2026-07-05: stale sidecar-tool version + missed origin-model-sidecar instruction, both because the
94
+ companion-store pull was skipped on task-first entry). The mechanical backstop is now built: a **SessionStart hook**
95
+ (`scripts/fh_session_load.sh`, registered operator-local in `.claude/settings.local.json`) fires the
96
+ companion pull + freshness delta **before turn 0, regardless of what the user types first**. Prose
97
+ remains the semantic layer (read + reconcile); the hook guarantees the pull + surfaces what is newer
98
+ than the card. (This resolves the `operational_adaptation.md` §Guards deferred-hook decision — its
99
+ measured revisit-trigger fired.)
100
+
101
+ **Single-source guard**: this methodology lives here in the public mirror. A companion store holds only the *outputs* that follow it (digests · signals · handoff files), never a copy of the rule.
102
+
103
+ ---
104
+
105
+ ## What You Get on Install — the value the harness adds
106
+
107
+ The forge-harness bundles **rules, skills, and session protocols** into one environment — not a standalone plugin list. Two layers combined:
108
+
109
+ ### Layer 1 — Core assets (rules domain / auto-activated on harness install)
110
+
111
+ | Core asset | Essence | Mode A | Mode B | Mode C | Mode D |
112
+ |---|---|:---:|:---:|:---:|:---:|
113
+ | **Active onboarding protocol** | Greeting trigger → 5-skill auto cascade | ✅ | ✅ | ❌ | ✅ |
114
+ | **Harness usage mode 4 branches** | User-free mode branching + AI guidance obligation | ✅ | ✅ | ❌ | ✅ |
115
+ | **Asset synergy branch judgment** | Auto-judgment of meta/hub seed vs field persistent location for new assets | ✅ | ✅ | ❌ | ✅ |
116
+ | **Memory system auto-operation** | User utterances/insights auto-persisted + intent-based + associative auto-recall | ✅ | Partial | ❌ | ✅ |
117
+ | **Companion-store routing** | Drafts/signals/handoffs → private store; methodology → public mirror | ❌ | ❌ | ❌ | ✅ |
118
+
119
+ ### Layer 2 — Skills domain (can separate plugin/skill / available in all Modes A·B·C·D)
120
+
121
+ | Skill | Essence |
122
+ |---|---|
123
+ | `plugin-recommender` | Tier 1·2·3 classification + organization GHE + token check |
124
+ | `cross-ecosystem-synergy-detection` | GHE cluster + Tier classification baseline |
125
+ | `harvest-loop` | Weekly audit + self-evolution pipeline + Phase 2+ PR auto-proposal |
126
+ | `verify-bidirectional` | Bidirectional self-verification + user-AI baseline update circuit |
127
+ | `frontier-digest` | External-facing asset cross-ref + frontier trend + per-audience guide |
128
+ | `hub-cc-pr-reviewer` | PR diff → baseline coherence check → review comment auto-generation |
129
+ | `context-doctor` | `.claudeignore` auto-generation + large file detection + `/clear` timing guidance |
130
+ | `harness-doctor` | Harness structure L1~L4 diagnosis + M/S/R prescription |
131
+ | `sim-conductor` | External scenario/internal audit/ideation scan autonomous execution + M-tier auto PR |
132
+
133
+ ### Synergy — Layer 1 × Layer 2 combined is when it fully manifests
134
+
135
+ ```
136
+ [Layer 1] Greeting trigger → active onboarding
137
+ ↓ auto cascade
138
+ [Layer 2] plugin-recommender → cross-ecosystem → sister asset catch
139
+ ↓ results accumulated
140
+ [Layer 1] memory system auto-persist → next session immediate awareness
141
+ ↓ weekly reflection
142
+ [Layer 2] harvest-loop → pattern formalization → memory update
143
+ ↓ precision counter-argument
144
+ [Layer 2] verify-bidirectional → baseline update channel
145
+ ```
146
+
147
+ → **Mode C** users receive Layer 2 but without Layer 1 rules = partial synergy only. **Mode A·B users get both layers auto-activated** = both layers active (Layer 1 + Layer 2).
148
+
149
+ > **Three-Doctor Loop**: `harness-doctor` (structure) + `context-doctor` (context) + `sim-conductor` (ideation) 3 skills form a diagnosis→prescription→re-diagnosis closed loop. External term: *Diagnostic Triad* (isomorphic with Anthropic 3-Agent Harness Planner·Generator·Evaluator).
150
+
151
+ ### Natural language → skill connection (new user entry map)
152
+
153
+ | User natural utterance | Meaning | Connected skill |
154
+ |---|---|---|
155
+ | "recommend a plugin", "what should I install" | Tool discovery | `plugin-recommender` |
156
+ | "can I use what's in another project?", "what's available?" | Ecosystem synergy discovery | `cross-ecosystem-synergy-detection` |
157
+ | "manage my context", "want to save tokens" | Context optimization | `context-doctor` |
158
+ | "wrap up this week's work", "want to reflect" | Weekly audit | `harvest-loop` |
159
+ | "review my PR", "please review" | PR audit | `hub-cc-pr-reviewer` |
160
+ | "check harness structure", "confirm everything's running well" | Structure diagnosis | `harness-doctor` |
161
+ | "what are the latest AI tools?", "tell me about frontier trends" | External asset discovery | `frontier-digest` |
162
+ | "want to share this pattern", "can I post this here?" | Pattern harvesting | `field-harvest` |
@@ -0,0 +1,73 @@
1
+ # Operational Adaptation Loop — User-Tuned Self-Optimization
2
+
3
+ Self-healing in FH today has two shapes: **FH-self-dev** (Mode D, the 4-axis auto-gate improving FH's own assets) and **reactive** (`verify-bidirectional`, a one-shot baseline update when the user pushes back). Both leave a gap: there is no **standing, per-user, operational** loop that tunes FH's everyday behavior to the individual during normal field use — and feeds the generalizable part of that tuning back to the origin.
4
+
5
+ This loop fills that gap. It is deliberately thin: it **reuses** existing parts and only adds a profile convention + a generalization gate.
6
+
7
+ | Concern | Existing part (reused — NOT rebuilt) | What this loop adds |
8
+ |---|---|---|
9
+ | Reactive correction | `verify-bidirectional` (per-correction baseline update) | A standing, aggregated profile (not one-shot) |
10
+ | Reverse-PR funnel | `field-harvest` Mode A (field pattern → FH PR) | Feeds it generalizable UAP entries |
11
+ | Outcome vocabulary | `operations.md` `subagent_invocations_log` (`accepted`/`rejected`/`sustained` + 60/40 gate) | Same vocabulary, extended from sub-agents to **skill proposals** |
12
+
13
+ ## User Adaptation Profile (UAP)
14
+
15
+ **Location**: `tracks/_meta/user_adaptation_profile.md` — **local / gitignored**. It is a **personal asset**, never committed to the public mirror (single-source / drift guard, per `modes_and_value.md`). Mode D: mirror to the companion store's `tracks-meta/`.
16
+
17
+ **Records behavioral preferences ONLY** — never domain work content (protects reference-asset identity):
18
+ - **Skill-proposal outcomes** — per skill: `accepted` / `rejected` / `sustained` with counts (same 4-category vocabulary as `operations.md`).
19
+ - **Preferred execution tier** (S/M/L/XL), language, working cadence.
20
+ - **Capability-escalation consent** — `sidecar_consent` + `floorup_consent` (`accepted`/`declined`/`unset`),
21
+ per the **Capability-Escalation Consent Protocol** (`knowledge/shared/harness-core/capability_escalation_consent.md`).
22
+ Settled at onboarding (install-wizard) or ask-once at first need; `declined` → route to the floor
23
+ (Sonnet / Tier-3 CC-only sub-agent as a *first-class* mode), surface as recommendation only, **never re-nag**.
24
+ - **Recurring friction points** (aggregated from `fh_signal_*`).
25
+ - **Muted nags** — cadence reminders the user repeatedly declines.
26
+
27
+ ## Operational adaptation pass (field-session close)
28
+
29
+ Runs at field-session close, **riding `field-harvest` Mode B** — no new trigger, never an interception. One pass per session.
30
+
31
+ - **READ** (session start / proposal time): apply UAP — suppress a skill proposal rejected 3+ times (an `accepted` record carries **no** positive auto-action — the skill simply stays surfaced; do not auto-run on acceptance), default to the preferred tier, mute cadence nags the user always declines, and **apply capability-escalation consent** (`sidecar_consent`/`floorup_consent` `declined` → route to the Sonnet / Tier-3 floor, recommend-only, no re-nag; `unset` → ask-once at first need per the consent protocol). (Tier note: the UAP tier default is a session-depth setting; the Mode D model notice is model-only + advisory and never overrides it.)
32
+ - **WRITE** (session close): update outcome counts + new friction points.
33
+
34
+ ## Generalization gate → reverse-PR funnel
35
+
36
+ This is the operator's **"원본 반영 가치"** criterion made mechanical. Split each UAP learning:
37
+
38
+ - **Idiosyncratic** (this user's taste) → stays in the UAP, local. **Never** escalated — pushing personal taste into the public reference asset is drift.
39
+ - **Generalizable** (any user would benefit; the pattern recurs across **2+ sessions or projects**, not user-specific) → routed through `field-harvest` Mode A as a harvest candidate → FH-origin PR (HITL approval, per the existing field-harvest gate).
40
+
41
+ **Promotion threshold** (reuse `operations.md` gate): a skill proposal `rejected ≥ 40%` across a 2+ session window is a *redefine/deprecate* candidate (a generalizable signal worth a PR); `accepted ≥ 60%` reinforces. Below threshold → personal one-off, stays local.
42
+
43
+ **Generalization is a judged call — adversarial pairing required (no judge-only path).** The idiosyncratic-vs-generalizable split is not decided by the same session that wrote the UAP alone: it is paired with (a) the mechanical **2+ session/project recurrence threshold** above, and (b) `field-harvest` Mode A's contention-layer + the **human PR review** gate. A learning only reaches the public mirror after passing both — the recurrence backstop filters one-offs, the PR gate filters taste a human disagrees is general.
44
+
45
+ ## Done When
46
+
47
+ - **UAP WRITE ran** at field-session close (or was correctly skipped — absent profile / ephemeral session). *Check class: mandatory-pass (binary — did Step 5-B.1 execute or log a skip reason).*
48
+ - **UAP READ applied** at session start / proposal time when a profile exists (preferred tier defaulted, 3×-rejected proposals suppressed, declined cadence nags muted). *Check class: judged, pair: the target-tier blind sim below.*
49
+ - **No domain content** entered the UAP this session. *Check class: judged, pair: phantom/content scan of the UAP diff.*
50
+
51
+ ## Guards
52
+
53
+ - **Local-default, escalate-only-generalizable** — the drift-prevention spine of the loop.
54
+ - **Behavioral data only** — no domain content in the UAP (reference-asset identity).
55
+ - **Ephemeral env** — the UAP is gitignored, wiped on cloud reclaim. In an ephemeral/cloud session it is **unavailable**: operate from defaults, do not fabricate a profile, do not rely on it for cross-session continuity (`modes_and_value.md` ephemeral rule). The loop is a **local-session** mechanism.
56
+ - **HITL** — escalation to FH origin goes through `field-harvest`'s existing PR-approval gate; no autonomous commit to the shared repo (`feedback_no_personal_commit_to_shared_repo`).
57
+ - **Salience / tier dependence** — this loop is prose-driven, not hook-enforced. On a weaker model the READ side (apply-at-session-start) may silently not fire even when a UAP exists. This is an accepted limitation, not a silent one: it is the reason the change ships with a target-tier blind sim (per CLAUDE.md §Target-tier sim gate). A hook-enforced READ is a future hardening candidate, deliberately not built today (keep the surface thin).
58
+
59
+ **Deliberated 2026-06-16 (decision: DEFER) → BUILT 2026-07-05 (revisit-trigger fired on a real miss).**
60
+ The right mechanism is *not* the git pre-commit hook (the READ fires at session-start / proposal-time,
61
+ which is not a git event) but a Claude Code **SessionStart hook**. The 2026-06-16 deferral set a
62
+ **measured revisit-trigger** (build only when a real miss is observed, not on a guess). That trigger
63
+ **fired 2026-07-05**: an opus-tier session opened with an immediate qasp task, the prose session-start
64
+ companion load silently did not fire, and the agent operated on stale local memory (stale agy version;
65
+ missed the standing origin-model-sidecar instruction). This was a *production* miss, stronger evidence
66
+ than the deferral's target-tier-sim bar — so the hook is now built: **`scripts/fh_session_load.sh`**,
67
+ registered operator-local in `.claude/settings.local.json` SessionStart. It pulls the companion store
68
+ and emits a freshness delta (files newer than the session card + INDEX live pointers) into turn-0
69
+ context, *before* the first user message is processed — closing the task-first-entry salience gap
70
+ mechanically. Note the miss was **not** low-stakes as the 2026-06-16 note predicted (it produced wrong
71
+ recommendations, not just an unapplied preference), which is what tipped defer → build. Prose READ
72
+ remains the semantic layer (read + reconcile); the hook is the mechanical floor
73
+ (`[[feedback_judge_robustness_mechanical_anchor]]` — mechanical anchor over salience).
@@ -0,0 +1,48 @@
1
+ ---
2
+ description: Defines sub-agent operating rules, weekly improvement cycle Phase 1.5~2, and the 3-phase maturity roadmap (Phase I~III).
3
+ ---
4
+
5
+ # Operations Reference
6
+
7
+ ## Sub-agent Operations (optional)
8
+
9
+ Custom sub-agents can be defined in hub or project `.claude/agents/*.md` (Claude Code standard).
10
+
11
+ **Invocation rules:**
12
+ - Prompts must be **self-contained** — sub-agents do not see main conversation context
13
+ - Immediately after invocation, append to `knowledge/shared/learnings/subagent_invocations_log.yaml` (8 fields · outcome 4 categories: `accepted`/`partial`/`rejected`/`sustained`)
14
+ - `sustained` (decided not to invoke) also recorded — negative sample for preventing over-engineering
15
+
16
+ **Shared repository caution:** For personal agents in team shared repos, add `.claude/agents/` to `.git/info/exclude` to keep local-only. `.gitignore` is committed to the repo — do not use it.
17
+
18
+ **Promotion gate (after 2+ week pilot):**
19
+ - `accepted ≥ 60%` → maintain + strengthen description
20
+ - `rejected ≥ 40%` → redefine scope or deprecate
21
+
22
+ ---
23
+
24
+ ## Weekly Improvement Cycle
25
+
26
+ The hub audits and improves itself weekly.
27
+
28
+ **Phase 1.5 (manual):**
29
+ 1. Gather window data by hand — `git log --since="{window}" --oneline` (+ count), `git tag --sort=-creatordate`, tail of `knowledge/shared/learnings/subagent_invocations_log.yaml`, stale-file spot checks. (No `_scanner.sh` exists — a prior reference here was a phantom, fixed 2026-06-11; the automation path is Phase 2 harvest-loop, a standalone scanner script is deliberately not built.)
30
+ 2. `bash scripts/below_floor_scan.sh` — below-floor marker re-run queue (the standing consumer §Floor governance promises: exit 1 = pending floor-tier re-validations, treat as S-tier; resolve via `floor-rerun:` / `floor-writeoff:` appended to the marker)
31
+ 3. Write `tracks/_audit/weekly_audit_YYYY-MM-DD.md` mirroring the previous audit file's format (frontmatter + activity table + 🟥🟧🟩 + pattern table — no separate template file exists)
32
+ 4. Propose 3-tier improvements (🟥mandatory/🟧strong/🟩recommended)
33
+
34
+ **Recurrence escalation** (N=3 threshold): Scanner output shows the same defect class in 3+ distinct commits or sessions within the audit window → S-tier signal; propose instrumenting as a CI probe (`npm test` extension or pre-commit hook) rather than adding a new habit rule. Three recurrences indicate the defect class is structural — habits don't hold.
35
+
36
+ **Phase 2 (skill-ized):** `/harvest-loop` (lightweight mode) automates the above procedure (manual ~10 min → auto ~3 min target). Scanner invocation, prediction vs measurement comparison, repetitive pattern detection, promotion/deprecation candidate proposal automated.
37
+
38
+ **Session start auto-detection (L1):** When Claude Code session starts in hub cwd, check mtime of recent `weekly_audit_*.md` file → propose audit if 7+ days elapsed.
39
+
40
+ **Phase 2~4 roadmap:** See `knowledge/shared/harness-core/hub_compounding_loop.md`.
41
+
42
+ ---
43
+
44
+ ## 3-Phase Maturity Roadmap
45
+
46
+ The hub's long-term evolution path is managed as a 3-stage model: **Phase I (entering maturity) → Phase II (frontier following) → Phase III (frontier leading)**. Phase transition gates have the simplification principle ("A good harness gets simpler over time") as a common condition.
47
+
48
+ **Detailed frame:** See `knowledge/shared/harness-core/hub_maturity_roadmap.md` (Phase I 5-criteria gate · Phase II (b) cadence · Phase III 6 indicators + operating guide for writing).
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Protocol for when a sister asset (another team within the organization, external frontier, another repo) covering the same topic is discovered — blocks cognitive gaps and opens a bidirectional learning loop. Keep the activation threshold low.
3
+ ---
4
+
5
+ # Sister Asset Protocol
6
+
7
+ When a **sister asset** (another team in the organization · external frontier · another repo) covering the same topic is discovered, follow this procedure to block cognitive gaps and open a bidirectional learning loop.
8
+
9
+ ## When to activate
10
+
11
+ - During work, a **sense of deja vu** arises: "I feel like this topic was covered somewhere"
12
+ - An external resource with **similar scope but different resolution** from a `knowledge/shared/` asset is found
13
+ - An external reference URL repeatedly appears in the weekly audit scanner aggregation
14
+ - User mentions "that other project/team also did this"
15
+
16
+ ## Lightweight path (C-tier — cheap debt entry)
17
+
18
+ If step 1 (asset identity) shows the territory is **already covered** — dedup hit on the source, or
19
+ a prior cross-audit of the same claims, with no new increment — do **not** write a full cross-audit:
20
+ record a **one-paragraph entry** (source · dedup verdict · the one-line increment if any · pointer to
21
+ the prior audit) in the ledger/log used for speculative intake. Full steps 2–3 are reserved for
22
+ A/B-tier sources (new territory or a real increment). Keeps intake cheap — the discipline that lets
23
+ the wide net stay wide.
24
+
25
+ ## 3 steps after detection
26
+
27
+ 1. **Asset identity confirmation (5 min)** — Confirm creation date · author · access scope (internal-public·open-source) · scope in one line. Identify **resolution difference** from the hub's corresponding asset.
28
+
29
+ 2. **Cross-audit session creation** — Record comparison in `tracks/_audit/session_YYYY_MM_DD_{slug}.md`. Minimum contents:
30
+ - Position comparison table of the two assets (perspective · axis basis · conclusion method)
31
+ - Overlap area (value if combined)
32
+ - List of **items to import** from the other side
33
+ - List of **items the hub can propagate**
34
+ - Cognitive gap facts (independent work interval, mutual unaware period)
35
+
36
+ 3. **Cross-reference link insertion judgment** — 1 line at the end of hub asset + 1 line at the head of the other asset. If no write access to the other repo, write a **proposal** (`tracks/_audit/proposal_*.md`) and deliver to the team.
37
+
38
+ ## Prohibited
39
+
40
+ - **One-way export** — No "we'll teach them" tone. **Publicly list the items to import first** to demonstrate bidirectionality.
41
+ - **Instructive proposals to restructure the other asset** — "add section / restructure / insert" verbs risk damaging the relationship. Use provider-humble phrasing.
42
+ - **Clone-and-own the other asset** — Do not copy the other repo's asset into the hub. Reference links + session records only.
43
+
44
+ ## Required before distributing proposals externally
45
+
46
+ Proposals to deliver to the other team are external-facing assets. After **3+ persona × 4-axis** (resonance·confusion·resistance·supplement) audit using `hub-persona-auditor` or similar, accept 3-tier revisions. Do not deliver directly without audit.
47
+
48
+ ## Quarterly sync
49
+
50
+ Quarterly sync with the latest version of the sister asset recommended (approximately 3-month cycle). Sharing the schedule with the other side makes work timing predictable.
51
+
52
+ ## Real-world value basis
53
+
54
+ The value of discovering a sister asset is proportional to the **cognitive gap period**. In a case where two teams in the same organization independently worked on the same topic 4 days apart, simply having cross-links would have multiplied the combined value. Keeping the protocol activation threshold low is the safe choice.