pi-braid 0.41.1 → 0.41.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.
package/build-info.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.41.1",
4
- "sha": "a585e2e45dac38920c4269a23409355da8266c2d",
5
- "shaShort": "a585e2e",
3
+ "version": "0.41.2",
4
+ "sha": "b46aa4f474e84f5394ddcbc4feb549181b0c6c8e",
5
+ "shaShort": "b46aa4f",
6
6
  "branch": "detached",
7
7
  "dirty": false,
8
- "packedAt": "2026-10-25T06:35:32.607Z"
8
+ "packedAt": "2026-10-25T10:56:25.509Z"
9
9
  }
package/docs/FLEET.md CHANGED
@@ -115,6 +115,27 @@ Opening an older store migrates it and records the new version, and the previous
115
115
  build keeps its access: a rollback can open and write a store this build created,
116
116
  because the column it needs was kept rather than dropped.
117
117
 
118
+ ## Node versions
119
+
120
+ The journal is reached through one module,
121
+ [`../scripts/fleet/journal.mjs`](../scripts/fleet/journal.mjs), which is also
122
+ where the fleet answers what importing SQLite costs. `node:sqlite` says it is
123
+ experimental on stderr, once per process, at the import: true of every 24 release
124
+ before 24.15, and no longer true from 24.15, where the module became a release
125
+ candidate and stopped saying it. The floor `engines` declares is 24.0.0, so the
126
+ answer is installed at that import - the warning withheld by its own type and
127
+ text, for the length of the import only, with the emitter restored in a `finally`
128
+ so a warning from any other module still reaches stderr. It is not done with
129
+ `--disable-warning` or `NODE_OPTIONS`, which remove the whole
130
+ `ExperimentalWarning` class for the process and hide those along with it, and it
131
+ cannot be done with a `warning` listener at all - Node's default printer is
132
+ registered by the runtime and prints whether or not another listener exists.
133
+
134
+ Both workflows run Node 24, the line `engines` declares, so the gate that reports
135
+ red and the gate that decides a release see the same runtime. The answer costs
136
+ nothing on 24.15 and above, and goes with its test once the whole supported line
137
+ is past it.
138
+
118
139
  ## Where the code is
119
140
 
120
141
  | File | What it owns |
package/docs/LOCAL_DEV.md CHANGED
@@ -11,7 +11,7 @@ For one-time setup, the full install-path catalog, and module toggling see
11
11
 
12
12
  | Tool | Version | Verify |
13
13
  | ---- | ------------- | -------------------------- |
14
- | Node | ≥ 22.19 | `node --version` |
14
+ | Node | ≥ 24.0 | `node --version` |
15
15
  | npm | bundled | `npm --version` |
16
16
  | git | any | `git --version` |
17
17
  | pi | peer-resolved | `which pi && pi --version` |
package/docs/SETUP.md CHANGED
@@ -26,7 +26,7 @@ Complete reference for installing braid, configuring pi to load it, enabling com
26
26
 
27
27
  | Tool | Version | Verify |
28
28
  | --------------- | ------------- | -------------------------- |
29
- | Node.js | ≥ 22.19 | `node --version` |
29
+ | Node.js | ≥ 24.0 | `node --version` |
30
30
  | pi-coding-agent | peer-resolved | `which pi && pi --version` |
31
31
  | npm | bundled | `npm --version` |
32
32
  | git | any recent | `git --version` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.41.1",
3
+ "version": "0.41.2",
4
4
  "description": "Metacognitive extension suite for pi-coding-agent: enforcement, memory, reasoning, self-improvement, and structured cognitive signals.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -102,6 +102,6 @@
102
102
  "author": "kifirkin",
103
103
  "license": "MIT",
104
104
  "engines": {
105
- "node": ">=22.19.0"
105
+ "node": ">=24.0.0"
106
106
  }
107
107
  }
@@ -25,7 +25,61 @@
25
25
  import { createHash } from "node:crypto";
26
26
  import { mkdirSync } from "node:fs";
27
27
  import { dirname, isAbsolute, join, resolve } from "node:path";
28
- import { DatabaseSync } from "node:sqlite";
28
+
29
+ /**
30
+ * The fleet's only way in to SQLite, and the answer to what its import costs.
31
+ *
32
+ * `node:sqlite` says it is experimental on stderr, once per process, at the moment
33
+ * it is imported: true of every 24 release up to 24.14, and no longer true from
34
+ * 24.15, where the module became a release candidate and the warning stopped
35
+ * (measured: 24.0.0 and 24.14.0 warn, 24.15.0 and 24.22.1 are silent). The floor
36
+ * `engines` declares is 24.0.0, so without this block a user on the floor meets a
37
+ * warning nobody documented, and every command that asserts an empty stderr - the
38
+ * fleet's own arms among them - fails on a healthy run. Once Node's whole supported
39
+ * line is past 24.15 this block answers nothing and can be deleted with its test.
40
+ *
41
+ * Every process that opens a journal pays it: the four commands, the supervisor
42
+ * they start, the drivers, and the guard extension. One import, answered once, is
43
+ * why they do not each need their own handling - `DatabaseSync` is re-exported for
44
+ * the guard rather than imported there a second time.
45
+ *
46
+ * The answer is matched on the warning's own type and text, and it lasts for the
47
+ * length of that import only: the original emitter is restored in `finally`, so a
48
+ * warning from any other module - another experimental API, a deprecation -
49
+ * reaches stderr exactly as it would without this file. The flags that would also
50
+ * remove this line, `--disable-warning` and `NODE_OPTIONS`, silence the whole
51
+ * ExperimentalWarning class for the entire process, which would hide those.
52
+ *
53
+ * A `warning` listener is not an alternative: it cannot suppress anything. Node's
54
+ * default printer is registered by the runtime, and it prints whether or not
55
+ * another listener exists (measured on 22.19.0, 22.23.4 and 24.0.0 - the listener
56
+ * sees the warning and stderr gets it too), so the emitter call itself is answered
57
+ * here, inside an import nobody else can route around.
58
+ */
59
+ const SQLITE_WARNING_TYPE = "ExperimentalWarning";
60
+ const SQLITE_WARNING_TEXT = "SQLite is an experimental feature and might change at any time";
61
+
62
+ /** The runtime's emitter, with the SQLite import's one warning withheld. */
63
+ function answerSqliteWarning(emit) {
64
+ return function (warning, type, ...rest) {
65
+ const text = typeof warning === "string" ? warning : warning?.message;
66
+ const name = type ?? warning?.name;
67
+ if (text === SQLITE_WARNING_TEXT && name === SQLITE_WARNING_TYPE) return undefined;
68
+ return emit.call(process, warning, type, ...rest);
69
+ };
70
+ }
71
+
72
+ async function importSqlite() {
73
+ const emit = process.emitWarning;
74
+ process.emitWarning = answerSqliteWarning(emit);
75
+ try {
76
+ return await import("node:sqlite");
77
+ } finally {
78
+ process.emitWarning = emit;
79
+ }
80
+ }
81
+
82
+ export const { DatabaseSync } = await importSqlite();
29
83
 
30
84
  /**
31
85
  * The shape a store has once `openJournal` returns.
@@ -97,9 +97,8 @@
97
97
 
98
98
  import { appendFileSync, existsSync } from "node:fs";
99
99
  import { join, resolve } from "node:path";
100
- import { DatabaseSync } from "node:sqlite";
101
100
 
102
- import { effectKey, journalPath, replayPolicy } from "./journal.mjs";
101
+ import { DatabaseSync, effectKey, journalPath, replayPolicy } from "./journal.mjs";
103
102
 
104
103
  /** The names the child reads. `off` is the switch, not an identifier. */
105
104
  export const GUARD_ENV = {