omgbase 0.28.0 → 0.29.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/dist/build-info.json +2 -2
- package/dist/src/cmd/admin.js +11 -2
- package/dist/src/cmd/sync.js +7 -0
- package/package.json +3 -3
package/dist/build-info.json
CHANGED
package/dist/src/cmd/admin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
|
-
import { rebuildIndex, runGc, buildEmbedTasks, buildDocEmbedTasks, indexIdentity, requireSemantic, resolveSettings, workspaceSettings, repoOwnSettings, writeWorkspaceSettings, writeRepoSettings, ftsIndexedRowCount, liveLeafCount, sizeReport, activeAlerts, readCapability, openCoverageFrom, captureFor, enableSemantic, disableSemantic, semanticProviderOf, SemanticProviderMissing, withWriterLock, vacuum, reclaimableBytes, humanBytes, formatShare, } from "@omgbase/core";
|
|
2
|
+
import { rebuildIndex, runGc, buildEmbedTasks, buildDocEmbedTasks, indexIdentity, requireSemantic, resolveSettings, workspaceSettings, repoOwnSettings, writeWorkspaceSettings, writeRepoSettings, ftsIndexedRowCount, liveLeafCount, sizeReport, activeAlerts, refreshLegacyBytesAlert, readCapability, openCoverageFrom, captureFor, enableSemantic, disableSemantic, semanticProviderOf, SemanticProviderMissing, withWriterLock, vacuum, reclaimableBytes, humanBytes, formatShare, } from "@omgbase/core";
|
|
3
3
|
import { CliUsageError, EngineErrorLike, EXIT_OK, EXIT_ERROR, emitMachine, renderHelp } from "../output.js";
|
|
4
4
|
import { columns } from "../render.js";
|
|
5
5
|
import { loadEmbedding, drainEmbeddings } from "./_embed.js";
|
|
@@ -87,7 +87,7 @@ function runDoctor(cli, args) {
|
|
|
87
87
|
if (values.help) {
|
|
88
88
|
return renderHelp(cli, {
|
|
89
89
|
name: "doctor",
|
|
90
|
-
summary: "Invariant sweep: FTS rows vs live leaf blocks, head present, capture complete, active alerts, SQLite integrity — exit 1 on any failure (CI-able)",
|
|
90
|
+
summary: "Invariant sweep: FTS rows vs live leaf blocks, head present, bytes reproducible, capture complete, active alerts, SQLite integrity — exit 1 on any failure (CI-able)",
|
|
91
91
|
usage: ["doctor [--json]", "doctor --size [--json]"],
|
|
92
92
|
options: [
|
|
93
93
|
["--size", "instead of the checks: what the database is made of — bytes and rows per category (content, identity, recovery, history, search, sync — the change feed under sync) and table, the file's pages, the feed's position, what VACUUM would reclaim, advice"],
|
|
@@ -124,6 +124,15 @@ function runDoctor(cli, args) {
|
|
|
124
124
|
// build without the module) owes none and the check says so in its detail.
|
|
125
125
|
const headless = db.prepare("SELECT count(*) c FROM docs d WHERE d.deleted_at IS NULL AND d.head IS NULL").get().c;
|
|
126
126
|
checks.push({ name: "head present", ok: headless === 0, detail: `${headless} without a head` });
|
|
127
|
+
// Store 17.4 (Phase 5a-ii; spec/store §5.11, §8 C9): every live document's
|
|
128
|
+
// rows reproduce its `file_hash` — the fidelity check the migration runs,
|
|
129
|
+
// re-derived here in full for the selected repository, and the `legacy_bytes`
|
|
130
|
+
// alert written to match (raised with the count and a sample of ids, or
|
|
131
|
+
// cleared), so the `alerts` check below sees the current condition. A
|
|
132
|
+
// document ingested before block trivia was stored fails it until `omg sync`
|
|
133
|
+
// repairs its rows from the file.
|
|
134
|
+
const legacy = refreshLegacyBytesAlert(db, repo.repoId, new Date().toISOString());
|
|
135
|
+
checks.push({ name: "bytes reproducible", ok: legacy.length === 0, detail: `${legacy.length} document(s) not reproducible from their rows` });
|
|
127
136
|
const manifest = readCapability(db, repo.repoId, "history");
|
|
128
137
|
const since = openCoverageFrom(manifest);
|
|
129
138
|
const recorder = captureFor(db, repo.repoId);
|
package/dist/src/cmd/sync.js
CHANGED
|
@@ -95,6 +95,13 @@ function runOneShot(cli, ws, repo) {
|
|
|
95
95
|
for (const p of result.conflicted)
|
|
96
96
|
io.out(` ${style.warn(p)}`);
|
|
97
97
|
}
|
|
98
|
+
// spec/sync §4.3 step 5 (4.4): the legacy documents whose separator bytes
|
|
99
|
+
// were repaired from their files (spec/store §5.11) — no commit, no revision.
|
|
100
|
+
if (result.repaired.length > 0) {
|
|
101
|
+
io.out(` ${style.ok(g.ok)} repaired ${result.repaired.length}`);
|
|
102
|
+
for (const p of result.repaired)
|
|
103
|
+
io.out(` ${style.accent(p)}`);
|
|
104
|
+
}
|
|
98
105
|
if (!result.changed)
|
|
99
106
|
io.out(` ${style.dim("already up to date")}`);
|
|
100
107
|
return EXIT_OK;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omgbase",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Open Markdown Graph Base — CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"omg": "./dist/src/main.js"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@omgbase/core": "^0.
|
|
48
|
+
"@omgbase/core": "^0.32.0",
|
|
49
49
|
"@omgbase/fs-adapter": "^0.2.0",
|
|
50
|
-
"@omgbase/sync": "^0.7.
|
|
50
|
+
"@omgbase/sync": "^0.7.2",
|
|
51
51
|
"yaml": "^2.9.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|