hivemind-context-governance 1.3.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/CHANGELOG.md +207 -0
  2. package/README.md +524 -153
  3. package/bin/hivemind-tools.cjs +1402 -0
  4. package/commands/hivemind-compact.md +20 -0
  5. package/commands/hivemind-scan.md +42 -0
  6. package/commands/hivemind-status.md +35 -0
  7. package/dist/cli/init.d.ts +11 -2
  8. package/dist/cli/init.d.ts.map +1 -1
  9. package/dist/cli/init.js +185 -27
  10. package/dist/cli/init.js.map +1 -1
  11. package/dist/cli/interactive-init.d.ts +15 -0
  12. package/dist/cli/interactive-init.d.ts.map +1 -0
  13. package/dist/cli/interactive-init.js +207 -0
  14. package/dist/cli/interactive-init.js.map +1 -0
  15. package/dist/cli.d.ts +4 -2
  16. package/dist/cli.d.ts.map +1 -1
  17. package/dist/cli.js +167 -36
  18. package/dist/cli.js.map +1 -1
  19. package/dist/dashboard/server.d.ts +78 -19
  20. package/dist/dashboard/server.d.ts.map +1 -1
  21. package/dist/dashboard/server.js +365 -249
  22. package/dist/dashboard/server.js.map +1 -1
  23. package/dist/hooks/compaction.d.ts +8 -1
  24. package/dist/hooks/compaction.d.ts.map +1 -1
  25. package/dist/hooks/compaction.js +88 -15
  26. package/dist/hooks/compaction.js.map +1 -1
  27. package/dist/hooks/event-handler.d.ts +6 -0
  28. package/dist/hooks/event-handler.d.ts.map +1 -0
  29. package/dist/hooks/event-handler.js +115 -0
  30. package/dist/hooks/event-handler.js.map +1 -0
  31. package/dist/hooks/index.d.ts +5 -2
  32. package/dist/hooks/index.d.ts.map +1 -1
  33. package/dist/hooks/index.js +5 -1
  34. package/dist/hooks/index.js.map +1 -1
  35. package/dist/hooks/sdk-context.d.ts +58 -0
  36. package/dist/hooks/sdk-context.d.ts.map +1 -0
  37. package/dist/hooks/sdk-context.js +100 -0
  38. package/dist/hooks/sdk-context.js.map +1 -0
  39. package/dist/hooks/session-lifecycle.d.ts +17 -7
  40. package/dist/hooks/session-lifecycle.d.ts.map +1 -1
  41. package/dist/hooks/session-lifecycle.js +585 -42
  42. package/dist/hooks/session-lifecycle.js.map +1 -1
  43. package/dist/hooks/soft-governance.d.ts +47 -0
  44. package/dist/hooks/soft-governance.d.ts.map +1 -0
  45. package/dist/hooks/soft-governance.js +351 -0
  46. package/dist/hooks/soft-governance.js.map +1 -0
  47. package/dist/hooks/tool-gate.d.ts +20 -3
  48. package/dist/hooks/tool-gate.d.ts.map +1 -1
  49. package/dist/hooks/tool-gate.js +143 -43
  50. package/dist/hooks/tool-gate.js.map +1 -1
  51. package/dist/index.d.ts +31 -10
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +82 -133
  54. package/dist/index.js.map +1 -1
  55. package/dist/lib/anchors.d.ts +16 -0
  56. package/dist/lib/anchors.d.ts.map +1 -0
  57. package/dist/lib/anchors.js +48 -0
  58. package/dist/lib/anchors.js.map +1 -0
  59. package/dist/lib/chain-analysis.d.ts +29 -0
  60. package/dist/lib/chain-analysis.d.ts.map +1 -0
  61. package/dist/lib/chain-analysis.js +59 -0
  62. package/dist/lib/chain-analysis.js.map +1 -0
  63. package/dist/lib/commit-advisor.d.ts +17 -0
  64. package/dist/lib/commit-advisor.d.ts.map +1 -0
  65. package/dist/lib/commit-advisor.js +21 -0
  66. package/dist/lib/commit-advisor.js.map +1 -0
  67. package/dist/lib/complexity.d.ts +5 -14
  68. package/dist/lib/complexity.d.ts.map +1 -1
  69. package/dist/lib/complexity.js +4 -24
  70. package/dist/lib/complexity.js.map +1 -1
  71. package/dist/lib/detection.d.ts +251 -0
  72. package/dist/lib/detection.d.ts.map +1 -0
  73. package/dist/lib/detection.js +631 -0
  74. package/dist/lib/detection.js.map +1 -0
  75. package/dist/lib/framework-context.d.ts +25 -0
  76. package/dist/lib/framework-context.d.ts.map +1 -0
  77. package/dist/lib/framework-context.js +133 -0
  78. package/dist/lib/framework-context.js.map +1 -0
  79. package/dist/lib/hierarchy-tree.d.ts +290 -0
  80. package/dist/lib/hierarchy-tree.d.ts.map +1 -0
  81. package/dist/lib/hierarchy-tree.js +633 -0
  82. package/dist/lib/hierarchy-tree.js.map +1 -0
  83. package/dist/lib/index.d.ts +11 -2
  84. package/dist/lib/index.d.ts.map +1 -1
  85. package/dist/lib/index.js +12 -2
  86. package/dist/lib/index.js.map +1 -1
  87. package/dist/lib/long-session.d.ts +16 -0
  88. package/dist/lib/long-session.d.ts.map +1 -0
  89. package/dist/lib/long-session.js +15 -0
  90. package/dist/lib/long-session.js.map +1 -0
  91. package/dist/lib/mems.d.ts +25 -0
  92. package/dist/lib/mems.d.ts.map +1 -0
  93. package/dist/lib/mems.js +84 -0
  94. package/dist/lib/mems.js.map +1 -0
  95. package/dist/lib/persistence.d.ts.map +1 -1
  96. package/dist/lib/persistence.js +54 -5
  97. package/dist/lib/persistence.js.map +1 -1
  98. package/dist/lib/planning-fs.d.ts +142 -1
  99. package/dist/lib/planning-fs.d.ts.map +1 -1
  100. package/dist/lib/planning-fs.js +379 -15
  101. package/dist/lib/planning-fs.js.map +1 -1
  102. package/dist/lib/sentiment.d.ts +3 -19
  103. package/dist/lib/sentiment.d.ts.map +1 -1
  104. package/dist/lib/sentiment.js +4 -153
  105. package/dist/lib/sentiment.js.map +1 -1
  106. package/dist/lib/session-export.d.ts +33 -0
  107. package/dist/lib/session-export.d.ts.map +1 -0
  108. package/dist/lib/session-export.js +74 -0
  109. package/dist/lib/session-export.js.map +1 -0
  110. package/dist/lib/staleness.d.ts +12 -0
  111. package/dist/lib/staleness.d.ts.map +1 -0
  112. package/dist/lib/staleness.js +17 -0
  113. package/dist/lib/staleness.js.map +1 -0
  114. package/dist/lib/tool-activation.d.ts +23 -0
  115. package/dist/lib/tool-activation.d.ts.map +1 -0
  116. package/dist/lib/tool-activation.js +71 -0
  117. package/dist/lib/tool-activation.js.map +1 -0
  118. package/dist/schemas/brain-state.d.ts +75 -4
  119. package/dist/schemas/brain-state.d.ts.map +1 -1
  120. package/dist/schemas/brain-state.js +93 -21
  121. package/dist/schemas/brain-state.js.map +1 -1
  122. package/dist/schemas/config.d.ts +11 -0
  123. package/dist/schemas/config.d.ts.map +1 -1
  124. package/dist/schemas/config.js +12 -1
  125. package/dist/schemas/config.js.map +1 -1
  126. package/dist/schemas/hierarchy.d.ts +0 -7
  127. package/dist/schemas/hierarchy.d.ts.map +1 -1
  128. package/dist/schemas/hierarchy.js +2 -8
  129. package/dist/schemas/hierarchy.js.map +1 -1
  130. package/dist/tools/check-drift.d.ts +7 -0
  131. package/dist/tools/check-drift.d.ts.map +1 -0
  132. package/dist/tools/check-drift.js +80 -0
  133. package/dist/tools/check-drift.js.map +1 -0
  134. package/dist/tools/compact-session.d.ts +45 -0
  135. package/dist/tools/compact-session.d.ts.map +1 -1
  136. package/dist/tools/compact-session.js +253 -14
  137. package/dist/tools/compact-session.js.map +1 -1
  138. package/dist/tools/declare-intent.d.ts +6 -0
  139. package/dist/tools/declare-intent.d.ts.map +1 -1
  140. package/dist/tools/declare-intent.js +73 -10
  141. package/dist/tools/declare-intent.js.map +1 -1
  142. package/dist/tools/export-cycle.d.ts +20 -0
  143. package/dist/tools/export-cycle.d.ts.map +1 -0
  144. package/dist/tools/export-cycle.js +120 -0
  145. package/dist/tools/export-cycle.js.map +1 -0
  146. package/dist/tools/hierarchy.d.ts +28 -0
  147. package/dist/tools/hierarchy.d.ts.map +1 -0
  148. package/dist/tools/hierarchy.js +112 -0
  149. package/dist/tools/hierarchy.js.map +1 -0
  150. package/dist/tools/index.d.ts +24 -5
  151. package/dist/tools/index.d.ts.map +1 -1
  152. package/dist/tools/index.js +24 -5
  153. package/dist/tools/index.js.map +1 -1
  154. package/dist/tools/list-shelves.d.ts +13 -0
  155. package/dist/tools/list-shelves.d.ts.map +1 -0
  156. package/dist/tools/list-shelves.js +61 -0
  157. package/dist/tools/list-shelves.js.map +1 -0
  158. package/dist/tools/map-context.d.ts +7 -0
  159. package/dist/tools/map-context.d.ts.map +1 -1
  160. package/dist/tools/map-context.js +128 -10
  161. package/dist/tools/map-context.js.map +1 -1
  162. package/dist/tools/recall-mems.d.ts +13 -0
  163. package/dist/tools/recall-mems.d.ts.map +1 -0
  164. package/dist/tools/recall-mems.js +59 -0
  165. package/dist/tools/recall-mems.js.map +1 -0
  166. package/dist/tools/save-anchor.d.ts +7 -0
  167. package/dist/tools/save-anchor.d.ts.map +1 -0
  168. package/dist/tools/save-anchor.js +40 -0
  169. package/dist/tools/save-anchor.js.map +1 -0
  170. package/dist/tools/save-mem.d.ts +13 -0
  171. package/dist/tools/save-mem.d.ts.map +1 -0
  172. package/dist/tools/save-mem.js +52 -0
  173. package/dist/tools/save-mem.js.map +1 -0
  174. package/dist/tools/scan-hierarchy.d.ts +9 -0
  175. package/dist/tools/scan-hierarchy.d.ts.map +1 -0
  176. package/dist/tools/scan-hierarchy.js +71 -0
  177. package/dist/tools/scan-hierarchy.js.map +1 -0
  178. package/dist/tools/self-rate.js +5 -5
  179. package/dist/tools/self-rate.js.map +1 -1
  180. package/dist/tools/think-back.d.ts +9 -0
  181. package/dist/tools/think-back.d.ts.map +1 -0
  182. package/dist/tools/think-back.js +127 -0
  183. package/dist/tools/think-back.js.map +1 -0
  184. package/docs/10-commandments.md +202 -0
  185. package/package.json +26 -9
  186. package/skills/context-integrity/SKILL.md +190 -0
  187. package/skills/delegation-intelligence/SKILL.md +159 -0
  188. package/skills/evidence-discipline/SKILL.md +122 -0
  189. package/skills/hivemind-governance/SKILL.md +109 -0
  190. package/skills/session-lifecycle/SKILL.md +185 -0
  191. package/dist/dashboard/i18n/en.d.ts +0 -43
  192. package/dist/dashboard/i18n/en.d.ts.map +0 -1
  193. package/dist/dashboard/i18n/en.js +0 -43
  194. package/dist/dashboard/i18n/en.js.map +0 -1
  195. package/dist/dashboard/i18n/index.d.ts +0 -10
  196. package/dist/dashboard/i18n/index.d.ts.map +0 -1
  197. package/dist/dashboard/i18n/index.js +0 -14
  198. package/dist/dashboard/i18n/index.js.map +0 -1
  199. package/dist/dashboard/i18n/vi.d.ts +0 -43
  200. package/dist/dashboard/i18n/vi.d.ts.map +0 -1
  201. package/dist/dashboard/i18n/vi.js +0 -43
  202. package/dist/dashboard/i18n/vi.js.map +0 -1
  203. package/dist/lib/context-refresh.d.ts +0 -46
  204. package/dist/lib/context-refresh.d.ts.map +0 -1
  205. package/dist/lib/context-refresh.js +0 -77
  206. package/dist/lib/context-refresh.js.map +0 -1
  207. package/src/cli/init.ts +0 -214
  208. package/src/cli.ts +0 -178
  209. package/src/dashboard/i18n/en.ts +0 -43
  210. package/src/dashboard/i18n/index.ts +0 -20
  211. package/src/dashboard/i18n/vi.ts +0 -43
  212. package/src/dashboard/server.ts +0 -372
  213. package/src/hooks/compaction.ts +0 -104
  214. package/src/hooks/index.ts +0 -8
  215. package/src/hooks/session-lifecycle.ts +0 -133
  216. package/src/hooks/tool-gate.ts +0 -205
  217. package/src/index.ts +0 -206
  218. package/src/lib/complexity.ts +0 -96
  219. package/src/lib/context-refresh.ts +0 -107
  220. package/src/lib/index.ts +0 -10
  221. package/src/lib/logging.ts +0 -53
  222. package/src/lib/persistence.ts +0 -83
  223. package/src/lib/planning-fs.ts +0 -187
  224. package/src/lib/sentiment.ts +0 -183
  225. package/src/schemas/brain-state.ts +0 -257
  226. package/src/schemas/config.ts +0 -184
  227. package/src/schemas/hierarchy.ts +0 -58
  228. package/src/schemas/index.ts +0 -7
  229. package/src/tools/compact-session.ts +0 -97
  230. package/src/tools/declare-intent.ts +0 -104
  231. package/src/tools/index.ts +0 -14
  232. package/src/tools/map-context.ts +0 -105
  233. package/src/tools/self-rate.ts +0 -86
package/CHANGELOG.md CHANGED
@@ -5,6 +5,204 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ### Fixed
11
+ - `export_cycle` now synchronizes flat `brain.hierarchy` projection after tree mutations, eliminating hierarchy/tree desync after subagent exports
12
+ - `declare_intent` no longer overwrites per-session files with legacy active template content; legacy `active.md` is updated separately for backward compatibility
13
+ - Stale auto-archive path now resets `hierarchy.json`, preventing orphaned tree carryover into newly created sessions
14
+ - `soft-governance` now wires `trackSectionUpdate`, activating section repetition detection that was previously dead code
15
+ - Persistence migration now backfills `metrics.write_without_read_count` (and related governance defaults) for older installs
16
+ - Compaction hook now consumes and clears `next_compaction_report` after injection to avoid stale repeated report injection
17
+ - Tool gate drift warnings now use projected turn state and persist drift score updates, removing one-turn lag and unsaved in-memory drift mutation
18
+
19
+ ### Changed
20
+ - First-run setup guidance now includes project/framework snapshot hints and a deep reconnaissance protocol before implementation
21
+ - `declare_intent` now requires completed CLI initialization (`.hivemind/config.json`) instead of silently bootstrapping default state
22
+ - Runtime log directory is now aligned with `.hivemind/logs` for initialized projects
23
+ - `initializePlanningDirectory` now creates `.hivemind/logs` explicitly
24
+
25
+ ### Documentation
26
+ - `README.md` fully rewritten: coherent install-to-runtime flow, upgrade guidance, troubleshooting, and expanded Vietnamese section focused on practical onboarding
27
+
28
+ ## [2.6.0] - 2026-02-12
29
+
30
+ ### Added
31
+ - **Ink-based TUI dashboard** (`hivemind dashboard`) replacing the old REST dashboard backend
32
+ - **Live governance panels** in TUI: session, hierarchy, metrics, escalation alerts, and traceability
33
+ - **Bilingual dashboard mode (EN/VI)** with runtime toggle (`l`) and manual refresh (`r`)
34
+ - **Traceability in TUI**: current timestamp, active session timeline, and current git hash
35
+ - **Semantic validation in `ecosystem-check`**: hierarchy chain integrity + stamp validation
36
+ - **Trace metadata in `ecosystem-check --json`**: `trace.time` and `trace.git_hash`
37
+ - **New test suites**: dashboard TUI (9 assertions), ecosystem-check CLI (8 assertions)
38
+
39
+ ### Changed
40
+ - `hivemind init` CLI wiring now accepts `--automation <manual|guided|assisted|full|retard>`
41
+ - `hivemind status` now shows automation level
42
+ - `hivemind dashboard` now launches the TUI with `--lang` and `--refresh` options
43
+ - `README.md` coverage and command docs updated to current state
44
+
45
+ ### Removed
46
+ - Obsolete cleanup artifacts: `.npmignore`, `tasks/`, and `docs/archive/historical-plans/`
47
+
48
+ ## [2.5.0] - 2026-02-12
49
+
50
+ ### Added
51
+ - **Evidence Gate System** — Escalating prompt pressure with 4 tiers (INFO → WARN → CRITICAL → DEGRADED) that intensify over unresolved turns
52
+ - **Evidence-based argument-back** — Every detection signal now includes data-backed evidence strings and counter-arguments against common agent excuses
53
+ - **"I am retard" mode** — New `automationLevel` CLI option with 5 levels (manual/guided/assisted/full/retard); retard mode forces strict governance, skeptical output, code review, max handholding
54
+ - **Write-without-read tracking (FileGuard)** — `soft-governance.ts` tracks blind file writes; detection engine generates `write_without_read` signal with evidence
55
+ - **`AutomationLevel` config type** — Persisted in `config.json`, read by hooks every turn (Rule 6)
56
+ - **`compileEscalatedSignals()`** — New entry point for evidence-based prompt injection, wraps `compileSignals()` with tiers + evidence + counter-excuses
57
+ - **`computeEscalationTier()`** — Pure function: turns × threshold → tier classification
58
+ - **44 new test assertions** — Evidence gate system tests: escalation, evidence quality, retard mode init, format compatibility (688 total)
59
+
60
+ ### Changed
61
+ - **Session lifecycle hook** — Now uses `compileEscalatedSignals()` instead of `compileSignals()` for richer prompt injection
62
+ - **Prompt format** — Escalated signals show `[TIER] message`, `EVIDENCE: data`, `↳ counter-argument` (backward compatible with non-escalated signals)
63
+ - **Retard mode auto-config** — Forces strict governance, beginner expert level, skeptical output, code review required, be_skeptical=true
64
+ - **Archived 9 historical plan documents** to `docs/archive/`
65
+
66
+ ## [2.3.0] - 2026-02-12
67
+
68
+ ### Added
69
+ - **Entry chain edge case tests** — JSONC config handling, re-init guard, config persistence verification (14 new assertions)
70
+ - **Config persistence verification** — `loadConfig` deep-merges constraints with defaults, partial updates preserve existing values
71
+ - **Re-init guard** — `hivemind init` no longer overwrites existing config (preserves governance_mode, language)
72
+
73
+ ### Fixed
74
+ - **JSONC config handling** — `opencode.jsonc` files now parsed correctly (was crashing on trailing commas/comments)
75
+ - **Master plan file tree accuracy** — docs now match actual output of `hivemind init`
76
+ - **Frozen config (L8)** — All 3 hooks now re-read config from disk each invocation via `loadConfig(directory)` instead of using stale closure values
77
+ - **Tool gate duplication (L9)** — Removed 130-line duplicated `createToolGateHookInternal` body; now delegates to `createToolGateHook().internal`
78
+ - **Dead sentiment_signals field (L10)** — Removed deprecated `SentimentSignal` type and `sentiment_signals: []` from BrainState schema
79
+ - **README accuracy (L1)** — Updated from "11 tools, 386 assertions" to "14 tools, 621 assertions"
80
+ - **CLI --help (L5)** — `--help` and `-h` flags now show help instead of running init
81
+
82
+ ### Changed
83
+ - Hook factories accept `_initConfig` parameter (unused — config read from disk per Rule 6)
84
+ - `bin/hivemind-tools.cjs` and `skills/` added to package.json `files` array for npm shipping
85
+ - Removed stale `tasks/prd-production-ready.md` and orphan `session-ses_3b3a.md`
86
+
87
+ ### Removed
88
+ - `SentimentSignal` interface and `sentiment_signals` field from BrainState
89
+ - Duplicated `createToolGateHookInternal` function body (kept as thin wrapper for backward compat)
90
+ - `src/lib/sentiment.ts` export from barrel (file retained for git history)
91
+
92
+ ## [2.2.0] - 2026-02-12
93
+
94
+ ### Added
95
+ - **export_cycle tool** (14th tool) — Captures subagent results into hierarchy tree + mems brain
96
+ - **Auto-capture hook** — `tool.execute.after` auto-captures all Task tool returns into `brain.cycle_log[]`
97
+ - **Pending failure acknowledgment** — `pending_failure_ack` flag set when subagent reports failure; system prompt warns until agent acknowledges
98
+ - **Skill system** (5 skills) — Behavioral governance through skills: `hivemind-governance` (bootstrap), `session-lifecycle`, `evidence-discipline`, `context-integrity`, `delegation-intelligence`
99
+ - **Tool activation engine** (7 priorities) — Suggests next tool based on session state (LOCKED → declare_intent, high drift → map_context, etc.)
100
+ - **Enhanced CLI** — `bin/hivemind-tools.cjs` expanded to 23 commands (source-audit, list-tools, list-hooks, verify-package, etc.)
101
+ - 36 new test assertions for cycle intelligence
102
+ - Entry chain E2E tests (56 assertions)
103
+
104
+ ## [2.1.0] - 2026-02-11
105
+
106
+ ### Added
107
+ - **Hierarchy tree engine** — Navigable tree with timestamp-based stamps, DFS traversal, cursor tracking
108
+ - **Detection engine** — Tool classification (read/write/query/governance), counter logic, keyword scanning, signal compilation
109
+ - **Per-session files** — Each session archived with `.json` export + `.md` export
110
+ - **Session manifest** — `manifest.json` registry of all sessions
111
+ - **Configurable thresholds** — `detection_thresholds` in config for turn count, failures, section repetition
112
+ - **Migration path** — `hierarchy_migrate` tool converts flat hierarchy to tree format
113
+ - **hierarchy_prune tool** — Removes completed branches, moves cursor to root
114
+ - **Compact purification** — `compact_session` generates next-compaction report for context preservation
115
+ - 2 new tools: `hierarchy_prune`, `hierarchy_migrate` (13 total)
116
+ - 158 new test assertions (hierarchy tree 55, detection 45, compact purification 34, entry chain 24)
117
+
118
+ ### Changed
119
+ - Session lifecycle hook now compiles detection signals into `<hivemind>` prompt injection
120
+ - Soft governance hook now runs full detection engine (tool classification, keyword scanning, failure tracking)
121
+ - Tree-aware chain analysis — detects timestamp gaps between nodes
122
+ - `max_active_md_lines` wired into detection thresholds
123
+
124
+ ## [2.0.0] - 2026-02-11
125
+
126
+ ### Breaking Changes
127
+ - System prompt injection restructured — uses `<hivemind>` tag instead of `<hivemind-governance>` and `<agent-configuration>`
128
+ - Commit suggestion removed from system prompt (was user concern, not agent concern)
129
+ - Mems count removed from system prompt (not actionable)
130
+
131
+ ### Added
132
+ - **Priority-sectioned system prompt** — drops lowest priority sections when budget exceeded instead of malformed truncation
133
+ - **Anchor age indicators** — anchors in system prompt show `(Xh ago)` / `(Xd ago)`
134
+ - **Input validation** — all string args validated for non-empty content
135
+ - **Helper footers** — every tool output suggests the logical next action
136
+ - **Upsert for anchors** — updating an existing key shows the delta (was/now)
137
+ - **Memory deduplication** — save_mem rejects duplicate content on same shelf
138
+ - **Session awareness** — save_anchor/save_mem warn when no active session
139
+ - **Overwrite warning** — declare_intent warns when replacing an existing trajectory
140
+ - **Output budget** — think_back capped at 2000 chars, anchors at 5, plan at 10 lines
141
+
142
+ ### Fixed
143
+ - **System prompt malformed XML** — truncation was closing `</agent-configuration>` inside `<hivemind-governance>` producing invalid XML
144
+ - **Hook inconsistency** — write tool lists now identical between before/after hooks (exact Set.has matching)
145
+ - **Fuzzy tool matching** — replaced dangerous `startsWith`/`includes` with exact `Set.has()`
146
+ - **Double save** — soft-governance hook consolidated to single disk write
147
+ - **Array mutation** — list-shelves sort no longer mutates shared state
148
+ - **scan_hierarchy JSON** — now returns structured text like all other tools
149
+ - **self_rate threshold** — score 6-7 now shows positive feedback instead of drift warning
150
+
151
+ ### Changed
152
+ - System prompt budget increased from 1000 to 2500 chars
153
+ - Package.json: removed src/ from files, added exports field, tightened peerDependencies
154
+ - Error messages standardized with `ERROR:` prefix and guidance
155
+ - scan_hierarchy description differentiated from think_back
156
+ - save_anchor description removes "API keys" (security risk)
157
+ - README rewritten to document all 11 tools and 4 hooks
158
+
159
+ ## [1.6.0] - 2026-02-11
160
+
161
+ ### Fixed
162
+ - **SHOWSTOPPER**: Tool registration changed from array to named Record — tools were being registered as "0", "1", "2" instead of "declare_intent", "map_context", etc. Agents could not call any tool by name.
163
+ - **CRITICAL**: `hivemind init` crash on npm install — `docs/` directory now included in `package.json#files`
164
+ - **CRITICAL**: System transform hook now accepts `model` parameter matching SDK contract
165
+ - **CRITICAL**: Legacy `.opencode` path in self-rate tool changed to `.hivemind/logs`
166
+ - **HIGH**: Double-counting turn increments — `incrementTurnCount` removed from `tool.execute.before` hook (kept only in `tool.execute.after`)
167
+ - **MEDIUM**: All 11 tools now accept `ToolContext` parameter matching SDK `execute(args, context)` signature
168
+
169
+ ### Changed
170
+ - Removed unused `zod` dependency from `package.json#dependencies` (SDK re-exports via `tool.schema.*`)
171
+ - Stale `.opencode/planning/` doc comment in `src/cli/init.ts` updated to `.hivemind/`
172
+
173
+ ## [1.5.0] - 2026-02-11
174
+
175
+ ### Added
176
+ - **Mems Brain** — Persistent, shelf-organized memory system for cross-session knowledge
177
+ - 3 new tools: `save_mem`, `list_shelves`, `recall_mems`
178
+ - Auto-mem on compaction: saves session summary to "sessions" shelf
179
+ - System prompt injection: mem count indicator
180
+ - Compaction context: injects recent mems for context preservation
181
+ - 40 new test assertions (Round 4)
182
+
183
+ ## [1.4.0] - 2026-02-11
184
+
185
+ ### Changed
186
+ - **BREAKING**: Migrated from `.opencode/planning/` to `.hivemind/` directory structure
187
+ - Plugin now creates `.hivemind/sessions/` for session state
188
+ - Added `.hivemind/10-commandments.md` (tool design reference)
189
+ - `.hivemind/plans/` for plan storage (not `.plan/plans/`)
190
+
191
+ ### Added
192
+ - 10 Commandments document for tool design principles
193
+ - `.hivemind/` directory structure with sessions, brain, plans, logs subdirectories
194
+ - Git hooks setup script (scripts/setup-git-hooks.sh)
195
+ - Pre-commit hook for enforcing atomic commits and session awareness
196
+
197
+ ### Fixed
198
+ - Path references throughout codebase, tests, documentation
199
+
200
+ ### Migration Guide
201
+ Existing projects using `.opencode/planning/` can manually move files:
202
+ 1. Create `.hivemind/` directory structure
203
+ 2. Move `.opencode/planning/` contents to `.hivemind/`
204
+ 3. Update `opencode.json` plugin registration if needed
205
+
8
206
  ## [1.3.0] - 2026-02-11
9
207
 
10
208
  ### Added
@@ -90,6 +288,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
90
288
  - Session lifecycle management
91
289
  - Planning directory structure (.opencode/planning/)
92
290
 
291
+ [2.3.0]: https://github.com/shynlee04/hivemind-plugin/compare/v2.2.0...v2.3.0
292
+ [2.2.0]: https://github.com/shynlee04/hivemind-plugin/compare/v2.1.0...v2.2.0
293
+ [2.1.0]: https://github.com/shynlee04/hivemind-plugin/compare/v2.0.0...v2.1.0
294
+ [2.0.0]: https://github.com/shynlee04/hivemind-plugin/compare/v1.6.0...v2.0.0
295
+ [1.6.0]: https://github.com/shynlee04/hivemind-plugin/compare/v1.5.0...v1.6.0
296
+ [1.5.0]: https://github.com/shynlee04/hivemind-plugin/compare/v1.4.0...v1.5.0
297
+ [1.4.0]: https://github.com/shynlee04/hivemind-plugin/compare/v1.3.0...v1.4.0
298
+ [1.3.0]: https://github.com/shynlee04/hivemind-plugin/compare/v1.2.1...v1.3.0
299
+ [1.2.1]: https://github.com/shynlee04/hivemind-plugin/compare/v1.2.0...v1.2.1
93
300
  [1.2.0]: https://github.com/shynlee04/hivemind-plugin/compare/v1.1.0...v1.2.0
94
301
  [1.1.0]: https://github.com/shynlee04/hivemind-plugin/compare/v1.0.0...v1.1.0
95
302
  [1.0.0]: https://github.com/shynlee04/hivemind-plugin/releases/tag/v1.0.0