@tenkara/afm-linux-arm64 0.0.0-stage → 4.0.0-alpha.11

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 (283) hide show
  1. package/bin/afm +4 -0
  2. package/content/.coupling-baseline.tsv +1 -0
  3. package/content/.pending-commands.txt +2 -0
  4. package/content/CHANGELOG-archive.md +806 -0
  5. package/content/CHANGELOG.md +4330 -0
  6. package/content/PRINCIPLES.md +119 -0
  7. package/content/README-light.md +158 -0
  8. package/content/README.md +150 -0
  9. package/content/code-style/_any/file-size.md +62 -0
  10. package/content/code-style/_any/imports.md +68 -0
  11. package/content/code-style/_any/naming.md +72 -0
  12. package/content/code-style/_any/test-placement.md +57 -0
  13. package/content/code-style/nextjs-app-router/imports.md +50 -0
  14. package/content/code-style/nextjs-app-router/naming.md +50 -0
  15. package/content/code-style/prisma-postgres/error-boundary.md +55 -0
  16. package/content/code-style/prisma-postgres/imports.md +61 -0
  17. package/content/code-style/shadcn-ui/naming.md +48 -0
  18. package/content/code-style/stripe-billing/naming.md +76 -0
  19. package/content/code-style/trigger-dev-v4/imports.md +58 -0
  20. package/content/code-style/trigger-dev-v4/naming.md +49 -0
  21. package/content/code-style/trigger-dev-v4/test-placement.md +61 -0
  22. package/content/code-style/trpc-v11/error-boundary.md +51 -0
  23. package/content/code-style/trpc-v11/file-size.md +44 -0
  24. package/content/code-style/trpc-v11/naming.md +60 -0
  25. package/content/code-style/trpc-v11/test-placement.md +52 -0
  26. package/content/core/ach.md +260 -0
  27. package/content/core/afm.md +514 -0
  28. package/content/core/gotchas.md +18 -0
  29. package/content/core/prd.md +141 -0
  30. package/content/core/protocol.md +158 -0
  31. package/content/core/ust.md +65 -0
  32. package/content/guardrails/README.md +55 -0
  33. package/content/guardrails/dsl-com-ordem-obrigatoria.md +47 -0
  34. package/content/guardrails/exaustividade-de-union.md +48 -0
  35. package/content/guardrails/fronteira-de-import.md +57 -0
  36. package/content/hooks/README.md +70 -0
  37. package/content/interview/bootstrap.md +417 -0
  38. package/content/interview/promotion.md +115 -0
  39. package/content/interview/refactor.md +379 -0
  40. package/content/interview/triggers.md +107 -0
  41. package/content/modules/nextjs-app-router/ach.patch.md +44 -0
  42. package/content/modules/nextjs-app-router/gotchas.seed.md +78 -0
  43. package/content/modules/nextjs-app-router/rules.patch.md +35 -0
  44. package/content/modules/prisma-postgres/ach.patch.md +65 -0
  45. package/content/modules/prisma-postgres/rules.patch.md +28 -0
  46. package/content/modules/shadcn-ui/ach.patch.md +42 -0
  47. package/content/modules/stripe-billing/ach.patch.md +46 -0
  48. package/content/modules/stripe-billing/gotchas.seed.md +73 -0
  49. package/content/modules/stripe-billing/rules.patch.md +30 -0
  50. package/content/modules/trigger-dev-v4/ach.patch.md +64 -0
  51. package/content/modules/trigger-dev-v4/gotchas.seed.md +53 -0
  52. package/content/modules/trigger-dev-v4/rules.patch.md +35 -0
  53. package/content/modules/trpc-v11/ach.patch.md +56 -0
  54. package/content/modules/trpc-v11/rules.patch.md +34 -0
  55. package/content/modules/vireya-ui/ach.patch.md +85 -0
  56. package/content/modules/vireya-ui/gotchas.seed.md +98 -0
  57. package/content/modules/vireya-ui/rules.patch.md +36 -0
  58. package/content/ops/adr.md +54 -0
  59. package/content/ops/analyze.md +130 -0
  60. package/content/ops/clarify.md +86 -0
  61. package/content/ops/deliver.md +209 -0
  62. package/content/ops/diagnose.md +143 -0
  63. package/content/ops/evolve.md +366 -0
  64. package/content/ops/export-template.md +97 -0
  65. package/content/ops/generalize.md +117 -0
  66. package/content/ops/gotcha.md +46 -0
  67. package/content/ops/obligations.md +145 -0
  68. package/content/ops/plan.md +61 -0
  69. package/content/ops/policy.md +61 -0
  70. package/content/ops/promote.md +72 -0
  71. package/content/ops/protocol.md +51 -0
  72. package/content/ops/reconcile.md +44 -0
  73. package/content/ops/reflect.md +182 -0
  74. package/content/ops/remediate.md +143 -0
  75. package/content/ops/restructure.md +142 -0
  76. package/content/ops/rule.md +170 -0
  77. package/content/ops/specify.md +62 -0
  78. package/content/ops/tasks.md +67 -0
  79. package/content/ops/update.md +252 -0
  80. package/content/ops/verify.md +67 -0
  81. package/content/patterns/adapter.md +46 -0
  82. package/content/patterns/facade.md +47 -0
  83. package/content/patterns/factory.md +46 -0
  84. package/content/patterns/null-object.md +55 -0
  85. package/content/patterns/result-vs-exception.md +52 -0
  86. package/content/patterns/strategy.md +45 -0
  87. package/content/patterns/template-method-vs-composition.md +50 -0
  88. package/content/questions/adr.questions.yaml +14 -0
  89. package/content/questions/analyze.questions.yaml +12 -0
  90. package/content/questions/bootstrap-mapping.questions.yaml +14 -0
  91. package/content/questions/bootstrap-rules.questions.yaml +10 -0
  92. package/content/questions/bootstrap-stack.questions.yaml +23 -0
  93. package/content/questions/clarify.questions.yaml +10 -0
  94. package/content/questions/code-style.questions.yaml +12 -0
  95. package/content/questions/confirm.questions.yaml +12 -0
  96. package/content/questions/deliver.questions.yaml +23 -0
  97. package/content/questions/evolve.questions.yaml +15 -0
  98. package/content/questions/export-template-apply.questions.yaml +11 -0
  99. package/content/questions/export-template.questions.yaml +23 -0
  100. package/content/questions/gates.questions.yaml +27 -0
  101. package/content/questions/generalize.questions.yaml +13 -0
  102. package/content/questions/gotcha.questions.yaml +11 -0
  103. package/content/questions/init-template.questions.yaml +10 -0
  104. package/content/questions/init.questions.yaml +41 -0
  105. package/content/questions/obligations.questions.yaml +17 -0
  106. package/content/questions/plan.questions.yaml +14 -0
  107. package/content/questions/refactor.questions.yaml +23 -0
  108. package/content/questions/reflect.questions.yaml +13 -0
  109. package/content/questions/remediate.questions.yaml +27 -0
  110. package/content/questions/restructure.questions.yaml +15 -0
  111. package/content/questions/rf-mapping.questions.yaml +12 -0
  112. package/content/questions/rule-scope.questions.yaml +12 -0
  113. package/content/questions/rule.questions.yaml +12 -0
  114. package/content/questions/specify.questions.yaml +23 -0
  115. package/content/questions/update-artifacts.questions.yaml +10 -0
  116. package/content/questions/update-strings.questions.yaml +14 -0
  117. package/content/questions/update.questions.yaml +10 -0
  118. package/content/questions/verify.questions.yaml +9 -0
  119. package/content/roles/executor.md +18 -0
  120. package/content/roles/explorer.md +22 -0
  121. package/content/roles/reviewer.md +23 -0
  122. package/content/rubrics/enum-vs-union-vs-branded.md +40 -0
  123. package/content/rubrics/episodic-vs-semantic-boundary.md +37 -0
  124. package/content/rubrics/error-classification.md +98 -0
  125. package/content/rubrics/failure-classification.md +111 -0
  126. package/content/rubrics/negative-filters.md +38 -0
  127. package/content/rubrics/solid-triggers.md +119 -0
  128. package/content/rubrics/template-vs-streaming-precedence.md +34 -0
  129. package/content/rubrics/validation-boundary.md +94 -0
  130. package/content/rubrics/when-to-create-dsl.md +65 -0
  131. package/content/rubrics/when-to-create-lib.md +49 -0
  132. package/content/rubrics/when-to-create-module.md +39 -0
  133. package/content/rubrics/when-to-evolve-methodology.md +62 -0
  134. package/content/skills/adr.md +42 -0
  135. package/content/skills/analyze.md +28 -0
  136. package/content/skills/clarify.md +28 -0
  137. package/content/skills/deliver.md +26 -0
  138. package/content/skills/diagnose.md +42 -0
  139. package/content/skills/evolve.md +43 -0
  140. package/content/skills/export-template.md +37 -0
  141. package/content/skills/generalize.md +31 -0
  142. package/content/skills/gotcha.md +40 -0
  143. package/content/skills/init.md +77 -0
  144. package/content/skills/obligations.md +27 -0
  145. package/content/skills/plan.md +28 -0
  146. package/content/skills/policy.md +25 -0
  147. package/content/skills/promote.md +39 -0
  148. package/content/skills/protocol.md +41 -0
  149. package/content/skills/reconcile.md +45 -0
  150. package/content/skills/refactor.md +79 -0
  151. package/content/skills/reflect.md +43 -0
  152. package/content/skills/remediate.md +33 -0
  153. package/content/skills/restructure.md +46 -0
  154. package/content/skills/rule.md +43 -0
  155. package/content/skills/specify.md +28 -0
  156. package/content/skills/tasks.md +24 -0
  157. package/content/skills/update.md +58 -0
  158. package/content/skills/verify.md +29 -0
  159. package/content/templates/adr.template.md +51 -0
  160. package/content/templates/evolution-report.template.md +132 -0
  161. package/content/templates/feature-plan.template.md +84 -0
  162. package/content/templates/feature-research.template.md +56 -0
  163. package/content/templates/feature-spec.template.md +86 -0
  164. package/content/templates/feature-tasks.induced.template.md +91 -0
  165. package/content/templates/feature-tasks.template.md +82 -0
  166. package/content/templates/focus.template.md +30 -0
  167. package/content/templates/gotcha.template.md +31 -0
  168. package/content/templates/guardrail-runner.template.md +97 -0
  169. package/content/templates/guardrail.template.md +63 -0
  170. package/content/templates/learning.template.md +40 -0
  171. package/content/templates/procedure.template.md +47 -0
  172. package/content/templates/protocols/p1.md +29 -0
  173. package/content/templates/protocols/p2.md +28 -0
  174. package/content/templates/protocols/p3.md +47 -0
  175. package/content/templates/research.template.md +50 -0
  176. package/content/templates/session-handoff.template.md +58 -0
  177. package/content/templates/us.template.md +39 -0
  178. package/content/tools/gate/core-rules/PLUGIN-13-secrets.sh +36 -0
  179. package/content/tools/gate/core-rules/PLUGIN-21-code-language.sh +27 -0
  180. package/content/tools/gate/core-rules/PLUGIN-35-gate-complete.sh +19 -0
  181. package/content/tools/gate/core-rules/PLUGIN-36-absolute-path.sh +38 -0
  182. package/content/tools/gate/core-rules/PLUGIN-37-prose-language.sh +56 -0
  183. package/content/tools/gate/core-rules/PLUGIN-38-parser-marker.sh +82 -0
  184. package/content/tools/gate/core-rules/PLUGIN-39-frontmatter-ops.sh +325 -0
  185. package/content/tools/gate/core-rules/PLUGIN-40-dead-reference.sh +74 -0
  186. package/content/tools/gate/core-rules/README.md +55 -0
  187. package/content/tools/gate/guardrails.sh +740 -0
  188. package/content/tools/gate/lib/ratchet.sh +119 -0
  189. package/content/tools/gate/lib/scope.sh +85 -0
  190. package/content/tools/gate/ratchet.seed.tsv +1 -0
  191. package/content/tools/gate/rules/README.md +50 -0
  192. package/package.json +19 -5
  193. package/plugin/agy/hooks.json +29 -0
  194. package/plugin/agy/mcp_config.json +7 -0
  195. package/plugin/agy/plugin.json +6 -0
  196. package/plugin/agy/skills/afm-adr/SKILL.md +48 -0
  197. package/plugin/agy/skills/afm-analyze/SKILL.md +34 -0
  198. package/plugin/agy/skills/afm-clarify/SKILL.md +34 -0
  199. package/plugin/agy/skills/afm-deliver/SKILL.md +30 -0
  200. package/plugin/agy/skills/afm-diagnose/SKILL.md +46 -0
  201. package/plugin/agy/skills/afm-evolve/SKILL.md +49 -0
  202. package/plugin/agy/skills/afm-export-template/SKILL.md +43 -0
  203. package/plugin/agy/skills/afm-generalize/SKILL.md +37 -0
  204. package/plugin/agy/skills/afm-gotcha/SKILL.md +46 -0
  205. package/plugin/agy/skills/afm-init/SKILL.md +81 -0
  206. package/plugin/agy/skills/afm-obligations/SKILL.md +31 -0
  207. package/plugin/agy/skills/afm-plan/SKILL.md +34 -0
  208. package/plugin/agy/skills/afm-policy/SKILL.md +29 -0
  209. package/plugin/agy/skills/afm-promote/SKILL.md +43 -0
  210. package/plugin/agy/skills/afm-protocol/SKILL.md +45 -0
  211. package/plugin/agy/skills/afm-reconcile/SKILL.md +49 -0
  212. package/plugin/agy/skills/afm-refactor/SKILL.md +83 -0
  213. package/plugin/agy/skills/afm-reflect/SKILL.md +49 -0
  214. package/plugin/agy/skills/afm-remediate/SKILL.md +39 -0
  215. package/plugin/agy/skills/afm-restructure/SKILL.md +52 -0
  216. package/plugin/agy/skills/afm-rule/SKILL.md +49 -0
  217. package/plugin/agy/skills/afm-specify/SKILL.md +34 -0
  218. package/plugin/agy/skills/afm-tasks/SKILL.md +28 -0
  219. package/plugin/agy/skills/afm-update/SKILL.md +64 -0
  220. package/plugin/agy/skills/afm-verify/SKILL.md +35 -0
  221. package/plugin/claude-code/.claude-plugin/marketplace.json +15 -0
  222. package/plugin/claude-code/.claude-plugin/plugin.json +9 -0
  223. package/plugin/claude-code/.mcp.json +7 -0
  224. package/plugin/claude-code/agents/afm-executor.md +18 -0
  225. package/plugin/claude-code/agents/afm-explorer.md +20 -0
  226. package/plugin/claude-code/agents/afm-reviewer.md +21 -0
  227. package/plugin/claude-code/hooks/hooks.json +85 -0
  228. package/plugin/claude-code/skills/adr/SKILL.md +48 -0
  229. package/plugin/claude-code/skills/analyze/SKILL.md +34 -0
  230. package/plugin/claude-code/skills/clarify/SKILL.md +34 -0
  231. package/plugin/claude-code/skills/deliver/SKILL.md +30 -0
  232. package/plugin/claude-code/skills/diagnose/SKILL.md +46 -0
  233. package/plugin/claude-code/skills/evolve/SKILL.md +49 -0
  234. package/plugin/claude-code/skills/export-template/SKILL.md +43 -0
  235. package/plugin/claude-code/skills/generalize/SKILL.md +37 -0
  236. package/plugin/claude-code/skills/gotcha/SKILL.md +46 -0
  237. package/plugin/claude-code/skills/init/SKILL.md +81 -0
  238. package/plugin/claude-code/skills/obligations/SKILL.md +31 -0
  239. package/plugin/claude-code/skills/plan/SKILL.md +34 -0
  240. package/plugin/claude-code/skills/policy/SKILL.md +29 -0
  241. package/plugin/claude-code/skills/promote/SKILL.md +43 -0
  242. package/plugin/claude-code/skills/protocol/SKILL.md +45 -0
  243. package/plugin/claude-code/skills/reconcile/SKILL.md +49 -0
  244. package/plugin/claude-code/skills/refactor/SKILL.md +83 -0
  245. package/plugin/claude-code/skills/reflect/SKILL.md +49 -0
  246. package/plugin/claude-code/skills/remediate/SKILL.md +39 -0
  247. package/plugin/claude-code/skills/restructure/SKILL.md +52 -0
  248. package/plugin/claude-code/skills/rule/SKILL.md +49 -0
  249. package/plugin/claude-code/skills/specify/SKILL.md +34 -0
  250. package/plugin/claude-code/skills/tasks/SKILL.md +28 -0
  251. package/plugin/claude-code/skills/update/SKILL.md +64 -0
  252. package/plugin/claude-code/skills/verify/SKILL.md +35 -0
  253. package/plugin/opencode/afm/index.js +245 -0
  254. package/plugin/opencode/afm/tui.js +21 -0
  255. package/plugin/opencode/agents/afm-executor.md +39 -0
  256. package/plugin/opencode/agents/afm-explorer.md +92 -0
  257. package/plugin/opencode/agents/afm-reviewer.md +93 -0
  258. package/plugin/opencode/skills/afm-adr/SKILL.md +48 -0
  259. package/plugin/opencode/skills/afm-analyze/SKILL.md +34 -0
  260. package/plugin/opencode/skills/afm-clarify/SKILL.md +34 -0
  261. package/plugin/opencode/skills/afm-deliver/SKILL.md +30 -0
  262. package/plugin/opencode/skills/afm-diagnose/SKILL.md +46 -0
  263. package/plugin/opencode/skills/afm-evolve/SKILL.md +49 -0
  264. package/plugin/opencode/skills/afm-export-template/SKILL.md +43 -0
  265. package/plugin/opencode/skills/afm-generalize/SKILL.md +37 -0
  266. package/plugin/opencode/skills/afm-gotcha/SKILL.md +46 -0
  267. package/plugin/opencode/skills/afm-init/SKILL.md +81 -0
  268. package/plugin/opencode/skills/afm-obligations/SKILL.md +31 -0
  269. package/plugin/opencode/skills/afm-plan/SKILL.md +34 -0
  270. package/plugin/opencode/skills/afm-policy/SKILL.md +29 -0
  271. package/plugin/opencode/skills/afm-promote/SKILL.md +43 -0
  272. package/plugin/opencode/skills/afm-protocol/SKILL.md +45 -0
  273. package/plugin/opencode/skills/afm-reconcile/SKILL.md +49 -0
  274. package/plugin/opencode/skills/afm-refactor/SKILL.md +83 -0
  275. package/plugin/opencode/skills/afm-reflect/SKILL.md +49 -0
  276. package/plugin/opencode/skills/afm-remediate/SKILL.md +39 -0
  277. package/plugin/opencode/skills/afm-restructure/SKILL.md +52 -0
  278. package/plugin/opencode/skills/afm-rule/SKILL.md +49 -0
  279. package/plugin/opencode/skills/afm-specify/SKILL.md +34 -0
  280. package/plugin/opencode/skills/afm-tasks/SKILL.md +28 -0
  281. package/plugin/opencode/skills/afm-update/SKILL.md +64 -0
  282. package/plugin/opencode/skills/afm-verify/SKILL.md +35 -0
  283. package/README.md +0 -3
@@ -0,0 +1,806 @@
1
+ # Changelog (archive) — framework-template
2
+
3
+ > **Historical archive. Nothing here was rewritten or compressed.**
4
+ >
5
+ > These are the releases from `3.0.0-rc.1` (2026-05-28) through `3.4.0-rc.7`, moved out of
6
+ > `CHANGELOG.md` on 2026-08-23 so the working file stays readable. The active file keeps
7
+ > `3.5.0` onward.
8
+ >
9
+ > **Why moved and not merged.** Two compression passes were run and both were rejected by
10
+ > an adversarial check. This file is dense: 1832 lines held 322 file paths, 96 measured
11
+ > numbers, 50 table rows, 32 consumer-migration blocks and 10 arXiv citations. Almost
12
+ > nothing here is ornament, so compressing it degrades a record instead of shortening one.
13
+ >
14
+ > **`ops/update.md` reads this file too.** The `### Consumer migration` blocks are
15
+ > parsed to decide what a consumer project must materialize. A version range that reaches
16
+ > back before `3.5.0` must read this archive, not only `CHANGELOG.md`.
17
+
18
+ ## [3.4.0-rc.7] — 2026-07-26
19
+
20
+ > **The plugin boundary becomes absolute, and the session becomes usage telemetry.** Two halves coupled by
21
+ > one point: the finding that `promote` now records lives in `afm_findings` of the session file.
22
+ > Executes Concept #5 of v4 (F9).
23
+
24
+ ### BREAKING (pre-release) — `promote` no longer writes to the plugin
25
+
26
+ - **`ops/promote.md` becomes a pure recorder.** Steps 3-6 (edit `framework-template/`, bump
27
+ `VERSION`, write `CHANGELOG`, "do not push") **are gone**. What stays: the reproducible mechanical
28
+ evidence gate and the walk classification, which now decides the finding's `target:` field instead of a
29
+ write destination. **Tracks A/B collapsed into one** — without a write to the plugin, the distinction no
30
+ longer discriminated anything.
31
+ - **Why, with the measurement:** the write steps resolved
32
+ `${CLAUDE_SKILL_DIR}/../../framework-template/...`, which points to the **versioned install cache**
33
+ (`~/.claude/plugins/cache/<mkt>/<plugin>/<version>/`) — **even in a session running inside the
34
+ plugin's own repo**, because since ADR-0005 the install is a copy, not a symlink. Measured 2026-07-26: 6
35
+ copies, 93 MB. Every `promote` edit would die on the next `plugin update`, with no error and no signal.
36
+ **The op never worked anywhere**; the owner invariant and the defect pointed to the same edit.
37
+ - **`PRINCIPLES.md` #6 bright line (b) hardens:** from "stops and asks" to **"no path exists"**.
38
+ No AFM op writes to the plugin. #7 gains the corollary of who edits (the maintainer, with the plugin
39
+ repo open) and why it is not just discipline. **Invariant principle reframe — hard rule 11.**
40
+ - **The boundary post-condition (`evolve.md § Phase 4.3`, two branches) becomes a universal assertion**
41
+ of the ops, not a guard for one cycle. The 4 mirrors already pointed there.
42
+ - **New mechanical gate in `test/refs-lint.sh`:** no op may declare an effect on the plugin on the
43
+ **Forma** line. Uses the structure that already existed instead of hunting a write verb — RED only on
44
+ `promote`, zero false positive.
45
+
46
+ ### Added — `docs/sessions/` stops being an audit log and becomes usage telemetry
47
+
48
+ - **What was missing was not a record of what changed** (git already does that, and the directory was not
49
+ even versioned) — it was a record **of what was asked and of how AFM was used to serve it**. It is the
50
+ only telemetry that neither git nor the substrate has, and the one an agent in the plugin repo needs
51
+ to improve AFM from real usage.
52
+ - **Three layers with no duplication:** `sessions/<date>-<sid6>.md` (rich frontmatter + timeline in 2 parts +
53
+ inline `afm_findings`) · `docs/evolution/NNN` (what `reflect` found **and fixed** — already canonical) ·
54
+ the transcript (via `claude_session_id`). **`docs_findings` is not a field** — it collapses into a
55
+ `reflection:` link; keeping the finding *and* the fix in two places would be the inflation `reflect`
56
+ itself forbids.
57
+ - **`afm-session-end.sh` (`Stop`, 0-LLM):** frontmatter gains the **full** `claude_session_id` (the id was
58
+ truncated with `cut -c1-6` and only became a filename suffix — that made the pointer to the transcript
59
+ useless), `name` (mechanical slug of the dominant subtree), `date`, `reflection:`. The body gains
60
+ `## what was asked`, `## how it was executed`, and `## afm_findings`.
61
+ - **`ops/reflect.md § 5.1` — session closing.** The hook writes the mechanical part; `reflect` fills in the
62
+ judgment part. **A session with no `reflect` keeps only the skeleton**, and that is acceptable —
63
+ rejected: intercepting `Stop` (blocks every turn end) and a per-turn timeline from `reconcile` (one write
64
+ per turn in every adopted project). No new template: partial fill of the
65
+ `evolution-report.template.md` (rule 34).
66
+ - **`sessions/` is dual-tier** (`rubrics/episodic-vs-semantic-boundary.md`): the handoff block decays,
67
+ the telemetry does not. **`state: consumed` marks the handoff as read, never the file as dead.** The
68
+ exclusion in rule 17 still runs on a closed path — the file is append-per-session, never rewritten.
69
+ - **Hard rule 13 now covers `docs/sessions/`** — the mandatory counterpart of versioning the narrative: the
70
+ agent cites the command it ran, and the command held the key. New verification by known credential
71
+ prefix (`sk-`, `ghp_`, `AIza`, `xox*-`, JWT), tested against a good **and** a bad case in the smoke test.
72
+ - **`hooks/test/run.sh` 54 → 57 asserts:** full id, 7 frontmatter fields, `afm_findings` reserved,
73
+ dedup preserved, and the rule 13 pattern against 5 prefixes + 1 negative.
74
+
75
+ ### Fixed
76
+
77
+ - **`afm-capture-failure.sh` had two dead patterns** (SC2221/SC2222): `*"npm test"*` already matches
78
+ `pnpm test` and `*"go test"*` already matches `cargo test` — the dedicated entries were never reached. No
79
+ behavior effect (all assigned the same oracle), but it left `shellcheck --severity=warning`
80
+ red. **It only surfaced because shellcheck ran through a container:** it is not installed on this machine and
81
+ the smoke test skips it silently (`shellcheck ausente — pulado`), so hard rule 33 had been
82
+ verified only halfway.
83
+
84
+ ### Consumer migration
85
+
86
+ - **Take `docs/sessions/` out of `.gitignore`** and start versioning the directory. That is what makes the
87
+ telemetry useful (it survives the machine and travels).
88
+ - **Extend hard rule 13** in your `docs/afm.md § 3` with the credential-prefix check over
89
+ `docs/sessions/` — without it, versioning the narrative is the new leak path.
90
+ - **Old session files stay readable** (`kind: handoff`): the hook does not rewrite what already exists.
91
+ The new fields appear starting with the next session that has work.
92
+ - **`/afm:promote` changed contract.** If any of your flows expected it to edit the plugin, it no longer
93
+ does — and it did not actually do so before either, it wrote to a disposable cache.
94
+
95
+ ## [3.4.0-rc.6] — 2026-07-26
96
+
97
+ > **The gates passed because they measured the wrong thing.** Four defects from the same family: a linter
98
+ > blind to a whole class of reference, a hook that counted noise as signal, an axis that never ran, and the
99
+ > instance/plugin boundary guard passing in silence exactly where it needed to block.
100
+
101
+ ### Fixed
102
+
103
+ - **`refs-lint.sh` gains class 5 — a backtick path.** Classes 1-2 covered a command and a markdown link.
104
+ The reference that escaped in rc.5 had a third nature (`MAINTAINERS.md` cited in prose inside a
105
+ SKILL.md, after the file left the plugin). Gate green, dead reference **installed in the consumer**.
106
+ It covers a canonical root doc cited by name plus a path anchored in the plugin. It ignores consumer
107
+ notation (`/docs/`, an instance dot-dir) and prose with an ellipsis. **`skills/promote/SKILL.md` fixed.**
108
+ - **Instance/plugin boundary — the guard was inert in production.** `git -C <not-a-repo> status
109
+ --porcelain` exits with **code 128 and empty stdout**, so the "empty output" check **passed** in a
110
+ directory that is not a git repo — which is exactly the plugin-root of a consumer (a versioned
111
+ marketplace cache). The postcondition now has **two branches** (`rev-parse` decides), and the no-git
112
+ branch compares against a `T0` captured in Phase 1. Canonical in `ops/evolve.md § Phase 4.3`; the 4
113
+ mirrors now link to it.
114
+ - **`afm-health.sh` — vital signs with ~90% noise.** Measured on this repo: 23 dead refs, of which 21
115
+ were a subproject path resolved against the root (including the check for rule 30 itself), and 5 of
116
+ 5 § 3 triggers the same way. Resolution now tries the path as a **versioned-file suffix** before
117
+ declaring it dead; a line announcing removal and an instance dot-dir path stop counting. **23 → 0.**
118
+ - **`afm-health.sh` A1 never ran without `docs/adr/`.** The guard was `ls ./docs/*.md ./docs/adr/*.md`,
119
+ and `ls` exits non-zero if **any** argument is missing — so every instance still without an ADR had the
120
+ axis silently turned off (it did not report "0 dead refs": it did not run). Caught by an assert that
121
+ passed for the wrong reason.
122
+ - **`afm-health.sh` A2 counted a mention as a gap.** A backtick marker is the doc **teaching the
123
+ convention**, not leaving a gap; `docs/research/` is episodic evidence that cites other docs. 20 → 4.
124
+ - **`afm-health.sh` A7 routed to the opposite of the right call.** In a monorepo where one subtree holds
125
+ >80% of the counted code, the global ratio is not interpretable: here it gave 2% ("under-documented" →
126
+ document more) when, once you exclude the engine that § 3.1 scopes out, it is 93% ("bloated" → the
127
+ opposite). It now reports the composition and **does not route to an action**.
128
+
129
+ ### Tests
130
+
131
+ - `hooks/test/run.sh`: **46 → 51 asserts.** Two new fixtures that *are* git repos (the old ones were not,
132
+ so the suffix-match was never exercised) — one proves a subproject path is not a dead ref, the other
133
+ that a reference with no anchor at all **still** gets flagged. The gate must not be blind while proving
134
+ it is not noisy.
135
+ - `refs-lint.sh --self-test`: 7 → 11 asserts (missing root doc, a sibling of the citer, both prose forms).
136
+
137
+ ### Consumer migration
138
+
139
+ - **Consumer-noop.** Nothing materialized changes. `CONSUMER_VERSION` stays at `3.3.0-rc.1`.
140
+
141
+ ## [3.4.0-rc.5] — 2026-07-25
142
+
143
+ > **`MAINTAINERS.md` leaves the plugin.** It gave instructions on how to **edit AFM** — and the person who edits AFM edits it **in this repo**, whose `/docs/` is the instance that already governs this work. The distributed plugin carried 140 lines of prose useful to only one repository. This was the duplication rule 34 forbids, in the most visible place possible.
144
+
145
+ ### Removed
146
+
147
+ - **`framework-template/MAINTAINERS.md`** (140 lines). Its content went to two places, by nature:
148
+
149
+ | Content | Went to | Why |
150
+ | --- | --- | --- |
151
+ | Shared hooks contract | **`plugins/afm/hooks/README.md`** | 6 scripts referenced it; the contract lives next to what it governs, and **travels with the plugin** |
152
+ | Versioning, watermark, how to add a component, degree of freedom, NEVER do | **`docs/procedures/manter-o-plugin-afm.md`** (this repo's instance) | it is a maintenance runbook, and maintenance happens here — `procedures/` is the exact family for this |
153
+
154
+ Content that **was already a hard rule** (`docs/afm.md` § 3: 11, 30, 31, 33, 34) was not copied: the runbook points to those rules. Duplicating the rule next to the procedure would repeat the error this removal fixes.
155
+
156
+ ### Changed
157
+
158
+ - **`skills/init` and `skills/refactor`: the "How to modify the methodology" section is removed.** This was prose in a thin wrapper that explained how to **edit the plugin** — not what the skill does. This cuts the 80% where it is obvious.
159
+ - **`ops/promote.md`**: the 3 bump criteria became inline (one line). `promote` **edits** the plugin and travels to the consumer — pointing it to a doc in the maintainer's repo would be a reference that does not resolve from where it runs.
160
+ - **`ops/evolve.md`**: "never renumber a rule" became inline with the reason (renumbering breaks every external reference and every trigger that cites the number), instead of a link.
161
+ - **`ops/diagnose.md`, `README-light.md`, `hooks/test/README.md`, 6 hook scripts, `CLAUDE.md`, `docs/afm.md`, `docs/gotchas.md`, `docs/adr/0002`**: repointed.
162
+
163
+ ### Consumer migration
164
+
165
+ - **Consumer-noop.** `MAINTAINERS.md` was never materialized in the instance (it was plugin-only, and its own header said "not runtime"). `CONSUMER_VERSION` stays at `3.3.0-rc.1`.
166
+
167
+ ## [3.4.0-rc.4] — 2026-07-25
168
+
169
+ > **F4 (forma e grau de liberdade) — what was convention becomes a verifiable contract.** The 21 ops now declare, in one line, what they do and how much freedom they have. Merge and removal stay out of scope (ADR-0012 + organic data).
170
+
171
+ ### Added
172
+
173
+ - **Line `> **Forma** —` in all 21 ops**: effect · trigger · precondition · composed-of · **grau de liberdade**. It exists so the agent can decide if the op fits **without opening the whole file**, and so the protocol can compose without duplicating procedure.
174
+ - **`test/refs-lint.sh`: form rule** — an op with no line, or with a grau outside the closed vocabulary (`alto|médio|baixo`), fails. Without a gate, a new op is born with no declaration, and the form stays a convention only the author remembers.
175
+ - **`MAINTAINERS.md` § Adicionar sub-flow ops novo** gains step 0, with the consequence table: grau **alto** means the op file carries the **contract** (input, output, invariants) and little else — prescribing the path where the decision depends on context is *over-specification*, a named anti-pattern.
176
+
177
+ ### Measured
178
+
179
+ Distribution: **alto 2 · médio 8 · baixo 11**. And the expected correlation (high grau ⇒ heavy prose) **does not exist**:
180
+
181
+ | grau | ops | average lines |
182
+ | --- | --- | --- |
183
+ | alto | 2 | 72 |
184
+ | **médio** | 8 | **117** |
185
+ | baixo | 11 | 62 |
186
+
187
+ The **médio** grau carries the most prescription, dominated by the two orchestrators (`deliver` and `evolve`, 184 lines each) — which arguably need procedure because they compose other ops. Among the `alto` ops, `reconcile` has **24 lines** and is the example of the grau applied well; `research` (120) is the outlier, and part of the weight came from this line's own rc.1 (the two modes). This stays on record as the first candidate for a future prune — which remains **not** approved.
188
+
189
+ ### Consumer migration
190
+
191
+ - **Consumer-noop.** The form line lives in the plugin's `ops/`, which are not materialized. `CONSUMER_VERSION` stays at `3.3.0-rc.1`.
192
+
193
+ ## [3.4.0-rc.3] — 2026-07-25
194
+
195
+ > **F8 — `update` learns to replace.** Until now it could only **copy new content**. Rename and removal existed only as prose in the migration block, with a single precedent (the `kenpachi`→`evolve` rename: one marker and one skill name). A framework that renames an already materialized term needs mechanics. Otherwise the instance keeps the old vocabulary, the plugin has the new one, and `diagnose A7` flags the contradiction later.
196
+
197
+ ### Added
198
+
199
+ - **`**Replacements**` block in the CHANGELOG** — a `File | From | To` table that `update` executes. Six 0/1 application rules: proof of need through `grep` before touching anything; **literal** replacement, never regex (regex on a hand-edited instance rewrites what nobody asked for); proof of application afterward with **both** counts (the first count alone cannot distinguish "replaced" from "deleted"); a missing file is skipped instead of created; **`[TBD]` stops the sync** (#4 — the owner's stance wins); and a replacement never creates a section.
200
+ - **`test/update-rehearsal.sh`** — a rehearsal on a disposable consumer, 13 asserts. Replacement fails in a way copy does not — it rewrites a doc the owner edited by hand. Rehearsing before touching the real instance is what separates "the migration works" from "it worked on the two I tested."
201
+
202
+ ### Decided
203
+
204
+ - **Removal stays out of mechanical scope, and this is deliberate.** Deleting content from the instance is a destructive operation, and destructive is a bright line in **every** protocol (#6). A release that removes something states in prose what became obsolete. The owner deletes it if they want. **`update` never deletes.**
205
+
206
+ ### Consumer migration
207
+
208
+ - **Consumer-noop.** The mechanics belong to the op. Nothing new to materialize. `CONSUMER_VERSION` stays at `3.3.0-rc.1`.
209
+
210
+ ## [3.4.0-rc.2] — 2026-07-25
211
+
212
+ > **F4 (mechanical part) — a partial read stops being silent.** The part of the consolidation that does **not** depend on organic data. Merge and removal stay blocked: ADR-0012 proved that no operation should be removed, and the license to merge depends on the cadence counter building up real use.
213
+
214
+ ### Added
215
+
216
+ - **Scope indicator in 16 reference files** (`> **Neste arquivo:** …`) — one line that lists the sections, right below the title.
217
+ - **`test/refs-lint.sh`: scope rule** — a reference file with more than 100 lines and 3+ sections declares the scope at the top, or it fails. More recorded debt, under the same discipline as `skills-lint`.
218
+
219
+ ### Measurement corrections
220
+
221
+ The plan dossier recorded **reference depth 3-5 and 2 cycles**. Measured with a graph resolver over the real links:
222
+
223
+ - **Max depth is 3** (`SKILL → op → core → rubric`), reaching 8-11 files. Not 5.
224
+ - **Zero link cycles.** The "2 cycles" (`deliver`↔`specify`, `evolve`↔`update`) are references in **prose** — one op mentions the phase of another op in the text. Prose is not a link that anyone follows, and the navigation graph has no cycle at all.
225
+
226
+ **Why the target stopped being "depth ≤1".** The official recommendation is to reference one level down from the SKILL.md. Here that would need the op to link nothing — impossible without duplicating `core/`, which breaks rule 34 (procedure in `ops/`, principle in `PRINCIPLES.md`, each in one place only). Chasing the number would break the rule that gives the number its meaning.
227
+
228
+ What the recommendation **protects** is named in the doc itself: a silent partial read (`head -100` leaves the agent with incomplete information without knowing it is incomplete). And the remedy also comes from the official doc — a reference file with more than 100 lines declares the scope at the top. That is the target now: mechanical, verifiable, and it attacks the risk instead of the proxy.
229
+
230
+ ### Consumer migration
231
+
232
+ - **Consumer-noop.** The scope indicator goes into `core/*.md`, which `/afm:update` materializes; an existing instance gets it on the next sync, with no behavior change. `CONSUMER_VERSION` stays at `3.3.0-rc.1`.
233
+
234
+ ## [3.4.0-rc.1] — 2026-07-25
235
+
236
+ > **F7 of v4 — own research MCP.** `plugins/afm/mcp/`, TypeScript, self-contained. It reads the page and returns **only the excerpts that match the query**, ranked by BM25, inside a token budget. `WebFetch` native becomes the last resort.
237
+
238
+ ### Added
239
+
240
+ - **`@afm-mcp/research`** — one tool (`web_read`). Pipeline: fetch → content extraction → chunking ~200 tokens at block boundary → BM25 (`k1=1.5`, `b=0.75`) → budget-based selection. Parameters come from published measurement: recall stays almost flat between 200 and 800 tokens, but IoU drops ~4.6x at 800, and overlap makes IoU worse. BM25, not embeddings, because the regime is zero-shot on a disposable page — embedding N chunks of a page that will not be re-queried does not pay off.
241
+ - **`research` in two modes** — `normal` (MCP only, inline) and `deep` (`Agent(Explore)` using `web_read` instead of `WebFetch`). What promotes to `deep`: a user flag or the active protocol (phase 1 of P3).
242
+ - **Eval with a frozen corpus** (`mcp/evals/`) — 4 real pages, target facts verified by `grep`, zero API calls. Arm A = the whole page extracted. Arm B = the distilled version.
243
+
244
+ ### Design notes
245
+
246
+ - **One tool, not a set.** The official guidance is explicit: *"more tools don't always lead to better outcomes"*, and a bloated set with ambiguous decision points is a named failure. A new tool enters only with a real case.
247
+ - **Headless stays OUTSIDE the minimum cut, but the signal is measured.** ~36% of sites return <80% of their content without JS, and the median time to network-idle with headless is ~21x longer. Paying 21x on 100% of fetches to cover 36% is the wrong trade-off as a default — so `fetch.ts` **detects** (`jsLikely`) and reports it, so the decision to raise the step comes from measured frequency.
248
+ - **`no_match` is a response, not an empty result.** A query that does not match returns an explicit status instead of the first chunks. Irrelevant content that looks like an answer is worse than nothing, because the model has no way to tell.
249
+ - **The pipeline is extractive by construction** — every returned line came literally from the page. Hallucination is not measured by sampling; the eval verifies the construction.
250
+
251
+ ### Record correction — the acceptance criterion was falsified and replaced
252
+
253
+ The plan declared `tokens(B) ≤ 0.3 × tokens(A)`. **It was falsified on the first run**, and the reason is structural, not a tuning issue: `tokens(B) ≥ relevant content` is an identity. On a page with relevance density above 30%, **no** correct distiller reaches 0.3×A — reaching it would require dropping relevant content, which is the quality loss the first inequality forbids. The two were unsatisfiable together in this regime. Measured on the corpus: density of 61%, 70%, 98%, and 105%.
254
+
255
+ Replaced by `tokens(B) ≤ budget` (always) **and** `tokens(A) > budget ⟹ tokens(B) < tokens(A)`. The 0.3x was a proxy for "saves a lot on a large page"; what matters for the context is the ceiling. The observed saving keeps being reported on every run, so the claim stays auditable.
256
+
257
+ **Known corpus bias:** the 4 pages are technical reference, high density. A blog or marketing page would show a much bigger saving. The extreme case (`hooks-events`, 4 MB) is the regime the pipeline exists for: **36,708 → 1,472 tokens (−96%)**, with fact-recall intact.
258
+
259
+ ### Fixed
260
+
261
+ - **The budget counted the raw chunk but returned chunk + breadcrumb** — it silently overran the ceiling (1688 returned against 1500). `render()` became the single source of shape and cost. Caught by the eval, with a regression guard in the unit test.
262
+ - **`&ecirc;` and the accented Latin-1 block passed through raw** into the extracted text. In a PT-BR corpus this breaks the term in the BM25 index, and the right chunk stops being retrievable. Caught by the unit test.
263
+
264
+ ### Consumer migration
265
+
266
+ - **Consumer-noop.** The MCP is an install-side surface; the plugin's `.mcp.json` declares the server, and `bootstrap.mjs` installs/builds it in the cached copy on first use. `CONSUMER_VERSION` stays at `3.3.0-rc.1`.
267
+
268
+ ## [3.3.0-rc.1] — 2026-07-25
269
+
270
+ > **F6 of v4 — the `protocol` layer.** The autonomy posture stops being global and implicit. It becomes **declared per work item**. Protocol is **data**, not a new execution path: it parametrizes operations that already exist. A project with no `protocol:` declared runs the defaults, which reproduce pre-v4 behavior.
271
+
272
+ ### Added
273
+
274
+ - **`core/protocol.md`** — canonical definition: 5 fields, 8 parameters with a default, the 3 presets, what the protocol does NOT govern, and the sub-agent delegation ceiling.
275
+ - **`ops/protocol.md` + skill `/afm:protocol`** — declares/reports the active protocol. With no argument it only reports. With an argument it materializes the preset and writes `protocol:` to `docs/_focus.md`.
276
+ - **`templates/protocols/{p1,p2,p3}.md`** — the presets as versionable data.
277
+ - **`SessionStart` injects the active protocol** (+ up to 700 chars of the file). Letting the model *discover* a file that nothing references would measure discovery by chance, not the layer.
278
+
279
+ ### Changed
280
+
281
+ - **`AUTONOMY=high|normal` → `plan` field of the protocol** (11 sites in `ops/deliver.md`, `core/afm.md`, `ops/evolve.md`). `"go"` survives as an **ephemeral gate override** — it forces `plan=auto` for this delivery without changing the project's contract. A gate override is not a contract change. Otherwise the contract stops being a contract.
282
+ - **The 3 bolts of the loose loop** (`core/afm.md § 2`): the READ step resolves the protocol. `PLAN_THRESHOLD` shifts the threshold of step 3. `RETRY_CAP` parametrizes the cap in § 5.1. § 8.5 closes the task and feeds the cadence. **The loop was not rewritten** — it only gained a name for the literals that were already there.
283
+ - **À-la-carte back-pointers now conditioned** (`specify`/`plan`/`tasks`): *"running this op IS ALREADY the approval"* stops being unconditional. It was the side door through which any assisted posture leaked — these ops were **more autonomous than the orchestrated path**, and not even `"go"` governed them. `research` stays invariant by purpose. It is input, not a definer of the work inventory.
284
+ - **`PRINCIPLES.md` #6 reframed** — the **degree** of autonomy becomes a parameter. The **form** (materialize-and-report), the 4 bright lines, and the load-bearing test stay invariant.
285
+ - **`ops/evolve.md`** stops denying a flag that no longer exists. A mandatory gate in every protocol is a first-class exception, next to the bright lines.
286
+
287
+ ### Design correction
288
+
289
+ - **`disallowed-tools: AskUserQuestion` is NOT the hard mechanism of P1.** The plan expected this, but the field is **per-skill** frontmatter, static, and the chosen architecture is protocol-as-data over a **shared** runner (`deliver` serves all three presets). A skill just for P1 would multiply the listing — the problem v4 exists to solve. The real mechanism is **`ROUND_CAP = 0`**: with no round available, every irreducible item falls to `UNKNOWN_POLICY` and becomes `[ASSUMED:]`. A counter, not a promise.
290
+ - **The predicted conflict with `gate_listing_budget` did not happen.** `/afm:protocol` is the 23rd skill and should have burst the one-directional gate. The rc.9 pruning left ~5k of slack and it fit (26,541 of 31,524). The allowlist entry stays the same either way — what stops silent growth is the recorded intent, not the slack.
291
+
292
+ ### Consumer migration
293
+
294
+ - **Consumer-facing (bumps `CONSUMER_VERSION` → 3.3.0-rc.1).** `/afm:update` materializes `docs/protocols/` with the 3 presets and writes `protocol: [TBD]` to `docs/_focus.md`. **Nothing changes in behavior until the owner declares it** — assuming the posture the owner wants would be invention (principle #4). P1 needs explicit invocation in the session. It is not granted by a file in the repo.
295
+
296
+ **Replacements** (apply in `<consumer>/docs/`):
297
+
298
+ | File | From | To |
299
+ | --- | --- | --- |
300
+ | `docs/afm.md` | `AUTONOMY=high` | `plan=auto` |
301
+ | `docs/afm.md` | `AUTONOMY=normal` | `plan=assisted` |
302
+
303
+ ## [3.2.0-rc.1] — 2026-07-25
304
+
305
+ > **F1 of v4 — the hard half.** Everything here is a mechanism the harness **enforces**, with no dependence on any assumption that the model cooperates. It closes three measured gaps: sub-agent with no rule, cadence with no counter, and a failure substrate that never existed.
306
+
307
+ ### Added
308
+
309
+ - **`afm-subagent-start.sh` (`SubagentStart`).** `SessionStart` does **not** fire for a sub-agent — measured in a 12-agent fanout: zero hook attachment in the transcripts, against 5 in the parent session. `CLAUDE.md` reaches the agent through the harness (except in `Explore`/`Plan`, which skip it by design and with no override), but the instance's **materialized** hard rules reached it through no channel. It injects the `§ 3` headlines, ~340 chars. No-op for `Explore`/`Plan`: they have Write/Edit denied, and a code rule is a **write trigger** — an agent that does not write cannot violate it. The exclusion lives in the script, not the matcher, so it stays testable.
310
+ - **`afm-capture-failure.sh` (`PostToolUseFailure` Bash).** `remediate` read `docs/.afm-log-failures/` — which **nothing populated**: only the agent, in the `§ 5.1` terminal, and `afm-capture.sh` excludes the directory. A 0/1 trigger over a structurally empty set is a dead trigger, and it was the second cause (independent of the listing truncation) of `remediate` never having run. Two levels: every **oracle** failure (closed allowlist) appends an event; only **recurrence** of the same `sig` promotes it to an artifact — which respects `§ 5.1`, because a failure resolved on retry is transient.
311
+ - **Derived cadence.** `task` events (a `git commit`) and `deliverable` events (a `tasks.md` with no `- [ ]` and with `[X]`), read by `afm-health.sh` in `SessionStart`. The counter is **never stored** — keeping mutable state in `.afm-log/` would violate **rule 18**, and in `_focus.md` it would collide with **rule 20** and create a race with the agent. Deriving it amends no universal rule. Two signals because they are two granularities: `deliverable` feeds the `evolve` threshold; `task` feeds the `reflect` threshold and is the **only** one that sees a small change, which by `§ 2.1` does not even open a feature folder — which is where most of the real work happens.
312
+
313
+ ### Fixed
314
+
315
+ - **`afm-pre-edit.sh`: `agent_id` in the cache key.** The sub-agent **shares the parent's `session_id`** (verified in the harness's real payload), and only calls from inside it carry `agent_id`. Without this in the key, a file already remembered in the parent had its reminder **suppressed silently** inside the sub-agent — exactly where context is scarcest.
316
+ - **The smoke test covered by name.** The `shellcheck` script list was written by hand, so any new hook was **skipped silently** and the gate looked green without covering it. It now derives from the directory.
317
+
318
+ ### Changed
319
+
320
+ - **Factual phrasing in the hooks.** `additionalContext` in command form triggers the model's defenses (official anti-prompt-injection guidance). "Before touching code, consult /docs" became "The normative source of this project is /docs"; the `PreToolUse` warning lost the `⚠` and the imperative.
321
+ - **`SessionStart`: 6,008 → 2,631 chars (−56%).** It injected 4,000 chars of `§ 3` in prose every session; now it sends only each rule's headline. Nothing is lost: `PreToolUse` delivers the **full** rule at write time, by path-match — real progressive disclosure instead of precautionary front-load.
322
+
323
+ ### Consumer migration
324
+
325
+ - **Consumer-noop.** The instance gains `docs/.afm-log/events/` with new `kind` values and, on recurrence, `docs/.afm-log-failures/` — both on-demand, append-only. `CONSUMER_VERSION` stays at `3.1.0-rc.7`.
326
+
327
+ ## [3.1.0-rc.9] — 2026-07-25
328
+
329
+ > **A description routes. The body explains.** The rc.8 took the skills rendering with no description from 7 to 3. The 3 remaining (`generalize`, `remediate`, `restructure`) sat at the edge of the shared budget — they needed ~1.6k more chars.
330
+
331
+ ### Changed
332
+
333
+ - **7 descriptions trimmed of internal mechanics** (`evolve`, `reconcile`, `update`, `reflect`, `remediate`, `restructure`, `generalize`): −1,387 chars. What left was procedure (the `evolve` 3 buckets, the `reconcile` memory-vs-doc criterion, the `generalize` backtrack, …) — information the model does not use to **route**, and that already lives, verifiably, in the matching canonical op. This is rule 34 at work: procedure in `ops/`, routing in the `description`.
334
+ - **`afm` listing: 10,033 → 8,646 chars.** Cumulative since rc.6: **26,683 → 8,646 (−68%)**. Total for installed plugins: 31,524 → 25,988.
335
+
336
+ ### Consumer migration
337
+
338
+ - **Consumer-noop.** `CONSUMER_VERSION` stays at `3.1.0-rc.7`.
339
+
340
+ ## [3.1.0-rc.8] — 2026-07-25
341
+
342
+ > **`when_to_use` leaves the frontmatter — negative routing moves down into the body.** The rc.7 shrank the listing and **it was not enough**: the 7 skills with zero usage still rendered with no description. The measurement showed why — the budget is **shared** across all plugins and built-ins, and loading only `afm` renders all 22 in full (`SEM_DESC=0`). Shrinking `afm` was necessary, not sufficient.
343
+
344
+ ### Changed
345
+
346
+ - **Frontmatter of the 22 skills: `when_to_use` removed.** The `ATIVA` half (trigger words) was **merged into `description`** — the field the official spec requires to contain *"what it does **and** when to use it"*, and the only documented one. The `NÃO ATIVA` half became the **`## Quando NÃO ativar`** section in the `SKILL.md` body.
347
+ **Why the body:** disambiguation is a criterion for **who already activated**, not for activation. Keeping 4,061 chars of negative routing always-resident charged context to describe *when to do nothing* — and the body loads on demand, with no penalty until it is read.
348
+ **Spec note:** `when_to_use` **does not exist** in the official Agent Skills spec (only `name` and `description`), but the Claude Code binary **injects it** — it builds the entry as `description + " - " + when_to_use`. AFM was paying 2x for a surface the doc treats as a single field.
349
+ - **`afm` listing: 14,182 → 10,033 chars** (−29%). Summed across installed plugins: 31,524 → 27,375.
350
+
351
+ ### Consumer migration
352
+
353
+ - **Consumer-noop.** Skills are install-side surface; nothing materialized in `<consumer>/docs/` changes. `CONSUMER_VERSION` stays at `3.1.0-rc.7`.
354
+
355
+ ## [3.1.0-rc.7] — 2026-07-25
356
+
357
+ > **F0 of v4 — listing unblocking and the gates it was missing.** The skill listing has a budget (`contextWindow × 4 × 1%`); when it overflows, the binary prioritizes by `usageCount × decay` and renders the losing entries **with no description**. The 7 `afm` skills with zero use (`analyze`, `clarify`, `diagnose`, `export-template`, `generalize`, `remediate`, `restructure`) were exactly in that state — invisible to the model, which blocked use, which lowered the score. A ratchet. This release installs the instrumentation that measures it and fixes the rule that let the problem start.
358
+
359
+ ### Fixed
360
+
361
+ - **13 dead links in `core/ach.md`** (§ rubrics): `../framework-template/rubrics/*.md` → `rubrics/*.md`. The old path did not resolve **from any root** — not in the plugin, not in the materialized instance. The new form resolves in both (`rubrics/` here, `docs/rubrics/` there).
362
+
363
+ ### Added
364
+
365
+ - **`test/lib/skill-entry.py`** — measures the resident cost of each `SKILL.md` in the listing, mirroring the binary's formula (`2 + len(name) + 2 + min(len(desc + " - " + wtu), 1536) + 1`). Its own frontmatter parser: multi-line YAML does not come out clean in shell, and this data is the base for all the new gates.
366
+ - **`test/baseline/`** — a baseline measured **before** any v4 edit: per-skill, aggregates, `usageCount` snapshot, pre-existing debt, and justified reference exceptions.
367
+ - **`test/skills-lint.sh`: 2 rules + 1 aggregate gate.** `rule_desc_len` (≤1024, the documented limit), `rule_name_spec` (≤64, `[a-z0-9-]`, no reserved term, `name` == directory) and `gate_listing_budget` — **one-directional**: shrinking passes, growing fails; a new skill enters through `test/baseline/allowlist.tsv`, never through a silent rebaseline. A pre-existing violation becomes registered `debt`, not a silent exemption.
368
+ - **`test/refs-lint.sh`** — a dead reference in two classes: a `/<plugin>:<skill>` command that does not exist, and a markdown link that does not resolve **relative to the citing file** (resolving from the root produces a false positive). This is the gate that makes it safe to consolidate operations in slices.
369
+
370
+ ### Changed
371
+
372
+ - **Hard rule 30 (this repo's instance) — surface widened from `framework-template/` to `{framework-template,skills,hooks}/`.** The old trigger did not cover `skills/`: commit `39c8a7b` trimmed the 22 `SKILL.md` files with no bump — legitimately, by the letter of the rule — and the installed cache kept serving **26,639** listing chars against the HEAD's **14,182**, under the same tag `3.1.0-rc.6`. A version that does not bump leaves the marketplace unaware it needs to recopy.
373
+
374
+ ### Consumer migration
375
+
376
+ - **Consumer-facing (bumps `CONSUMER_VERSION` → 3.1.0-rc.7).** Nothing else changes in the instance — the new gates are repo-level, not materialized.
377
+
378
+ **Replacements** (apply in `<consumer>/docs/`):
379
+
380
+ | File | From | To |
381
+ | --- | --- | --- |
382
+ | `docs/ach.md` | `../framework-template/rubrics/` | `rubrics/` |
383
+
384
+ ## [3.1.0-rc.6] — 2026-06-16
385
+
386
+ > **Fix for the rc.5 design — after a large delivery, `deliver` calls `/afm:reflect`, not `/afm:evolve`.** The automatic pass at the end of a **large** delivery under `AUTONOMY=high` (step 4.D) is **session behavioral self-reflection** (`reflect` — where the docs guided the delivery poorly), not the full instance health cycle (`evolve`, heavier / signal-driven / with a cooldown). `reflect` is session-scoped, **auto-gated by evidence** (no friction experienced → it stops, no cooldown) and keeps its own gate. This fits better: the delivery's *new* knowledge is already covered by `reconcile` (4.B). `reflect` covers the complementary axis — the doc that **failed as a harness**.
387
+
388
+ ### Changed
389
+
390
+ - **`deliver` step 4.D + stop table + suppression contract + `core/afm.md § 2.2` step 6:** `/afm:evolve` → **`/afm:reflect`**. `reflect` keeps its own gate (it does not auto-apply — #6; the human approves the instructivity refinements). Removed the mention of cooldown/unlock (`reflect` has no cooldown — it is auto-gated by session evidence). Under `AUTONOMY=normal` it stays only **suggested**. The `/afm:evolve` skill still exists and can be invoked à la carte — it only stops being the automatic post-`deliver` trigger.
391
+
392
+ ### Consumer migration
393
+
394
+ - **Consumer-facing (bumps `CONSUMER_VERSION` → 3.1.0-rc.6).** `/afm:update` materializes the fixed step 6 in `afm.md § 2.2` (`reflect` instead of `evolve`). Nothing else changes.
395
+
396
+ ## [3.1.0-rc.5] — 2026-06-16
397
+
398
+ > **BREAKING (pre-release) — rename `kenpachi` → `evolve`.** The orchestrator of the local documentation self-evolution cycle drops the codename `kenpachi` (the doc itself admitted it was not descriptive) and becomes **`evolve`** — aligned with `docs/evolution/` (the lineage it writes) and with the rubric `when-to-evolve-methodology`. By MAINTAINERS, a file rename in `framework-template/` is **major**. Because the whole 3.x line is still pre-release (3.0.0 never shipped), the rename is absorbed into the 3.1.0 line, with the breaking change documented here (the final numbering is decided at release). Tests: harness 26/26 + smoke 17/17. **Also (feature):** `deliver` now runs `/afm:evolve` at the end of a **large** delivery under `AUTONOMY=high` (gated doc hygiene).
399
+
400
+ ### Added
401
+
402
+ - **`deliver` runs `/afm:evolve` at the end of a large delivery under `AUTONOMY=high`** (new step **4.D** + a row in the stop table + `core/afm.md § 2.2` step 6). When the delivery hits the feature-folder heuristic (**large**) **AND** the user said "go" (skipped the Phase 2 review gate), `deliver` **starts** the local doc hygiene cycle. Rationale: under "go" the human reviewed **less inline** → a **gated** pass catches the drift/inflation that a large delivery accumulates. `evolve` **keeps its own gate** (it does not auto-apply — #6). The large-delivery-under-"go" condition is the **signal** that unlocks the `evolve` cooldown. Under `AUTONOMY=normal` it stays only a **suggestion**. This is the only line in the `deliver` suppression contract where the composed op's gate is **NOT** suppressed — that is the whole point (hygiene reviewed by the human).
403
+
404
+ ### Changed (BREAKING)
405
+
406
+ - **Skill renamed: `/afm:kenpachi` → `/afm:evolve`.** Anyone invoking `/afm:kenpachi` now uses `/afm:evolve`. **Natural-language activation is unchanged** (lives in `when_to_use`: "audit the methodology", "the docs are a mess", etc.).
407
+ - **Files moved:** `framework-template/ops/kenpachi.md` → `ops/evolve.md`; `skills/kenpachi/SKILL.md` → `skills/evolve/SKILL.md` (dir `skills/kenpachi/` → `skills/evolve/`).
408
+ - **Override marker renamed:** `<!-- kenpachi: marker-age-days=… inflation-lines=… cooldown-days=… -->` → `<!-- evolve: … -->` in `docs/.afm-version` (read by `diagnose`/`afm-health.sh`).
409
+ - **~110 cross-refs across ~28 files** updated `kenpachi`→`evolve`: ops/* (deliver/diagnose/reflect/generalize/restructure/update/promote/reconcile/remediate), every SKILL.md, README/README-light, MAINTAINERS, the rubric `when-to-evolve-methodology`, ach, bootstrap, refactor, triggers, evolution-report template, plugin.json, hooks (`afm-health.sh`/`afm-session-start.sh`), and the test fixtures. **Historical CHANGELOG entries (rc.10–rc.4) keep the period name `kenpachi`** (non-revisionist).
410
+
411
+ ### Consumer migration
412
+
413
+ - **Consumer-facing (bumps `CONSUMER_VERSION` → 3.1.0-rc.5).** (1) Use **`/afm:evolve`** instead of `/afm:kenpachi` (natural language stays the same). (2) If you had the cooldown override in `docs/.afm-version`, **rename the marker** `<!-- kenpachi: … -->` → `<!-- evolve: … -->` — otherwise the parser cannot find it and falls back to defaults. `/afm:update` applies this rename. If you had no marker: nothing changes beyond the skill's new name.
414
+
415
+ ## [3.1.0-rc.4] — 2026-06-16
416
+
417
+ > **Phase 4 of the v3.2 initiative (essential Tier 2) — promotion gating + self-reflection on failures.** Closes the highest-value, lowest-risk Tier 2 items. **Negative filters** (what NOT to promote — a false constraint is poison), **cardinality fan-out** (a redefinition covers all pages), and **`kenpachi` composes `remediate` over recurring failures** — the "self-reflection that resolves the error for good" (procedure/learning). **Deferred to rc.5 (focused):** the `docs/index.md` catalog + diagnose axis A8 (high churn in the "7 axes" refs) and **usage-based decay** (`access_count`) — this last one depends on an open design decision about the access-tracking mechanism (frontmatter vs `.afm-access.jsonl`), and without it the metric is inert.
418
+
419
+ ### Added
420
+
421
+ - **Rubric `rubrics/negative-filters.md`** — a **rejection** checklist at the `gotcha`/`reconcile`/`remediate` gate: a negative tool claim (a fossil refusal), a transient failure (a dead constraint), a one-off narrative, user-visible status, a vibe rule with no trigger. 4 promotion tests (durable antidote? survives the cause's fix? #1? >=2x/user/SDK?). Referenced in `ach.md § 6`. Field evidence (ai-memory: ~28% of pages are low-signal).
422
+ - **Principle `afm.md § 1.3` — ingest is cardinality fan-out** (Karpathy LLM-wiki): redefining a term that lives across several docs touches **all** of them (`grep -rl`), not just the obvious one. Orthogonal to rule 17 (granularity=delta vs cardinality=fan-out). A principle, not a hard rule (no clean 0/1 trigger for "this is a redefinition" — #3).
423
+ - **Principle `afm.md § 1.3` — promotion goes through the negative filter** (the negative face of #5).
424
+
425
+ ### Changed
426
+
427
+ - **`kenpachi` Phase 1 composes `remediate` over recurring failures** (`sig=` >=2x in `docs/.afm-log-failures/`): `diagnose`/rule 19 **flag** the orphan failure, and the cycle **resolves it for good** (procedure/learning) in a single gate. This is the requested self-reflection on failures. The `kenpachi` suppression table gains the `remediate.md` row. (Note: `reflect` remains docs-to-docs — an instructiveness refinement; a task failure belongs to `remediate`, not to `reflect`.)
428
+ - **`ops/reconcile.md` gains step 2.5 (negative filter at the entry gate)** + the cardinality-fan-out discipline before promotion.
429
+
430
+ ### Consumer migration
431
+
432
+ - **Consumer-facing (bumps `CONSUMER_VERSION` -> 3.1.0-rc.4).** `/afm:update` materializes: the 2 new principles in `afm.md § 1.3` (fan-out + negative-filter) and the references to the `negative-filters`/`episodic-vs-semantic-boundary` rubrics in `ach.md § 6`. The rubrics live in the plugin (consulted through the skill); nothing new is hand-created in `/docs`. No hook change -> harness unchanged (**26 ok**).
433
+
434
+ ## [3.1.0-rc.3] — 2026-06-16
435
+
436
+ > **Phase 3 of the v3.2 initiative — cross-session continuity.** On top of the substrate (rc.1) and the CRITIC loop (rc.2), this closes the 3rd gap of half-memory: AFM now **honors work state between sessions/agents** without promoting it to a normative doc. At the end of a session with work, it writes an **episodic handoff**; on the next one, it injects "where we stopped" + the **current focus**. **Main risk addressed:** the exception to rule 17 for the `_focus.md`/`sessions/` slots is a **closed path** (not a loosened threshold), preserving anti-context-collapse in the normative docs. **Hard rule 20 + 4th `Stop` hook + 2 episodic families, consumer-facing.**
437
+
438
+ ### Added
439
+
440
+ - **Hook `afm-session-end.sh` (`Stop`, fallback `SessionEnd`) — cross-session handoff.** In a session with work (`git diff` not empty), it synthesizes `docs/sessions/<ts>-<sid>.md` (`state: open`, `tier: episodic`): `files_touched` via git, `summary` via this session's `s=<sid>` events in the substrate. Rule-based, 0-LLM, dedup per session; a session with no work is a no-op (negative-filter).
441
+ - **Episodic family `docs/sessions/`** (handoffs) + `templates/session-handoff.template.md`.
442
+ - **`docs/_focus.md`** (slot-state, mutable current focus) + `templates/focus.template.md`. Read in `afm.md § 2 READ` and injected at SessionStart.
443
+ - **Hard rule 20 — `_focus.md` is small, overwritable slot-state** (OVERWRITE, does not grow by append). *Verification:* `wc -l docs/_focus.md > 40 → BLOATED` empty.
444
+ - **Rubric `rubrics/episodic-vs-semantic-boundary.md`** — what decays (episodic: `sessions/`, `_focus.md`) vs what is permanent (semantic). Referenced in `ach.md § 6`. CoALA ancestor.
445
+
446
+ ### Changed
447
+
448
+ - **Hard rule 17 (ACE) extends the path exclusion to `docs/_focus.md` and `docs/sessions/`** (slots that overwrite by design). **Closed-path exclusion, NOT a loosened threshold** — never through a flag a normative doc could set (otherwise it reopens context-collapse). This is the mitigation for the plan's main risk.
449
+ - **`hooks/afm-session-start.sh` injects the cwd's `state: open` handoff + `docs/_focus.md`** into `additionalContext` (continuity at open).
450
+ - **`hooks/hooks.json` gains the `Stop` event** → `afm-session-end.sh` (4th hook).
451
+ - **`ops/reconcile.md` gains the 4th destination `docs/_focus.md` (OVERWRITE) + consumes the handoff** (`state: open` → `consumed`). Handoff/`_focus` sit **below** the promotion-to-doc gate (#1).
452
+ - **`afm.md § 2 READ`** now reads `docs/_focus.md`. `MAINTAINERS.md § Hooks` documents the 4th hook. Harness `run.sh` +4 asserts → **26 ok, 0 fail**.
453
+
454
+ ### Consumer migration
455
+
456
+ - **Consumer-facing (bumps `CONSUMER_VERSION` → 3.1.0-rc.3).** `/afm:update` materializes: **hard rule 20**, the extended exclusion of rule 17, the `_focus.md` bullet in `§ 2 READ`, and the reference to the `episodic-vs-semantic-boundary` rubric in `ach.md § 6`. The `docs/sessions/` and `docs/_focus.md` families are born on-demand (on the 1st `Stop` with work / 1st focus update) — nothing to materialize by hand. Both committed (continuity through git).
457
+
458
+ ## [3.1.0-rc.2] — 2026-06-16
459
+
460
+ > **Phase 2 of the v3.2 initiative — CRITIC loop recognize-failure→remediate.** On top of the rc.1 substrate, this closes the 2nd gap of half-memory: the agent now **recognizes failure by EXTERNAL SIGNAL** (CRITIC — never self-judgment), **records it** durably, and **remediates it for good** — **procedure** (mechanical) or **learning** (conceptual, that instructs other Claude sessions by path-match). Gated by #5: 1 user correction OR a recurring `sig=` ≥2x promotes; a single/transient failure stays only evidence. **22nd skill `remediate` + 2 new families (`procedures/`, `learnings/`) + hard rule 19 (consumer-facing).** The deep scan of `.afm-log-failures/` by `reflect`/`kenpachi` (cross-session self-reflection) arrives in Phase 4.
461
+
462
+ ### Added
463
+
464
+ - **Skill `remediate` (`/afm:remediate`) + `ops/remediate.md` — CRITIC loop (22nd skill).** Reads `status: open` failures in `docs/.afm-log-failures/`, classifies them via the rubric, and **proposes** (a delta, citing `sig=`) the durable artifact: **procedure** (mechanical) or **learning** (conceptual). It complements — it does not duplicate — the short in-task loop of `§ 5.1` (it is the **long loop**, cross-session). Composed of `reconcile` (passive) and `kenpachi` through the suppression contract.
465
+ - **Family `docs/procedures/`** (repeatable runbooks: release/deploy/migration) + `templates/procedure.template.md` — steps with `Verification: 0/1`, a precondition (references `§ 6.1`, does not duplicate it), rollback, `Origin: sig=`.
466
+ - **Family `docs/learnings/`** (MD that instructs other Claude sessions) + `templates/learning.template.md`. **Injected by path-match** through `afm-pre-edit.sh` via the `**Trigger:**` field (the same mechanism as gotchas) → the next Claude session that touches the area gets the lesson.
467
+ - **Rubric `rubrics/failure-classification.md`** — mechanical→procedure | conceptual→learning | transient→nothing; an **executable** discriminator; referenced in `ach.md § 6`.
468
+ - **Hard rule 19 — a recurring anchored failure becomes a remediation** (`afm.md § 3`). Every `sig=` that appears ≥2x in `.afm-log-failures/` has an artifact that cites it. **Explicit anti-Goodhart caveat** (STOP, arXiv:2310.02304): the trigger measures **traceability**, not the quality of the remedy (human gate) — it guarantees that no recurring failure stays orphaned. *Verification:* grep of duplicated `sig=` values with no remediation → empty.
469
+
470
+ ### Changed
471
+
472
+ - **`afm.md § 5.1` (reflect-retry terminal) records `kind=failure` BEFORE it halts** — `docs/.afm-log-failures/YYYY-MM-DD-<slug>.md` (`status: open`, external signal + command + output, a stable `sig=`). A failure resolved on retry is **transient** (it is not recorded — negative filter); an explicit user correction is also recorded (the user is the oracle). Recognition by **tool** (CRITIC, #3), never self-judgment.
473
+ - **`ops/reconcile.md` step 2 routes an `open` failure to the CRITIC loop** (`remediate.md`) — gated, proposes-does-not-apply (#6).
474
+ - **`hooks/afm-pre-edit.sh` injects `docs/learnings/` by path-match** (mirrors the gotchas block). Harness `hooks/test/run.sh` +1 assert (learning injection) → **22 ok, 0 fail**.
475
+ - **`interview/triggers.md`** gains 3 signals: a failure crossed the §5.1 terminal, a `sig=` recurred ≥2x, a repeatable operational sequence ≥2x → procedure.
476
+
477
+ ### Consumer migration
478
+
479
+ - **Consumer-facing (bumps `CONSUMER_VERSION` → 3.1.0-rc.2).** `/afm:update` materializes: **hard rule 19**, the extension of `afm.md § 5.1` (failure record on the terminal), and the reference to the `failure-classification` rubric in `ach.md § 6`. The `docs/procedures/`/`docs/learnings/` families and the `docs/.afm-log-failures/` dir are **born on-demand** (on the 1st use of `remediate`/the §5.1 terminal) — nothing to materialize by hand. `docs/learnings/` is **committed** (it instructs future sessions through injection). The `remediate` skill is install-side (it does not materialize into `/docs`).
480
+
481
+ ## [3.1.0-rc.1] — 2026-06-16
482
+
483
+ > **This opens the 3.1.0 line (initiative codename: "v3.2") — auditable memory/continuity.** First phase of a multi-phase initiative (capture substrate → recognize-failure→remediate CRITIC loop → cross-session continuity) that closes the AFM's three **half-memory** gaps: volatile learning signal (`reconcile` only observed session memory, which dies at compaction/crash), no failure recognition/remediation, and no continuity between sessions/agents. This rc delivers **Phase 1 — auditable capture substrate**, the base that unlocks the rest. Research dossier and ROI prioritization: `relatorio-afm-3.2.md` + `plano-afm-3.2.md`. Opens the rc cycle for 3.1.0 (one rc per phase, as with 3.0.0-rc.1..13). **Adds universal hard rule 18 (consumer-facing → bumps `CONSUMER_VERSION`).**
484
+
485
+ ### Added
486
+
487
+ - **Hook `afm-capture.sh` (`PostToolUse` Edit|Write) — auditable capture substrate.** It records **one line per completed edit of a normative doc** in an append-only ledger `docs/.afm-log/events/YYYY-MM.md` — format `- [ISO-8601 UTC] <kind> | s=<sid6> | <título>`, `kind` inferred **mechanically from the path** (closed vocabulary). It is the "funnel entry": `reconcile` now **reads** this ledger instead of relying on session memory. **0-LLM, fire-and-forget, always exit 0**, writes stay inside the dotdir; product code and the substrate/`_focus`/`sessions` themselves do **not** become an event (anti-transcript, #6 — capture ≠ promotion). Idempotent bootstrap of `docs/.afm-log/HEAD` (the `reconcile` cursor, epoch 0).
488
+ - **Hard rule 18 — the substrate is append-only** (`core/afm.md § 3`). Events are never rewritten or deleted; audit = `git log -p`; `HEAD` is the only exception (1-line overwrite). *Verification:* `git log -p -- docs/.afm-log/events/ | grep -c '^-- \['` → `0`. **§ 3 reserves 18–29 for universal template rules** (the consumer project-rule placeholder moves from "starting at 18" to "starting at 30").
489
+
490
+ ### Changed
491
+
492
+ - **`ops/reconcile.md` step 1 reads the substrate delta since the `HEAD` cursor** (safety net against a volatile signal), **adding** it to what it observed in-context; it writes `HEAD` at the end of the turn (a 1-line overwrite, exempt from rule 17 by path). Steps 2–4 (propose-don't-apply / delta-not-rewrite / never-auto-apply) are unchanged.
493
+ - **Hard rule 17 (ACE anti-context-collapse) gains a path exclusion for the `docs/.afm-log*` dotdir** — an append-only slot, **not** a relaxation of the threshold (the 1-line `HEAD` overwrite is already below the 20-line floor). Rule 21 (Phase 3) will extend the exclusion to `docs/_focus.md`/`docs/sessions/`.
494
+ - **`hooks/hooks.json` gains `PostToolUse` Edit|Write → `afm-capture.sh`** (3rd hook). `MAINTAINERS.md § Hooks` documents the hook + the ledger's **parseable format contract** (a change in the script changes `reconcile.md` step 1 AND the fixture too). The `hooks/test/run.sh` harness covers capture (**+6 asserts**: append per kind, kind from path, product code does not get captured, the substrate does not capture itself, no-op outside AFM, `HEAD` bootstrap) — **21 ok, 0 fail**.
495
+
496
+ ### Consumer migration
497
+
498
+ - **Consumer-facing (bumps `CONSUMER_VERSION` → 3.1.0-rc.1).** `/afm:update` materializes **hard rule 18** in the consumer's `afm.md § 3`, plus the path exclusion for rule 17, plus the renumbered project-rule placeholder ("starting at 30"). **Note for anyone who already added project rules at 18/19:** renumber **your** rules to 30+ (never-renumber protects the universal/canonical numbers; renumbering your own project rules on a version bump is an expected migration step).
499
+ - **The `docs/.afm-log/` substrate comes up on its own at runtime** (the first doc edit with `PostToolUse` active) — nothing to materialize by hand. **Decision: the substrate IS COMMITTED** (git audit — `git blame`/`git log -p` — is the "auditable" goal; it accepts a dirty working-tree state per edit). Anyone pinned to `docs/.afm-version` upgrades via `/afm:update`.
500
+
501
+ ## [3.0.0-rc.13] — 2026-06-14
502
+
503
+ > **Closes 4 functional issues logged by a beta round of self-evolution** (`sdk.mapree.dev/docs/evolution/002` — the loop found the gaps during the rc.5→rc.11 update). PF-1 (HIGH) is a new capability (new skill); PF-2 (MEDIUM)/PF-3/PF-4 (LOW) are refinements to existing surfaces. **No new principle, no renumber → zero migration of `#N` refs.**
504
+
505
+ ### Added
506
+
507
+ - **21st skill `update` — plugin→instance sync (`ops/update.md` + `skills/update/SKILL.md`).** Resolves the **A3 version drift**: it reads the consumer-facing deltas from `CHANGELOG.md` between the version pinned in `docs/.afm-version` and the current `VERSION`, materializes only what is missing (discover-first by grep; skips a consumer-noop release), and bumps `.afm-version` at the end. **This was the missing path** for an already bootstrapped instance to move to a new version — `refactor` **refuses** a project with `.afm-version` (PF-1: the CHANGELOGs said "re-run `/afm:refactor`", the skill that denies that audience). It only **reads** the plugin; it writes only to the instance (#7). It runs à-la-carte (own gate) or under `kenpachi` (gate suppressed).
508
+ - **`framework-template/CONSUMER_VERSION` — watermark for materializable content** (PF-3). Marks the last version with a consumer-facing delta; consumer-noop releases do not bump it. The A3 vital sign compares against it, not against `VERSION`.
509
+
510
+ ### Changed
511
+
512
+ - **`kenpachi` composes `update` on the A3 axis (was Phase 2.2 own-procedure).** The drift migration, which used to "live" in the orchestrator, became the op `update`; `kenpachi` now **reads and follows** it through the suppression contract (mirrors the rc.7 split of the mechanisms — DRY). The suppression table gains the `update.md` row; Phase 1.3 composes `update` when `diagnose` flags A3.
513
+ - **Upgrade instructions corrected (PF-1).** The 5 "Consumer migration" blocks (rc.5–rc.9) that said "re-run `/afm:refactor`" now point to `/afm:update`; the `refactor` pre-check gains a redirect ("want to move to a new version? → `/afm:update`"); the `CLAUDE.md` disambiguation table + README/README-light/plugin.json are updated (20→21 skills).
514
+ - **`promote.md § 1.5` gains Track B (plugin meta-fix) (PF-2).** The anti-rot gate assumed "promotion = a learning from code that ran green" (a clean consumer working tree). A fix to the **plugin itself** found by `reflect`/`diagnose` (a cross-ref typo proved by `grep`) does not fit — its validation is the **mechanical trigger of the finding** (the command that proves the defect returns 1 before / 0 after), not consumer git-clean. This is the most common case in self-evolution, and the single track used to block it behind an unrelated commit.
515
+ - **The `afm-health.sh` A3 axis compares against the watermark + routes to an action (PF-3).** It fires only when the instance is **behind** the `CONSUMER_VERSION` (`sort -V`), not on every internal tag bump; the message now prescribes `/afm:update`.
516
+
517
+ ### Fixed
518
+
519
+ - **`afm-pre-edit.sh` injects only under the consumer root (PF-4).** Editing another repo from a consumer session (for example, the plugin itself) no longer pulls in that consumer's irrelevant gotchas/rules — guard `case "$FILE" in "$PWD"/*)`.
520
+
521
+ ### Consumer migration
522
+
523
+ - **None (consumer-noop).** The `update` skill + the op + `CONSUMER_VERSION` are install-side / plugin-side; nothing materializes in `/docs`. The `promote`/hooks fixes belong to the plugin. `CONSUMER_VERSION` stays at `rc.9` (rc.10–rc.13 are all consumer-noop). `.afm-version` does not need to move.
524
+
525
+ ## [3.0.0-rc.12] — 2026-06-14
526
+
527
+ > **Framing fix (patch — "comprehension bug fix").** The self-evolution family (`kenpachi` + `diagnose`/`reflect`/`generalize`/`restructure`) **describes** its target correctly in the details (all cite `<consumer>/docs/`, have bright line #7 and the post-condition that the plugin's `git status` is empty), but the **headline framing** — "self-evolution **of the methodology**", "health **of the methodology**" — reads as *"evolve the AFM plugin"*. At activation, the model formed the wrong mental model (wanting to edit `framework-template/`) because the real target — the *instance materialized in the local docs* — stayed buried in a secondary clause. The defenses were **post-condition** (they catch the error afterward), not **priming** (they do not prevent the wrong model at entry). This rc fixes the priming. **No change to procedure/buckets/gates/principles — clarity only.** No consumer migration.
528
+
529
+ ### Changed
530
+
531
+ - **New canonical block at the top of `ops/kenpachi.md`** (`## ⚠ O alvo da evolução: os docs locais, NUNCA o plugin`): states unambiguously that "evolve the methodology" = refine the instance materialized in `<consumer>/docs/`; the plugin (`framework-template/`) is never touched (#7), it only receives a **suggestion** through `/afm:promote`. The 4 mechanisms link this block.
532
+ - **Target banner in the opening blockquote of the 4 mechanisms** (`diagnose`/`reflect`/`generalize`/`restructure`): one line "target = this project's local docs, never the plugin" pointing to the `kenpachi` canonical block.
533
+ - **`description` of the 5 SKILL.md** (kenpachi/diagnose/reflect/generalize/restructure): the opening framing changed from "…of the AFM **methodology**" to "…of the project's **local documentation** (the materialized instance of the methodology in `<consumer>/docs/`) — NOT the plugin itself". This is the text that primes the model at activation.
534
+ - **Reframe of the secondary points** that primed the wrong model: `plugin.json` description, `README-light.md`, `MAINTAINERS.md § Manter o op kenpachi` (+ banner), rubric `when-to-evolve-methodology.md` (+ banner at the top), `core/ach.md`, `interview/bootstrap.md`, `templates/evolution-report.template.md` → "self-evolution of the **local documentation** (materialized instance of the methodology)".
535
+
536
+ ### Consumer migration
537
+
538
+ - **Nothing.** The change is only framing/priming in the plugin docs + skill descriptions. No procedure, bucket, gate, or principle changed; materialized instances do not need to rematerialize. `.afm-version` can mark `rc.12` (consumer-noop).
539
+
540
+ ## [3.0.0-rc.11] — 2026-06-13
541
+
542
+ > **Reference fix (patch — "bug fix in a link/path").** The rc.9 in-task reflect-retry loop lives in `core/afm.md` under the literal heading **`### 5.1`** (a sub-step of "5. GREEN"), but **every** operational reference cited it as `§ 2.5.1` — a number that does not exist in the file. An agent that fails a task under `deliver` and greps `2.5.1` in `core/afm.md` finds nothing. Drift across 12 refs in a load-bearing feature (the Reflexion/Autogenesis integration). Found by the `/afm:reflect` self-reflection itself (sdk.mapree.dev instance) during the rc.5→rc.10 update. No behavior change, no consumer migration (the materialized section in the instances is already `§ 5.1`).
543
+
544
+ ### Fixed
545
+
546
+ - **`§ 2.5.1` → `§ 5.1` in all refs** (`ops/deliver.md` ×6 — Phase 3.B, the stop table, the bright line, anti-patterns; `ops/reflect.md` § 5; `PRINCIPLES.md` #6; and the 4 rc.9 entries in this CHANGELOG). They now match the real heading `core/afm.md § 5.1`.
547
+
548
+ ### Consumer migration
549
+
550
+ - **Nothing.** Internal plugin refs; the instances already materialized the section as `§ 5.1`. `.afm-version` can mark `rc.11` (consumer-noop — no new content to materialize).
551
+
552
+ ## [3.0.0-rc.10] — 2026-06-13
553
+
554
+ > **Closes ROI #1 of a 4-axis audit** (Axis 4: "signals exist but do not route to action"). The vital sign **A7** (`afm-health.sh`, ratio context:code — Codified-Context arXiv:2602.20478) **reported** the out-of-band number but, unlike A6 (per-file inflation, which already suggested `/afm:generalize`/`/afm:restructure`), **did not prescribe an action**. Additive, patch — refinement of an existing nudge. No hard rule, no principle, no renumber.
555
+
556
+ ### Changed
557
+
558
+ - **A7 routes to action (`afm/hooks/afm-health.sh`).** The single `if` that covered both sides of the band in one string becomes `if/elif` per branch, each with the **correct** action: `>60%` inflated → `/afm:restructure` (partitions) or `/afm:generalize` (merges redundancy) + `do NOT prune by size (ACE)` (mirrors the A6 wording); `<5%` under-documented → `/afm:reconcile` or `/afm:refactor` (covers what is missing — `restructure` here would be **wrong**: there is nothing to re-partition when documentation is missing).
559
+
560
+ ### Safety
561
+
562
+ - **Only #1 of the audit was applied.** #3 literal ("avoided errors" counter) **rejected** — avoidance is counterfactual/unfalsifiable/*reward-hackable*, and it contradicts the STOP guard from rc.8 (`PRINCIPLES.md` #3); the falsifiable intent already shipped (rc.9's last bite). #2 (commit-counter docs/week) rejected (a metric with no coupled action is the exact gap it claims to fight). #5 (F4.1 null-retrieval), #4 (AGENTS re-sync), #6 (online template induction) **deferred**, gated on evidence/ADR.
563
+
564
+ ### Consumer migration
565
+
566
+ - **Nothing.** The change is only in the plugin's hook (install-side); consumers do not materialize `afm-health.sh`. Refs `#N` unchanged.
567
+
568
+ ## [3.0.0-rc.9] — 2026-06-13
569
+
570
+ > **Closes the remaining Reflexion gap (arXiv:2303.11366)** — the 3 items in the "still improvable" section of the summary. rc.8 already had the backbone (gotcha = long-term memory; `≥2×` = mechanical "when to reflect"; `reflect` = self-reflection anchored on the trajectory). This rc applies **point 1** (there was no retry-with-reflection loop *inside* the task), **honestly defers point 2** (the tight loop already is point 1; the rest = F4.1, gated on evidence), and **reframes point 3** (usefulness counter) in a falsifiable way. Direction: **more robust** (bounded self-correction before it escalates) AND **leaner** (dead-gotcha pruning). **Additive — no new hard rule § 3 (it is a loop, not a binary gate), no new principle, no renumber** → zero `#N` ref migration.
571
+
572
+ ### Added
573
+
574
+ - **Retry-with-reflection loop in-task — `core/afm.md § 5.1` (Reflexion 2303.11366 + Self-Refine 2303.17651 + CRITIC 2305.11738).** When GREEN fails (red test / broken `tsc`), **before it halts**: (1) it verbalizes the failure *grounded* in the real test/`tsc` output (CRITIC — self-critique with no tool degrades), (2) it retries GREEN against the same RED (TDD intact), (3) **cap of 2 retries** (Reflexion window Ω 1-3), (4) **anti-oscillation** (same failure 2x → stop and escalate, Self-Refine), (5) cap or oscillation exhausted → it halts to the human gate (the paper's "Commit"). In-task reflection = **ephemeral** short-term memory (a retry does not become a gotcha; it crosses into the doc only through the `≥2×` gate). Zero cost on the happy path.
575
+
576
+ ### Changed
577
+
578
+ - **`ops/deliver.md` Phase 3.B — the capped reflect-retry precedes the halt.** Step 1 (GREEN points to § 5.1), step 3 (a non-`[P]` failure runs the retry before it halts), stop table (failure row + oscillation row), bright line and anti-patterns updated. `deliver` reuses § 5.1, it does not duplicate it.
579
+ - **`ops/reflect.md` § 5 — closes the honest admission of the old § 82** ("re-execution is only observed future behavior"): **in-task** re-execution now exists (literal, immediate) for the test-of-its-own-task case. Boundary note: in-task reflection (Reflexion short-term, signal = test/`tsc`) ≠ `reflect` docs→docs (long-term, signal = a doc that misled). The two ends of Reflexion; one does not replace the other.
580
+ - **`PRINCIPLES.md` #6 (verification corollary) — 1 clause added to bucket (a):** self-correction now extends to **bounded re-execution** when a cheap re-runnable signal exists (test/`tsc`), capped + anti-oscillation. Corollary under the existing number — **no renumber** (same as rc.8 did with CRITIC/STOP).
581
+ - **Last-bite signal in the gotcha + pruning in `restructure` (reframe of point 3).** `gotcha.template.md`: the `Bites:` line gains `(last: YYYY-MM)` — zero new ritual (the agent already touches the line when it increments; `ops/gotcha.md` step 4 stamps the date). `ops/restructure.md § 1.1`: a gotcha with an old last-bite date (> N months, default 12) **AND** `N` stalled → pruning candidate → **tombstone** (rule 17, never a hard delete). Reuses the existing staleness machinery.
582
+
583
+ ### Safety
584
+
585
+ - **Point 2 (tight feedback loop) NOT reopened** — the tight loop that matters IS point 1 (reflection in the same agent's context, no hook). The cross-session gap (F4.1, null-retrieval nudge in `afm-pre-edit.sh`) stays **deferred, gated on evidence** that the case really bites (rc.8 decision preserved).
586
+ - **Point 3 did NOT become an avoidance counter** ("Avoided: N"): avoidance is counterfactual, **unfalsifiable**, and *reward-hackable* — it would contradict the STOP guard from rc.8 (`PRINCIPLES.md` #3). Pruning is by **observable incidence** (last-bite + stalled `N`), which Reflexion approximates without violating the hardening.
587
+ - **Cap + anti-oscillation are the token guard** of § 5.1 — worst case 3x the cost of 1 attempt, only on a failing task; happy path unchanged.
588
+
589
+ ### Consumer migration
590
+
591
+ - **Nothing mandatory.** § 5.1, corollary #6, and the `last:` field activate additively. Pre-rc.9 instances have neither § 5.1 materialized nor the date in `Bites:` — copy it from `core/` or run `/afm:update` (version sync — materializes the consumer-facing deltas automatically). `#N` refs **do not** change (no renumber). Old gotchas with no `last:` are treated as "date unknown" by `restructure` (no pruning until the next bite stamps it).
592
+
593
+ ## [3.0.0-rc.8] — 2026-06-13
594
+
595
+ > **Applies what was still missing from the "training-free improvement" lineage** (the papers in `[references]/kenpachi`). Line 3.0.0 already embodied most of it — CRITIC/Self-Refine → executable-trigger doctrine + `analyze` gating; Reflexion/MetaReflection → gotcha + `generalize`; Self-Harness/Autogenesis → `diagnose`/`kenpachi`; Codified-Context → `restructure` + hooks. This rc closes the narrow gap that remained, where the **"leaner AND more robust"** gain lives: **ACE** (anti-context-collapse, #1 in the report, previously ~0% applied), **Voyager/AWM** (retrieval-before-generate + induced templates + offline↔online precedence), and explicit hardening of **CRITIC/STOP** (self-critique with no tool degrades; a non-gameable trigger). **Additive rc iteration — no new principle, no renumber** (materialization composes #1/#3/#5/#6/#8) → zero `#N` ref migration in consumers.
596
+
597
+ ### Added
598
+
599
+ - **Hard rule 17 (universal) — anti-context-collapse (ACE, arXiv:2510.04618).** `core/afm.md § 3`: a rewrite of a `/docs/` doc that deletes >50% of the lines in one edit (floor 20 lines) **stops and needs review**. Trigger `git diff --numstat -- docs/ | awk '$2>20 && $2/($1+$2+1)>0.5'`. Delete-only → `generalize` consolidation (tombstone = *adds* lines) does **not** fire. The non-mechanizable half becomes a principle in § 1.3 ("a doc evolves by delta, not monolithic rewrite"; failure modes *context collapse* + *brevity bias*).
600
+ - **`rubrics/template-vs-streaming-precedence.md` (9th rubric) — AWM non-additivity (arXiv:2409.07429).** A frozen template (offline, `export-template`) and streaming learning (online, `reconcile`) are **non-additive — combining them hurts**. Rule: **precedence + tombstone, never sum**. Recorded in `ach.md § 6`.
601
+ - **`templates/feature-tasks.induced.template.md` — induced tasks template (AWM/Voyager).** A parametrized variant (`{product-name}`/`{domain}`/`{entity}`/`{boundary-procedure}`); `export-template` induces it from the most recent 100% `[X]` feature (gate `L_eval=1`) and writes it into the frozen template so the next consumer **composes** instead of regenerating.
602
+ - **`Mordidas:` field in `gotcha.template.md`** — an itemized counter à la ACE (helpful/harmful bullets), fed by the "≥2×" that `ops/gotcha.md` already collects; ≥2 in the same area routes to `generalize`.
603
+
604
+ ### Changed
605
+
606
+ - **`ops/reconcile.md` — explicit delta policy (ACE).** New step: every proposal is a structured append OR an in-place update of a named item, never a rewrite (>50% violates rule 17); an anti-inflation nudge, signal-gated (grep ≥2 similar gotchas → suggests `/afm:generalize`); a template↔streaming precedence clause for a template-origin project.
607
+ - **`ops/deliver.md` + `ops/specify.md` — retrieval-before-generate (Voyager/AWM).** New `deliver` Phase 0.A0 (grep similar features/ADRs/gotchas before synthesizing → composes, does not regenerate) + `specify` step 2.5; reuses the `retrieval-before-create` discipline from `kenpachi.md § Disciplina` (bidirectional link, zero duplication).
608
+ - **`ops/promote.md` + `ops/export-template.md` — anti-rot gate (Voyager/AWM).** Promotes/freezes only work that is green and committed (`git diff --quiet` + `test -e`); export suggests `/afm:generalize` pre-freeze (consolidates streaming into the template). The export green-check is doubled onto the existing destructive confirmation (not a second prompt).
609
+ - **`PRINCIPLES.md` #3 — CRITIC + STOP corollaries.** Self-critique with no external tool degrades (the *why* of the executable trigger; #6's self-verification only holds anchored to a command) + an anti-Goodhart guard (a non-gameable trigger). A corollary under the existing number — **no renumber** (not a reframe).
610
+ - **`ops/rule.md` — anti-Goodhart guard (STOP, arXiv:2310.02304):** "does a diff exist that passes the trigger but violates the spirit?" → rewrite it or demote it to § 1.3.
611
+ - **`ops/analyze.md` (gating) + `ops/deliver.md` Phase 1.D — anti-oscillation history (Self-Refine, arXiv:2303.17651):** each auto-fix round carries `finding → fix`; a finding that reappears after "fixed" = oscillation → escalates to the (b) bucket, does not re-auto-fix.
612
+ - **`hooks/afm-health.sh` — A6 two tiers + new A7.** A6: 800 (inflated) / 500 (norm Configuring → consolidation, never pruning by size — ACE). A7: context:code ratio (~24% calibration, `git ls-files`, band 5–60%; **sum via `awk`, robust to `xargs` batching** — `tail -1` would undercount in a large monorepo where the args overflow ARG_MAX, inflating the PCT). Recorded in `MAINTAINERS.md § Hooks` (+ fixes the `v3.1.0`→`rc.6` forward-ref in afm-health).
613
+ - **Containerized test harness** (`afm/hooks/test/container/`): runs the 3 hooks against synthetic consumers in an Alpine **GNU + busybox** setup (macOS-BSD portability/proxy) with **shellcheck** (missing on the local machine) — catches shell bugs and **token bloat** (measures the injection size: § 3 at 16KB → 5KB injected, the cap works; pre-edit ≤5 gotchas out of 300). 20 green checks across both toolsets. This is what caught the A7 bug above.
614
+ - **`when-to-evolve-methodology.md`** — note "size is a signal of consolidation, never of pruning" (resolves the ACE × Configuring tension).
615
+ - **`README.md`** — `AGENTS.md` block (a tool-agnostic facade, Configuring arXiv:2602.14690 — only points, never duplicates a rule; creates it if absent) in the "How to use in a NEW project" § + a pointer in `bootstrap.md`/`refactor.md`. Structure tree realigned (pre-existing drift: 9 rubrics, 10 templates, evolution ops, 17 rules).
616
+ - **`CHANGELOG.md`** — pre-3.0.0 entries collapsed into milestones (grow-and-refine applied to the framework itself; full history in git).
617
+
618
+ ### Safety
619
+
620
+ - **Rule 17 is delete-only** — does not conflict with `generalize`'s tombstone (which adds lines). Verified.
621
+ - **Offline↔online precedence is precedence + tombstone, never merge** (AWM measured: combining lands *between* the two and matches neither). Preserves the "never delete, tombstone" invariant.
622
+ - **Anti-rot gate and nudges are a materialization of #5/#6** — no new principle, no renumber.
623
+ - **F4.1 (null-retrieval → nudge in `afm-pre-edit.sh`) DEFERRED** — noise risk > gain; not included (explicit decision).
624
+ - **`README-light.md` kept** — audited and it is **not** a stale subset (a deliberate quickstart, in sync); removing it would lose value (#5).
625
+
626
+ ### Consumer migration
627
+
628
+ - **Nothing required.** Rule 17 + the precedence rubric + the induced template + A7/A6-soft activate additively. Pre-rc.8 instances have neither rule 17 nor the 9th rubric materialized — copy them from `core/` or run `/afm:update` (version sync). `#N` refs **do not** change (no renumber).
629
+
630
+ ## [3.0.0-rc.7] — 2026-06-13
631
+
632
+ > **Splits the monolithic `kenpachi` into an orchestrator + 4 mechanism skills.** The rc.6 delivered the third loop (methodology→methodology) as **one** skill that did everything. But self-evolution and self-reflection are **distinct mechanisms** — and AFM skills should be the *mechanisms*, not just the goal. Each of the 4 reference papers describes a mechanism that the monolithic kenpachi only partly materialized: mechanical weakness-mining (Self-Harness), behavioral self-reflection (MetaReflection + Autogenesis *Reflect*), semantic consolidation (MetaReflection *MetaReflect*), and context-architecture health (Codified-Context). The rc.7 decomposes: `kenpachi` becomes **conductor-not-executor** (mirrors `deliver`) and **composes** the mechanisms through a suppression contract; each mechanism also runs à-la-carte. **BREAKING inside the rc (layout): moves procedure inside `framework-template/`** (kenpachi Phase 0/1 → `diagnose.md`) + changes the `kenpachi.md` op contract (executor→orchestrator). **No new principle, no renumber** (composed materialization of #1/#2/#3/#6/#8) — zero `#N` ref migration in consumers.
633
+
634
+ ### Added
635
+
636
+ - **`ops/reflect.md` + `skills/reflect/SKILL.md` — behavioral self-reflection (docs→docs).** Reflects on where the docs **underperformed as a harness** in the session (an ambiguous rule applied wrong, a doc that misled, a section that gave no guidance, a lived contradiction, a user correcting against the doc) and proposes **making the doc more assertive/clear** (refines the instructivity of what exists — it does not add knowledge) plus suggestions for the human. Evidence = the session trajectory (φ_b = `(sintoma-vivido, status-causal-do-doc, mecanismo)`), not a static scan. **Mandatory self-critique "a violated rule is not a wrong rule"** (rival hypothesis "it was me, not the doc") before proposing. Ancestors: MetaReflection (self-reflection = episodic memory; distill into one assertive instruction) + Autogenesis *Reflect*. **Hybrid** activation: an in-session behavioral accumulator (`triggers.md`) suggests `/afm:reflect` when a threshold is crossed (>=2 events) + a static proxy in `afm-health.sh` (§3 with content but no `*Verification:*` = "no ShowsImprovement").
637
+ - **`ops/diagnose.md` + `skills/diagnose/SKILL.md` — mechanical read-only weakness-mining.** Extracts Phase 0 (scan of the 7 axes A1-A7) + Phase 1 (φ, addressability, severity, ANALYZER role) from the monolithic kenpachi into its own skill. Returns an **evidence bundle** ordered by severity — **zero edit proposals, no gate, no cooldown** (read-only and cheap). Ancestor: Self-Harness *Weakness Mining*. À-la-carte = health report; under `kenpachi` it feeds the cycle.
638
+ - **`ops/generalize.md` + `skills/generalize/SKILL.md` — semantic consolidation of gotchas.** Merges a **batch of >=2 similar gotchas** (AFM's "bit twice" = the paper's batch) into one **abstract, non-case-specific rule** (episodic `gotchas.md` → semantic `afm.md`). **ShowsImprovement** validation: a merged rule becomes a hard rule in §3 only if it has an executable 0/1 trigger (else §1.3 principle — #3); **backtracking** if the abstraction does not cover the cases. Merged gotchas become a **tombstone** (provenance preserved, never deleted). Ancestor: MetaReflection *MetaReflect*. Anti-inflation at the root — where `diagnose` (A6) only detects.
639
+ - **`ops/restructure.md` + `skills/restructure/SKILL.md` — context-architecture health.** (1) **staleness** (git trigger: a cited path has a later commit than the doc — the paper's only confirmed failure mode); (2) **findability** (info that exists but sits in the wrong place → relocate; missing info routes to `reconcile`); (3) **temperature partition** (hot-always vs on-demand, **opt-in** ADR proposal — YAGNI for small docs). Ancestor: Codified-Context.
640
+ - **`ops/kenpachi.md` rewritten as ORCHESTRATOR** (modeled on `deliver.md`): keeps only the conductor's 3 pieces — (1) evidence-collection driver (composes `diagnose` + `reflect`; `generalize`/`restructure` on demand), (2) partition into buckets + a single gate, (3) apply + postconditions + record/lineage. **`§ Disciplina de proposta (compartilhada)`** (retrieval-before-create, minimal change, 4-field audit record, inventory-to-preserve, attempt memory + flip-flop, dry-run before the gate, partition into 3 buckets) becomes a **single canonical section** the mechanisms link to (not duplicate — auditable DRY). **Suppression contract** expanded with rows for `diagnose`/`reflect`/`generalize`/`restructure`.
641
+
642
+ ### Changed
643
+
644
+ - **`rubrics/when-to-evolve-methodology.md` → 3-way decision:** cycle (`kenpachi`, multi-modality sweep with a consolidated gate) vs **single mechanism** (`diagnose`/`reflect`/`generalize`/`restructure` à-la-carte, scoped) vs point fix (`reconcile`→`gotcha`/`rule`/`adr`, additive-local). Decreasing cost; scope decides the path.
645
+ - **`interview/triggers.md`** — new row for the `reflect` behavioral accumulator (a doc guided wrong, single-doc; >=2 events/session); the "lived contradiction" row narrowed to **cross-doc** (single-doc routes to reflect); a `generalize` row (>=2 similar gotchas) and a `restructure` row (staleness / misplaced info, with a note "missing info → gotcha").
646
+ - **`hooks/afm-health.sh`** — emits a `reflect` nudge when `afm.md § 3` has content but **no** `*Verification:*` at all (secondary static proxy; reflect's strong trigger is behavioral). Smoke test `hooks/test/run.sh` stays 15/15; shellcheck `--severity=warning` clean.
647
+ - **kenpachi `whitelist`** — the protected surface generalized from "the kenpachi rubric + triggers" to "the evolution rubric + the `triggers.md` entries that fire **any** evolution mechanism skill" (anti-self-reference).
648
+
649
+ ### Safety
650
+
651
+ - **Shared discipline, DRY (auditable):** the `retrieval-before-create`/`dry-run` anchors live **only** in `ops/kenpachi.md § Disciplina de proposta (compartilhada)`; the mechanisms link and follow (never copy) — grep proves zero duplication.
652
+ - **`reflect` cannot soften a rule that only got in the way** — the "a violated rule is not a wrong rule" guardrail (same as kenpachi's) is mandatory before any refinement, else the agent ends up rewriting its own constraints.
653
+ - **`generalize` never deletes** — merged gotchas become a tombstone (`*(consolidado na regra N — ver ciclo NNN)*`); deletion is a bright line (#6), its own gate item.
654
+ - **`restructure` never invents missing content** — info that does not exist becomes `reconcile`/`gotcha` or `[TBD]` (#4/#5); staleness is a signal, not a verdict (it does not rewrite on its own).
655
+ - **Editing a hook trigger/path always follows bucket (b)** in every mechanism (narrowing one's own oversight); the postcondition `git -C <plugin-root> status --porcelain` empty is kept.
656
+ - **`test/skills-lint.sh` suite (repo-level)** covers the 4 new SKILL.md files automatically (500-line cap; thin wrappers at ~30-40 lines pass with room to spare).
657
+
658
+ ### Consumer migration
659
+
660
+ - **Nothing required.** Mechanism skills activate only by invocation (or a reconcile/hook suggestion); `kenpachi` stays invocable and now composes the mechanisms. Pre-rc.7 instances do not have the updated 3-way rubric or the new `triggers.md` rows — copy from `core/`/`interview/` or run `/afm:update` (version sync). `docs/evolution/` still appears on the 1st cycle. `#N` refs in consumers **do not** change (no renumber).
661
+
662
+ ## [3.0.0-rc.6] — 2026-06-12
663
+
664
+ > **This closes the third loop: methodology→methodology (codename `kenpachi`).** The 3.0.0 line already closed code→docs (reconcile) and docs→code (hooks). This repo still needed an owner for the **health of the AFM materialized instance itself**: a rule whose trigger stopped running, dead refs, `[TBD]` markers that age, instance↔plugin drift, a broken ADR chain, inflated or contradictory docs — symptoms that neither `reconcile` (single signal→edit), nor `analyze` (cross-artifact for ONE feature), nor `promote` (consumer→plugin) covers. `kenpachi` is the self-reflection cycle that diagnoses this with **evidence external to the text** (git/FS/command), partitions the findings into buckets, and delivers **one evolution package** approved at one gate. Ancestors: Self-Harness (arXiv 2606.09498) and Autogenesis (arXiv 2604.15034) — their loop's *Commit* becomes the human gate (AFM has no held-out re-runnable set; high-risk needs a gate stronger than pass-rate, and that gate is the human). **Additive rc iteration — no new principle** (kenpachi is a composed materialization of #2/#3/#6/#8); no consumer migration.
665
+
666
+ ### Added
667
+
668
+ - **`skills/kenpachi/SKILL.md` (16th skill) + `ops/kenpachi.md` (orchestrator op).** A 5-phase cycle: **Scan** (Class A + directed greps, evidence = command + `file:line`) → **Diagnosis** (ANALYZER role, signature φ = `(symptom, behavior-causal-status, mechanism)` + addressability filter — a finding with no editable surface becomes an observation, not a patch) → **Proposal** (IMPROVER role, retrieval-before-create, minimal change, 4-field audit record, inventory-to-preserve, attempt memory + per-surface lineage with a flip-flop flag, **validation dry-run before the gate**) → **Single gate** (`AskUserQuestion` `multiSelect` item-by-item, **never skippable — no "go" path**) → **Apply + post-conditions** (re-extracting the hooks keeps the format or reports a rollback; `git -C <plugin-root> status --porcelain` empty) → **Record** in `docs/evolution/NNN-<date>.md` + suggests `promote` if it generalizes. Resumable (state = report on disk). Reuses `analyze`/`rule`/`gotcha`/`adr`/`reconcile`/`promote` through an honest suppression contract (the logic to downgrade/archive/merge **lives in the op** — there is no canonical op for it).
669
+ - **A 3-bucket partition (verification corollary of #6), bucket (a) NARROW:** (a) self-applicable only for **non-semantic** restorative fixes proven by git/FS (a dead path ref, a broken ADR link) — **an edit to a `*Verification:*` command in § 3, or to a path the hooks parse, is ALWAYS (b)** (these are enforcement guardrails; fixing one can narrow what it catches); (b) load-bearing → gate; (c) cosmetic → diff. The gate always runs, even for an (a)-only package.
670
+ - **`rubrics/when-to-evolve-methodology.md` (8th rubric).** Binary decision cycle-vs-point-fix (both signals: instance problem **and** observable evidence); self-critique = the jiuwenswarm "dreaming" 3 questions ("an empty diagnosis is a valid result — do not fabricate an illness"); counterexamples ("❌ run it as ritual"). Materialized in the consumer alongside the other rubrics (bootstrap/refactor); referenced in `ach.md § 6`.
671
+ - **`templates/evolution-report.template.md`.** Materializes `<consumer>/docs/evolution/NNN-<date>.md` (φ findings, buckets, audit records, both rejected AND approved-then-reverted, vital signs before/after, cooldown). The `docs/evolution/` directory is born on demand at the 1st cycle (like `docs/research/` in 1.2.0).
672
+ - **`afm/hooks/afm-health.sh` — Class A vital signs at SessionStart.** Called by `afm-session-start.sh`; static/cheap checks only (`test -e`/`grep`/`wc`, **does not run § 3**); cached once a day in `$TMPDIR` (does not pollute the consumer's git); silent when the instance is healthy; anti-Goodhart doctrine inline ("age/count is not bad on its own"). This is what makes the "sensing that things are not at 100%" real — the same mechanism that made reconcile always-on real. **It informs, never decides or blocks.**
673
+ - **2 passive triggers (Class B) in `triggers.md`:** a contradiction lived between docs (>=2x in the session) and perceived inflation at apply-time → reconcile **suggests** `/afm:kenpachi` (suggests, does not run it — only the user invokes the cycle).
674
+
675
+ ### Safety (designed against an adversarial 3-lens audit — fidelity to sources / fit with invariants / self-modification risk)
676
+
677
+ - **No `AUTONOMY=high` path in kenpachi** — the valve that makes "go" safe in `deliver` (halt at the 1st dependent task) does not exist here (the edit to the doc *is* the effect); so the gate is inescapable.
678
+ - **The instance/plugin boundary becomes MECHANICAL** — post-condition: the plugin-root `git status --porcelain` is empty (before, "never edit the plugin" was doctrine with no trigger — it failed its own test #3).
679
+ - **Anti-oscillation** — per-surface lineage + a flip-flop flag; the memory covers both rejected **and** approved-then-reverted; re-proposing needs new evidence.
680
+ - **A "rule violated" signal does not downgrade a rule on its own** — "agent non-compliant" is a mandatory rival mechanism in the φ; downgrading needs proof the rule is *wrong*, not just *violated*.
681
+ - **`multiSelect` gate item-by-item** (not one monolithic plan-approve — the edits are independent); downgrading/removing a rule and deletion are item-by-item and inescapable; never renumbers (tombstone `*(removed — lives in §X)*`); ADRs are itemized at the gate, zero post-gate materialization.
682
+
683
+ ### Consumer migration
684
+
685
+ - **Nothing mandatory.** `kenpachi` activates only on explicit invocation; the `afm-health.sh` hook is opt-in per install (needs `jq`, degrades to a no-op). Pre-rc.6 instances' `docs/rubrics/` do not have the 8th rubric — copy `rubrics/when-to-evolve-methodology.md` by hand, or run `/afm:update` (version sync). `docs/evolution/` is born at the 1st cycle.
686
+
687
+ ## [3.0.0-rc.5] — 2026-05-30
688
+
689
+ > **Release candidate (iterates on rc.4).** This closes the structural gap a 5-lens audit found: the methodology kept the docs alive well (the **code→docs** loop through `reconcile`), but it barely applied the docs to the code (the **docs→code** loop) — that loop rested on one passive sentence in the consumer `CLAUDE.md`, with no mechanism. rc.5 gives this loop executable wiring (hooks), makes § 3 consistent with its own contract (a rule with no executable trigger becomes a principle), and gives the autonomy "load-bearing" pivot a structural test (a deterministic gate). **The plugin stops being pure Markdown** — it gains `afm/hooks/` (shell + smoke test).
690
+
691
+ ### Added
692
+
693
+ - **`afm/hooks/` — closes the docs→code loop (the central fix).** `hooks/hooks.json` declares two events; the scripts' cwd is the consumer root; they degrade to a silent no-op outside an AFM project or without `jq` (they never break the session or block Edit).
694
+ - **`afm-session-start.sh`** (`SessionStart`): injects a digest (§ 2 situation→doc map + § 3 hard rules + reconcile doctrine) through `hookSpecificOutput.additionalContext`. **This is what makes reconcile truly "always-on"** — before this it was aspirational (a skill frontmatter has no way to be injected every session without a hook).
695
+ - **`afm-pre-edit.sh`** (`PreToolUse` matcher `Edit|Write`): injects the rules (§ 3) and gotchas whose path-prefix/`Gatilho` matches a segment of the edited file's path. Cached per session+file. It delivers "the right rule at the moment of writing".
696
+ - **`afm/hooks/test/run.sh`**: smoke test (shellcheck if present + functional asserts with fixtures). The plugin gained shell, so it gained a test.
697
+ - **Rubrics materialized in the consumer.** The decision rubrics (`rubrics/`) were orphans — not copied to the consumer `/docs/` nor listed in the `CLAUDE.md` index. Now `bootstrap.md` (Step 7) and `refactor.md` (B.7) copy `rubrics/` → `<consumer>/docs/rubrics/`; `export-template` keeps `rubrics/` in the "keep" set; from-template copies it if missing.
698
+ - **DSL-first — new rubric + principle + trigger.** New rubric `rubrics/when-to-create-dsl.md` (7th, in the "when-to-create-X" family): the agent **suggests** a DSL (fluent builder / combinators / declarative object / mini-language) when boilerplate over primitives scales up. **Trigger = two combined signals:** (1) 3 or more call sites repeating the same primitive *sequence* in fixed order (Rule-of-Three over a sequence), AND (2) wiring dominates intent at those sites — plus the condition that separates a DSL from a helper: a **reusable grammar** exists. This complements the Rule of Three, and is not the opposite of KISS (it picks the lightest form that captures the grammar; a parser is the last resort). **It suggests, it does not build:** proposing a DSL is an architectural change → hard rule 11 (stop and ask; bring an API sketch plus a candidate ADR). Principle in `core/afm.md § 1.3`, passive trigger in `triggers.md` (reconcile proposes it), reference in `ach.md § 6`. Materialized in the consumer alongside the other rubrics.
699
+
700
+ ### Changed
701
+
702
+ - **§ 3 becomes consistent with its own contract (mechanize-or-demote).** The contract (`core/afm.md` § 3 + `PRINCIPLES.md` #3) now requires an **executable trigger the agent runs at the keyboard** (`grep`/`wc`/`git diff`/`tsc`); "code review"/"PR template"/"manual review" no longer count (and "binary checklist" is dropped from the list). Disposition: **rule 3** (types at boundaries) and **8** (Rule of Three) and **14** (saga ordering) are demoted to § 1.3 (they were already principles; 3 and 8 already lived there — this collapses the duplication; saga ordering gets its own dedicated bullet); **rule 13** (secrets) is mechanized with `git diff --staged | grep`; **rule 11** (architectural change) gets a **mid-flight** trigger on the working tree (`git status --porcelain`), not a "PR checklist" (`deliver` fires it before a PR even exists). Modules (`modules/*/rules.patch.md`) are restructured: "Hard rules (executable trigger)" vs. "Principles (review → § 1.3)" — rules that were only "code review" (stripe 1/3/5, prisma 3, trpc 5, trigger 2, vireya 6) become principles.
703
+ - **Broken trigger commands fixed.** Brace-glob in `find`/`grep` paths (`*.{css,module.css}`, `*.{{ext}}`) → `--include`/`-o`; `grep "a\|b"` → `grep -E "a|b"`; PCRE lookahead `:focus(?!-visible)` under `-E` → the portable `:focus([^-]|$)`; `wc -l **/route.ts` (globstar) → `find ... | xargs wc -l`. All validated by running them in a POSIX shell.
704
+ - **`PRINCIPLES.md` #6/#8 — a structural "load-bearing" discriminator (a deterministic gate).** The circular pivot "it breaks something if it goes wrong" becomes a mechanical test: a finding is bucket (b) (escalates to the gate) **if and only if the wrong choice changes which components/boundaries/tasks get created** (the structural inventory), not just the content. CRITICAL = it changes the inventory of the whole plan; HIGH = of one feature/task. `#6` and `#2` are rewritten as scannable sub-bullets (bright lines — push, rule-11, destructive, plugin — stop being clauses buried in a 30-line paragraph). Bright line (a), destructive, now explicitly covers a destructive operation that arrives as a task from an approved `tasks.md`.
705
+ - **`ops/deliver.md` Phase 2 — "go" no longer lets a load-bearing guess steer things silently.** On the `AUTONOMY=high` path with a HIGH bucket (b) finding: the agent adopts the recommendation and marks `[NEEDS CLARIFICATION:]`, **but** the tasks that depend on the assumption are born marked, and the Phase 3.B driver **halts at the first one of them** (resumable) — the drift surfaces at the dependent task's boundary, not 8 tasks later. The question cap is clarified as **per feature lifetime** (resumability does not reset the counter; rounds spent are noted in the spec). A 5th stop bright line is added to the table.
706
+ - **`ops/analyze.md` (verification engine) aligned:** bucket (b) uses the structural test; CRITICAL/HIGH locks to (b) (gate), never (c), after 3 auto-fix rounds; the severity matrix is adjusted (HIGH no longer cites "hard rule with no trigger" — it does not exist; § 1.3 includes the demoted rules).
707
+ - **Activation disambiguation:** reciprocal carve-outs between `analyze`↔`clarify` (read-only validation vs. resolving markers), `analyze`→`deliver`, and `research` tightened (it over-captured "investigate this bug" — now it is only an external technical unknown to decide; diagnostic debugging is explicitly excluded).
708
+ - **`deliver`'s attention cost:** a note at the top of the suppression contract — the only universal suppression is `AskUserQuestion`/diff per artifact (it escalates to the gate); do not re-read the 7 ops re-subtracting steps.
709
+
710
+ ### Fixed
711
+
712
+ - **Principle-numbering drift after the rc.1 renumber.** `skills/reconcile/SKILL.md` cited `#5` for propose-not-apply (it is `#6`) and `#4` for do-not-invent (it is `#5`) — and it contradicted itself internally (line 53 already had the fix). `skills/research/SKILL.md` cited `#4` for do-not-invent (it is `#5`). Fixed. A sweep confirmed the other ops/interview files were already correct; `#N` refs in the CHANGELOG are historical and are not rewritten.
713
+
714
+ ### Consumer migration
715
+
716
+ - **Hooks are opt-in through the plugin install** — an existing consumer starts receiving them on the next plugin update; no manual action needed. `jq` must be on the PATH to activate them (without `jq`, a silent no-op).
717
+ - **`/docs/rubrics/` is not retroactive** — consumers bootstrapped before rc.5 do not have the folder; run `/afm:update` (version sync) OR copy `rubrics/` manually to `docs/rubrics/` (they are stack-agnostic, with no placeholders).
718
+ - **Demoted rules (3/8/14):** if a consumer materialized `afm.md` before rc.5, the rules stay in § 3 there — no automatic migration (the template changed, the instance did not). Optional: move them to § 1.3 on the next reconcile pass.
719
+
720
+ ## [3.0.0-rc.4] — 2026-05-30
721
+
722
+ > **Release candidate (iterates on rc.3).** Closes the efficiency gap of autonomy: rc.1–rc.3 gave autonomy to **production** (materializes, infers, cuts gates), but not to **verification**. Without self-verification, drift only showed up late (in `git diff` or in a test failing 8 tasks later) — and the "fewer questions" gain came back as expensive rework. rc.4 brings **some questions back, but earned**: the gate stops being ceremony and becomes the load-bearing residue of self-critique.
723
+
724
+ ### Changed
725
+
726
+ - **`PRINCIPLES.md` #6 gains a verification corollary.** Autonomy-first is *produce → **self-verify** → report*, not *produce → report*. Before it delivers an artifact (discovery/spec/plan/tasks), the agent runs adversarial self-critique and **partitions** each finding into 3 buckets: (a) resolvable by evidence → self-corrects; (b) load-bearing + not resolvable → becomes the gate question; (c) cosmetic/deferrable → `[TBD]`/`[NEEDS CLARIFICATION:]` for reconcile. The **delivery gate = bucket (b)**, not a process question. With no (b) and no CRITICAL → there is no gate ("go").
727
+ - **`PRINCIPLES.md` #8 gains an "earned question" corollary.** Only what survives discover-first (#2) + self-critique (#6) + load-bearing reaches `AskUserQuestion`. Every gate question carries evidence + a recommendation (`(Recomendado)`) + "what breaks if wrong". The anti-interrogation cap (≤4/call, ≤2 rounds) is holistic: discovery and verification share the same budget.
728
+ - **`ops/analyze.md` gains two modes.** *Advisory* (default, à-la-carte — read-only in chat, unchanged) and *gating* (in-loop, called by `deliver`): same detection (steps 2-5), but it partitions into the 3 buckets, self-corrects bucket (a), and **re-runs until CRITICAL/HIGH clears** (cap 3 rounds), returns bucket (b) as earned questions; no report-in-chat. `analyze` becomes the **verification engine** of AFM.
729
+ - **`ops/deliver.md` Phase 1.D + Phase 2 rewritten.** 1.D stops being "silent self-check (only CRITICAL escalates)" and becomes the mandatory verification that produces the partition (self-corrects (a) + loop-until-clear + (b) for the gate). Phase 2 stops being "approve the plan?" and instead **carries the earned questions from bucket (b)** (≤4, recommendation-first, evidence + "what breaks" built in) — answering IS approving. `AUTONOMY=high` with non-CRITICAL (b): adopts its own recommendation as default + records `[NEEDS CLARIFICATION:]` (documents, does not guess); CRITICAL (b) asks even with "go". Suppression table and anti-patterns updated.
730
+ - **`core/afm.md` § 2.2** steps 2-3 reframed: synthesis gains self-verification; the single gate = residue of verification.
731
+
732
+ ### Notes
733
+
734
+ - Iterates within the same rc (rc.1–rc.3 not pushed). Doctrine anchored as a corollary, **with no principle renumbering** (operator's choice) — zero consumer migration. Conceptual ancestor: the "adversarial verify / completeness critic" patterns from multi-agent orchestration, applied to the methodology's own artifacts (not only to code, which already had an oracle via TDD).
735
+
736
+ ## [3.0.0-rc.3] — 2026-05-29
737
+
738
+ > **Release candidate (iterates on rc.2).** Makes the `refactor` interview embody #6 (autonomy-first) — fewer gates, fewer questions about the discoverable, same captured information.
739
+
740
+ ### Changed
741
+
742
+ - **`interview/refactor.md` — a more autonomous interview.** It applies #6 (autonomy-first) and #2 (discover-first) to the retroactive adoption flow, without losing information:
743
+ - **Ceremony gates removed:** the pre-check no longer asks "start?" (invoking `/afm:refactor` already approves — it announces the plan in 1 line and continues); B.8 no longer asks "want to review?" (it materializes + reports paths, review via `git diff`); D.10 forward-only materializes the default (from-today + boy-scout) with a non-blocking note instead of an `AskUserQuestion` about granularity.
744
+ - **New A.7 — CI/hooks scan:** it discovers what **already gates** merge/push (`.github/workflows`, `.husky`, `.pre-commit-config`, `package.json` scripts/`lint-staged`, `Makefile`). C.9.6 (DoD/pre-push) now enters **pre-marked** with what it discovered, recommendation-first — a confirmation instead of a blank multi-select. Empty result → falls back to the current behavior.
745
+ - **Closing:** the remaining `[TBD]` markers are **reported** (a summary + commit note) and handed to the always-on `reconcile`, instead of the `multiSelect` gate "which to fill in now?".
746
+ - **Kept** (the operator's decision): the block for **product intent** (C.9.1–C.9.5 — pain/persona/summary/ADR/gotcha) stays **one per turn** with validation by rephrasing. Only the human knows this. The careful cadence stays on purpose.
747
+ - Anti-patterns and success criteria of `refactor.md` updated: "only genuine intent consumes a turn; zero ceremony gates; nothing discoverable gets asked".
748
+ - **`init`/`refactor` become explicit-activation-only.** The `when_to_use` of both skills loses the **auto-activation by project state** branches (detected greenfield/brownfield/from-template): now they ACTIVATE only by explicit invocation — `/afm:init`÷`/afm:refactor` or an explicit natural-language request ("build the AFM doc", "adopt AFM here"). The **pre-checks** stay intact and use state **after** invocation to redirect (`init`↔`refactor`, from-template branch) or refuse (already bootstrapped). The disambiguation table in the root `CLAUDE.md` and `README.md` was rewritten to reflect "explicit activation, state only describes when it fits". `reconcile` remains the only always-on skill.
749
+ - **`interview/bootstrap.md` — stack inferred from evidence (#2 + #8), always with confirmation.** Step 1 gains **1.0 — Stack scan**: when a manifest exists in the repo (or the user named the stack in Step 0), it infers each layer (web/API/DB+ORM/tasks) and takes it to the `AskUserQuestion` **pre-marked as `(Recommended)`** citing the evidence — the question becomes a confirmation of a suggestion, not a blank choice. No signal → the current blank flow. Step 6 (DoD/pre-push) works the same way: it pre-marks whatever `.github/workflows`/`.husky`/scripts/`Makefile` reveal. Guiding rule #1 rewritten ("pre-filled suggestion > blank question, where a signal exists") + anti-pattern "asking for the stack blank when a manifest exists". **The user's confirmation is kept** — the stack is their decision, no ceremony gate was removed here (unlike `refactor`, which materializes directly). `bootstrap` stays conversational, since it is almost all product intent.
750
+
751
+ ### Notes
752
+
753
+ - Refinement inside the same rc (rc.1/rc.2 were not pushed/merged). No change to principle, numbering, or consumer contract — it is `refactor` and `bootstrap` embodying the #6/#2 the doctrine already declared. It operationalizes what `PRINCIPLES.md` #2 already mandated for greenfield ("where a manifest exists, infer the stack as a recommendation BEFORE offering options").
754
+
755
+ ## [3.0.0-rc.2] — 2026-05-29
756
+
757
+ > **Release candidate (iterates on rc.1).** Refines headline principle #2 — discovery stops being a mandatory sweep and becomes **gap-triggered**.
758
+
759
+ ### Changed
760
+
761
+ - **#2 discover-first reframed as a gap-triggered decision procedure** (`PRINCIPLES.md`). Before, it read as "exhaust the discoverable before ANY question" (it sounded like an always-on sweep). Now: the agent works and, on hitting **missing information**, routes **in this order** — (1) code/`docs/` can answer → local discovery (`grep`/glob/`Read`/Explore); (2) the web can answer (lib/tech) → research; (3) no path resolves it OR it is product intent → `AskUserQuestion` (#8). **Discovery is conditional:** with no discoverable gap, there is no discovery — it does not scan what it already knows or research what it does not need; asking is the fallback after (1) and (2).
762
+ - **`core/afm.md` § 2.2** step 1 and **`ops/deliver.md` Phase 0** reframed as gap-driven: it identifies the gaps first, and scans/researches only those; a trivial/already-specified feature passes almost straight through. The `deliver` convergent loop only digs deeper where a gap still exists.
763
+
764
+ ### Notes
765
+
766
+ - Refinement within the same rc (rc.1 was not pushed/merged). Bright lines of #6, mechanical-refusal gates, and intent questions: unchanged. #8 already filtered to "only the irreducible left over from #2" — this stays consistent.
767
+
768
+ ## [3.0.0-rc.1] — 2026-05-28
769
+
770
+ > **Release candidate.** This locks in the philosophy shift (BREAKING) and opens a test window before the final `3.0.0`.
771
+
772
+ ### Philosophy — autonomy-first
773
+
774
+ The v2.1.0 introduced discover-first (#9) and `deliver`, but treated autonomy as "a mode of `deliver`". The 3.0.0 locks it in as **law of the whole methodology**: the agent discovers everything discoverable and goes to the human only with **product intent**. No more `"where is X"`, `"what is the current state of X"`, `"which components"`, `"which stack"` — the agent looks and answers itself.
775
+
776
+ ### Changed (BREAKING)
777
+
778
+ - **Principles renumbered and reframed** in `PRINCIPLES.md`. Old→new map: `#2→#3, #3→#4, #4→#5, #5→#6, #6→#7, #7→#8, #8→#9, #9→#2`. Result: **8 universals (§1-8) + #9 refactor-only**.
779
+ - **#2 — discover-first** (was #9, mis-numbered after the refactor-only): **raised** to an early foundational principle, default law for EVERY op (not only `deliver`). Active side of #1.
780
+ - **#6 — autonomy-first** (reframe of the old #5 "propose the edit, do not apply"): inside an approved scope (an op invoked, or a feature approved at the `deliver` gate), the agent **materializes and reports** — writes and shows a summary + paths for review through `git diff`, with no blocking per-write `AskUserQuestion`. The invocation itself IS the consent. **Bright lines that still confirm first:** a destructive operation (`export-template` deletes files), an edit to the plugin (`promote`), a push (`§ 6.1`), an architectural surprise (rule 11). Absorbs the checkpoint corollary of `deliver`.
781
+ - **#9 — retroactive load-bearing ADR** (was #8): the only refactor-only entry, moved to the end.
782
+ - **Standalone ops become autonomous by default.** Running `/afm:plan` (etc.) alone now infers everything from the scan (discover-first), materializes, and reports — with no interrogation of discoverable state and no blocking diff per edit. This affects `gotcha/adr/rule/specify/plan/tasks/clarify/research`. Feature disambiguation in `plan/tasks/clarify/research` now auto-detects (branch/recency), and asks only when 2+ candidates are ambiguous. Kept: **mechanical refusal** gates (`gotcha` 2×, `tasks` HARD-block, `rule` trigger) and **intent** questions (ADR status, rule scope, product clarify).
783
+ - **Sweep of `#N` references** across every op, SKILL.md, `core/afm.md`, interviews, READMEs, and `CLAUDE.md` for the new numbering. `analyze.md` constitution set moves from `§1-7` to `§1-8` (fixes a drift that omitted discover-first); detection of "applied without a diff" becomes "crossed a bright line without confirming" (#6).
784
+
785
+ ### Removed
786
+
787
+ - **The interrogative bias of the doctrine.** The default was "ask what is needed" and is now "discover what you can, ask only what is irreducible".
788
+ - **Legacy triggers `/afm:init <op>` / `/afm:refactor <op>`** across the 11 op files + README — a residue of the pre-v2.0.0 router; each op now declares only `/afm:<op>`.
789
+ - **`spec-kit/`** leaves the repo (`.gitignore`) — it was an external reference clone (GitHub spec-kit), with no code dependency (only cited as an ancestor in historical notes).
790
+
791
+ ### Notes
792
+
793
+ - **This is rc.1.** Consumer migration: consumer projects' `CLAUDE.md` that cites a principle `#N` may need the map above. Bright-line behavior is preserved — autonomy is not recklessness.
794
+ - **The `[2.1.0]`/`[2.0.0]`/earlier entries stay frozen** (they describe the numbering state of their own time); only this entry uses the new numbering.
795
+
796
+ ## Pre-3.0.0 — milestones (collapsed)
797
+
798
+ > The detailed entries from 0.1.0 → 2.1.0 were collapsed into milestones (grow-and-refine in the framework itself — ACE: prune redundancy, not load-bearing detail). **Full history is preserved in git** (`git log -- framework-template/CHANGELOG.md` or the commits for each version). The principle numbering `#N` cited in pre-rc.1 entries reflects the numbering **of that time** (the v3.0.0-rc.1 reframe remapped `#2↔#9` — see that entry).
799
+
800
+ - **[2.1.0] — 2026-05-28** — Skill `deliver` (autonomous end-to-end delivery orchestrator: discovery → 1 gate → runs to the end, resumable, DRY suppression contract). The discover-first principle introduced (then `#9`). Hard rule `nextjs-app-router` `<html lang>` on the `[lang]` segment.
801
+ - **[2.0.0] — 2026-05-28 (BREAKING)** — refactors from "2 skills + op router" to **14 atomic skills** (`/afm:clarify`, `/afm:gotcha`, etc. invoked directly); `/afm:reconcile` always-on centralizes the continuous doctrine formerly duplicated in init/refactor; the legacy bridge `commands/afm.md` removed. Hard cut, no shim.
802
+ - **[1.3.0] — 2026-05-09** — a third project state: greenfield with an architectural template (`docs/.template`). Op `export-template` + from-template branch in `init`.
803
+ - **[1.2.0] — 2026-05-09** — delivery loop auxiliaries: `clarify` / `analyze` / `research` + research templates. Inspired by spec-kit (Phase 0), preserving AFM invariants.
804
+ - **[1.1.0] — 2026-05-09** — per-feature delivery loop: `specify` / `plan` / `tasks` + `feature-{spec,plan,tasks}` templates + `core/afm.md § 2.1` (folder heuristic) + `[NEEDS CLARIFICATION:]` marker.
805
+ - **[1.0.0–1.0.4] — 2026-05-01→03** — splits the monolithic `afm` skill into a plugin with `init`+`refactor` sharing `framework-template/`; `${CLAUDE_SKILL_DIR}` paths; ops extracted to `framework-template/ops/` (single canonical source); `MAINTAINERS.md`; SKILL.md trim.
806
+ - **[0.1.0–0.3.0] — 2026-04-29** — genesis: initial PRINCIPLES/templates/rubrics, first interviews (bootstrap/refactor), first stack modules.