latticesql 4.2.0 → 4.2.2

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.
@@ -17,6 +17,7 @@ Complete reference for `lattice.config.yml` — the YAML schema config format in
17
17
  - [Multiple entities](#multiple-entities)
18
18
  - [Programmatic config API](#programmatic-config-api)
19
19
  - [Complete example](#complete-example)
20
+ - [Troubleshooting](#troubleshooting)
20
21
 
21
22
  ---
22
23
 
@@ -451,3 +452,29 @@ without `fts` are still searchable via the LIKE fallback. Indexes are created
451
452
  **only** for opt-in tables, so a library consumer with no `fts` config incurs
452
453
  no index and no write-path overhead. See `docs/api-reference.md` →
453
454
  _Full-text search_ for the `fullTextSearch` API.
455
+
456
+ ## Troubleshooting
457
+
458
+ ### The local SQLite engine auto-rebuilds when the Node runtime changes
459
+
460
+ The local SQLite backend is powered by the `better-sqlite3` native module,
461
+ whose compiled binary is pinned to the Node ABI present when it was installed.
462
+ If your Node version later changes — a package-manager upgrade, a version
463
+ switch via a Node manager, or simply a different Node in CI than on your
464
+ machine — that prebuilt binary no longer matches the runtime.
465
+
466
+ Lattice handles this transparently: the SQLite engine is loaded the first time
467
+ a workspace opens, and when it detects an ABI mismatch it **automatically
468
+ rebuilds `better-sqlite3` for the current runtime** in-process, then continues.
469
+ You'll see a single line on stderr while the rebuild runs (so a slow rebuild
470
+ isn't a silent hang); on success there's nothing else to do.
471
+
472
+ An error is surfaced only as a last resort — when the module isn't installed at
473
+ all, or the automatic rebuild can't complete (no build toolchain, no network to
474
+ fetch a prebuild, etc.). In that case the message tells you exactly what to run:
475
+ `npm rebuild better-sqlite3` (or a clean reinstall), then retry.
476
+
477
+ To disable the automatic rebuild (e.g. in a sandboxed or read-only environment
478
+ where you'd rather manage the native module yourself), set the environment
479
+ variable `LATTICE_SQLITE_NO_AUTOREBUILD=1`. With it set, an ABI mismatch raises
480
+ the same actionable error instead of attempting a rebuild.
@@ -92,6 +92,16 @@ A bare `new Lattice(path)` does **not** auto-render (`_scheduleAutoRender`
92
92
  early-returns when no output dir is set) — call `render(dir)` / `reconcile(dir)`
93
93
  manually, or opt in with `enableAutoRender(dir)`.
94
94
 
95
+ On open, a staleness gate decides whether the existing tree can be reused or must
96
+ be re-rendered. Alongside the data cursor (has anything the tree depends on
97
+ changed?), the manifest records a **render-output format version**. When a
98
+ release changes how the tree is derived or templated — i.e. the bytes a clean
99
+ render produces for unchanged data — that version is bumped, and the gate treats
100
+ any workspace whose manifest records an older version as stale. The result is a
101
+ **one-time full re-render on the first open after upgrading**, so a render-logic
102
+ fix reaches workspaces rendered by an older version automatically; once the
103
+ manifest is re-stamped, subsequent opens skip again when nothing has changed.
104
+
95
105
  ## File loopback (3.4)
96
106
 
97
107
  When the GUI is serving a workspace, editing a rendered `.md` file on disk is automatically captured back into the database through the normal write path — so the change lands in the changelog (versioned/undoable) and appears live in the GUI, exactly as if the edit had been made there. Structured frontmatter and body `key: value` fields round-trip automatically; edits that can't be safely parsed (free-form or custom renders) are surfaced as a notice rather than guessed at, so a lossy render can't corrupt a row. Render echoes are suppressed via the manifest, so there is no write loop.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "latticesql",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "Persistent structured memory for AI agent systems — pluggable SQLite or Postgres backend, LLM context bridge",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",