memhouse 0.7.1 → 0.9.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 (37) hide show
  1. package/README.md +79 -43
  2. package/bin/memhouse.js +153 -147
  3. package/editors/antigravity.js +7 -15
  4. package/editors/cursor.js +18 -24
  5. package/editors/goose.js +9 -21
  6. package/editors/index.js +19 -70
  7. package/editors/opencode.js +6 -15
  8. package/editors/sqlite.js +74 -0
  9. package/editors/windsurf.js +3 -3
  10. package/editors/zed.js +10 -15
  11. package/memhouse/COMPETITION.md +9 -5
  12. package/memhouse/DESIGN.md +29 -30
  13. package/memhouse/RESUME-AND-UPDATE.md +7 -10
  14. package/memhouse/delivery/AGENT-INSTALL.md +15 -13
  15. package/memhouse/delivery/PROMPT.md +7 -9
  16. package/memhouse/delivery/kernel-install.md +18 -33
  17. package/memhouse/delivery/plugin/skills/search/SKILL.md +25 -38
  18. package/memhouse/delivery/plugin/skills/sessions/SKILL.md +15 -28
  19. package/memhouse/delivery/plugin/skills/sql/SKILL.md +23 -36
  20. package/memhouse/host.js +1 -1
  21. package/memhouse/house/HOUSE.md +74 -0
  22. package/memhouse/house/house.js +170 -0
  23. package/memhouse/{per-member/schema-member.sql.tpl → house/schema.sql.tpl} +8 -11
  24. package/memhouse/resume.js +1 -1
  25. package/memhouse/self-update.js +4 -4
  26. package/memhouse/server/queries.js +8 -2
  27. package/memhouse/shipper/ship.js +30 -37
  28. package/package.json +2 -6
  29. package/memhouse/per-member/INSTALL.md +0 -228
  30. package/memhouse/per-member/PLAN.md +0 -174
  31. package/memhouse/per-member/PROVISIONING.md +0 -177
  32. package/memhouse/per-member/README.md +0 -48
  33. package/memhouse/per-member/SCHEMA.md +0 -120
  34. package/memhouse/per-member/SHARING.md +0 -149
  35. package/memhouse/per-member/provision.js +0 -297
  36. package/memhouse/per-member/rooms.js +0 -252
  37. package/memhouse/per-member/schema-merge.sql.tpl +0 -24
package/README.md CHANGED
@@ -1,19 +1,31 @@
1
1
  # memhouse
2
2
 
3
- Long-term memory for coding agents. memhouse reads the session transcripts your
4
- editors already write to disk — **17 of them**, Claude Code, Codex, Cursor, Zed,
5
- Copilot, Gemini CLI and the rest — parses them locally, and ships typed rows into
6
- ClickHouse. Nothing is proxied or intercepted. Then you can search every past
7
- session, see what it cost, and let an agent query its own history.
3
+ **Claude Code deletes your transcripts after 30 days.** (`cleanupPeriodDays`,
4
+ default 30 — session files are removed at startup.) Measured on the machine this
5
+ was built on: months of daily use, and the oldest surviving local transcript was
6
+ nine days old. Every problem you solved before that exists nowhere — unless
7
+ something durable was keeping it.
8
+
9
+ memhouse is that something. It reads the session transcripts your editors already
10
+ write to disk — **17 of them**: Claude Code, Codex, Cursor, Zed, Copilot, Gemini
11
+ CLI and the rest — parses them locally, and ships typed rows into a ClickHouse
12
+ **you own**. Nothing is proxied, intercepted, or sent to anyone's cloud. Then you
13
+ can search every past session, see what it cost, resume the conversation that
14
+ solved this before, and let an agent query its own history.
15
+
16
+ And every row says where it came from, in a way no client can fake: `user_id` is
17
+ stamped **by the server** (`MATERIALIZED currentUser()`, async inserts pinned off
18
+ so the stamp cannot be skipped) and `host` is a fingerprint minted once per
19
+ install. A team pointed at one house is a team memory with real attribution — not
20
+ a label somebody's client claimed.
8
21
 
9
22
  ```bash
10
- npm install -g memhouse --allow-scripts=better-sqlite3
23
+ npm install -g memhouse
11
24
  memhouse onboard
12
25
  ```
13
26
 
14
- That is the whole install. `onboard` finds your editors, sets up a house, ships,
15
- and starts the dashboard. **Don't drop `--allow-scripts`** — see
16
- [below](#the-allow-scripts-flag).
27
+ That is the whole install — no flags, nothing to compile. `onboard` finds your
28
+ editors, sets up a house, ships, and starts the dashboard.
17
29
 
18
30
  **On most Linux distros that first line needs `sudo`.** A distro-packaged Node puts
19
31
  its global prefix under `/usr`, which you do not own, so npm stops with `EACCES`.
@@ -22,7 +34,7 @@ Ubuntu machine:
22
34
 
23
35
  ```bash
24
36
  ls -ld "$(npm prefix -g)" # root-owned? use sudo. Owned by you? do NOT — see EACCES below
25
- sudo npm install -g memhouse --allow-scripts=better-sqlite3
37
+ sudo npm install -g memhouse
26
38
  ```
27
39
 
28
40
  If the prefix is yours (Homebrew, fnm, nvm, volta), `sudo` is the wrong fix and
@@ -36,6 +48,13 @@ makes it worse — [EACCES on install](#eacces-on-install) tells them apart.
36
48
  memhouse deploy --local # a loopback-bound ClickHouse, then install and ship
37
49
  ```
38
50
 
51
+ The house it stands up is **yours by name**: its superuser defaults to your OS
52
+ username (`polat`, not `memhouse_root` — override with `--user`), and the house
53
+ database defaults to the same name, so your memory lives at `polat.messages` and
54
+ `WHERE user_id = 'polat'` reads like it should. The name
55
+ and password are fixed when the data volume is first initialised, like any ClickHouse
56
+ container, and reused on every redeploy after that.
57
+
39
58
  Otherwise point at one you already run, or hand the SQL to whoever administers it:
40
59
 
41
60
  ```bash
@@ -142,13 +161,11 @@ memhouse update # upgrade, restart the daemons, check the house schem
142
161
  memhouse update --check # compare versions, change nothing
143
162
  ```
144
163
 
145
- A bare `npm i -g memhouse@latest` does one third of the job. It does not re-pass
146
- `--allow-scripts=better-sqlite3`, so the five SQLite adapters go quiet; it does not
147
- restart the daemons, which keep parsing with the code they booted with (a shipper here
148
- once ran 1d16h out of a directory that had been *moved*); and it does not check whether
149
- your house predates a room the new shipper needs. `update` does all three, and from a
150
- checkout it rebuilds `public/` — otherwise `git pull` serves you the previous release's
151
- dashboard forever.
164
+ A bare `npm i -g memhouse@latest` does half the job. It does not restart the daemons,
165
+ which keep parsing with the code they booted with (a shipper here once ran 1d16h out of
166
+ a directory that had been *moved*); and it does not check whether your house predates a
167
+ room the new shipper needs. `update` does both, and from a checkout it rebuilds
168
+ `public/` — otherwise `git pull` serves you the previous release's dashboard forever.
152
169
 
153
170
  The daemons also notice on their own: each one compares the installed version against
154
171
  what it booted with and hands over — exiting under systemd/launchd so the supervisor
@@ -157,19 +174,30 @@ immediate.
157
174
 
158
175
  ## How your memory is stored
159
176
 
160
- **One house, one set of rooms per member.** You own `sessions_<you>`,
161
- `messages_<you>`, `tool_calls_<you>` in the `mem` database, and hold grants on
162
- those and nothing else. Isolation is a grant that is simply *absent*, so it fails
163
- closed — no row policy that has to be right on every table and every read path.
177
+ **A house is a database; its rooms are three shared tables.** `sessions`, `messages`
178
+ and `tool_calls` live in whatever database you point at — your own name by default
179
+ (`polat.messages`), a team's (`team_a.messages`), even `default`. Everyone in the
180
+ house writes into the same tables with their own credential, and every row says where
181
+ it came from: `user_id`, stamped by the server (`MATERIALIZED currentUser()`, with
182
+ async inserts pinned off so the stamp cannot be skipped), and `host`, the machine's
183
+ install fingerprint.
184
+
185
+ `WHERE user_id = 'alice'` is one person. `WHERE host = '…'` is one machine. No filter
186
+ is the whole house — which is exactly what a team dashboard wants.
164
187
 
165
- All of *your* machines ship into *your* rooms; the `host` column tells them apart.
166
- Another member's machines never do. A team-wide read is a `Merge` room
167
- (`all_sessions`) plus a `GRANT`, which narrows to whatever the caller can already
168
- see. Sharing a whole room needs no operator.
188
+ Sharing is not a feature bolted on top; it IS the house. A team makes a database,
189
+ grants each person `ALL` on it, and their shippers all write into the same rooms:
169
190
 
170
- The member name comes from the server — `SELECT currentUser()` — not from your
171
- config. A client that could name its own member could write into someone else's
172
- rooms.
191
+ ```sql
192
+ CREATE DATABASE team_a;
193
+ CREATE USER alice IDENTIFIED BY '…';
194
+ GRANT ALL ON team_a.* TO alice; -- repeat per housemate
195
+ ```
196
+
197
+ `ALL` on your own house reaches nothing outside it — the database is the boundary,
198
+ which is also why joining a ClickHouse someone else runs (a kernel's, a team's) needs
199
+ no negotiation beyond a database and a credential. Housemates are collaborators;
200
+ groups that should not see each other get separate houses.
173
201
 
174
202
  ### Imported history is protected
175
203
 
@@ -192,24 +220,22 @@ has it wrong, so an old house cannot be corrupted by a new shipper.
192
220
 
193
221
  ## Troubleshooting
194
222
 
195
- ### The `--allow-scripts` flag
196
-
197
- Five adapters — **cursor, zed, opencode, goose, antigravity** — read sessions out
198
- of SQLite files, and `better-sqlite3` builds its native binding from an install
199
- script. npm 12 blocks install scripts by default, so without the flag those five
200
- read nothing and you ship a partial history.
223
+ ### An editor reads zero sessions
201
224
 
202
- (This said six and named windsurf, which is wrong: windsurf lists its sessions over
203
- language-server RPC and touches SQLite only to read a usage key, so a dead binding
204
- costs it numbers, not sessions. `editors/index.js` has the real list.)
225
+ Five adapters — **cursor, zed, opencode, goose, antigravity** — read sessions out of
226
+ SQLite files. That used to mean `better-sqlite3`, whose native binding is built by
227
+ an npm install script; npm 12 blocks install scripts by default, so a plain install left
228
+ all five reading nothing and the fix was a flag
229
+ (`--allow-scripts=better-sqlite3`) you had to re-type on every upgrade. SQLite is
230
+ `node:sqlite` now — part of Node — so that failure class is gone along with the flag.
205
231
 
206
- It is not silent: `memhouse discover` and `memhouse doctor` both name the skipped
207
- adapters. The other twelve adapters keep working.
208
-
209
- `npx` takes the same flag, before the package name:
232
+ What can still go wrong is one store at a time: a `state.vscdb` locked by a running
233
+ editor, a corrupt file, a schema a new editor release changed. None of it is silent —
234
+ `memhouse discover` and `memhouse doctor` both name the skipped adapter and say why,
235
+ and the other sixteen keep working.
210
236
 
211
237
  ```bash
212
- npx --allow-scripts=better-sqlite3 -y memhouse discover
238
+ npx -y memhouse discover # no flags here either
213
239
  ```
214
240
 
215
241
  ### `EACCES` on install
@@ -244,7 +270,7 @@ A rootless podman house has the same problem for the same reason, and
244
270
  ## Working from a checkout
245
271
 
246
272
  ```bash
247
- npm install # the repo's allowScripts field covers the binding
273
+ npm install # two runtime deps, no build step
248
274
  node bin/memhouse.js …
249
275
  npm test # syntax gate + unit checks
250
276
  ```
@@ -275,6 +301,16 @@ In constellation terms (`TERMINOLOGY.md`) memhouse is an **agency**: a **house**
275
301
  alone would hold; the shipper is what makes it act. It competes with
276
302
  memory-house; if it wins, it becomes memory-house v4.
277
303
 
304
+ ## What's supported
305
+
306
+ | Surface | Status |
307
+ |---|---|
308
+ | macOS | primary — developed and driven here daily |
309
+ | Linux | real — installs, ships, `service install` (systemd `--user`), rootless podman `deploy --local`; exercised on Debian and Ubuntu machines |
310
+ | Windows | **untested** — the adapters declare Windows paths but no one has run a single install; treat it as unknown until this row changes |
311
+ | ClickHouse | 25.11 and 26.x, both in CI; 26.2+ needs no flags, 25.x needs the text-index flag the shipper already passes |
312
+ | Node | **≥ 24** — SQLite comes from `node:sqlite`, which is stable in 24. It works flagless on 22.13+ but prints `ExperimentalWarning` on every command (measured on v22.23.2), and Node 20 is past EOL. There is no native dependency and no build step at any version. |
313
+
278
314
  ## Heritage & license
279
315
 
280
316
  Built on [agentlytics](https://github.com/f/agentlytics) by Fatih Kadir Akın (MIT)