@chrono-meta/fh-gate 1.4.72 → 1.4.74
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.
- package/.claude/rules/.public-surface-patterns.defaults +44 -0
- package/.claude/rules/fh_4axis_gate.md +207 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/AGENTS.md +26 -2
- package/CATALOG.md +31 -0
- package/docs/ETHOS.md +106 -0
- package/docs/OUTPUT_EVIDENCE.md +118 -0
- package/docs/WHY.md +42 -0
- package/knowledge/patterns/ensemble_union_detection_task_pattern.md +125 -0
- package/knowledge/shared/GLOSSARY.md +77 -0
- package/knowledge/shared/harness-core/measurement-integrity-checklist.md +10 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +554 -0
- package/knowledge/shared/patterns/multi-persona-review.md +88 -0
- package/knowledge/shared/plugin-catalog/recommended_plugins.md +117 -0
- package/package.json +42 -1
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/.claude-plugin/plugin.json +2 -2
- package/plugins/fh-meta/CHANGELOG.md +617 -0
- package/plugins/fh-meta/skills/context-doctor/SKILL.md +42 -4
- package/plugins/fh-meta/skills/context-doctor/SKILL_detail.md +38 -0
- package/scripts/below_floor_scan.sh +91 -0
- package/scripts/chamber_candidate_collect.sh +223 -0
- package/scripts/chamber_run.sh +184 -0
- package/scripts/degrade_direction_scan.sh +222 -0
- package/scripts/fh_env_delta_scan.sh +108 -0
- package/scripts/fh_session_load.sh +202 -0
- package/scripts/gate_pathspec_check.sh +166 -0
- package/scripts/package_coverage_check.sh +119 -0
- package/scripts/prepush_guard_check.sh +374 -0
- package/scripts/psa_scan_lib.sh +153 -0
- package/scripts/public_surface_scan_files.sh +157 -0
- package/scripts/selfcheck.sh +28 -0
- package/scripts/session_close_check.sh +171 -0
- package/scripts/substrate_jump_detector.sh +60 -0
- package/scripts/test_degrade_scan_shell_probes.sh +185 -0
- package/scripts/test_marker_floor_lanes.sh +45 -0
- package/scripts/test_prepush_stdin_integrity.sh +119 -0
- package/scripts/tier_census_grep.sh +54 -0
- package/scripts/universal_guard_check.sh +280 -0
- package/templates/.claude/rules/mcp_tool_gating.md +157 -0
- package/templates/.claude/rules/session.md +153 -0
- package/templates/.git-hooks/pre-commit +848 -0
- package/templates/.git-hooks/pre-push +585 -0
- package/templates/PRE-PUBLISH-CHECKLIST.md +85 -0
- package/templates/contrib_session.md +34 -0
- package/templates/degrade_direction_scan.sh +222 -0
- package/templates/goal-quench-hook-setup.md +152 -0
- package/templates/predelete_check.sh +72 -0
- package/templates/regression_guard.sh +563 -0
- package/templates/starter_profile.md +83 -0
- package/templates/temper_check.sh +46 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ensemble-union-detection-task
|
|
3
|
+
description: "Detection tasks benefit from ensemble UNION (2.5–3.0x coverage lift); generation tasks do not (voting, ~0x). Measured, domain-agnostic."
|
|
4
|
+
type: pattern
|
|
5
|
+
status: VALIDATED
|
|
6
|
+
tags: [ensemble, union, detection, decorrelation, composition-over-scale]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Ensemble Union Pattern for Detection Tasks
|
|
10
|
+
|
|
11
|
+
> **Measurement basis**: a PRD-review detection protocol (n=3 real product PRDs) + a generation-task
|
|
12
|
+
> contrast, measured on a fixed open-weight 3-model roster. Detection lift +11.3 findings (2.8x; per-PRD
|
|
13
|
+
> range 2.5x–3.0x); generation lift ~0.
|
|
14
|
+
|
|
15
|
+
## Pattern
|
|
16
|
+
|
|
17
|
+
**Detection tasks benefit from an ensemble UNION strategy, not voting.**
|
|
18
|
+
|
|
19
|
+
- **Detection** (finding defects, gaps, issues): union of all model findings → **2.5x–3.0x** more coverage.
|
|
20
|
+
- **Generation** (creating one artifact): voting for consensus → **~0x lift** (no benefit).
|
|
21
|
+
|
|
22
|
+
## Mechanism
|
|
23
|
+
|
|
24
|
+
Each model has **different blind spots**. Model A finds category-X defects, B finds Y, C finds Z.
|
|
25
|
+
`Union(A, B, C)` = superset of all findings → coverage expansion. Voting would **discard minority
|
|
26
|
+
findings**, losing exactly the diversity that makes the panel worth running. (This is the
|
|
27
|
+
composition-over-scale lever: the gain is model *diversity*, not model size — and it holds only while the
|
|
28
|
+
errors are decorrelated. A shared/correlated blind spot is not closed by union; diagnose correlated vs
|
|
29
|
+
independent first.)
|
|
30
|
+
|
|
31
|
+
## Measured Results
|
|
32
|
+
|
|
33
|
+
Anchored on a PRD-review detection protocol (3 real product PRDs; 3-model open-weight union vs each single
|
|
34
|
+
model):
|
|
35
|
+
|
|
36
|
+
| Metric | Union (E) | Best single | Lift |
|
|
37
|
+
|---|:--:|:--:|:--:|
|
|
38
|
+
| Mean findings / PRD | 18.0 | 6.7 | **+11.3 (2.8x)** |
|
|
39
|
+
|
|
40
|
+
Per-PRD lift ranged **+10.7 to +12.0 (2.5x–3.0x)** — union was 18.0 on every PRD while the best single
|
|
41
|
+
model never exceeded 7.3, because each model surfaced *different* findings. A generation-task contrast
|
|
42
|
+
(create one artifact) showed **~0 lift** from the same union: consensus/voting adds nothing when the goal
|
|
43
|
+
is one output rather than coverage. (The detection→UNION / generation→VOTING split is the validated
|
|
44
|
+
pattern; the +11.3 detection anchor is the measured number, the generation-0 is the qualitative contrast.)
|
|
45
|
+
|
|
46
|
+
**Arms** (illustrative open-weight roster): three distinct open-weight models spanning ≥2 model families
|
|
47
|
+
(e.g. `qwen3.5-122b`, `qwen3-next-80b`, `gpt-oss-120b`). Family diversity is the point — a same-family
|
|
48
|
+
trio shares blind spots. `E` = union(the three).
|
|
49
|
+
|
|
50
|
+
## Implementation
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
# Detection task → UNION
|
|
54
|
+
result = ensemble_request(
|
|
55
|
+
prompt="Review this document and classify findings into bins A/B/C/D",
|
|
56
|
+
models=[MODEL_A, MODEL_B, MODEL_C], # ≥2 families
|
|
57
|
+
strategy="UNION",
|
|
58
|
+
temperature=0.0,
|
|
59
|
+
)
|
|
60
|
+
# result.findings = all unique findings across models
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Deduplication logic
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
def compute_union(responses):
|
|
67
|
+
"""Union of findings across models, deduplicated by normalized description."""
|
|
68
|
+
seen, union = set(), []
|
|
69
|
+
for response in responses:
|
|
70
|
+
for finding in extract_findings(response):
|
|
71
|
+
key = finding.get("description", "")[:50].lower()
|
|
72
|
+
if key and key not in seen:
|
|
73
|
+
seen.add(key)
|
|
74
|
+
union.append(finding)
|
|
75
|
+
return {"findings": union, "total": len(union)}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Token economics
|
|
79
|
+
|
|
80
|
+
Detection is where a cheap local/open-weight union beats a single frontier call on **both** axes —
|
|
81
|
+
more findings **and** lower cost — because union trades false-positive rate (filtered downstream) for
|
|
82
|
+
coverage:
|
|
83
|
+
|
|
84
|
+
| Option | Relative cost | Findings/item | Note |
|
|
85
|
+
|---|:--:|:--:|---|
|
|
86
|
+
| Frontier alone | baseline | 6.7 | single strong model |
|
|
87
|
+
| Open-weight union (3-model) | ~1/19 | 18.0 | ~19x cheaper + ~2.8x more findings |
|
|
88
|
+
|
|
89
|
+
## Constraints
|
|
90
|
+
|
|
91
|
+
- **False positives**: union includes *all* findings → higher FP rate. Mitigate with a frontier filter
|
|
92
|
+
(union output → one strong-model validation pass), expert review of high-priority findings only, and a
|
|
93
|
+
downstream precision measurement against ground truth.
|
|
94
|
+
- **Decorrelation precondition**: union only helps when the panel's errors are *independent*. If a blind
|
|
95
|
+
spot is shared (correlated), stacking more models does not close it — escalate to a human/ground anchor
|
|
96
|
+
instead. Diagnose correlated-vs-independent (reps ≥ 3) before prescribing union.
|
|
97
|
+
|
|
98
|
+
## When to apply
|
|
99
|
+
|
|
100
|
+
| Task type | Examples | Strategy |
|
|
101
|
+
|---|---|:--:|
|
|
102
|
+
| **Detection** | Bug finding · document review · audit · red-team · structure/traceability check | **UNION** |
|
|
103
|
+
| **Generation** | Artifact creation · synthesis · single-answer tasks | **VOTING** |
|
|
104
|
+
|
|
105
|
+
**Rule of thumb**: "find all X" → UNION. "create one Y" → VOTING.
|
|
106
|
+
|
|
107
|
+
## Cross-domain applicability
|
|
108
|
+
|
|
109
|
+
Domain-agnostic — applies to any detection task where (1) multiple independent judges have different
|
|
110
|
+
blind spots, (2) the goal is coverage maximization not consensus, (3) false positives can be filtered
|
|
111
|
+
downstream. Examples beyond QA: code review (security · performance · maintainability), multi-specialist
|
|
112
|
+
diagnosis, content moderation (hate speech · spam · misinformation), fraud detection (multiple risk
|
|
113
|
+
models).
|
|
114
|
+
|
|
115
|
+
## Done When
|
|
116
|
+
|
|
117
|
+
- [x] Validated on a PRD-review detection protocol (+11.3, 2.8x; per-PRD +10.7 to +12.0) + a generation contrast (~0 lift). *[measured]*
|
|
118
|
+
- [x] Deduplication logic specified. *[mandatory-pass]*
|
|
119
|
+
- [x] Decorrelation precondition + FP mitigation documented. *[judged — pair: correlated-blindspot diagnosis]*
|
|
120
|
+
- [ ] (Optional) Precision/FP-rate measurement against ground truth.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
**One-line takeaway**: Detection → ensemble UNION (2.5–3.0x lift). Generation → voting (~0x). The lever is
|
|
125
|
+
family diversity, not model size, and only while errors stay decorrelated.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# GLOSSARY — forge-harness Key Term Definitions
|
|
2
|
+
|
|
3
|
+
> One-line definitions of FH-specific vocabulary appearing in skills, agents, and documentation.
|
|
4
|
+
> Reference point for new user onboarding. Keep in sync with the README key terms table.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Hub Structure
|
|
9
|
+
|
|
10
|
+
| Term | Definition |
|
|
11
|
+
|---|---|
|
|
12
|
+
| **Meta-Harness** | A persistent hub in a Claude Code environment that connects the work, learnings, and patterns of N projects for mutual reinforcement. Not a simple storage — a connection layer through which knowledge flows between projects. |
|
|
13
|
+
| **Meta Hub** | The role of coordinating all field projects from the meta-harness cwd. Hub = common standards and feedback center / field projects = execution sites. |
|
|
14
|
+
| **Launch Pad Effect** | Using the meta-harness not as a final destination but as a launch pad — even a brief pass-through generates setup, pattern sharing, and speed-up effects. |
|
|
15
|
+
| **Transit Acceleration Value** | The meta-harness's core value — passing through itself accelerates the starting line. Acceleration effect occurs the moment you pass through, without requiring absorption or permanent setup. |
|
|
16
|
+
| **Shared Skill Pool** | Removes the cost of each team/harness independently reinventing the same skills/agents. The meta-harness provides a common pool and each project draws from it. |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Operating Modes
|
|
21
|
+
|
|
22
|
+
| Term | Definition |
|
|
23
|
+
|---|---|
|
|
24
|
+
| **Mode A** | Full harness clone + use all skills/agents. Run directly from hub cwd. |
|
|
25
|
+
| **Mode B** | Partial harness clone or fork. Select and use specific skills/agents only. |
|
|
26
|
+
| **Mode C** | Install only fh-meta via `claude plugin install` without cloning hub. Independent plugin method. |
|
|
27
|
+
| **Path B generalization** | Generalizing skill behavior to work in external user environments without organization-specific infrastructure dependencies. |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Diagnostic Skill Triangle
|
|
32
|
+
|
|
33
|
+
| Term | Definition |
|
|
34
|
+
|---|---|
|
|
35
|
+
| **Three-Doctor Loop** | Pattern where harness-doctor (structure diagnosis) + context-doctor (token/context diagnosis) + sim-conductor (simulation/ideation scan) form a self-renewing closed loop of diagnosis→prescription→re-diagnosis. |
|
|
36
|
+
| **harness-doctor** | Harness structure L1~L4 diagnostic skill. L1 structural completeness · L2 complexity · L3 Drift · L4 connection diagnosis. |
|
|
37
|
+
| **context-doctor** | Token waste diagnostic skill. `.claudeignore` auto-generation, large file detection, `/clear` timing guidance. |
|
|
38
|
+
| **sim-conductor** | Meta-simulation automation skill. Area A (external user) · B (internal audit) · C (ideation scan) · D (code/session/skill/memory verification) · E (quality examination). |
|
|
39
|
+
| **install-doctor** | Plugin install pre/post conflict, duplicate, and silent overwrite risk diagnostic skill. |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Prescription Tiers
|
|
44
|
+
|
|
45
|
+
| Term | Definition |
|
|
46
|
+
|---|---|
|
|
47
|
+
| **M-tier (Mandatory)** | Requires immediate action. Risk of functional failure or data loss if left unaddressed. |
|
|
48
|
+
| **S-tier (Strongly recommended)** | Strongly recommended improvement. Quality degradation and drift accumulation if left unaddressed. |
|
|
49
|
+
| **R-tier (Recommended)** | Recommended optimization item. Efficiency improvement when resolved. |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Design Principles
|
|
54
|
+
|
|
55
|
+
| Term | Definition |
|
|
56
|
+
|---|---|
|
|
57
|
+
| **Simplification Guard** | Mandatory matching of existing assets before adding new ones. Additions rejected without "N+ real-use observations". The execution mechanism of the "a good harness gets simpler over time" principle. |
|
|
58
|
+
| **Description diet** | Removing self-marketing vocabulary (iteration counts, version history, emphasis words, owner names) from skill frontmatter descriptions to make them readable by external users. |
|
|
59
|
+
| **Layer A auto-read** | The 4 files CLAUDE.md automatically reads at session start (CATALOG.md · latest track file · MEMORY.md · next session starter card). Only works in meta-harness cwd. |
|
|
60
|
+
| **Layer A fallback** | Alternate path when Layer A silent-skips in non-meta-harness cwd environments. Manual CATALOG.md read or adding Layer A reference to project CLAUDE.md. |
|
|
61
|
+
| **silent overwrite** | Risk of overwriting existing settings without user awareness. Detected in advance by install-doctor. |
|
|
62
|
+
| **drift** | Phenomenon of growing gap between design intent and actual behavior. Checked periodically as harness-doctor L3 item. |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Evolution Concepts
|
|
67
|
+
|
|
68
|
+
| Term | Definition |
|
|
69
|
+
|---|---|
|
|
70
|
+
| **cascade α** | Stage where FH skills are first autonomously executed by internal users (including owner). |
|
|
71
|
+
| **cascade β** | Stage where FH skills are autonomously executed by users other than the owner (quasi-external). First achieved by an external user. |
|
|
72
|
+
| **cross-project skill bus** | Structure for centrally managing skills/agents of local projects through FH and enabling cross-project cross-calling. |
|
|
73
|
+
| **field harvest** | Process of feeding patterns discovered in field project work back (pull) to FH. Automated with `/field-harvest` skill. |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
*Updated: 2026-05-26*
|
|
@@ -120,6 +120,8 @@ here.** Three shapes, all observed 2026-07-20 in a single session:
|
|
|
120
120
|
| n+7 | **Instrument sees only part of its own declared surface** | An "always-loaded footprint" scan summed files rooted at `$TARGET`, silently omitting the auto-loaded memory index living outside it — **61% of the real resident surface** | A known-positive (a file you *know* is resident) fails to appear in the sum |
|
|
121
121
|
| n+8 | **A cheap proxy substituted for the real property** | Index-line/topic-file **size ratio** used as a proxy for *content coverage*; minimum ratio 3.7× read as "safe" — while an entry whose file was 3.7× larger still lacked every fact the index carried | One known case checked by content, not size, inverts the verdict immediately |
|
|
122
122
|
| n+9 | **Language / encoding assumption mismatch** | An **ASCII-token scanner run over a Korean corpus**: the index wrote `catch`, `MERGED`, `expert-system`; the files wrote `잡았다`, `머지`, `케이스크래프트` → every token scored as missing. **~96% false positives** | One known-negative (an entry you know is fully covered) scores as "missing" → mismatch exposed |
|
|
123
|
+
| n+10 | **Accepted into the scanned set, but no probe matches that shape** — the instrument counts the file as covered and reports it *clean* | `degrade_direction_scan.sh` collected `.sh` files while every probe was Python-shaped (`except:` / `.get(k, True)` / `if not x:`). A known-positive bash file with four default-toward-PASS constructs scored **0/4**, and the output read `no default-toward-PASS smells in 1 scanned py/sh file` (2026-07-28) | The known-positive of *that shape* scores 0 while the summary says "scanned" — the tell is coverage claimed without detection demonstrated |
|
|
124
|
+
| n+11 | **The collection predicate, not the probe, is what silently drops the target** | Same scan: git hooks are named `pre-push` (no extension) under `.git-hooks` (dotted directory), and the extension test ran against the **full path**, so FH's own mechanical floor reported `no scannable (py/sh) target files`, exit 0 | Point the instrument at a directory you *know* holds a positive; an empty file list is the finding, not a clean result |
|
|
123
125
|
|
|
124
126
|
Secondary false-positive sources in the same run, worth checking explicitly: **whitespace/hyphen
|
|
125
127
|
variants** (`3주새` vs `3주 새`), and treating a line's **navigational annotation** (`(detail …, archive)`)
|
|
@@ -134,6 +136,14 @@ as a factual claim.
|
|
|
134
136
|
`UNMEASURED`, never `0`.
|
|
135
137
|
- An instrument that produces an **impossible value** (all-pass, all-fail, or a self-scan in which the
|
|
136
138
|
running tool does not detect itself) is suspect **before** its target is. Suspect the instrument first.
|
|
139
|
+
- **"Scanned" is a claim, and it is separate from "covered."** A scanner that admits a file type into its
|
|
140
|
+
scanned set owes a known-positive *of that type*; without one, its clean message is a false clean, which
|
|
141
|
+
is strictly worse than an honest "not covered" (n+10). Same for the collection step: an empty file list
|
|
142
|
+
is a calibration failure to report, never a clean run (n+11).
|
|
143
|
+
- **A probe that flags the prescribed remedy is a defect in the probe.** Measured 2026-07-28: flagging
|
|
144
|
+
`${count:-0}` — the integer sanitization that closes the `pipefail`-fallback class — would push an author
|
|
145
|
+
to delete the fix. Hand-check a sample of hits before shipping a probe; on this corpus 6/6 sampled hits
|
|
146
|
+
were false positives and the scoping that followed cut the load from 73 to 14.
|
|
137
147
|
|
|
138
148
|
### Done When
|
|
139
149
|
|