@viloforge/vfkb 0.2.3 → 0.4.1
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/dist/broadcast.js +134 -0
- package/dist/bundles/vfkb-mcp.mjs +106 -39
- package/dist/bundles/vfkb.mjs +595 -183
- package/dist/cli.js +86 -5
- package/dist/doctor.js +138 -10
- package/dist/engine.js +80 -5
- package/dist/init.js +1 -1
- package/dist/journal.js +207 -0
- package/dist/storage.js +10 -1
- package/package.json +1 -1
package/dist/storage.js
CHANGED
|
@@ -8,6 +8,7 @@ import { basename, dirname, join, resolve } from 'node:path';
|
|
|
8
8
|
import { homedir } from 'node:os';
|
|
9
9
|
import { createHash } from 'node:crypto';
|
|
10
10
|
import { storageBackend } from './backend.js';
|
|
11
|
+
import { journalAppend } from './journal.js';
|
|
11
12
|
import { normalizeEntry } from './validate.js';
|
|
12
13
|
export function isTombstone(r) {
|
|
13
14
|
return r.deleted === true;
|
|
@@ -51,7 +52,15 @@ export function defaultProject() {
|
|
|
51
52
|
// GUARANTEED side-effect (mykb L11; ADR-0014) — policy, so it lives here,
|
|
52
53
|
// above the backend's raw append. ---
|
|
53
54
|
export function appendRecord(rec) {
|
|
54
|
-
storageBackend()
|
|
55
|
+
const be = storageBackend();
|
|
56
|
+
// ADR-0064: journal-first untracked mirror — the durability floor for the
|
|
57
|
+
// window between this append and the next brain commit. JSONL-fs only: the
|
|
58
|
+
// journal is the file tier's crash net; a non-fs backend owns its own
|
|
59
|
+
// durability, and its location() is not a filesystem path (mirroring it
|
|
60
|
+
// materialized a literal 'memory:/test/.journal' dir in the cwd).
|
|
61
|
+
if (be.name === 'jsonl-fs')
|
|
62
|
+
journalAppend(be.location(), rec);
|
|
63
|
+
be.append(rec);
|
|
55
64
|
writeMeta();
|
|
56
65
|
}
|
|
57
66
|
// ADR-0040: the exclusive section for read-decide-append engine ops, provided by
|
package/package.json
CHANGED