@massu/core 1.16.2 → 2.0.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.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,164 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
10
10
  > redistributed under the **Apache License 2.0**. Full license + NOTICE:
11
11
  > `packages/core/assets/embedder/MODEL-LICENSE`.
12
12
 
13
+ ## [2.0.0] - 2026-07-21
14
+
15
+ **Breaking release.** The local database engine now defaults to Node's built-in
16
+ `node:sqlite` instead of the native `better-sqlite3`, and the minimum Node version is
17
+ raised to **22.13.0**. This ends the Node-ABI-mismatch failure class structurally — the
18
+ default install has no compiled native module to `dlopen`, so a Node upgrade can never
19
+ again silently break memory storage.
20
+
21
+ ### Changed
22
+
23
+ - **BREAKING: minimum Node is now `>=22.13.0`** (drops 20 and 21). `node:sqlite` ships
24
+ flag-free with FTS5 only from 22.13; earlier 22.x (22.0–22.12) are not supported. A
25
+ preflight check fails loudly with the required version if you run an older Node.
26
+ - **BREAKING: the default local DB engine is now `node:sqlite` (native-free)** (CR-69,
27
+ `plan-memory-system-to-100-percent` WS4 / Layer 2). Every database open routes through a
28
+ single adapter (`db-driver.ts`) that constructs Node's built-in SQLite — no native
29
+ compile, no ABI, no `prebuild-install`. `better-sqlite3` is retained as an **opt-in
30
+ fallback**: set `MASSU_DB_ENGINE=better-sqlite3` to route through the CR-65 self-healing
31
+ native loader instead. Storage format is unchanged and byte-compatible in both
32
+ directions — existing databases open as-is under either engine. Enforced by a dual-engine
33
+ parity test (derived from the live schema), a drift-guard, and pattern-scanner Check 46.
34
+ `massu doctor` now reports the active engine and proves it by constructing a DB and
35
+ running `SELECT 1`.
36
+
37
+ ### Migration
38
+
39
+ - Most installs need no action — a fresh `npm install -g @massu/core@2.0.0` on Node
40
+ `>=22.13` switches to `node:sqlite` automatically and reads your existing database
41
+ unchanged. If you must stay on the native engine (e.g. an environment pinned below Node
42
+ 22.13 that you cannot upgrade), set `MASSU_DB_ENGINE=better-sqlite3` — but the supported
43
+ path is to upgrade Node.
44
+
45
+ ### Infrastructure
46
+
47
+ - **G-6 anti-vacuity registration for this release's guard pile** (no `@massu/core` runtime
48
+ change, `plan-2026-07-21-g6-wave-2-unpushed-pile-registration`). Registers a can-fail proof
49
+ for every enforcement guard shipped by WS3 / Slice 5 (CR-67) / CR-68 / WS4 (CR-69) — 14
50
+ pattern-scanner shell fail-points (Checks 44/45/46) + 32 vitest source-plant proofs — plus
51
+ re-pins 3 stale non-guard exempts and hardens 3 T-3 symbol-grep predicates (Check 44 d/e →
52
+ AST call-site checks). Makes pre-push `[22/22]` (the G-6 anti-vacuity meta-gate) green.
53
+
54
+ ## [1.17.0] - 2026-07-21
55
+
56
+ The memory system is now feature-complete: cross-repo sharing and the opt-in file
57
+ renderer land here, both fail-closed and default-off. This is the last release on the
58
+ `better-sqlite3` engine and the last to support Node 20/21 — the next major (`2.0.0`)
59
+ switches the local database to Node's built-in `node:sqlite` and raises the Node floor.
60
+
61
+ ### Added
62
+
63
+ - **Cross-repo memory sharing — local-first, opt-in, fail-closed** (`plan-memory-system-to-100-percent`
64
+ Slice 5, CR-67). A durable memory can now travel from one repo to another, but **nothing crosses a
65
+ repo boundary without a human act on both sides, and nothing that crosses is ever treated as an
66
+ instruction.** Export is an explicit human `massu memory share` that produces a signed, secret-refusing
67
+ envelope (it refuses rather than redacts) written to `~/.massu/shared/`, outside every repo. The
68
+ receiving side never auto-applies: `massu memory accept` materializes the memory only after
69
+ **re-verifying the retained signed envelope bytes** (a stored "verified" boolean is never treated as
70
+ authority), and until then the item surfaces in recall as a zero-content pointer; once accepted it
71
+ surfaces as fenced, provenance-headed data. New CLI verbs: `massu memory review | accept | refuse |
72
+ share | trust` (accept/refuse are CLI-only — never a tool the model can invoke). Both opt-ins default
73
+ **OFF**, so a dormant install shares and mints nothing. Three-layer enforcement: code apply-gates +
74
+ `shared-memory-*` drift-guards + pattern-scanner Check 44.
75
+ - **Opt-in memory file-renderer** (`plan-memory-system-to-100-percent` WS3, CR-61). Massu can render
76
+ selected durable memories into a managed region of your memory files. It is **off by default**
77
+ (`memory.files.renderEnabled: false`) and the human always wins: the file on disk is the standing
78
+ source of truth, Massu **never writes a file it cannot prove it authored** (authorship is a per-install
79
+ keyed HMAC, never a public body-hash) and **never un-deletes a file the human deleted** — an absent
80
+ memory directory is a no-op. Tombstones live in the memory corpus, not the database.
81
+
82
+ ### Fixed
83
+
84
+ - **Memory ingestion no longer mints noise, and the writer only renders memory-worthy facts**
85
+ (`plan-memory-system-to-100-percent` WS3 prerequisites). A cluster of ingestion defects that would
86
+ have polluted the corpus the moment the renderer was enabled: Massu stopped mining tool-call
87
+ responses for spurious "decisions"; a hook double-fire that recorded every event twice was ended
88
+ (one settings layer now owns the hooks); `massu memory prune-noise` expires accumulated ingestion
89
+ noise (expire, never hard-delete); and the file-renderer now writes only memory-worthy fact types,
90
+ never raw session telemetry.
91
+
92
+ ### Infrastructure
93
+
94
+ - **CR-68 — every session handoff must be turn-key** (internal governance; no shipped `@massu/core`
95
+ runtime change). A `RECAP`/`HANDOFF` must carry a Next-Session Runbook that spells out Vehicle,
96
+ Steps, Stop gates, and a verifiable Acceptance check per open item — never a bare "Operator TODO"
97
+ list. Enforced by a completeness script + drift-guard + pattern-scanner Check 45 (VR-HANDOFF).
98
+ - **CR-62 — a bug the machine finds produces the same artifacts as one a human reports** (internal
99
+ governance). Any fix that closes a silent-failure or data-loss class now ships an incident doc, a
100
+ drift-guard, and a memory entry in the same push, enforced at pre-push (VR-INCIDENT-COVERAGE) —
101
+ closing the class where audit-discovered defects were fixed and forgotten with no durable trail.
102
+
103
+ ## [1.16.3] - 2026-07-15
104
+
105
+ ### Fixed
106
+
107
+ - **Cloud sync no longer silently discards large sessions, and the `cloud.requestTimeoutMs`
108
+ knob actually works** (`plan-2026-07-20-cloud-sync-timeout`, incident 2026-07-20). A
109
+ session with many observations produces a large `/sync` payload; a 423-observation
110
+ payload measured ~9.2 s against the live ingest, over the 8 s per-request timeout — and
111
+ the client does not retry a timeout, so every drain failed, re-queued, and grew the queue
112
+ until the retry-limit shredder permanently discarded payloads (83 `cloud_sync_giveup`
113
+ events, real session/observation copies lost). The documented `cloud.requestTimeoutMs`
114
+ remedy was itself unusable: the key was absent from `CloudConfigSchema` (zod strips
115
+ unknown keys, so it never reached the reader), and `cloud.enabled` used a zod
116
+ `.default(false)` that overrode the key-triggered auto-enable via object spread — so
117
+ merely declaring a `cloud:` block to tune the timeout silently turned sync **off**. The
118
+ default per-request timeout is raised 8 s → 15 s (inside the 20 s deadline),
119
+ `requestTimeoutMs` is now a real schema key (capped at the deadline), and `enabled` is
120
+ decided after the spread so an explicit `false` is still honoured. Drift-guard:
121
+ `cloud-config-knobs.test.ts` (mutation-verified).
122
+ - **Native SQLite engine now self-heals on a Node ABI mismatch, and `massu doctor` can no
123
+ longer lie about it** (`plan-massu-resilience-layer1`, incident 2026-07-12, CR-65).
124
+ `better-sqlite3` is a native module compiled for one Node ABI; installing under one Node
125
+ major and running under another made its binary `dlopen`-fail lazily inside the `Database`
126
+ constructor. Two defects fell out: (1) DB-touching commands died — on one build
127
+ `consolidate --dry-run --json` printed the raw `NODE_MODULE_VERSION` error and **exited 0**
128
+ (silently-dead memory); (2) `massu doctor` reported "better-sqlite3 loads correctly" because
129
+ it only imported the JS wrapper (the native load is lazy). Now every load routes through a
130
+ single SSOT loader that, on an ABI failure, **rebuilds the engine for the Node you are
131
+ actually running** (via `prebuild-install` → `node-gyp`, driven by `process.execPath`,
132
+ cross-process-locked), retries once, and otherwise fails LOUD with a structured error and a
133
+ one-command remedy — never swallowed, never exit 0. `massu doctor` now actually constructs a
134
+ DB and runs `SELECT 1` (sharing one probe with server startup), and a new **`massu heal`**
135
+ command (`massu heal --check` is non-mutating) rebuilds on demand. Hooks route through the
136
+ loader but never rebuild (5 s budget). Heal events are recorded to
137
+ `~/.massu/native-heal-events.jsonl`.
138
+ - **Config templates can no longer silently ship `verification.<lang>` commands that disagree
139
+ with the detection source-of-truth** (`plan-swift-ios-config-template-drift`, incident
140
+ 2026-07-18, CR-66). `massu init` wrote a scaffolded config's per-language test/build/lint
141
+ command block from two independent places — the code map (`vr-command-map.ts:getVRCommands`)
142
+ and each language template's hand-copied YAML — with nothing binding them, so they drifted
143
+ (`go-chi` shipped a `gofmt` syntax step the map lacked and dropped `go build ./...`;
144
+ `rails`/`spring` added commands the map had no case for). `vr-command-map.ts` is now the single
145
+ authoring site: a filesystem-derived drift-guard asserts every template's block equals the map
146
+ (dir-normalized, null-stripped), every intentional divergence is recorded in one self-pruning
147
+ allowlist that must actually diverge, and a pattern-scanner check mirrors it — so a template
148
+ block that disagrees with the map, or a new template that drifts, fails the build. No shipped
149
+ `massu init` output changed (the agreeing templates are locked, not rewritten).
150
+
151
+ ### Infrastructure
152
+
153
+ - Internal-only bookkeeping (no shipped `@massu/core` runtime change): SEC-1 license-signing key
154
+ rotation recorded as FULLY CLOSED — the leaked key was purged from git history (`git filter-repo
155
+ --replace-text`, force-pushed main + all tags, remote verified clean), the local private key
156
+ shredded, and only a future adoption-gated fingerprint-allowlist shrink remains. `.mcp.json` pin
157
+ bumped to `@massu/core@1.16.2`, and the memory-system roadmap adds WS0 (retro-on-discovery) as
158
+ STEP 0.
159
+ - Test-suite flake eliminated (test-only; no shipped code): 13 tests wrote scratch files under
160
+ `packages/core/src`, which intermittently raced the source-tree walkers under the coverage run
161
+ (ENOENT crash). All scratch moved to the OS temp dir, and a mutation-tested drift-guard now makes
162
+ writing scratch under `src` impossible to reintroduce.
163
+ - G-6 anti-vacuity registry (internal gate work; no shipped `@massu/core` runtime change),
164
+ `plan-2026-07-15-wave-1-g6-anti-vacuity-registry`: the meta-gate that proves every OTHER gate can
165
+ actually fail. Wave 1a covered the 108 shell fail-points; Wave 1b extends it to the full
166
+ structurally-discovered guard universe — an AST discoverer over every vitest/shell/eslint
167
+ enforcement guard, a completeness gate + validated `exempt` allowlist, and a per-kind real-tree
168
+ can-fail oracle. All 472 guard candidates are ruled (proven can-fail or cited-exempt); the P7b
169
+ harness mutation-tests the machinery itself; enforced in CI.
170
+
13
171
  ## [1.16.2] - 2026-07-15
14
172
 
15
173
  ### Security