@chrono-meta/fh-gate 3.45.0 → 3.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.claude/rules/fh_4axis_gate.md +1 -1
  2. package/.claude-plugin/marketplace.json +4 -4
  3. package/CHEATSHEET.md +8 -4
  4. package/README.ja.md +4 -0
  5. package/README.ko.md +22 -0
  6. package/README.md +24 -0
  7. package/README.zh.md +4 -0
  8. package/docs/codex-compat.md +4 -4
  9. package/knowledge/shared/harness-core/agents_md_runtime_details.md +2 -2
  10. package/knowledge/shared/harness-core/builtin_capability_map.md +5 -2
  11. package/knowledge/shared/harness-core/claude_md_full_reference.md +5 -1
  12. package/knowledge/shared/harness-core/fh_4axis_gate_detail.md +15 -0
  13. package/knowledge/shared/harness-core/fh_detail_protocols.md +1 -0
  14. package/knowledge/shared/harness-core/fh_integration_contract.md +2 -2
  15. package/knowledge/shared/learnings/subagent_invocations_log.yaml +14 -0
  16. package/package.json +3 -1
  17. package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
  18. package/plugins/fh-commons/skills/mcp-circuit-breaker/SKILL.md +12 -6
  19. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  20. package/plugins/fh-meta/CHANGELOG.md +89 -0
  21. package/plugins/fh-meta/skills/context-doctor/SKILL.md +1 -0
  22. package/plugins/fh-meta/skills/deep-clarify/SKILL.md +76 -22
  23. package/plugins/fh-meta/skills/frontier-digest/SKILL_detail.md +13 -7
  24. package/plugins/fh-meta/skills/harvest-loop/SKILL.md +2 -2
  25. package/plugins/fh-meta/skills/memory-hygiene/SKILL.md +6 -0
  26. package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
  27. package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
  28. package/scripts/fh-gate.sh +149 -19
  29. package/scripts/live_eval_trace.py +22 -4
  30. package/scripts/pr_merge_verified.sh +14 -4
  31. package/scripts/selfcheck.sh +2 -0
  32. package/scripts/test_action_yml_lanes.sh +50 -0
  33. package/scripts/test_deep_clarify_interview_lanes.sh +108 -0
  34. package/scripts/test_deep_clarify_spec_path_lanes.sh +91 -0
  35. package/scripts/test_fh_gate_absorb_lanes.sh +1 -0
  36. package/scripts/test_fh_gate_defaults_lanes.sh +229 -3
  37. package/scripts/test_fh_gate_fusion_lanes.sh +1 -0
  38. package/scripts/test_fh_gate_regressions.sh +1 -0
  39. package/scripts/test_live_eval_trace_lanes.sh +27 -7
  40. package/scripts/test_pr_merge_verified_lanes.sh +15 -2
  41. package/scripts/test_probe_live_eval_lanes.sh +4 -3
  42. package/scripts/worktree_reclaim.sh +1 -1
  43. package/templates/PRE-PUBLISH-CHECKLIST.md +22 -0
  44. package/templates/predelete_check.sh +2 -0
  45. package/templates/predelete_check.test.sh +10 -0
@@ -2,6 +2,95 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### [3.47.0] — 2026-11-22
6
+
7
+ Minor by the version policy. `fh-gate`'s review calls change behaviour: the default, goldfish and elephant review calls are read-only, and no review call loads the reviewed checkout's settings, hooks or instruction files (#1179, #1181, #1182, #1183). The opt-in `/code-review` call is still not read-only. The codex review no longer pins a model and the record names the model each pass used (#1186). The GitHub Action passes its inputs as data (#1176). There are new shipped lanes (D13–D17 in `test_fh_gate_defaults_lanes.sh`, L7 in `test_action_yml_lanes.sh`, two cases in `templates/predelete_check.test.sh`) and two judged procedure lines (#1180, #1185).
8
+
9
+ Two changes make a shipped gate refuse more by default; see their `BREAKING (gate):` entries:
10
+ - a codex review refuses (exit 10, nothing sent) when the user's codex config names a provider or base URL (#1183);
11
+ - every claude and codex review call now needs a backend CLI that knows the new flags, and fails closed (exit 10) on one that does not (#1179, #1181, #1183).
12
+
13
+ `FH_REVIEWER=code-review` currently always exits 10: headless `/code-review` does not return the structured object the gate needs (0 of 11 on claude 2.1.330). It stays opt-in and fails closed (#1186).
14
+
15
+ Items marked «not in the npm package» are in the repository checkout only.
16
+
17
+ ### Changed
18
+ - BREAKING (gate): `fh-gate` (shipped), codex backend. Applies to `FH_BACKEND=codex`, and to `auto` and `cross` when they pick codex.
19
+ - What changed: before any codex call, `fh-gate` reads `${CODEX_HOME:-~/.codex}/config.toml` as text and exits 10, with nothing sent, when one of these holds:
20
+ - a line names `model_provider` (other than `"openai"`), `model_providers`, `openai_base_url` or `chatgpt_base_url`;
21
+ - a line has a `\u`, `\U` or `\x` escape;
22
+ - the file cannot be read, or its absence cannot be confirmed.
23
+
24
+ The message names the key and line, never the value.
25
+ - Why: codex review calls now drop the user config (`--ignore-user-config`, see below), and that also drops any provider it names. Without this check, a review meant for a proxy or a company gateway would go to codex's default provider instead. Measured on codex 0.164.0: the provider config sent 3 of 3 reviews to the configured endpoint before, and the escaped-key form sent 8 requests a run; this change closed 3 of 3 with 0 requests. A plain config with a real login gave 4 of 4 SUCCESS. Measured with a file-backed ChatGPT login only; keyring and API-key logins are UNMEASURED. The rest of the user config (model, profiles, MCP servers, login storage) no longer applies to the review call either.
26
+ - What now blocks: a codex user config that names where requests go, uses one of those escapes, or cannot be read. The match is by text, so a profile table, a trailing comment or a value that merely contains one of those names closes too. In `cross` mode the codex leg then fails, and the run is single-leg and says it is not decorrelated: a single leg's PASS or PENDING becomes ESCALATE `cross-degraded` unless `FH_GATE_CROSS_ALLOW_SINGLE=1`.
27
+ - Remedy: use the claude backend, or run with a `CODEX_HOME` whose `config.toml` names no provider (#1183).
28
+ - BREAKING (gate): `fh-gate` (shipped), every claude and codex review call.
29
+ - What changed: the default call now passes the read-only flags, and every review call passes the new checkout flags (see below). claude needs `--tools`, `--strict-mcp-config`, `--disable-slash-commands` and `--setting-sources`; codex needs `-s read-only`, `-c` and `--ignore-user-config`.
30
+ - What now blocks: a backend CLI too old for one of these flags fails the call, which fails closed (exit 10). In 3.46.0 the default call passed none of them, and the goldfish and elephant passes had only the tool flags and `-s read-only`. Measured working on claude 2.1.330 and codex 0.164.0; the oldest working versions are UNMEASURED.
31
+ - Remedy: update the backend CLI (#1179, #1181, #1183).
32
+ - `fh-gate` (shipped), default review call: it gets the same read-only policy as the opt-in passes. On claude it runs with `--tools Read,Glob,Grep --strict-mcp-config --disable-slash-commands` and the same allow and deny lists; on codex it runs with `-s read-only`. Both run at the repository root. Verdicts, exit codes, the prompt and outputs are unchanged. Before this, the call ran with whatever the backend CLI's settings allowed (#1179).
33
+ - `fh-gate` (shipped), all review calls: the checkout under review is treated as untrusted input (#1181, #1182, #1183, #1186).
34
+ - claude gets `--setting-sources user`. Measured on claude 2.1.330 with planted checkouts under `/tmp`: the checkout's `CLAUDE.md`, `CLAUDE.local.md` and `.claude/rules` text did not reach the call (0 of 3; 3 of 3 without the flag), and a project SessionStart hook ran without the flag and not with it (one run each).
35
+ - codex gets `-c project_doc_max_bytes=0` and `--ignore-user-config`. Measured on codex 0.164.0: the checkout's `AGENTS.md` was not sent, and when the user config marks the checkout trusted, its `.codex/config.toml` MCP servers no longer start outside the sandbox (0 of 3; 3 of 3 before). The canary rule and two hook events in a trusted checkout did not apply either (0 of 3). Those canaries only.
36
+ - `--bare` is not used: it also drops OAuth and keychain login.
37
+ - `fh-gate` (shipped), opt-in `FH_REVIEWER=code-review`: the call now loads none of the checkout's settings, hooks, `CLAUDE.md` or `.mcp.json` servers (`--setting-sources user`), and its prompt comes after `--`, so claude reads it as a prompt. Before this, claude 2.1.330 read the prompt as the value of `--disallowedTools` and the call never reached `/code-review`. It still exits 10 (see above). The call is still not read-only: `/code-review` needs git's read commands (#1182, #1186).
38
+ - `fh-gate` (shipped), codex model: with `FH_MODEL` unset, codex gets no `-m` and picks its own default. The old default `gpt-5.5` was refused for a ChatGPT login (HTTP 400). Measured: `main` 2 of 2 exit 10, this change 2 of 2 SUCCESS, and codex picked `gpt-6.1-terra`. `FH_MODEL=<id>` still passes `-m <id>`. To keep the old model, set `FH_MODEL=gpt-5.5`. The governance record's `model:` line now reads `codex default (not pinned, resolved review <id>[, elephant <id>])`. Each id is read from codex's own banner and is id-shaped or `unknown`. A parser that matched `gpt-5.5` there sees a new string. `fh-run.sh` and `fh-goal.sh` still default to `gpt-5.5`; this is named here and not changed (#1186).
39
+ - GitHub Action (`action.yml`, not in the npm package): `dry-run`, `version`, `files`, `level` and `fail-on` reach the run script through `env:`, and the script reads them as `"$VAR"`. Before this, GitHub pasted them into the script as text, so a quote in a caller value (a file list built from PR data, say) became shell code. Input names, defaults, the exit-code mapping, `fail-on` and the outputs are unchanged. Behaviour change for callers: a caller whose `files:` value relied on the shell expanding it (`$VAR` or `$(…)` inside the value) now gets the literal text. Compute the list in an earlier step and pass that step's output (#1176).
40
+ - `templates/predelete_check.sh` (shipped) ends with one question: is another session, worktree, live site or shared database or config using the target right now? SAFE means «merged», not «idle». Step 1 of the Destructive-Op Gate in `claude_md_full_reference.md` has the same sentence. Exit codes and the SAFE/CHECK/REVIEW lines are unchanged (#1185).
41
+ - `.claude/rules/fh_4axis_gate.md` and `fh_4axis_gate_detail.md` (shipped): a gate or lane repair takes at least one fail-before input from the change record (fix commit, issue or review finding) and names its source as `input-from=<…>` (or `input-from=none(self-found)`) on the first `controls:` line. Record only: no new key and no hook check (#1180).
42
+
43
+ ### Added
44
+ - `test_fh_gate_defaults_lanes.sh` (shipped) gains:
45
+ - D13: the default call's flags, and that it runs from the repository root;
46
+ - D14: the `/code-review` call's `--setting-sources user` and `--`;
47
+ - D15: `--ignore-user-config` on every codex review call;
48
+ - D16: the route guard's refusals and passes;
49
+ - D17: the unpinned codex model and the per-pass record.
50
+
51
+ `test_fh_gate_absorb_lanes.sh`, `test_fh_gate_fusion_lanes.sh` and `test_fh_gate_regressions.sh` pin `CODEX_HOME`, so a runner whose codex config names a provider no longer turns them red (#1179, #1181, #1182, #1183, #1186).
52
+ - `test_action_yml_lanes.sh` (shipped; needs the repository's `action.yml`) L7: no `${{ }}` of any form (bracket form included) inside `run:`, and a run that imitates GitHub's substitution with a payload in `files` (#1176).
53
+ - `templates/predelete_check.test.sh` (shipped): two cases for the closing question (#1185).
54
+
55
+ ### Docs
56
+ - `README.md`, `README.ko.md`, `README.ja.md` and `README.zh.md` (shipped), Door ①. Three things are added:
57
+ - what a run costs: it sends the changed files to the logged-in backend and makes one review call there, up to two with `FH_BACKEND=cross` and more with the opt-in layers; `FH_DRY_RUN=1` makes no call;
58
+ - what it runs: the default review call can only read and loads nothing from the reviewed checkout; `FH_GATE_EXEC=on` runs the repository's own lane scripts;
59
+ - which exit codes fail a CI step: a plain step fails on every non-zero exit, `1` PENDING included, while the Action passes PENDING by default.
60
+
61
+ The opt-in sentence says `/code-review` is not read-only and currently always exits 10 (#1178, #1182, #1183, #1186).
62
+ - From the release audit (outside reader, before the tag): `fh-gate --help` (shipped) lists the two new causes of exit 10 and says that a plain CI step fails on 1 while the Action lets it pass; `CHEATSHEET.md` (shipped) says the `/code-review` opt-in currently always exits 10; each README says the execution layer's copy is not a sandbox.
63
+ - `docs/codex-compat.md`, `fh_integration_contract.md` and `agents_md_runtime_details.md` (shipped): the codex model row and the record example match the unpinned default. Examples drop `-m gpt-5.5` (#1186).
64
+ - `frontier-digest` `SKILL_detail.md` (shipped): the HackerNews example encodes `>` as `%3E`. The raw form returned HTTP 400 and the encoded one HTTP 200. Every curl example carries `--compressed`, which saves size and fixes nothing (#1184).
65
+ - `builtin_capability_map.md` (shipped): instruction audits route to `/doctor prompt-audit` (Claude Code 2.1.283 or later), and coordinated threads to Projects (public beta). The map says what FH keeps on top of each (#1177).
66
+
67
+ ### [3.46.0] — 2026-11-21
68
+
69
+ Minor by the version policy. Skill behaviour changes: `deep-clarify` saves its spec outside `.claude/` (#1162) and changes its interview (#1174); `mcp-circuit-breaker` names `WRONG_SHAPE` and trips it on the first failure (#1164, #1171); the close retrospective has five fields (#1166). There is also a new record field on the live-eval behaviour profile (#1167) and new shipped lanes: new lane files (#1162, #1174) and a new case in an existing one (#1161).
70
+
71
+ One change makes a shipped helper refuse more by default; see its `BREAKING (gate):` entry: `pr_merge_verified.sh` refuses a commit id that is not full length (#1163).
72
+
73
+ ### Added
74
+ - Live-eval behaviour profile (record only): each `behaviour-profile:` line that has a stream carries `first_error=` after `total=` — the 1-based position of the first top-level tool call whose result is an error, `none` when every call has a result and none is an error, or `unknown` when a call before that has no result (not measured is not «no error»). Calls inside subagents are not counted. Nothing scores it; verdict rows are unchanged. `live_eval_trace.py profile` (shipped). (#1167)
75
+
76
+ ### Changed
77
+ - `deep-clarify` (shipped) interview: Round 1 asks the upper goal (Why) as its own question next to completion criteria, and scope moves to Round 2. A textbook phrase («make it scalable», «standard architecture») is not recorded as a requirement — the skill asks once what is actually needed; a repeat answer becomes an `(inferred: …)` guess and an open question. Round 3 tests understanding with one design option the user has not mentioned, judged against the Why as the user stated it: a contradiction gets one re-ask in the same round, then goes under Open questions. Step 4's default next step is a new session that reads only the saved spec; «Start implementation directly» stays as a non-default option. The spec format gains `## Why`, `## Understanding check` and `## Open questions`. The 3-round · 2-question cap, the `(inferred: X)` guesses, the Excluded scope and the `specs/` path are unchanged. New lane `scripts/test_deep_clarify_interview_lanes.sh` (shipped) checks the round templates' structure, not whether a model follows them. (#1174)
78
+ - `mcp-circuit-breaker` (shipped) names a new failure type, `WRONG_SHAPE`: no error and a success status (e.g. HTTP 200), but the answer is not the expected shape — an HTML page where JSON was expected, or a needed field missing. The half-open recovery probe counts as success only when the answer has the expected shape, so such an answer leaves the circuit OPEN. `WRONG_SHAPE` trips the circuit on its first failure, like `ADMIN_GATED`, `AUTH` and `NOT_FOUND`: the host or path is wrong, so the same call keeps getting the same wrong answer. The other types keep their counts. The trip threshold line and the Step 2 table now say which types trip at 1; Step 2 says how to tell `MALFORMED` (could not be parsed) from `WRONG_SHAPE` (parsed, but not what the caller needs); the trip log gains an `expected_shape:` line that the Step 5 probe checks against; and Step 4 gains a «fix the endpoint» row for `WRONG_SHAPE`. (#1164, #1171, release audit)
79
+ - `templates/PRE-PUBLISH-CHECKLIST.md` (shipped) gains Step 0b for publishing a filtered copy: check that the stripped tree did not flow back into your own branch with `git diff --name-status origin/main main` — commit counts and ahead/behind look normal when it has. The step says `origin` must be the unfiltered upstream, that protected paths come from the filter's own exclusion list, and how to put deleted files back (anything wider goes through the Destructive-Op gate). Text only; no script or hook. (#1165, release audit)
80
+ - The session close retrospective (`fh_detail_protocols.md`, shipped) gains a `막지 못한 통제:` line — the gate, lane or hook a defect slipped past, or «그 자리에 통제 없음» — beside the caught-by line; `harvest-loop` Step 0-d now asks for five fields. New records only. (#1166)
81
+ - `memory-hygiene` (shipped) Step 3 describes an optional `metadata.evidence:` line — the narrowest source of a lesson (a commit hash, PR number, log line or `file:line`), written when the memory is created and opened first on re-verify. Optional and never inferred; an older entry without it is not an error, and a pointer that no longer resolves is reported, not filled in. Staleness thresholds and type methods are unchanged. (#1170)
82
+ - `CHEATSHEET.md` (shipped) rows catch up with four merged behaviours: the deep-clarify spec path, `WRONG_SHAPE`, pre-publish Step 0b, and a newline-named file making `fh-gate` / `fh-goal` exit 10. (#1169)
83
+
84
+ ### Fixed
85
+ - `test_fh_gate_defaults_lanes.sh` (shipped) run where there is no `action.yml` — the npm package, or a field harness that syncs FH's lanes — names D7 as skipped («NOT-APPLICABLE … not measured, not a pass») and prints `1 skipped (not a pass)`; before, D7 failed there and the suite exited 1 (3.45.0). In an FH checkout a missing `action.yml` is still reported by `test_action_yml_lanes.sh` (exit 10). New lane D12 runs the lane from a copy without `action.yml`. (#1161)
86
+ - `deep-clarify` (shipped) saves its spec to `specs/{slug}.md` in the work folder instead of `.claude/specs/{slug}.md`. Claude Code treats `.claude/` as sensitive: a headless run had the write refused, and an interactive user got a «modify sensitive file» prompt. The ABORT-if-exists check, the `test -f` save check and the gitignore advice for company projects keep their logic and now name `specs/`; a spec already saved under `.claude/specs/` stays there, and both paths are gitignored in this repo. New lane `scripts/test_deep_clarify_spec_path_lanes.sh` (shipped) runs the skill's own Step 3 commands in an empty folder. (#1162)
87
+ - BREAKING (gate): `pr_merge_verified.sh` (shipped), the merge helper.
88
+ - What changed: it refuses, before the merge call, a PR head or `--expect-head` that is not a full 40- or 64-character lowercase hex commit id, and says the value may have been cut on the way (PR head: exit 4 · `--expect-head`: exit 2, the existing usage code).
89
+ - Why: a field run saw an output-compression proxy shorten `git rev-parse HEAD` to 37 characters. A short value still resolves locally, so before this the merge call went out with it and failed later with no hint why.
90
+ - What now blocks: a cut commit id, or one that is not lowercase hex. A full lowercase id behaves as before.
91
+ - Remedy: pass the full id (for example from `gh pr view --json headRefOid`); if an output proxy shortens it, run that command through the proxy's raw escape hatch (for rtk: `rtk proxy <cmd>`). The script's usage line and header now name `--expect-head` and these two exits.
92
+ - `context-doctor` gains one line where it recommends a command-output proxy: values a later step reads as data must bypass the proxy or be checked. (#1163)
93
+
5
94
  ### [3.45.0] — 2026-11-20
6
95
 
7
96
  Minor by the version policy: fh-gate gains an execution layer, a review pass that follows `/code-review`'s method, a history-aware «elephant» pass and `/code-review` itself as an opt-in reviewer (#1147, #1156). There are also new shipped tools and lanes (`live_eval_matrix.py`, `heavy_skill_smell.py`, `job_heartbeat.py`), a new `FH_AGY_ISOLATION=no-tools-agent` route, and judged procedure changes in shipped skills and canon.
@@ -219,6 +219,7 @@ The reductions above all act on the **context-footprint** axis (files, history r
219
219
  - ⚠️ **Name collision**: there is an unrelated `reachingforthejack/rtk` (Rust Type Kit). Verify the Token-Killer build — `rtk gain` (savings analytics) should work; "command not found" means the wrong binary.
220
220
  - **No-reinvention**: FH **routes to** this tool; it does not rebuild a token-killer. Install + hook wiring live in the user's own config (global `CLAUDE.md` / `settings.json`), never reimplemented here.
221
221
  - ⚠️ **Never filter a command whose output a mechanical gate parses.** FH gates read raw command output (a pre-commit hook greps, `regression_guard` diffs). A filtered `git diff` / `git log` feeding a gate gives the gate wrong input — the same trap as grepping filtered prose for a verdict (typed-verdict-channel). Keep filtering off gate-input paths, and keep a raw escape hatch (`rtk proxy <cmd>`).
222
+ - ⚠️ **Values a later step reads as data must bypass the proxy or be checked.** Trimming is for reading, not for data: the same layer can shorten a hash, object ID, token or digest that a later command consumes. A field run saw `git rev-parse HEAD` come back 37 of 40 characters, and the API call that used it failed later with no hint why. Run such commands through the raw escape hatch, or check the value's shape before use (a full commit id is 40 or 64 hex characters — `pr_merge_verified.sh` refuses anything else).
222
223
 
223
224
  **Prescription**: in a normal token environment, recommend the per-call flags (#1) and **do not** suggest installing a proxy — the lossy risk is not worth it. Only when the user states or exhibits a binding token constraint, surface #2 with the gate-input caveat above. Diagnosis + recommendation, never an auto-install.
224
225
 
@@ -40,44 +40,83 @@ Quickly identify the following from the user's request.
40
40
 
41
41
  ```
42
42
  Clarity check:
43
+ □ Upper goal — Why (why this is wanted, what is better once it is done) — ask if unclear
43
44
  □ Final state (what will be different when done?) — ask if unclear
44
45
  □ Completion criteria (how will it be verified?) — ask if unclear
45
46
  □ Constraints (what must not be done, what must not be touched) — ask if unclear
46
47
  □ Priority (fast vs thorough, now vs later) — ask if unclear
48
+ □ Textbook phrases in the request (see below)
47
49
  ```
48
50
 
49
- **Direct entry conditions** (skip to Step 3 without questions):
50
- - Request is specific and completion criteria are clear → draft spec document and confirm
51
+ The Why is asked on its own, not folded into the Goal: when it is missing, the gaps get filled with the AI's
52
+ own defaults, and every later choice inherits them.
53
+
54
+ ### Textbook phrases
55
+
56
+ A phrase that sounds like a requirement but does not say what to do — "make it scalable", "standard
57
+ architecture", "clean code", "best practice", "production-ready", "user-friendly" (examples, not a closed
58
+ list) — is **not recorded as a requirement**. Ask once what is actually needed behind it, with a concrete
59
+ guess: *"'Scalable' — for how many users or how much data, and what must not get slower? (inferred: one team,
60
+ a few hundred records)"*. This question uses one of the round's two slots. If the answer is the phrase again,
61
+ record your guess as `(inferred: …)` in the spec and list it under Open questions — do not ask a second time.
62
+
63
+ **Direct entry conditions** (skip Rounds 1–2 and go straight to Round 3):
64
+ - Request is specific and completion criteria are clear → draft the spec (Step 3's format), then run Round 3's
65
+ understanding check; Step 3 saves the result
51
66
  - Clarity at the level of "add Y feature to file X"
52
67
 
53
68
  ---
54
69
 
55
70
  ## Step 2. Socratic Dialogue
56
71
 
57
- ### Round 1 — Goal / Completion Criteria (core 2 questions)
72
+ ### Round 1 — Why / Completion Criteria (core 2 questions)
58
73
 
59
74
  ```
60
75
  Clarification needed.
61
76
 
62
- 1. Completion criteria: What does a completed [task name] look like?
77
+ 1. Why: What is this for — what will be better once it is done?
78
+ (inferred: [inferred upper goal] — confirm if correct)
79
+
80
+ 2. Completion criteria: What does a completed [task name] look like?
63
81
  (inferred: [inferred completion criteria] — confirm if correct)
82
+ ```
83
+
84
+ Skip a question the request already answers. A textbook phrase (Step 1) takes the free slot here or in Round 2.
85
+
86
+ ### Round 2 — Scope / Constraints / Priority (only if needed)
64
87
 
65
- 2. Scope: Which of [A / B / C] takes priority?
88
+ Skip if Round 1 resolves everything. Ask at most two of the items still open — scope, what must not be done,
89
+ priority, a textbook phrase — and infer the rest as `(inferred: X)`.
90
+
91
+ ```
92
+ 1. Scope: Which of [A / B / C] takes priority?
66
93
  (inferred: [inferred choice] — reason: [rationale])
94
+ 2. Is there anything this task must absolutely not do?
95
+ (or, if that is already clear: Which takes priority — fast completion vs solid design?)
67
96
  ```
68
97
 
69
- ### Round 2 — Constraints / Priority (only if needed)
98
+ ### Round 3 — Understanding Check (always — one question, a second only on a contradiction)
70
99
 
71
- Skip if Round 1 resolves everything.
100
+ Draft the spec first and show its summary, Excluded scope included. Then test understanding instead of asking
101
+ "is this right?" — agreement proves little, a choice proves more. Pick **one design option the user has not
102
+ mentioned**, one whose answer follows from the Why (for example: save to a local file vs a server database;
103
+ one shared page vs a page per user).
72
104
 
73
105
  ```
74
- 1. Is there anything this task must absolutely not do?
75
- 2. Which takes priority: fast completion vs solid design?
106
+ 1. One choice we have not discussed: for [decision], [option A] or [option B]?
107
+ (I expect [A], because your Why is "[Why in their words]")
108
+ 2. (only if the pick contradicts the Why) You picked [B], but [B] means [consequence], and your Why was
109
+ "[Why]". Which matters more here?
76
110
  ```
77
111
 
78
- ### Round 3 — Final Confirmation (only if needed)
79
-
80
- Draft the spec first, then single confirmation: "Is this the right direction?"
112
+ - Judge the fit against the Why **as the user stated it**. The reason the user gives for the pick ("less
113
+ hassle") is not part of the Why unless they say so; if the pick's consequence works against the stated Why
114
+ (it may miss what they said they need to find), that is a contradiction even when the reason sounds fair.
115
+ - The pick fits the Why → understanding confirmed; record it in `## Understanding check`.
116
+ - It contradicts the Why → ask question 2 (the same round, so the 3-round · 2-question cap holds). Update the
117
+ Why or the spec from the answer.
118
+ - Still contradictory after question 2 → stop asking: write the conflict under Open questions in the spec and
119
+ end. Do not open a fourth round.
81
120
 
82
121
  ---
83
122
 
@@ -89,23 +128,27 @@ path is not saving it.
89
128
  1. Derive the slug: `slug = kebab-case(spec title) + "-" + YYYYMMDD`
90
129
  (lowercase, non-alphanumerics → `-`, collapse repeats, strip leading/trailing `-`).
91
130
  Example: "Rewrite the login flow" on 2026-08-11 → `rewrite-the-login-flow-20260811`.
92
- 2. If `.claude/specs/{slug}.md` **already exists → ABORT** and report the existing path.
131
+ 2. If `specs/{slug}.md` **already exists → ABORT** and report the existing path.
93
132
  Never overwrite and never silently suffix — an existing spec is a prior decision to extend or
94
133
  supersede, and that is the user's call.
95
134
  3. Create the directory, then write the file with the **Write** tool (not a shell redirect):
96
135
 
97
136
  ```bash
98
- mkdir -p .claude/specs
137
+ mkdir -p specs
99
138
  ```
100
139
 
101
- Then `Write` → `.claude/specs/{slug}.md` with the format below, and verify:
140
+ Then `Write` → `specs/{slug}.md` with the format below, and verify:
102
141
 
103
142
  ```bash
104
- test -f .claude/specs/{slug}.md && echo "SPEC SAVED: .claude/specs/{slug}.md"
143
+ test -f specs/{slug}.md && echo "SPEC SAVED: specs/{slug}.md"
105
144
  ```
106
145
 
146
+ **Where**: `specs/` in the work folder, not under `.claude/` — Claude Code asks before writing there, so a
147
+ headless run is refused and an interactive user gets a «modify sensitive file» prompt. A spec an earlier
148
+ version saved under `.claude/specs/` stays where it is.
149
+
107
150
  **Residency**: the spec records the user's goals, constraints, and "must not touch" list.
108
- `.claude/specs/` is gitignored in this repo; **in a company project, confirm the path is gitignored
151
+ `specs/` is gitignored in this repo; **in a company project, confirm the path is gitignored
109
152
  there too before writing** — if it is not, write to a gitignored location instead.
110
153
 
111
154
  ### Spec Document Format
@@ -115,7 +158,10 @@ there too before writing** — if it is not, write to a gitignored location inst
115
158
  Created: {date} | Status: draft
116
159
 
117
160
  ## Goal
118
- {One sentence — what is being built and why}
161
+ {One sentence — what is being built}
162
+
163
+ ## Why
164
+ {The upper goal in the user's words — why it is wanted, what is better once it is done}
119
165
 
120
166
  ## Completion Criteria
121
167
  - [ ] {verifiable condition 1}
@@ -132,6 +178,12 @@ Excluded: {what is explicitly excluded}
132
178
  ## Priority
133
179
  {Fast completion / Solid design / Balanced} — {reason}
134
180
 
181
+ ## Understanding check
182
+ Option offered: {the choice not discussed before} · Picked: {answer} · Fits the Why: {yes / re-asked → yes / no — see Open questions}
183
+
184
+ ## Open questions
185
+ {conflicts left after Round 3, textbook phrases the user did not unpack — or "none"}
186
+
135
187
  ## References
136
188
  {related files / existing skills / prerequisite work}
137
189
  ```
@@ -140,13 +192,14 @@ Excluded: {what is explicitly excluded}
140
192
 
141
193
  ## Step 4. Follow-up Connections
142
194
 
143
- After generating the spec document, suggest the appropriate next path:
195
+ After generating the spec document, suggest the appropriate next path. The first row is the default:
144
196
 
145
197
  | Situation | Connected skill |
146
198
  |---|---|
147
- | Agent orchestration needed for implementation | `agent-composer` — pass spec document path |
199
+ | **Default** — implementation | Open a new session that reads only the saved spec (`specs/{slug}.md`) and implement there. The guesses this interview corrected stay in this window and would otherwise pull the implementation back toward them |
200
+ | Agent orchestration needed for implementation | `agent-composer` — pass spec document path (it, too, should read the spec, not this conversation) |
148
201
  | Plan / design review needed | built-in `Plan` agent — build plan based on spec |
149
- | Single task is now clear | Start implementation directly |
202
+ | Single task is now clear and the user wants to stay here | Start implementation directly (not the default — offer it when the user asks) |
150
203
  | Audit needed before external sharing | `hub-persona-auditor` |
151
204
 
152
205
  ---
@@ -156,7 +209,8 @@ After generating the spec document, suggest the appropriate next path:
156
209
  | Condition | Completion verdict | Check class |
157
210
  |---|---|---|
158
211
  | Socratic dialogue complete (≤3 rounds, ≤2 questions/round) | ✅ Clarification complete | **mandatory-pass** |
159
- | `test -f .claude/specs/{slug}.md` exits 0 — the file **exists on disk** | ✅ Save complete | **mandatory-pass** (a printed path is not a saved file) |
212
+ | `test -f specs/{slug}.md` exits 0 — the file **exists on disk** | ✅ Save complete | **mandatory-pass** (a printed path is not a saved file) |
213
+ | The spec's `## Why` and `## Understanding check` are filled — the option offered, the pick, and whether it fits the Why (a contradiction left open is listed under Open questions) | ✅ Understanding tested | **mandatory-pass** (an empty or "n/a" Understanding check fails) |
160
214
  | The spec's Completion Criteria are independently verifiable — someone other than the author could tell whether each is met | ✅ Spec actionable | **judged** — adversarial pairing: `fh-meta:beginner` cold-reads the spec and attempts to state, per criterion, how they would check it; a criterion they cannot operationalize fails |
161
215
  | Follow-up skill connection suggestion output | ✅ Handoff complete | **mandatory-pass** |
162
216
 
@@ -91,13 +91,19 @@ load: on-demand
91
91
 
92
92
  ```bash
93
93
  for KW in "AI agent" "LLM harness" "Claude" "multi-agent" "context engineering"; do
94
- curl -s --max-time 8 \
95
- "https://hn.algolia.com/api/v1/search_by_date?query=$(echo $KW | tr ' ' '+')&tags=story&hitsPerPage=5&numericFilters=points>30"
94
+ curl -s --compressed --max-time 8 \
95
+ "https://hn.algolia.com/api/v1/search_by_date?query=$(echo $KW | tr ' ' '+')&tags=story&hitsPerPage=5&numericFilters=points%3E30"
96
96
  done
97
97
  ```
98
98
 
99
99
  Collection criteria: score > 30, keyword-relevant items only. Max 15 items.
100
100
 
101
+ > **Write `>` as `%3E` in every URL, and give `curl` `--compressed` (measured 2026-11-22, public endpoints, generic UA).**
102
+ > A raw `numericFilters=points>30` returns **HTTP 400** (273 B «Bad Request»); the same URL with `points%3E30` returns
103
+ > 200 with 5 hits. The un-encoded form sat in this block for three consecutive digest runs (11-20 · 11-21 · 11-22), each
104
+ > run patching it by hand. `--compressed` is a transfer-size saving, not a correctness fix: the HN and arXiv legs answer
105
+ > identically with or without it, while TLDR 7.8 KB → 1.8 KB, The Batch 148 KB → 26 KB, GeekNews 28 KB → 9 KB.
106
+
101
107
  > **`/search_by_date`, not `/search` (revised 2026-09-04; prescribed 2026-09-01, unapplied for 3 runs).**
102
108
  > `/search` ranks by relevance and returned items dated 2025-11→2026-06 on 2026-09-01 — a *relevant-but-stale*
103
109
  > leg, the mirror image of the 2026-07-26 arXiv *fresh-but-off-axis* failure, and the HN leg carried neither
@@ -114,7 +120,7 @@ Collection criteria: score > 30, keyword-relevant items only. Max 15 items.
114
120
  # gamification, RF fingerprinting). Freshness was fine; relevance was not — so the staleness rule below
115
121
  # could not catch it.
116
122
  for Q in "LLM agent" "agent harness" "context engineering"; do
117
- curl -s --max-time 8 \
123
+ curl -s --compressed --max-time 8 \
118
124
  "https://export.arxiv.org/api/query?search_query=cat:cs.SE+AND+all:%22${Q// /+}%22&max_results=2&sortBy=submittedDate&sortOrder=descending"
119
125
  done
120
126
  ```
@@ -140,7 +146,7 @@ know the answer to is not filtering — it is generating.
140
146
  ### TLDR AI (RSS)
141
147
 
142
148
  ```bash
143
- curl -s --max-time 8 "https://tldr.tech/api/rss/ai"
149
+ curl -s --compressed --max-time 8 "https://tldr.tech/api/rss/ai"
144
150
  ```
145
151
 
146
152
  Parse `<item>` → title + link. Max 5 items.
@@ -148,7 +154,7 @@ Parse `<item>` → title + link. Max 5 items.
148
154
  ### The Batch — deeplearning.ai (HTML scraping)
149
155
 
150
156
  ```bash
151
- curl -s --max-time 10 -L "https://www.deeplearning.ai/the-batch"
157
+ curl -s --compressed --max-time 10 -L "https://www.deeplearning.ai/the-batch"
152
158
  ```
153
159
 
154
160
  ⚠️ **No trailing slash.** `…/the-batch/` returns **HTTP 308** redirecting to the slash-less path (verified
@@ -162,7 +168,7 @@ HTTP 200, ~186 KB, **0 matches**, and the `/the-batch/issue-N` anchors carry no
162
168
  (GeekNews `/rss/news` 2026-06-20 · trailing-slash 308 2026-07-26 · this). Current shape, verified live:
163
169
 
164
170
  ```bash
165
- curl -s --max-time 15 -L "https://www.deeplearning.ai/the-batch" \
171
+ curl -s --compressed --max-time 15 -L "https://www.deeplearning.ai/the-batch" \
166
172
  | /usr/bin/grep -oE '<a [^>]*aria-label="[^"]+"[^>]*href="/the-batch/issue-[0-9]+"' \
167
173
  | sed -E 's/.*aria-label="([^"]+)".*href="(\/the-batch\/issue-[0-9]+)".*/\1\t\2/' | head -5
168
174
  ```
@@ -179,7 +185,7 @@ row today; known-negative = an empty body yields the UNMEASURED line, not `0`.
179
185
  ### GeekNews — news.hada.io (RSS)
180
186
 
181
187
  ```bash
182
- curl -sL --max-time 8 "https://news.hada.io/rss/news"
188
+ curl -sL --compressed --max-time 8 "https://news.hada.io/rss/news"
183
189
  ```
184
190
 
185
191
  🟥 **`-L` is load-bearing (2026-11-04).** `/rss/news` now answers `302 → feeds.feedburner.com/geeknews-feed`;
@@ -72,12 +72,12 @@ Session end
72
72
  **운영자 발화가 인용돼 기록되는 순간** 승인된다. 전자는 세션이 자기 권한을 넓히는 형태다.
73
73
 
74
74
  산출: 오늘자 `tracks/_meta/fh_signal_{date}_{source}.md` 에 `retro: close` 를 달고
75
- `## Session Retrospective` 4필드를 채운다(형식 정본 = fh_detail_protocols.md).
75
+ `## Session Retrospective` 5필드를 채운다(형식 정본 = fh_detail_protocols.md).
76
76
  「없음」·「0」도 유효한 값이고, **비우는 것만 안 된다.**
77
77
 
78
78
  Done When:
79
79
  + 오늘자 signal 파일이 존재하고 `retro: close` 를 달고 있다 — mandatory-pass
80
- + Session Retrospective 4필드가 전부 채워졌다 — mandatory-pass
80
+ + Session Retrospective 5필드가 전부 채워졌다 — mandatory-pass
81
81
  + 정정 건수는 **세었지 회상하지 않았다** — measured
82
82
  + FH Registration Candidate 가 비면 그 이유가 한 줄 적혀 있다 — mandatory-pass
83
83
 
@@ -100,6 +100,12 @@ FRESH (<threshold):
100
100
 
101
101
  ### Step 3 — Re-verify Stale Entries
102
102
 
103
+ **Evidence pointer first.** An entry may carry `metadata.evidence:` — one line naming the narrowest source of
104
+ the lesson: a commit hash, a PR number, a log line or a `file:line`. Write it when the memory is created, next to
105
+ the session link it already has. When it is present, re-verify against it before the type method below; it is the
106
+ place to go back to. It is optional and never inferred: an older entry without it is not an error, and a pointer
107
+ that no longer resolves is reported as such, not filled in.
108
+
103
109
  For each stale entry, run the appropriate re-verification:
104
110
 
105
111
  **Reference type** (URLs, DOIs, GitHub):
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-preprep",
3
- "version": "3.45.0",
3
+ "version": "3.47.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-qp",
3
- "version": "3.45.0",
3
+ "version": "3.47.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },