@chrono-meta/fh-gate 1.4.52 → 1.4.54

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.
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "fh-commons",
3
+ "version": "1.4.54",
4
+ "engines": {
5
+ "claudeCode": ">=1.0.0"
6
+ },
7
+ "description": "Cross-project utility skill bundle — 4 skills + 1 agent. Domain-agnostic and portable: convergence-loop, deliberation, mcp-circuit-breaker, token-budget-gate + quench-challenger agent.",
8
+ "author": {
9
+ "name": "chrono-meta",
10
+ "email": "chrono-meta@users.noreply.github.com"
11
+ },
12
+ "keywords": [
13
+ "commons",
14
+ "convergence-loop",
15
+ "gate-reinforcement",
16
+ "multi-round-validation",
17
+ "deliberation",
18
+ "multi-perspective-synthesis",
19
+ "forge-skill",
20
+ "domain-agnostic",
21
+ "cross-project"
22
+ ]
23
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "fh-meta",
3
+ "version": "1.4.54",
4
+ "engines": {
5
+ "claudeCode": ">=1.0.0"
6
+ },
7
+ "description": "Hub meta-engineering toolkit — 33 skills + 7 agents. New in 1.4.48: phantom-quench + steel-quench gain external frontier anchors (arXiv:2607.02052 package-hallucination; arXiv:2607.02057 prompt-coverage-adequacy); README model-flat claim reframed from a per-release point-curve to structural invariants (operation flattens across tiers; depth tier-order fixed within a generation). New in 1.4.47: onboarding step ① surfaces the Mode D companion-store session-start load in the auto-read salience anchor (previously only in the local binding + rules, so a greeting could skip the load). New in 1.4.46: context-doctor gains a command-output axis — routes to a command-output proxy/hook (rtk) to trim verbose CLI stdout, complementing .claudeignore; risk-gated to token-scarce environments (lossy filtering, off gate-input paths). New in 1.4.41: context-doctor 2026 trigger vocab (context engineering/rot/collapse) + phantom-citation hardening; hub measurement-integrity-checklist (cross-model measurement pre-flight: display-name pin/reps≥3/discriminating probe). New in 1.4.40: install-wizard scaffolds the companion store as a queryable wiki (INDEX + session-start read + Raw/Wiki/Conversation ingest axis). New in 1.4.39: auto-decorrelation (cross-family verifier sidecar recruitment, calibration-gated) + video-ingest (capability-routed video ingestion). New in 1.4.37: corpus-grounding-expander + persona-roster-expander (field-harvested verbatim-relay capability skills). New in 1.3.0: public-surface-audit (git-tracked private-token leak scan), field-harvest Mode B session-end auto-trigger, 4-axis gate scope extension (docs/ + AGENTS.md). New in 1.2.0: pipeline-conductor (4-pipeline gated sweep), return-path-gate (chain closure audit), goal-quench (Stop hook + quality gate), steel-quench Wave 5 (multi-model sidecar challenger), 2-layer architecture docs, YAML validation script. Validated cross-CLI: Claude Code, Codex, Gemini.",
8
+ "author": {
9
+ "name": "chrono-meta",
10
+ "email": "chrono-meta@users.noreply.github.com"
11
+ },
12
+ "keywords": [
13
+ "hub-meta",
14
+ "fact-check",
15
+ "self-verification",
16
+ "bidirectional-validation",
17
+ "cross-ecosystem-synergy",
18
+ "plugin-recommender",
19
+ "pr-review",
20
+ "harness-engineering",
21
+ "ai-collaboration",
22
+ "token-efficiency",
23
+ "context-doctor",
24
+ "harness-doctor",
25
+ "install-doctor",
26
+ "install-conflict-detection",
27
+ "install-wizard",
28
+ "onboarding-automation",
29
+ "marketplace-gate",
30
+ "marketplace-readiness",
31
+ "meta-prompt-builder",
32
+ "prompt-delegation",
33
+ "circular-validation",
34
+ "2d-adversary"
35
+ ]
36
+ }
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env bash
2
+ # count_check.sh — skill/agent count-consistency check (single source).
3
+ # Class: mandatory-pass (harness_6axis_framework.md §Axis 5) — exit 1 on drift.
4
+ #
5
+ # Called by ALL THREE count-consistency boundaries so one logic runs everywhere:
6
+ # - scripts/selfcheck.sh → publish-readiness (prepublishOnly + npm test)
7
+ # - templates/.git-hooks/pre-commit → local commit time, `--staged` (index mode)
8
+ # - .github/workflows/validate.yml → PR/merge boundary (checked-out tree == committed)
9
+ #
10
+ # Origin (fh_signal_2026-06-21): the count check used to live ONLY at the publish boundary.
11
+ # But the actor that breaks it — a commit/merge that adds/removes a skill dir — acts at
12
+ # commit/merge time, so a skill-adding PR (#111) merged with stale counts and they sat
13
+ # undetected on main until the next publish. This is the gate-locality gap (a gate must
14
+ # live where the breaking action happens). One source, three boundaries, no reinvention.
15
+ #
16
+ # Modes:
17
+ # (default) count the WORKING TREE — selfcheck (publish; tree == HEAD) and CI
18
+ # (a checked-out PR IS the committed state). cat/glob the on-disk files.
19
+ # --staged count the INDEX (exactly what THIS commit will contain) — the pre-commit
20
+ # hook. Fixes steel-quench S1 (2026-06-21): a worktree-only count can
21
+ # FALSE-PASS a commit that stages a skill add but leaves the count-file
22
+ # updates unstaged — the gate would verify a different tree than it commits.
23
+ set -u
24
+ cd "$(dirname "${BASH_SOURCE[0]}")/.." || { echo "COUNT-CHECK: FAIL (cannot cd to repo root)"; exit 1; }
25
+
26
+ MODE="worktree"
27
+ [ "${1:-}" = "--staged" ] && MODE="staged"
28
+ fail=0
29
+
30
+ # Read a tracked file's content from the active tree (index in --staged, disk otherwise).
31
+ read_tree() { # read_tree <path>
32
+ if [ "$MODE" = staged ]; then git show ":$1" 2>/dev/null; else cat "$1" 2>/dev/null; fi
33
+ }
34
+ # List a plugin's top-level SKILL.md paths in the active tree.
35
+ list_skills() { # list_skills <plugin>
36
+ if [ "$MODE" = staged ]; then
37
+ git ls-files --cached -- "plugins/$1/skills" 2>/dev/null \
38
+ | grep -E "^plugins/$1/skills/[^/]+/SKILL\.md$"
39
+ else
40
+ local s
41
+ for s in plugins/"$1"/skills/*/SKILL.md; do [ -f "$s" ] && echo "$s"; done
42
+ fi
43
+ }
44
+ # Count a plugin's top-level agent .md files in the active tree.
45
+ count_agents() { # count_agents <plugin>
46
+ if [ "$MODE" = staged ]; then
47
+ git ls-files --cached -- "plugins/$1/agents" 2>/dev/null \
48
+ | grep -cE "^plugins/$1/agents/[^/]+\.md$"
49
+ else
50
+ ls plugins/"$1"/agents/*.md 2>/dev/null | wc -l | tr -d ' '
51
+ fi
52
+ }
53
+ # Active skill = SKILL.md whose head (first 20 lines) carries no deprecation marker
54
+ # (a whole-file grep false-positives on skills that merely mention the word).
55
+ count_active() { # count_active <plugin>
56
+ local n=0 s
57
+ while IFS= read -r s; do
58
+ [ -z "$s" ] && continue
59
+ read_tree "$s" | head -20 | grep -qE 'deprecated: true|DEPRECATED' || n=$((n+1))
60
+ done < <(list_skills "$1")
61
+ echo "$n"
62
+ }
63
+
64
+ meta_sk=$(count_active fh-meta); meta_ag=$(count_agents fh-meta)
65
+ com_sk=$(count_active fh-commons); com_ag=$(count_agents fh-commons)
66
+ total_sk=$((meta_sk + com_sk)); total_ag=$((meta_ag + com_ag))
67
+
68
+ # Impossible-zero guard (steel-quench A4 — fail CLOSED): fh-meta always has active skills.
69
+ # A 0 means the tree/glob resolved to nothing (wrong cwd, empty index, sh-as-bash shim) —
70
+ # a gate must never return "consistent" from an empty tree.
71
+ if [ "$meta_sk" -eq 0 ]; then
72
+ echo "COUNT-CHECK: FAIL (0 active fh-meta skills — empty/wrong tree, mode=$MODE)"
73
+ exit 1
74
+ fi
75
+
76
+ count_check() { # count_check <label> <file> <expected-string>
77
+ if read_tree "$2" | grep -q "$3"; then
78
+ echo "PASS count: $1"
79
+ else
80
+ echo "FAIL count: $1 — expected \"$3\" in $2 (actual: fh-meta ${meta_sk}sk/${meta_ag}ag, fh-commons ${com_sk}sk/${com_ag}ag)"
81
+ fail=1
82
+ fi
83
+ }
84
+ count_check "fh-meta plugin.json" plugins/fh-meta/.claude-plugin/plugin.json "${meta_sk} skills + ${meta_ag} agents"
85
+ count_check "fh-commons plugin.json" plugins/fh-commons/.claude-plugin/plugin.json "${com_sk} skills"
86
+ count_check "marketplace.json fh-meta" .claude-plugin/marketplace.json "${meta_sk} skills + ${meta_ag} agents"
87
+ count_check "README header" README.md "${total_sk} skills · ${total_ag} agents"
88
+ count_check "local_fh_context fh-meta" templates/local_fh_context.md "(fh-meta, ${meta_sk})"
89
+
90
+ if [ "$fail" -ne 0 ]; then
91
+ echo "COUNT-CHECK: FAIL"
92
+ exit 1
93
+ fi
94
+ echo "COUNT-CHECK: PASS (mode=$MODE)"
95
+ exit 0
@@ -25,6 +25,11 @@ for f in bin/*.js; do
25
25
  check "node --check $f" node --check "$f"
26
26
  done
27
27
 
28
+ # Codex adapter drift: the thin Codex runtime must keep reading canonical FH
29
+ # skill/agent surfaces without silently accepting Claude-native primitives as
30
+ # Codex-native.
31
+ check "fh-codex-doctor --strict" bash -c 'node bin/fh-codex-doctor.js --strict >/dev/null'
32
+
28
33
  # Bash surface: npm-shipped scripts + local bin wrappers + gate-chain infra
29
34
  for f in scripts/*.sh bin/fh-gate bin/fh-run bin/fh-goal \
30
35
  templates/regression_guard.sh templates/temper_check.sh templates/predelete_check.sh templates/.git-hooks/pre-commit; do
@@ -43,26 +48,28 @@ if ! bash scripts/count_check.sh; then
43
48
  fail=1
44
49
  fi
45
50
 
46
- # Referenced-path existence: backtick-quoted repo-relative file refs in the always-loaded
47
- # governance surface (CLAUDE.md + .claude/rules/*.md) must exist. Phantom-reference class
48
- # recurred N>=3 in the 2026-06-11 audit window (operations.md _scanner.sh, claude-chrono path,
49
- # stale templates ref) instrument-not-habit. Globs/placeholders/{vars} are excluded by the
50
- # filter; tracks/ is machine-local and deliberately out of scope. Gitignored refs (e.g.
51
- # `.claude/settings.json` named in prose *about* gitignored files) are skipped they exist
52
- # locally but not on a fresh clone, and "must exist" here means "must ship".
53
- while IFS= read -r p; do
54
- if git check-ignore -q "$p" 2>/dev/null; then
55
- echo "SKIP ref-path (gitignored): $p"
56
- elif [ -f "$p" ]; then
57
- echo "PASS ref-path: $p"
58
- else
59
- echo "FAIL ref-path: $p — referenced in CLAUDE.md/.claude/rules but missing"
60
- fail=1
61
- fi
62
- done < <(grep -hoE '\`[^\` ]+\`' CLAUDE.md .claude/rules/*.md 2>/dev/null \
63
- | sed 's/\`//g' \
64
- | grep -E '^(knowledge|templates|scripts|docs|plugins|\.claude)/[^*{}<>$]+\.(md|sh|ya?ml|jsonc|json)$' \
65
- | sort -u)
51
+ # Referenced-path existence is a source-tree check. The npm package intentionally
52
+ # ships a narrower runtime surface, so package-mode selfcheck skips this section.
53
+ if [ -d ".claude/rules" ]; then
54
+ # Backtick-quoted repo-relative file refs in the always-loaded governance surface
55
+ # (CLAUDE.md + .claude/rules/*.md) must exist. Phantom-reference class recurred
56
+ # N>=3 in the 2026-06-11 audit windowinstrument-not-habit.
57
+ while IFS= read -r p; do
58
+ if git check-ignore -q "$p" 2>/dev/null; then
59
+ echo "SKIP ref-path (gitignored): $p"
60
+ elif [ -f "$p" ]; then
61
+ echo "PASS ref-path: $p"
62
+ else
63
+ echo "FAIL ref-path: $p — referenced in CLAUDE.md/.claude/rules but missing"
64
+ fail=1
65
+ fi
66
+ done < <(grep -hoE '\`[^\` ]+\`' CLAUDE.md .claude/rules/*.md 2>/dev/null \
67
+ | sed 's/\`//g' \
68
+ | grep -E '^(knowledge|templates|scripts|docs|plugins|\.claude)/[^*{}<>$]+\.(md|sh|ya?ml|jsonc|json)$' \
69
+ | sort -u)
70
+ else
71
+ echo "SKIP ref-path (package mode: .claude/rules absent)"
72
+ fi
66
73
 
67
74
  if [ "$fail" -ne 0 ]; then
68
75
  echo "SELFCHECK: FAIL"
@@ -0,0 +1,87 @@
1
+ # CLAUDE.md
2
+
3
+ ## Session Start
4
+
5
+ When a user starts a session with greetings like "hello", "let's start", "resume", "continuing from where we left off", or says "read root memory", **both layers must activate**:
6
+
7
+ ### Layer A — Auto read (4 steps required)
8
+
9
+ 1. **Read CATALOG.md** — `~/projects/forge-harness/CATALOG.md` (recent work context + latest meta cwd work cross-link)
10
+ 2. **Read latest session file** — `~/projects/forge-harness/tracks/{project}/` most recent mtime item (last work on domain + next round reverse-injection intent persistence location / use `ls -lat` or `find -mtime`)
11
+ 3. **Check MEMORY.md next-session trigger** — if project memory `MEMORY.md` auto-load is truncated, explicitly Read to supplement the next-session trigger section
12
+ 4. **Check todo/plan files if present** — `*todo*`/`*plan*` pattern (supplementary materials)
13
+ 5. **Search for duplicate installs in same root** — `ls ../ | grep -iE '(harness|forge)'` to catch sibling assets in parent directory. If found, report to user + delegate branching decision (use existing install / proceed with new / archive then proceed)
14
+
15
+ ### Layer B — Proactive initiative (active onboarding 5-skill cascade)
16
+
17
+ After Layer A completes, **when the user enters a task**, activate AI proactive initiative mode:
18
+
19
+ 1. **Auto-initiative (1-line question)** — *"What task/project would you like to start? (e.g., 'Spring Boot API development', 'React component refactoring', 'continue existing [X] track')"* (if active track exists: *"Would you like to continue active track [X], or enter a new task?"*)
20
+ 2. **5-skill cascade** — `plugin-recommender` (internal GHE → external → built-in candidates) → `cross-ecosystem-synergy-detection` (synergy grade table) → `.claudeignore` standard initiative (`cp templates/.claudeignore`) → model switching guidance (default `/model sonnet` — FH dispatches floored skills/agents at higher tiers itself; pin a stronger model for harness-editing sessions, or when the Field Depth-Escalation Notice below fires — see README §Model setup) → `verify-bidirectional`·`harvest-loop` natural emergence waiting
21
+ 3. **User consent → actual setup** — plugin install / skill pre-activation / `.claudeignore` application / model switch
22
+ 4. **Project cwd handover guidance** — *"Setup complete. Move to the project cwd and call `claude` to start working."*
23
+
24
+ **Simplification guard**: When an explicit task utterance is made (e.g., "debug X code"), enter task immediately (skip onboarding). Activates once per session.
25
+
26
+ ### Field Depth-Escalation Notice (advisory — once per session)
27
+
28
+ The Sonnet default covers routine field work because FH dispatches floored skills/agents at higher
29
+ tiers itself. But when **main-thread development visibly strains the session tier**, surface a
30
+ one-line escalation proposal — do not leave it to recall:
31
+
32
+ **Triggers** (any one): the same problem survives 2–3 correction loops · the work enters
33
+ architecture/design reasoning that cannot be decomposed into a dispatchable unit · the user
34
+ signals being stuck ("keeps failing", "why is this still wrong").
35
+
36
+ **Two-step ladder** (propose the cheaper rung first):
37
+ 1. **Opus dispatch (sidecar)** — if the heavy reasoning packages into a unit (a design review, a
38
+ root-cause hunt, an adversarial pass), propose dispatching it to an Opus agent: the session
39
+ stays on Sonnet, cost stays local to the unit.
40
+ 2. **Session pin** — if the work is inherently main-thread (iterative dialogue design, repeated
41
+ whole-context reasoning), propose: *"This work demands session-level design depth — pinning
42
+ `/model opus` is recommended. Proceeding as-is also works: dispatches still cover floored units."*
43
+ 3. **No higher tier available** — common in metered API routing (a Bedrock-style Sonnet-only
44
+ deployment) or alternative runtimes (Hermes / OpenCode-class) that don't offer higher Claude
45
+ tiers: skip the proposal, proceed at the available tier, and **flag depth-sensitive
46
+ deliverables with an explicit below-floor limitation note** (F2 semantics — tier-floor
47
+ resolution, `multi_model_sidecar_strategy.md §Tier-floor`). Silent proceeding is the failure
48
+ mode this rung exists to prevent; the note makes the deliverable a re-review candidate when a
49
+ floor tier becomes reachable.
50
+
51
+ **Guards** (mirrors the hub's Mode D Model Notice): once per session · advisory only — **never
52
+ switch the session model autonomously** (human override is inviolable) · sessions where nothing
53
+ strains never see it — the Sonnet default stays friction-free.
54
+
55
+ **Basis**: Meta-harness mission *"easy and convenient + no setup burden + token savings"* direct implementation mechanism. Natural hub/action-leader division (single trigger in meta-harness cwd → handover to action-leader cwd).
56
+
57
+ **3 usage modes — "don't block those who come, don't stop those who leave"** (meta-harness operating philosophy):
58
+ - **Mode A (standard)**: meta-harness cwd setup → handover to separate project cwd (4 steps above)
59
+ - **Mode B (resident)**: create **separate project directory** within the forge-harness install environment and work there. Keep the forge-harness directory itself as reference only — use `.gitignore` to block forge-harness assets from mixing into the project
60
+ - **Mode C (plugin/skill only)**: install only plugins/skills without going through forge-harness (available via marketplace without cloning). Skill output accumulates as history within the user's own project. No automatic signals from the forge-harness side expected — indirect contribution depends on user's active communication (issues · PR · channels)
61
+
62
+ If the user explicitly states a mode, immediately guide that mode. Do not force standard mode. Do not accumulate personal work artifacts in the forge-harness directory itself (protect reference asset identity).
63
+
64
+ ## Asset Synergy Branching Decision (meta vs. action-leader)
65
+
66
+ When persisting new assets (memory · feedback · patterns · rules) during a session, asset location determination is required:
67
+
68
+ | Location | Nature | Examples |
69
+ |---|---|---|
70
+ | **Meta-harness side seed** | Useful as-is when installed in other projects (cross-project synergy) | User baseline propositions, environment common conventions, common action rules for all personas, session operation patterns |
71
+ | **Action-leader project side persistence** | Meaningful only in this project's domain/session context | Domain knowledge, session records, domain-specific validation loop outputs, per-project identity |
72
+
73
+ When the judgment is ambiguous, the AI **states synergy potential first** then delegates the location decision to the user.
74
+
75
+ ## Knowledge Hub (forge-harness)
76
+
77
+ Persistent knowledge for this project is stored at `~/projects/forge-harness/`.
78
+
79
+ - **Past work search**: First read `~/projects/forge-harness/CATALOG.md`, identify related files by tags
80
+ - **Learnings/feedback originals**: `~/projects/forge-harness/tracks/{project_name}/`
81
+ - **At session end**: follow the Sync Protocol in `~/projects/forge-harness/CLAUDE.md` to sync
82
+ - **When new patterns are found**: follow the Push Protocol in `~/projects/forge-harness/CLAUDE.md` to feed back
83
+
84
+ <!-- [CUSTOMIZE] Replace {project_name} with the actual project name -->
85
+ <!-- [CUSTOMIZE] If there is a domain knowledge path, add:
86
+ - **Domain knowledge**: `~/projects/forge-harness/knowledge/domain/{domain}/`
87
+ -->
@@ -0,0 +1,18 @@
1
+ ---
2
+ scope: local-only
3
+ description: forge-harness path and skill list pointer — local only, do not commit to shared repo
4
+ ---
5
+
6
+ # forge-harness Cross-Context
7
+
8
+ > Install: `cp {FH_ROOT}/templates/local_fh_context.md .claude/rules/local_fh_context.md`
9
+ > Local only: `echo ".claude/rules/local_fh_context.md" >> .git/info/exclude`
10
+
11
+ **forge-harness path**: `~/path/to/forge-harness` (replace with your actual install path)
12
+ **Session records**: `{FH_ROOT}/tracks/_meta/`
13
+
14
+ **Available skills (fh-meta, 33)**: agent-composer · apex-review · asset-placement-gate · auto-decorrelation · context-doctor · contention-layer · corpus-grounding-expander · cross-ecosystem-synergy-detection · deep-clarify · edit-manifest · field-harvest · frontier-digest · goal-quench · harness-doctor · harvest-loop · hub-cc-pr-reviewer · install-doctor · install-wizard · marketplace-gate · memory-hygiene · meta-prompt-builder · persona-roster-expander · phantom-quench · pipeline-conductor · plugin-recommender · prompt-regression · public-surface-audit · return-path-gate · sim-conductor · salience-splitter · steel-quench · verify-bidirectional · video-ingest
15
+
16
+ **Available skills (fh-commons)**: convergence-loop · deliberation · mcp-circuit-breaker · token-budget-gate
17
+
18
+ Skill details available on demand at `{FH_ROOT}/plugins/{plugin}/skills/{skill-name}/SKILL.md`.