nox-mem 3.2.1 → 3.4.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/README.md +28 -6
- package/dist/__tests__/fts-or-fallback.test.js +115 -0
- package/dist/__tests__/reindex-dedup.test.js +80 -0
- package/dist/__tests__/reindex-safety.test.js +116 -0
- package/dist/__tests__/session-distill-sources.test.js +98 -0
- package/dist/__tests__/telemetry-per-chunk.test.js +110 -0
- package/dist/__tests__/temporal-filter.test.js +117 -0
- package/dist/api-server.js +43 -2
- package/dist/db.js +55 -10
- package/dist/doctor.js +107 -29
- package/dist/index.js +59 -9
- package/dist/lib/dates.js +98 -0
- package/dist/lib/db-path.js +45 -0
- package/dist/lib/op-audit.js +19 -12
- package/dist/lib/reranker.js +4 -1
- package/dist/mcp-server.js +9 -1
- package/dist/reindex-errors.js +26 -0
- package/dist/reindex.js +106 -23
- package/dist/search.js +98 -18
- package/dist/session-distill.js +73 -24
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -189,8 +189,11 @@ All destructive operations (reindex, consolidate, compact, crystallize, kg-prune
|
|
|
189
189
|
After install, verify the engine is healthy:
|
|
190
190
|
|
|
191
191
|
```bash
|
|
192
|
-
#
|
|
193
|
-
|
|
192
|
+
nox-mem doctor # Core must be ✅/⚠️; ⚪ under "Optional integrations" is fine
|
|
193
|
+
nox-mem doctor --quiet # scripts: prints only core problems, exits 1 if one failed
|
|
194
|
+
|
|
195
|
+
# Start the API server
|
|
196
|
+
nox-mem-api &
|
|
194
197
|
|
|
195
198
|
# Check vector coverage (should be close to 1.0). Code default port is 18800.
|
|
196
199
|
curl -s "http://127.0.0.1:${NOX_API_PORT:-18800}/api/health" | jq .vectorCoverage
|
|
@@ -204,17 +207,36 @@ A `vectorCoverage` value below 0.99 means some chunks are not yet embedded — r
|
|
|
204
207
|
|
|
205
208
|
```
|
|
206
209
|
nox-mem search "query" — hybrid search (FTS5 + semantic + RRF)
|
|
207
|
-
nox-mem
|
|
208
|
-
nox-mem
|
|
210
|
+
nox-mem search "q" --as-of 2026-05-01 — time-travel: chunks that existed then
|
|
211
|
+
nox-mem search "q" --changed-since 7d — recency window (15m, 2h, 7d, 1w or ISO)
|
|
212
|
+
NOX_FTS_OR_FALLBACK=auto|on|off — FTS5 OR retry (stopwords dropped) when the AND query finds nothing; auto (default) = only when no GEMINI_API_KEY/OPENAI_API_KEY is set, so natural-language questions work on keyless installs and keyed setups are unchanged
|
|
213
|
+
nox-mem answer "question" — grounded answer with citations (needs GEMINI_API_KEY)
|
|
214
|
+
nox-mem ingest <file> — ingest a markdown or entity file (one file per call)
|
|
215
|
+
nox-mem reindex — rebuild the index from $OPENCLAW_WORKSPACE (see warning below)
|
|
209
216
|
nox-mem vectorize — embed any unembedded chunks
|
|
210
217
|
nox-mem stats — chunk/entity/vector counts
|
|
211
218
|
nox-mem kg-build — extract knowledge graph entities
|
|
212
219
|
nox-mem reflect — surface high-salience insights
|
|
213
|
-
|
|
214
|
-
|
|
220
|
+
nox-mem-api — start HTTP API on $NOX_API_PORT (code default 18800)
|
|
221
|
+
nox-mem-mcp — start MCP server over stdio (20 tools, for agents)
|
|
222
|
+
nox-mem doctor — health check (core + optional integrations)
|
|
215
223
|
nox-mem --help — full command reference
|
|
216
224
|
```
|
|
217
225
|
|
|
226
|
+
Wire the MCP server into Claude Code:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
claude mcp add nox-mem -e NOX_DB_PATH="$HOME/.nox-mem/nox.db" -e GEMINI_API_KEY="$GEMINI_API_KEY" -- nox-mem-mcp
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
The temporal filter is also on HTTP (`?as_of=` / `?changed_since=` on `/api/search`, or the same keys in a POST body) and MCP (`as_of` / `changed_since` on `nox_mem_search`). It is a hard SQL pre-filter on `created_at` / `updated_at` (ingestion time), not a ranking boost. `as_of` answers *which chunks existed then*, not *what they said then*: there is no version history, so a chunk edited after the date comes back with its current text. A bare date means the whole day in UTC (`--as-of 2026-05-01` includes 23:59 that day; `--changed-since 2026-05-01` starts at 00:00); a time without an offset is read as UTC. An unparseable date is an error on every surface (exit 2 / HTTP 400 / MCP `isError`), never a silently unfiltered search.
|
|
233
|
+
|
|
234
|
+
> ⚠️ **`reindex` rebuilds only from `$OPENCLAW_WORKSPACE/memory` and `/shared`** (default workspace `/root/.openclaw/workspace`). If that source is missing or empty while the DB holds chunks, it **refuses before touching the DB**; if the rebuild would drop more than 10% of the chunks, it refuses before deleting anything (`NOX_REINDEX_MIN_RETENTION_RATIO`, override `NOX_REINDEX_ALLOW_WIPE=1`). Chunks ingested from outside the workspace are still treated as orphans by a reindex that does run. Preview with `nox-mem reindex --dry-run`. On a standalone install that adds notes with `nox-mem ingest <file>` you normally do not need `reindex`.
|
|
235
|
+
|
|
236
|
+
> **Where the database lives.** `NOX_DB_PATH` if set; else `$OPENCLAW_WORKSPACE/tools/nox-mem/nox-mem.db`; else an existing `<package>/nox-mem.db` (installs from ≤3.4 keep working — with a warning if it sits inside `node_modules`, which `npm update -g` replaces); else `~/.nox-mem/nox.db`. `nox-mem doctor` prints the resolved path.
|
|
237
|
+
|
|
238
|
+
> Without embeddings, search is FTS5 keyword search, which requires every term to match: prefer keywords (`"zebra migration"`) over full questions (`"when was the zebra migration?"`) until you run `vectorize`.
|
|
239
|
+
|
|
218
240
|
---
|
|
219
241
|
|
|
220
242
|
## sqlite-vec and platform binaries
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// FTS5 OR fallback — natural-language questions on keyless installs.
|
|
2
|
+
//
|
|
3
|
+
// FTS5 ANDs a space-separated query, so "when was the zebra migration" matches
|
|
4
|
+
// nothing unless every filler word is in the chunk. search() retries with an OR
|
|
5
|
+
// of the content terms, but ONLY when the AND query returned zero rows, and only
|
|
6
|
+
// when NOX_FTS_OR_FALLBACK allows it (auto = no embedding key in the env).
|
|
7
|
+
//
|
|
8
|
+
// The DB is isolated with NOX_DB_PATH in a mkdtemp BEFORE db.js is imported.
|
|
9
|
+
//
|
|
10
|
+
// Run: npm test (or: npx tsc -p tsconfig.test.json && node --test dist/__tests__/fts-or-fallback.test.js)
|
|
11
|
+
import { test, before, after, beforeEach } from "node:test";
|
|
12
|
+
import assert from "node:assert/strict";
|
|
13
|
+
import { mkdtempSync, rmSync } from "fs";
|
|
14
|
+
import { tmpdir } from "os";
|
|
15
|
+
import { join } from "path";
|
|
16
|
+
import { parseTemporalFilter } from "../lib/dates.js";
|
|
17
|
+
const TMP_ROOT = mkdtempSync(join(process.env.NOX_TEST_TMP_ROOT || tmpdir(), "nox-mem-fts-or-test-"));
|
|
18
|
+
process.env.NOX_DB_PATH = join(TMP_ROOT, "test.db");
|
|
19
|
+
delete process.env.GEMINI_API_KEY;
|
|
20
|
+
delete process.env.OPENAI_API_KEY;
|
|
21
|
+
delete process.env.NOX_FTS_OR_FALLBACK;
|
|
22
|
+
delete process.env.NOX_EMBEDDING_API_KEY;
|
|
23
|
+
delete process.env.NOX_EMBED_API_KEY;
|
|
24
|
+
const NOW = Date.parse("2026-09-28T12:00:00Z");
|
|
25
|
+
const QUESTION = "when was the zebra migration";
|
|
26
|
+
let getDb, closeDb, search, buildFtsOrQuery, ftsOrFallbackEnabled;
|
|
27
|
+
before(async () => {
|
|
28
|
+
({ getDb, closeDb } = await import("../db.js"));
|
|
29
|
+
({ search, buildFtsOrQuery, ftsOrFallbackEnabled } = await import("../search.js"));
|
|
30
|
+
const db = getDb();
|
|
31
|
+
const ins = db.prepare(`INSERT INTO chunks (source_file, chunk_type, chunk_text, source_date, created_at, updated_at)
|
|
32
|
+
VALUES (?, 'other', ?, NULL, ?, ?)`);
|
|
33
|
+
// The chunk the question must find (none of when/was/the is in it).
|
|
34
|
+
ins.run("zebra.md", "zebra migration yesterday", "2026-09-01 08:00:00", "2026-09-01 08:00:00");
|
|
35
|
+
// AND-vs-OR discriminator: "aardvark tunnel" ANDs to fig.md only; OR would add fig2.md.
|
|
36
|
+
ins.run("fig.md", "aardvark tunnel survey", "2026-09-01 08:00:00", "2026-09-01 08:00:00");
|
|
37
|
+
ins.run("fig2.md", "aardvark burrow notes", "2026-09-01 08:00:00", "2026-09-01 08:00:00");
|
|
38
|
+
// Temporal pair for the OR branch: same words, different age.
|
|
39
|
+
ins.run("quokka-old.md", "quokka census results", "2026-01-10 08:00:00", "2026-01-10 08:00:00");
|
|
40
|
+
ins.run("quokka-new.md", "quokka census results", "2026-09-26T10:00:00.000Z", "2026-09-26T10:00:00.000Z");
|
|
41
|
+
});
|
|
42
|
+
after(() => {
|
|
43
|
+
closeDb();
|
|
44
|
+
rmSync(TMP_ROOT, { recursive: true, force: true });
|
|
45
|
+
});
|
|
46
|
+
// Each test sets exactly the env it needs; the gate must be read per call.
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
delete process.env.GEMINI_API_KEY;
|
|
49
|
+
delete process.env.OPENAI_API_KEY;
|
|
50
|
+
delete process.env.NOX_FTS_OR_FALLBACK;
|
|
51
|
+
});
|
|
52
|
+
const files = (rs) => rs.map((r) => r.source_file).sort();
|
|
53
|
+
// ─── helpers ─────────────────────────────────────────────────────────────────
|
|
54
|
+
test("buildFtsOrQuery: stopwords out, terms quoted, ORed, deduplicated", () => {
|
|
55
|
+
assert.equal(buildFtsOrQuery(QUESTION), '"zebra" OR "migration"');
|
|
56
|
+
assert.equal(buildFtsOrQuery("Zebra zebra ZEBRA migration"), '"Zebra" OR "migration"');
|
|
57
|
+
assert.equal(buildFtsOrQuery("quando foi a migração da zebra"), '"migração" OR "zebra"');
|
|
58
|
+
});
|
|
59
|
+
test("buildFtsOrQuery: only stopwords ⇒ null; embedded quotes are doubled", () => {
|
|
60
|
+
assert.equal(buildFtsOrQuery("what is the"), null);
|
|
61
|
+
assert.equal(buildFtsOrQuery("o que é"), null);
|
|
62
|
+
assert.equal(buildFtsOrQuery('a"b'), '"a""b"');
|
|
63
|
+
});
|
|
64
|
+
test("ftsOrFallbackEnabled: gate matrix", () => {
|
|
65
|
+
assert.equal(ftsOrFallbackEnabled({}), true);
|
|
66
|
+
// Any key the embedding provider resolves counts as "has embeddings".
|
|
67
|
+
assert.equal(ftsOrFallbackEnabled({ NOX_EMBEDDING_API_KEY: "k" }), false);
|
|
68
|
+
assert.equal(ftsOrFallbackEnabled({ NOX_EMBED_API_KEY: "k" }), false);
|
|
69
|
+
assert.equal(ftsOrFallbackEnabled({ NOX_FTS_OR_FALLBACK: "auto" }), true);
|
|
70
|
+
assert.equal(ftsOrFallbackEnabled({ GEMINI_API_KEY: "k" }), false);
|
|
71
|
+
assert.equal(ftsOrFallbackEnabled({ OPENAI_API_KEY: "k" }), false);
|
|
72
|
+
assert.equal(ftsOrFallbackEnabled({ NOX_FTS_OR_FALLBACK: "on", GEMINI_API_KEY: "k" }), true);
|
|
73
|
+
assert.equal(ftsOrFallbackEnabled({ NOX_FTS_OR_FALLBACK: "off" }), false);
|
|
74
|
+
});
|
|
75
|
+
// ─── search() ────────────────────────────────────────────────────────────────
|
|
76
|
+
test("(1) auto, no key: a natural-language question finds the chunk", () => {
|
|
77
|
+
assert.deepEqual(files(search(QUESTION, 10, false)), ["zebra.md"]);
|
|
78
|
+
});
|
|
79
|
+
test("(2) auto WITH an embedding key in the env: same question returns [] as before", () => {
|
|
80
|
+
process.env.GEMINI_API_KEY = "test-key";
|
|
81
|
+
assert.deepEqual(search(QUESTION, 10, false), []);
|
|
82
|
+
delete process.env.GEMINI_API_KEY;
|
|
83
|
+
process.env.OPENAI_API_KEY = "test-key";
|
|
84
|
+
assert.deepEqual(search(QUESTION, 10, false), []);
|
|
85
|
+
});
|
|
86
|
+
test("(3) off: [] even without a key", () => {
|
|
87
|
+
process.env.NOX_FTS_OR_FALLBACK = "off";
|
|
88
|
+
assert.deepEqual(search(QUESTION, 10, false), []);
|
|
89
|
+
});
|
|
90
|
+
test("on: forces the fallback even with a key", () => {
|
|
91
|
+
process.env.NOX_FTS_OR_FALLBACK = "on";
|
|
92
|
+
process.env.GEMINI_API_KEY = "test-key";
|
|
93
|
+
assert.deepEqual(files(search(QUESTION, 10, false)), ["zebra.md"]);
|
|
94
|
+
});
|
|
95
|
+
test("(4) AND already hits: result identical (order and scores) with the fallback on and off", () => {
|
|
96
|
+
process.env.NOX_FTS_OR_FALLBACK = "on";
|
|
97
|
+
const on = search("aardvark tunnel", 10, false);
|
|
98
|
+
process.env.NOX_FTS_OR_FALLBACK = "off";
|
|
99
|
+
const off = search("aardvark tunnel", 10, false);
|
|
100
|
+
assert.deepEqual(files(off), ["fig.md"]); // OR would also have pulled fig2.md
|
|
101
|
+
assert.deepEqual(on, off);
|
|
102
|
+
});
|
|
103
|
+
test("(5) stopwords only: no fallback, even forced on", () => {
|
|
104
|
+
process.env.NOX_FTS_OR_FALLBACK = "on";
|
|
105
|
+
assert.deepEqual(search("what was the", 10, false), []);
|
|
106
|
+
assert.deepEqual(search("o que é a", 10, false), []);
|
|
107
|
+
});
|
|
108
|
+
test("(6) the temporal filter is honoured on the OR branch", () => {
|
|
109
|
+
const q = "when was the quokka census";
|
|
110
|
+
assert.deepEqual(files(search(q, 10, false)), ["quokka-new.md", "quokka-old.md"]);
|
|
111
|
+
const since = parseTemporalFilter({ changedSince: "7d" }, NOW);
|
|
112
|
+
assert.deepEqual(files(search(q, 10, false, since)), ["quokka-new.md"]);
|
|
113
|
+
const asOf = parseTemporalFilter({ asOf: "2026-02-01" }, NOW);
|
|
114
|
+
assert.deepEqual(files(search(q, 10, false, asOf)), ["quokka-old.md"]);
|
|
115
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// reindex on a DB that the pre-2026-09-28 reindex already doubled, plus the
|
|
2
|
+
// adversarial-review findings on PR #29 (GLM + DeepSeek):
|
|
3
|
+
// - the retention guard measured ROWS, so cleaning 2N → N read as a 50% wipe
|
|
4
|
+
// and the first reindex after the fix was refused forever;
|
|
5
|
+
// - among duplicates, the kept row must be the one holding the embedding;
|
|
6
|
+
// - an edited file replaces content, it is not a loss;
|
|
7
|
+
// - --dry-run must not write;
|
|
8
|
+
// - the legacy DB path must equal the one db.ts used before the refactor.
|
|
9
|
+
//
|
|
10
|
+
// Run: npm test (or: npx tsc -p tsconfig.test.json && node --test dist/__tests__/reindex-dedup.test.js)
|
|
11
|
+
import { test, before, after } from "node:test";
|
|
12
|
+
import assert from "node:assert/strict";
|
|
13
|
+
import { mkdtempSync, mkdirSync, realpathSync, rmSync, writeFileSync } from "fs";
|
|
14
|
+
import { tmpdir } from "os";
|
|
15
|
+
import { dirname, join, resolve } from "path";
|
|
16
|
+
import { fileURLToPath } from "url";
|
|
17
|
+
import { LEGACY_DB_PATH } from "../lib/db-path.js";
|
|
18
|
+
const TMP_ROOT = realpathSync(mkdtempSync(join(process.env.NOX_TEST_TMP_ROOT || tmpdir(), "nox-mem-dedup-test-")));
|
|
19
|
+
const WS = join(TMP_ROOT, "ws");
|
|
20
|
+
const MEM = join(WS, "memory");
|
|
21
|
+
mkdirSync(MEM, { recursive: true });
|
|
22
|
+
mkdirSync(join(WS, "tools", "nox-mem"), { recursive: true });
|
|
23
|
+
delete process.env.NOX_DB_PATH;
|
|
24
|
+
delete process.env.NOX_REINDEX_ALLOW_WIPE;
|
|
25
|
+
// Hermetic: with an embedding key in the caller's env, ingest auto-vectorizes
|
|
26
|
+
// (real API calls, and every row gets a vector), which changes which duplicate
|
|
27
|
+
// counts as "the embedded one". Tests never spend on embeddings.
|
|
28
|
+
for (const k of ["GEMINI_API_KEY", "OPENAI_API_KEY", "NOX_EMBEDDING_API_KEY", "NOX_EMBED_API_KEY"])
|
|
29
|
+
delete process.env[k];
|
|
30
|
+
process.env.OPENCLAW_WORKSPACE = WS;
|
|
31
|
+
let getDb, closeDb, reindex, routeIngest;
|
|
32
|
+
const N = 20;
|
|
33
|
+
const count = () => getDb().prepare("SELECT COUNT(*) AS c FROM chunks").get().c;
|
|
34
|
+
before(async () => {
|
|
35
|
+
({ getDb, closeDb } = await import("../db.js"));
|
|
36
|
+
({ reindex } = await import("../reindex.js"));
|
|
37
|
+
({ routeIngest } = await import("../lib/ingest-router.js"));
|
|
38
|
+
for (let i = 1; i <= N; i++)
|
|
39
|
+
writeFileSync(join(MEM, `n${i}.md`), `# N${i}\nnote number ${i} about topic${i}.\n`);
|
|
40
|
+
for (let i = 1; i <= N; i++)
|
|
41
|
+
await routeIngest(join(MEM, `n${i}.md`));
|
|
42
|
+
});
|
|
43
|
+
after(() => {
|
|
44
|
+
closeDb();
|
|
45
|
+
rmSync(TMP_ROOT, { recursive: true, force: true });
|
|
46
|
+
});
|
|
47
|
+
test("legacy DB path is the one db.ts used before the refactor (<package>/nox-mem.db)", () => {
|
|
48
|
+
// this file compiles to dist/__tests__/…; db.ts compiled to dist/db.js and used resolve(dist, "..", "nox-mem.db")
|
|
49
|
+
const dist = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
50
|
+
assert.equal(LEGACY_DB_PATH, resolve(dist, "..", "nox-mem.db"));
|
|
51
|
+
});
|
|
52
|
+
test("--dry-run does not write", async () => {
|
|
53
|
+
const pre = count();
|
|
54
|
+
const maxId = getDb().prepare("SELECT MAX(id) AS m FROM chunks").get().m;
|
|
55
|
+
await reindex({ dryRun: true });
|
|
56
|
+
assert.equal(count(), pre);
|
|
57
|
+
assert.equal(getDb().prepare("SELECT MAX(id) AS m FROM chunks").get().m, maxId);
|
|
58
|
+
});
|
|
59
|
+
test("an already-doubled DB is cleaned (2N → N), not refused, and keeps the embedded copy", async () => {
|
|
60
|
+
const db = getDb();
|
|
61
|
+
db.exec("INSERT INTO chunks (source_file, chunk_type, chunk_text, source_date) SELECT source_file, chunk_type, chunk_text, source_date FROM chunks");
|
|
62
|
+
assert.equal(count(), 2 * N);
|
|
63
|
+
// Mark the HIGHER-id copy of n7 as the embedded one; lowest-id-wins alone would drop it.
|
|
64
|
+
const copies = db.prepare("SELECT id FROM chunks WHERE chunk_text LIKE '%number 7 about%' ORDER BY id").all();
|
|
65
|
+
assert.equal(copies.length, 2);
|
|
66
|
+
db.exec("CREATE TABLE IF NOT EXISTS vec_chunk_map (vec_rowid INTEGER PRIMARY KEY, chunk_id INTEGER NOT NULL UNIQUE)");
|
|
67
|
+
db.prepare("INSERT INTO vec_chunk_map (vec_rowid, chunk_id) VALUES (?, ?)").run(900001, copies[1].id);
|
|
68
|
+
await reindex();
|
|
69
|
+
assert.equal(count(), N, "one row per distinct content");
|
|
70
|
+
const left = db.prepare("SELECT id FROM chunks WHERE chunk_text LIKE '%number 7 about%'").all();
|
|
71
|
+
assert.deepEqual(left.map((r) => r.id), [copies[1].id], "the copy with the embedding survives");
|
|
72
|
+
});
|
|
73
|
+
test("editing many files is replacement, not loss (guard stays quiet)", async () => {
|
|
74
|
+
// Rewrite half the corpus: every chunk of those files changes fingerprint.
|
|
75
|
+
for (let i = 1; i <= N / 2; i++)
|
|
76
|
+
writeFileSync(join(MEM, `n${i}.md`), `# N${i}\nnote number ${i} REWRITTEN.\n`);
|
|
77
|
+
await reindex();
|
|
78
|
+
assert.equal(count(), N);
|
|
79
|
+
assert.equal(getDb().prepare("SELECT COUNT(*) AS c FROM chunks WHERE chunk_text LIKE '%REWRITTEN%'").get().c, N / 2);
|
|
80
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// reindex safety (2026-09-28) — measured on a clean npm install before the fix:
|
|
2
|
+
// 1. no $OPENCLAW_WORKSPACE ⇒ the scan found 0 files ⇒ every chunk was deleted
|
|
3
|
+
// as an "orphan"; the retention guard threw only AFTER the DELETE;
|
|
4
|
+
// 2. every reindex kept both the old row and the fresh copy of unchanged
|
|
5
|
+
// content (10 chunks → 20).
|
|
6
|
+
// Also covers the shared DB path resolver (db.ts and op-audit must agree).
|
|
7
|
+
//
|
|
8
|
+
// Run: npm test (or: npx tsc -p tsconfig.test.json && node --test dist/__tests__/reindex-safety.test.js)
|
|
9
|
+
import { test, before, after } from "node:test";
|
|
10
|
+
import assert from "node:assert/strict";
|
|
11
|
+
import { mkdtempSync, mkdirSync, realpathSync, rmSync, writeFileSync, unlinkSync } from "fs";
|
|
12
|
+
import { tmpdir, homedir } from "os";
|
|
13
|
+
import { join } from "path";
|
|
14
|
+
import { resolveDbPathWithSource, LEGACY_DB_PATH, DEFAULT_STANDALONE_DB_PATH, isInsideNodeModules, } from "../lib/db-path.js";
|
|
15
|
+
// realpath: op-audit refuses snapshot dirs reached through a symlink (macOS /tmp → /private/tmp).
|
|
16
|
+
const TMP_ROOT = realpathSync(mkdtempSync(join(process.env.NOX_TEST_TMP_ROOT || tmpdir(), "nox-mem-reindex-test-")));
|
|
17
|
+
const WS = join(TMP_ROOT, "ws");
|
|
18
|
+
const MEM = join(WS, "memory");
|
|
19
|
+
mkdirSync(MEM, { recursive: true });
|
|
20
|
+
mkdirSync(join(WS, "tools", "nox-mem"), { recursive: true });
|
|
21
|
+
// DB derives from the workspace, as on the origin deployment (op-audit rejects a
|
|
22
|
+
// NOX_DB_PATH that disagrees with OPENCLAW_WORKSPACE).
|
|
23
|
+
delete process.env.NOX_DB_PATH;
|
|
24
|
+
delete process.env.NOX_REINDEX_ALLOW_WIPE;
|
|
25
|
+
// Hermetic: with an embedding key in the caller's env, ingest auto-vectorizes
|
|
26
|
+
// (real API calls, and every row gets a vector), which changes which duplicate
|
|
27
|
+
// counts as "the embedded one". Tests never spend on embeddings.
|
|
28
|
+
for (const k of ["GEMINI_API_KEY", "OPENAI_API_KEY", "NOX_EMBEDDING_API_KEY", "NOX_EMBED_API_KEY"])
|
|
29
|
+
delete process.env[k];
|
|
30
|
+
process.env.OPENCLAW_WORKSPACE = WS;
|
|
31
|
+
const DB = join(WS, "tools", "nox-mem", "nox-mem.db");
|
|
32
|
+
// ─── DB path resolver (pure) ─────────────────────────────────────────────────
|
|
33
|
+
test("db-path: NOX_DB_PATH wins", () => {
|
|
34
|
+
const r = resolveDbPathWithSource({ NOX_DB_PATH: "/x/y.db", OPENCLAW_WORKSPACE: "/ws" }, () => true);
|
|
35
|
+
assert.deepEqual(r, { path: "/x/y.db", source: "NOX_DB_PATH" });
|
|
36
|
+
});
|
|
37
|
+
test("db-path: OPENCLAW_WORKSPACE next (origin layout unchanged)", () => {
|
|
38
|
+
const r = resolveDbPathWithSource({ OPENCLAW_WORKSPACE: "/root/.openclaw/workspace" }, () => false);
|
|
39
|
+
assert.deepEqual(r, { path: "/root/.openclaw/workspace/tools/nox-mem/nox-mem.db", source: "OPENCLAW_WORKSPACE" });
|
|
40
|
+
});
|
|
41
|
+
test("db-path: existing legacy <package>/nox-mem.db is kept (no silent move of live data)", () => {
|
|
42
|
+
const r = resolveDbPathWithSource({}, (p) => p === LEGACY_DB_PATH);
|
|
43
|
+
assert.deepEqual(r, { path: LEGACY_DB_PATH, source: "legacy-package" });
|
|
44
|
+
});
|
|
45
|
+
test("db-path: fresh install defaults to ~/.nox-mem/nox.db, not the package dir", () => {
|
|
46
|
+
const r = resolveDbPathWithSource({}, () => false);
|
|
47
|
+
assert.equal(r.source, "standalone-default");
|
|
48
|
+
assert.equal(r.path, join(homedir(), ".nox-mem", "nox.db"));
|
|
49
|
+
assert.equal(r.path, DEFAULT_STANDALONE_DB_PATH);
|
|
50
|
+
assert.equal(isInsideNodeModules(r.path), false);
|
|
51
|
+
});
|
|
52
|
+
test("db-path: node_modules detection", () => {
|
|
53
|
+
assert.equal(isInsideNodeModules("/usr/lib/node_modules/nox-mem/nox-mem.db"), true);
|
|
54
|
+
assert.equal(isInsideNodeModules("/home/u/.nox-mem/nox.db"), false);
|
|
55
|
+
});
|
|
56
|
+
// ─── reindex against a real workspace ────────────────────────────────────────
|
|
57
|
+
let getDb, closeDb, reindex, assertReindexSource;
|
|
58
|
+
let ReindexSourceMissingError, ReindexWipeDetectedError, routeIngest;
|
|
59
|
+
const count = () => getDb().prepare("SELECT COUNT(*) AS c FROM chunks").get().c;
|
|
60
|
+
const ids = () => getDb().prepare("SELECT group_concat(id) AS g FROM (SELECT id FROM chunks ORDER BY id)").get().g;
|
|
61
|
+
before(async () => {
|
|
62
|
+
({ getDb, closeDb } = await import("../db.js"));
|
|
63
|
+
({ reindex, assertReindexSource, ReindexSourceMissingError, ReindexWipeDetectedError } = await import("../reindex.js"));
|
|
64
|
+
({ routeIngest } = await import("../lib/ingest-router.js"));
|
|
65
|
+
for (let i = 1; i <= 10; i++)
|
|
66
|
+
writeFileSync(join(MEM, `n${i}.md`), `# N${i}\nnote number ${i} about topic${i}.\n`);
|
|
67
|
+
for (let i = 1; i <= 10; i++)
|
|
68
|
+
await routeIngest(join(MEM, `n${i}.md`));
|
|
69
|
+
assert.equal(getDb().prepare("SELECT 1").get() !== undefined, true);
|
|
70
|
+
});
|
|
71
|
+
after(() => {
|
|
72
|
+
closeDb();
|
|
73
|
+
rmSync(TMP_ROOT, { recursive: true, force: true });
|
|
74
|
+
});
|
|
75
|
+
test("reindex: unchanged content is not duplicated and keeps its ids", async () => {
|
|
76
|
+
const before = ids();
|
|
77
|
+
assert.equal(count(), 10);
|
|
78
|
+
await reindex();
|
|
79
|
+
assert.equal(count(), 10, "one reindex must not double the corpus");
|
|
80
|
+
await reindex();
|
|
81
|
+
assert.equal(count(), 10);
|
|
82
|
+
assert.equal(ids(), before, "old rows (with their embeddings) are the ones kept");
|
|
83
|
+
});
|
|
84
|
+
test("reindex: edited file replaces its chunk, new file is added", async () => {
|
|
85
|
+
writeFileSync(join(MEM, "n1.md"), "# N1\nnote number 1 EDITED.\n");
|
|
86
|
+
writeFileSync(join(MEM, "n11.md"), "# N11\nbrand new note eleven.\n");
|
|
87
|
+
await reindex();
|
|
88
|
+
const q = (like) => getDb().prepare("SELECT COUNT(*) AS c FROM chunks WHERE chunk_text LIKE ?").get(like).c;
|
|
89
|
+
assert.equal(q("%EDITED%"), 1);
|
|
90
|
+
assert.equal(q("%number 1 about%"), 0);
|
|
91
|
+
assert.equal(q("%eleven%"), 1);
|
|
92
|
+
assert.equal(count(), 11);
|
|
93
|
+
});
|
|
94
|
+
test("reindex: retention guard refuses BEFORE deleting (rows survive the throw)", async () => {
|
|
95
|
+
for (const i of [2, 3, 4, 5, 6])
|
|
96
|
+
unlinkSync(join(MEM, `n${i}.md`));
|
|
97
|
+
const pre = count();
|
|
98
|
+
await assert.rejects(() => reindex(), (e) => e instanceof ReindexWipeDetectedError);
|
|
99
|
+
assert.ok(count() >= pre, `no chunk may be deleted when the guard fires (pre=${pre}, now=${count()})`);
|
|
100
|
+
});
|
|
101
|
+
test("assertReindexSource: refuses when no source dir exists and the DB has chunks", () => {
|
|
102
|
+
// The workspace path is captured at import, so empty the fixture instead.
|
|
103
|
+
rmSync(MEM, { recursive: true, force: true });
|
|
104
|
+
assert.throws(() => assertReindexSource(5), (e) => e instanceof ReindexSourceMissingError && /no source directory/.test(e.message));
|
|
105
|
+
assert.doesNotThrow(() => assertReindexSource(0), "an empty DB has nothing to lose");
|
|
106
|
+
});
|
|
107
|
+
test("assertReindexSource: refuses when the source dir exists but holds no file", () => {
|
|
108
|
+
mkdirSync(MEM, { recursive: true });
|
|
109
|
+
assert.throws(() => assertReindexSource(5), (e) => e instanceof ReindexSourceMissingError && /found 0 files/.test(e.message));
|
|
110
|
+
});
|
|
111
|
+
test("reindex: refusal leaves every chunk in place", async () => {
|
|
112
|
+
const pre = count();
|
|
113
|
+
assert.ok(pre > 0);
|
|
114
|
+
await assert.rejects(() => reindex(), (e) => e instanceof ReindexSourceMissingError);
|
|
115
|
+
assert.equal(count(), pre);
|
|
116
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Guards for the two things a VPS migration moved at once: WHERE agent session
|
|
2
|
+
// transcripts live, and WHAT SHAPE they have. Both failures are silent — the
|
|
3
|
+
// old path simply reports "No unprocessed sessions found" with exit 0, and the
|
|
4
|
+
// old schema check drops every line of a Claude CLI transcript without an
|
|
5
|
+
// error. One deployment ran 28 days that way with its cron marked "ok".
|
|
6
|
+
//
|
|
7
|
+
// Run: npx tsc && node --test dist/__tests__/session-distill-sources.test.js
|
|
8
|
+
import { test } from "node:test";
|
|
9
|
+
import assert from "node:assert/strict";
|
|
10
|
+
import { mkdtempSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { tmpdir } from "node:os";
|
|
12
|
+
import { resolve } from "node:path";
|
|
13
|
+
import { claudeProjectSlug, claudeProjectsDirs, sessionDirsFor, extractMessages, } from "../session-distill.js";
|
|
14
|
+
function writeTranscript(lines) {
|
|
15
|
+
const dir = mkdtempSync(resolve(tmpdir(), "nox-distill-"));
|
|
16
|
+
const file = resolve(dir, "session.jsonl");
|
|
17
|
+
writeFileSync(file, lines.map((l) => JSON.stringify(l)).join("\n"), "utf-8");
|
|
18
|
+
return file;
|
|
19
|
+
}
|
|
20
|
+
const CLI_LINES = [
|
|
21
|
+
{ type: "queue-operation", op: "enqueue" },
|
|
22
|
+
{ type: "attachment", path: "/tmp/x.png" },
|
|
23
|
+
{ type: "user", message: { role: "user", content: "por que o distill parou de rodar" } },
|
|
24
|
+
{
|
|
25
|
+
type: "assistant",
|
|
26
|
+
message: {
|
|
27
|
+
role: "assistant",
|
|
28
|
+
content: [
|
|
29
|
+
{ type: "text", text: "porque as sessoes mudaram de endereco" },
|
|
30
|
+
{ type: "tool_use", name: "Bash", input: {} },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
test("Claude CLI transcripts (type user/assistant) are read", () => {
|
|
36
|
+
const msgs = extractMessages(writeTranscript(CLI_LINES));
|
|
37
|
+
assert.equal(msgs.length, 2, "both turns must survive");
|
|
38
|
+
assert.deepEqual(msgs.map((m) => m.role), ["user", "assistant"]);
|
|
39
|
+
// Only the text part is kept; tool_use carries no prose to distill.
|
|
40
|
+
assert.equal(msgs[1].text, "porque as sessoes mudaram de endereco");
|
|
41
|
+
});
|
|
42
|
+
test("legacy OpenClaw transcripts (type message) still are read", () => {
|
|
43
|
+
const msgs = extractMessages(writeTranscript([
|
|
44
|
+
{ type: "message", message: { role: "user", content: "pergunta legada" } },
|
|
45
|
+
{ type: "message", message: { role: "assistant", content: "resposta legada" } },
|
|
46
|
+
]));
|
|
47
|
+
assert.equal(msgs.length, 2);
|
|
48
|
+
});
|
|
49
|
+
test("unknown event types and heartbeat noise stay out", () => {
|
|
50
|
+
const msgs = extractMessages(writeTranscript([
|
|
51
|
+
{ type: "summary", message: { role: "user", content: "nao e um turno de conversa" } },
|
|
52
|
+
{ type: "user", message: { role: "user", content: "HEARTBEAT_OK" } },
|
|
53
|
+
{ type: "user", message: { role: "user", content: "[cron:eod] disparo" } },
|
|
54
|
+
{ type: "user", message: { role: "user", content: "ok" } },
|
|
55
|
+
{ type: "user", content: "sem o campo message" },
|
|
56
|
+
]));
|
|
57
|
+
assert.equal(msgs.length, 0);
|
|
58
|
+
});
|
|
59
|
+
test("slug derivation matches the Claude CLI layout", () => {
|
|
60
|
+
// The CLI replaces both "/" and "." with "-", so the leading slash and the
|
|
61
|
+
// dotted dir collapse into the doubled dash seen on disk.
|
|
62
|
+
assert.equal(claudeProjectSlug("/root/.openclaw/workspace"), "-root--openclaw-workspace");
|
|
63
|
+
assert.equal(claudeProjectSlug("/root/.openclaw/workspace/agents/forge"), "-root--openclaw-workspace-agents-forge");
|
|
64
|
+
});
|
|
65
|
+
test("an explicit NOX_CLAUDE_PROJECTS_DIR wins over discovery", () => {
|
|
66
|
+
const prev = process.env.NOX_CLAUDE_PROJECTS_DIR;
|
|
67
|
+
process.env.NOX_CLAUDE_PROJECTS_DIR = "/somewhere/projects";
|
|
68
|
+
try {
|
|
69
|
+
assert.deepEqual(claudeProjectsDirs(), ["/somewhere/projects"]);
|
|
70
|
+
const dirs = sessionDirsFor("forge");
|
|
71
|
+
// Legacy dir first, then the CLI one — the legacy dir still holds sessions
|
|
72
|
+
// predating the switch, so neither may be dropped.
|
|
73
|
+
assert.equal(dirs.length, 2);
|
|
74
|
+
assert.match(dirs[0], /agents\/forge\/sessions$/);
|
|
75
|
+
assert.equal(dirs[1], "/somewhere/projects/-root--openclaw-workspace-agents-forge");
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
if (prev === undefined)
|
|
79
|
+
delete process.env.NOX_CLAUDE_PROJECTS_DIR;
|
|
80
|
+
else
|
|
81
|
+
process.env.NOX_CLAUDE_PROJECTS_DIR = prev;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
test("the main agent maps to the workspace root, not to agents/main", () => {
|
|
85
|
+
const prev = process.env.NOX_CLAUDE_PROJECTS_DIR;
|
|
86
|
+
process.env.NOX_CLAUDE_PROJECTS_DIR = "/p";
|
|
87
|
+
try {
|
|
88
|
+
const cli = sessionDirsFor("main")[1];
|
|
89
|
+
assert.equal(cli, "/p/-root--openclaw-workspace");
|
|
90
|
+
assert.doesNotMatch(cli, /agents-main/);
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
if (prev === undefined)
|
|
94
|
+
delete process.env.NOX_CLAUDE_PROJECTS_DIR;
|
|
95
|
+
else
|
|
96
|
+
process.env.NOX_CLAUDE_PROJECTS_DIR = prev;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// v19 — telemetria por chunk (`top_chunk_ids` / `top_scores`).
|
|
2
|
+
//
|
|
3
|
+
// Dois grupos de asserção, com propósitos diferentes:
|
|
4
|
+
//
|
|
5
|
+
// (A) schema — a coluna existe tanto num install limpo quanto num DB legado
|
|
6
|
+
// que já estava em v18. Um `ALTER TABLE` só no caminho de migração deixa
|
|
7
|
+
// o install limpo sem a coluna; um `CREATE TABLE` só no caminho novo
|
|
8
|
+
// deixa o DB existente sem ela. Os dois caminhos são testados separados
|
|
9
|
+
// porque falham separado.
|
|
10
|
+
//
|
|
11
|
+
// (B) privacidade — o INSERT de `search.ts` NÃO pode conter `query_text`.
|
|
12
|
+
// Isso não é preferência de estilo: `db.ts` declara, no comentário do v6,
|
|
13
|
+
// que "não armazenamos texto cru da query por privacidade". A coluna
|
|
14
|
+
// `query_text` existe em alguns DBs por reconciliação de drift de schema,
|
|
15
|
+
// e existir não é autorização para escrever. Este teste lê o fonte e
|
|
16
|
+
// morde se alguém a reintroduzir — inclusive eu, que já fiz exatamente
|
|
17
|
+
// isso uma vez.
|
|
18
|
+
//
|
|
19
|
+
// Run: npm run build && node --test dist/__tests__/telemetry-per-chunk.test.js
|
|
20
|
+
import { test, before, after } from "node:test";
|
|
21
|
+
import assert from "node:assert/strict";
|
|
22
|
+
import { mkdtempSync, rmSync, readFileSync } from "node:fs";
|
|
23
|
+
import { join, dirname, resolve } from "node:path";
|
|
24
|
+
import { fileURLToPath } from "node:url";
|
|
25
|
+
import { tmpdir } from "node:os";
|
|
26
|
+
import Database from "better-sqlite3";
|
|
27
|
+
const TMP_ROOT = mkdtempSync(join(process.env.NOX_TEST_TMP_ROOT || tmpdir(), "nox-mem-telemetry-test-"));
|
|
28
|
+
const TEST_DB = join(TMP_ROOT, "fresh.db");
|
|
29
|
+
process.env.NOX_DB_PATH = TEST_DB;
|
|
30
|
+
// dist/__tests__/ → ../../../src/search.ts
|
|
31
|
+
const SRC = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "src");
|
|
32
|
+
let getDb;
|
|
33
|
+
let closeDb;
|
|
34
|
+
before(async () => {
|
|
35
|
+
const m = await import("../db.js");
|
|
36
|
+
getDb = m.getDb;
|
|
37
|
+
closeDb = m.closeDb;
|
|
38
|
+
});
|
|
39
|
+
after(() => {
|
|
40
|
+
try {
|
|
41
|
+
closeDb();
|
|
42
|
+
}
|
|
43
|
+
catch { /* ignore */ }
|
|
44
|
+
rmSync(TMP_ROOT, { recursive: true, force: true });
|
|
45
|
+
});
|
|
46
|
+
const colunas = (db, tabela) => db.pragma(`table_info(${tabela})`).map((c) => c.name);
|
|
47
|
+
test("A1 — install limpo cria search_telemetry já com as duas colunas", () => {
|
|
48
|
+
const cols = colunas(getDb(), "search_telemetry");
|
|
49
|
+
assert.ok(cols.includes("top_chunk_ids"), `top_chunk_ids ausente: ${cols.join(", ")}`);
|
|
50
|
+
assert.ok(cols.includes("top_scores"), `top_scores ausente: ${cols.join(", ")}`);
|
|
51
|
+
closeDb();
|
|
52
|
+
});
|
|
53
|
+
test("A2 — DB legado parado em v18 ganha as colunas ao reabrir", async () => {
|
|
54
|
+
const legado = join(TMP_ROOT, "v18.db");
|
|
55
|
+
// Reconstrói o estado v6/v18: a tabela SEM as colunas novas, e o meta dizendo 18.
|
|
56
|
+
const raw = new Database(legado);
|
|
57
|
+
raw.exec(`
|
|
58
|
+
CREATE TABLE meta (key TEXT PRIMARY KEY, value TEXT, updated_at TEXT);
|
|
59
|
+
CREATE TABLE search_telemetry (
|
|
60
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
61
|
+
ts TEXT NOT NULL DEFAULT (datetime('now')),
|
|
62
|
+
query_hash TEXT NOT NULL,
|
|
63
|
+
query_words INTEGER NOT NULL,
|
|
64
|
+
variants_count INTEGER NOT NULL DEFAULT 1,
|
|
65
|
+
results_count INTEGER NOT NULL DEFAULT 0,
|
|
66
|
+
has_semantic INTEGER NOT NULL DEFAULT 0,
|
|
67
|
+
latency_ms INTEGER NOT NULL DEFAULT 0,
|
|
68
|
+
expansion_skipped_reason TEXT
|
|
69
|
+
);
|
|
70
|
+
INSERT INTO meta (key, value) VALUES ('schema_version', '18');
|
|
71
|
+
`);
|
|
72
|
+
const antes = raw.pragma("table_info(search_telemetry)").map((c) => c.name);
|
|
73
|
+
assert.ok(!antes.includes("top_chunk_ids"), "pré-condição do teste quebrou: legado já tinha a coluna");
|
|
74
|
+
raw.close();
|
|
75
|
+
process.env.NOX_DB_PATH = legado;
|
|
76
|
+
// Especificador em variável: precisa de uma instância NOVA do módulo (db.js
|
|
77
|
+
// memoiza a conexão em escopo de módulo), e o `?v18` faz o loader tratar como
|
|
78
|
+
// outra entrada de cache. Literal aqui faria o tsc tentar resolver o arquivo.
|
|
79
|
+
const espec = "../db.js?v18";
|
|
80
|
+
const m = (await import(espec));
|
|
81
|
+
const db = m.getDb();
|
|
82
|
+
const depois = colunas(db, "search_telemetry");
|
|
83
|
+
assert.ok(depois.includes("top_chunk_ids") && depois.includes("top_scores"), depois.join(", "));
|
|
84
|
+
// E a migração não perdeu as colunas antigas.
|
|
85
|
+
assert.ok(depois.includes("query_hash") && depois.includes("expansion_skipped_reason"));
|
|
86
|
+
m.closeDb();
|
|
87
|
+
process.env.NOX_DB_PATH = TEST_DB;
|
|
88
|
+
});
|
|
89
|
+
test("B1 — o INSERT de telemetria NÃO grava o texto cru da query", () => {
|
|
90
|
+
const fonte = readFileSync(join(SRC, "search.ts"), "utf8");
|
|
91
|
+
const m = fonte.match(/INSERT INTO search_telemetry \(([^)]*)\)/);
|
|
92
|
+
assert.ok(m, "não achei o INSERT INTO search_telemetry em search.ts");
|
|
93
|
+
const escritas = m[1].split(",").map((s) => s.trim());
|
|
94
|
+
assert.ok(!escritas.includes("query_text"), `regressão de privacidade: ${escritas.join(", ")}`);
|
|
95
|
+
assert.ok(escritas.includes("query_hash"), "o hash é a ÚNICA representação da query que pode ser gravada");
|
|
96
|
+
assert.ok(escritas.includes("top_chunk_ids") && escritas.includes("top_scores"), escritas.join(", "));
|
|
97
|
+
});
|
|
98
|
+
test("B2 — a lista de colunas do INSERT casa com o número de parâmetros", () => {
|
|
99
|
+
// Defeito mecânico clássico: adicionar coluna e esquecer o `?`, ou o argumento
|
|
100
|
+
// do `.run()`. O SQLite aceita a discrepância de argumento em silêncio em
|
|
101
|
+
// alguns casos, e a coluna nova fica NULL para sempre — que é indistinguível
|
|
102
|
+
// de "a feature não foi usada".
|
|
103
|
+
const fonte = readFileSync(join(SRC, "search.ts"), "utf8");
|
|
104
|
+
const bloco = fonte.slice(fonte.indexOf("INSERT INTO search_telemetry"));
|
|
105
|
+
const cols = bloco.match(/INSERT INTO search_telemetry \(([^)]*)\)/)[1].split(",").length;
|
|
106
|
+
const placeholders = bloco.match(/VALUES \(([^)]*)\)/)[1].split(",").length;
|
|
107
|
+
const args = bloco.slice(bloco.indexOf(".run(")).match(/\.run\(([^;]*)\)/)[1].split(",").length;
|
|
108
|
+
assert.equal(placeholders, cols, `${cols} colunas mas ${placeholders} placeholders`);
|
|
109
|
+
assert.equal(args, cols, `${cols} colunas mas ${args} argumentos no .run()`);
|
|
110
|
+
});
|