@inerrata-corporation/errata 2.0.6-dev.2333 → 2.0.6-dev.2504
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/consolidate-worker.mjs +1694 -4
- package/errata.mjs +148 -45
- package/package.json +1 -1
- package/pass-worker.mjs +17 -3
package/errata.mjs
CHANGED
|
@@ -17176,6 +17176,21 @@ var init_anchorable = __esm({
|
|
|
17176
17176
|
});
|
|
17177
17177
|
|
|
17178
17178
|
// ../../packages/local-shared/src/sqlite-adapter.ts
|
|
17179
|
+
function loadNodeSqlite() {
|
|
17180
|
+
const original = process.emitWarning;
|
|
17181
|
+
process.emitWarning = function(warning, ...rest2) {
|
|
17182
|
+
const text = typeof warning === "string" ? warning : warning?.message ?? "";
|
|
17183
|
+
const opt = rest2[0];
|
|
17184
|
+
const type = typeof opt === "string" ? opt : opt?.type ?? warning?.name;
|
|
17185
|
+
if (type === "ExperimentalWarning" && /SQLite/i.test(text)) return;
|
|
17186
|
+
return original.call(process, warning, ...rest2);
|
|
17187
|
+
};
|
|
17188
|
+
try {
|
|
17189
|
+
return process.getBuiltinModule("node:sqlite");
|
|
17190
|
+
} finally {
|
|
17191
|
+
process.emitWarning = original;
|
|
17192
|
+
}
|
|
17193
|
+
}
|
|
17179
17194
|
function openDatabase(path2) {
|
|
17180
17195
|
const db = new DatabaseSync(path2);
|
|
17181
17196
|
try {
|
|
@@ -17257,12 +17272,11 @@ function normalizeParam(v) {
|
|
|
17257
17272
|
if (typeof v === "boolean") return v ? 1 : 0;
|
|
17258
17273
|
return v;
|
|
17259
17274
|
}
|
|
17260
|
-
var
|
|
17275
|
+
var DatabaseSync;
|
|
17261
17276
|
var init_sqlite_adapter = __esm({
|
|
17262
17277
|
"../../packages/local-shared/src/sqlite-adapter.ts"() {
|
|
17263
17278
|
"use strict";
|
|
17264
|
-
|
|
17265
|
-
DatabaseSync = nodeSqlite.DatabaseSync;
|
|
17279
|
+
DatabaseSync = loadNodeSqlite().DatabaseSync;
|
|
17266
17280
|
}
|
|
17267
17281
|
});
|
|
17268
17282
|
|
|
@@ -78124,7 +78138,7 @@ function createWatchBreaker(deps) {
|
|
|
78124
78138
|
}
|
|
78125
78139
|
|
|
78126
78140
|
// src/engine.ts
|
|
78127
|
-
var DAEMON_VERSION = true ? "2.0.6-dev.
|
|
78141
|
+
var DAEMON_VERSION = true ? "2.0.6-dev.2504" : "2.0.0-alpha.0";
|
|
78128
78142
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
78129
78143
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
78130
78144
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -80960,7 +80974,7 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
|
|
|
80960
80974
|
return key ? { originSession: key } : {};
|
|
80961
80975
|
};
|
|
80962
80976
|
const symbolIndex = opts.workspaceRoot ? publicSymbolIndex(store, opts.workspaceRoot) : null;
|
|
80963
|
-
const ownLexicon = buildSymbolLexicon(store);
|
|
80977
|
+
const ownLexicon = opts.lexicon ?? buildSymbolLexicon(store);
|
|
80964
80978
|
const projectIdentity = {
|
|
80965
80979
|
...profile.name ? { name: profile.name } : {},
|
|
80966
80980
|
...profile.repoLocator ? { repoLocator: profile.repoLocator } : {},
|
|
@@ -81348,8 +81362,40 @@ function buildCausalEdgeBackfill(store, profile, daemonVersion) {
|
|
|
81348
81362
|
return { ...base, payloadDigest: digest(base) };
|
|
81349
81363
|
}
|
|
81350
81364
|
|
|
81351
|
-
// src/
|
|
81365
|
+
// src/drain-build.ts
|
|
81352
81366
|
init_generalize_graph();
|
|
81367
|
+
function buildDrainContext(store, input) {
|
|
81368
|
+
return buildContextIngest(store, input.profile, input.daemonVersion, input.ignorePatterns, {
|
|
81369
|
+
...input.includePackages !== void 0 ? { includePackages: input.includePackages } : {}
|
|
81370
|
+
});
|
|
81371
|
+
}
|
|
81372
|
+
function buildDrainInstances(store, sharedStore, input) {
|
|
81373
|
+
let lexicon;
|
|
81374
|
+
let lexiconError;
|
|
81375
|
+
try {
|
|
81376
|
+
lexicon = buildSymbolLexicon(store);
|
|
81377
|
+
} catch (err2) {
|
|
81378
|
+
lexiconError = err2 instanceof Error ? err2.message : String(err2);
|
|
81379
|
+
}
|
|
81380
|
+
let composition = null;
|
|
81381
|
+
const batch = buildInstanceIngest(store, input.profile, input.daemonVersion, input.ignorePatterns, {
|
|
81382
|
+
...input.includePackages !== void 0 ? { includePackages: input.includePackages } : {},
|
|
81383
|
+
workspaceRoot: input.workspaceRoot,
|
|
81384
|
+
sharedStore,
|
|
81385
|
+
onComposition: (c) => {
|
|
81386
|
+
composition = c;
|
|
81387
|
+
},
|
|
81388
|
+
...lexicon ? { lexicon } : {},
|
|
81389
|
+
...input.project ? { project: input.project } : {}
|
|
81390
|
+
});
|
|
81391
|
+
return {
|
|
81392
|
+
batch,
|
|
81393
|
+
composition: composition ?? batch?.composition ?? null,
|
|
81394
|
+
...lexiconError ? { lexiconError } : {}
|
|
81395
|
+
};
|
|
81396
|
+
}
|
|
81397
|
+
|
|
81398
|
+
// src/multi.ts
|
|
81353
81399
|
init_webui();
|
|
81354
81400
|
|
|
81355
81401
|
// src/consolidate-worker-client.ts
|
|
@@ -84403,6 +84449,15 @@ async function resolveProjectSymbolSalt(client, projectId) {
|
|
|
84403
84449
|
projectSymbolSalts.set(projectId, salt);
|
|
84404
84450
|
return { projectId, salt };
|
|
84405
84451
|
}
|
|
84452
|
+
var WATERMARK_BATCH = 250;
|
|
84453
|
+
async function stampBatched(items, stamp) {
|
|
84454
|
+
let i2 = 0;
|
|
84455
|
+
for (const item of items) {
|
|
84456
|
+
if (i2 > 0 && i2 % WATERMARK_BATCH === 0) await new Promise((r) => setImmediate(r));
|
|
84457
|
+
i2++;
|
|
84458
|
+
stamp(item);
|
|
84459
|
+
}
|
|
84460
|
+
}
|
|
84406
84461
|
function normPath(p) {
|
|
84407
84462
|
return p.replace(/\\/g, "/").replace(/\/+$/, "").toLowerCase();
|
|
84408
84463
|
}
|
|
@@ -85507,6 +85562,53 @@ async function startMultiDaemon(opts = {}) {
|
|
|
85507
85562
|
};
|
|
85508
85563
|
let uploaded = 0;
|
|
85509
85564
|
const errors = [];
|
|
85565
|
+
const workerFor = (r) => consolidateWorker && r.engine.paths.castalia !== ":memory:" ? consolidateWorker : null;
|
|
85566
|
+
const buildContextBatch = async (r, input) => {
|
|
85567
|
+
const w = workerFor(r);
|
|
85568
|
+
if (w) {
|
|
85569
|
+
try {
|
|
85570
|
+
return await w.run({
|
|
85571
|
+
kind: "drainContext",
|
|
85572
|
+
sharedDbPath,
|
|
85573
|
+
castaliaPath: r.engine.paths.castalia,
|
|
85574
|
+
drain: input
|
|
85575
|
+
});
|
|
85576
|
+
} catch (err2) {
|
|
85577
|
+
console.warn(
|
|
85578
|
+
`[errata] drain context-build worker failed \u2014 running inline: ${err2 instanceof Error ? err2.message : err2}`
|
|
85579
|
+
);
|
|
85580
|
+
}
|
|
85581
|
+
}
|
|
85582
|
+
const done = markPass(`drain-context-build-inline:${r.entry.name}`);
|
|
85583
|
+
try {
|
|
85584
|
+
return buildDrainContext(r.engine.store, input);
|
|
85585
|
+
} finally {
|
|
85586
|
+
done();
|
|
85587
|
+
}
|
|
85588
|
+
};
|
|
85589
|
+
const buildInstanceBatch = async (r, input) => {
|
|
85590
|
+
const w = workerFor(r);
|
|
85591
|
+
if (w) {
|
|
85592
|
+
try {
|
|
85593
|
+
return await w.run({
|
|
85594
|
+
kind: "drainInstances",
|
|
85595
|
+
sharedDbPath,
|
|
85596
|
+
castaliaPath: r.engine.paths.castalia,
|
|
85597
|
+
drain: input
|
|
85598
|
+
});
|
|
85599
|
+
} catch (err2) {
|
|
85600
|
+
console.warn(
|
|
85601
|
+
`[errata] drain instance-build worker failed \u2014 running inline: ${err2 instanceof Error ? err2.message : err2}`
|
|
85602
|
+
);
|
|
85603
|
+
}
|
|
85604
|
+
}
|
|
85605
|
+
const done = markPass(`drain-instance-build-inline:${r.entry.name}`);
|
|
85606
|
+
try {
|
|
85607
|
+
return buildDrainInstances(r.engine.store, sharedStore, input);
|
|
85608
|
+
} finally {
|
|
85609
|
+
done();
|
|
85610
|
+
}
|
|
85611
|
+
};
|
|
85510
85612
|
const lane = async (name2, projectName, run3) => {
|
|
85511
85613
|
try {
|
|
85512
85614
|
await run3();
|
|
@@ -85548,7 +85650,10 @@ async function startMultiDaemon(opts = {}) {
|
|
|
85548
85650
|
}
|
|
85549
85651
|
}
|
|
85550
85652
|
clearProjectHold(r.id);
|
|
85551
|
-
const context =
|
|
85653
|
+
const context = await buildContextBatch(r, {
|
|
85654
|
+
profile: r.engine.profile,
|
|
85655
|
+
daemonVersion: DAEMON_VERSION,
|
|
85656
|
+
ignorePatterns: [...ignore2],
|
|
85552
85657
|
includePackages: cfg2.consent.contributePackages
|
|
85553
85658
|
});
|
|
85554
85659
|
if (context) {
|
|
@@ -85556,12 +85661,14 @@ async function startMultiDaemon(opts = {}) {
|
|
|
85556
85661
|
const res = await client.ingest(context, {
|
|
85557
85662
|
onChunk: (p) => {
|
|
85558
85663
|
const seq = store.currentIngestSeq();
|
|
85559
|
-
|
|
85560
|
-
const
|
|
85561
|
-
|
|
85562
|
-
|
|
85563
|
-
|
|
85564
|
-
|
|
85664
|
+
store.transaction(() => {
|
|
85665
|
+
for (const wireId of p.nodeIds) {
|
|
85666
|
+
const localId = context.localIdByWireId[wireId] ?? wireId;
|
|
85667
|
+
const local = store.getNode(localId);
|
|
85668
|
+
if (!local) continue;
|
|
85669
|
+
store.updateNode(localId, { attrs: { ...local.attrs, contributedAtSeq: seq } });
|
|
85670
|
+
}
|
|
85671
|
+
});
|
|
85565
85672
|
if (p.blockedNodeIds?.length) {
|
|
85566
85673
|
console.log(
|
|
85567
85674
|
`[sync\u2192cloud] [${projectName}] context: ${p.blockedNodeIds.length} node(s) refused by an edge/CDN filter on content \u2014 left pending, will retry`
|
|
@@ -85574,25 +85681,21 @@ async function startMultiDaemon(opts = {}) {
|
|
|
85574
85681
|
return res.accepted;
|
|
85575
85682
|
});
|
|
85576
85683
|
}
|
|
85577
|
-
|
|
85578
|
-
|
|
85579
|
-
|
|
85580
|
-
|
|
85581
|
-
} catch (err2) {
|
|
85582
|
-
lexiconError = err2 instanceof Error ? err2.message : String(err2);
|
|
85583
|
-
console.warn(`[errata] symbol sidecar DISABLED for ${r.entry.name}: lexicon build failed \u2014 ${lexiconError}`);
|
|
85584
|
-
}
|
|
85585
|
-
let composition = null;
|
|
85586
|
-
const instances = buildInstanceIngest(store, r.engine.profile, DAEMON_VERSION, ignore2, {
|
|
85684
|
+
const built = await buildInstanceBatch(r, {
|
|
85685
|
+
profile: r.engine.profile,
|
|
85686
|
+
daemonVersion: DAEMON_VERSION,
|
|
85687
|
+
ignorePatterns: [...ignore2],
|
|
85587
85688
|
includePackages: cfg2.consent.contributePackages,
|
|
85588
85689
|
workspaceRoot: r.root,
|
|
85589
|
-
sharedStore,
|
|
85590
|
-
onComposition: (c) => {
|
|
85591
|
-
composition = c;
|
|
85592
|
-
},
|
|
85593
|
-
...lexicon ? { lexicon } : {},
|
|
85594
85690
|
...project ? { project } : {}
|
|
85595
85691
|
});
|
|
85692
|
+
if (built.lexiconError) {
|
|
85693
|
+
console.warn(
|
|
85694
|
+
`[errata] symbol sidecar DISABLED for ${r.entry.name}: lexicon build failed \u2014 ${built.lexiconError}`
|
|
85695
|
+
);
|
|
85696
|
+
}
|
|
85697
|
+
const composition = built.composition;
|
|
85698
|
+
const instances = built.batch;
|
|
85596
85699
|
if (!instances && composition) {
|
|
85597
85700
|
appendPassLedger(r.engine.paths.configDir, "ship", 0, {
|
|
85598
85701
|
...compositionCounters(composition),
|
|
@@ -85685,11 +85788,11 @@ async function startMultiDaemon(opts = {}) {
|
|
|
85685
85788
|
`[sync\u2192cloud] [${projectName}] instances: HOLDING ${nowHeld.length} node(s) \u2014 refused identically ${SHIP_TERMINAL_REFUSALS}\xD7 on unchanged text; not re-sent until the text changes: ` + nowHeld.map(({ id, reason }) => `${id} "${owningStore(id)?.n.description.slice(0, 60) ?? ""}": ${reason}`).join(" | ")
|
|
85686
85789
|
);
|
|
85687
85790
|
}
|
|
85688
|
-
|
|
85791
|
+
await stampBatched(instances.nodes, (n) => {
|
|
85689
85792
|
const owner = owningStore(n.id);
|
|
85690
|
-
if (!owner || !["Problem", "Solution", "RootCause"].includes(owner.n.label))
|
|
85691
|
-
if (blocked.has(n.id))
|
|
85692
|
-
if (rejected.has(n.id))
|
|
85793
|
+
if (!owner || !["Problem", "Solution", "RootCause"].includes(owner.n.label)) return;
|
|
85794
|
+
if (blocked.has(n.id)) return;
|
|
85795
|
+
if (rejected.has(n.id)) return;
|
|
85693
85796
|
const cloudNodeId = cloudIdByLocal.get(n.id);
|
|
85694
85797
|
const {
|
|
85695
85798
|
shipRefusedSinceSeq: _clearedSeq,
|
|
@@ -85705,31 +85808,31 @@ async function startMultiDaemon(opts = {}) {
|
|
|
85705
85808
|
...cloudNodeId && cloudNodeId !== n.id ? { cloudNodeId } : {}
|
|
85706
85809
|
}
|
|
85707
85810
|
});
|
|
85708
|
-
}
|
|
85709
|
-
|
|
85811
|
+
});
|
|
85812
|
+
await stampBatched(Object.entries(instances.anchorDigests), ([localId, dg]) => {
|
|
85710
85813
|
const owner = owningStore(localId);
|
|
85711
|
-
if (!owner)
|
|
85712
|
-
if (rejected.has(localId) || blocked.has(localId))
|
|
85814
|
+
if (!owner) return;
|
|
85815
|
+
if (rejected.has(localId) || blocked.has(localId)) return;
|
|
85713
85816
|
owner.s.updateNode(localId, {
|
|
85714
85817
|
attrs: { ...owner.n.attrs, anchorsContributedDigest: dg }
|
|
85715
85818
|
});
|
|
85716
|
-
}
|
|
85717
|
-
|
|
85819
|
+
});
|
|
85820
|
+
await stampBatched(Object.entries(instances.projectAnchorDigests), ([localId, dg]) => {
|
|
85718
85821
|
const owner = owningStore(localId);
|
|
85719
|
-
if (!owner)
|
|
85720
|
-
if (rejected.has(localId) || blocked.has(localId))
|
|
85822
|
+
if (!owner) return;
|
|
85823
|
+
if (rejected.has(localId) || blocked.has(localId)) return;
|
|
85721
85824
|
owner.s.updateNode(localId, {
|
|
85722
85825
|
attrs: { ...owner.n.attrs, projectAnchorsContributedDigest: dg }
|
|
85723
85826
|
});
|
|
85724
|
-
}
|
|
85725
|
-
|
|
85827
|
+
});
|
|
85828
|
+
await stampBatched(Object.entries(instances.semanticEdgeDigests), ([localId, dg]) => {
|
|
85726
85829
|
const owner = owningStore(localId);
|
|
85727
|
-
if (!owner)
|
|
85728
|
-
if (rejected.has(localId) || blocked.has(localId))
|
|
85830
|
+
if (!owner) return;
|
|
85831
|
+
if (rejected.has(localId) || blocked.has(localId)) return;
|
|
85729
85832
|
owner.s.updateNode(localId, {
|
|
85730
85833
|
attrs: { ...owner.n.attrs, semanticEdgesContributedDigest: dg }
|
|
85731
85834
|
});
|
|
85732
|
-
}
|
|
85835
|
+
});
|
|
85733
85836
|
appendPassLedger(r.engine.paths.configDir, "ship", Date.now() - shipStartedAt, {
|
|
85734
85837
|
...compositionCounters(instances.composition),
|
|
85735
85838
|
accepted: res.accepted,
|
package/package.json
CHANGED
package/pass-worker.mjs
CHANGED
|
@@ -15463,6 +15463,21 @@ var init_anchorable = __esm({
|
|
|
15463
15463
|
});
|
|
15464
15464
|
|
|
15465
15465
|
// ../../packages/local-shared/src/sqlite-adapter.ts
|
|
15466
|
+
function loadNodeSqlite() {
|
|
15467
|
+
const original = process.emitWarning;
|
|
15468
|
+
process.emitWarning = function(warning, ...rest) {
|
|
15469
|
+
const text = typeof warning === "string" ? warning : warning?.message ?? "";
|
|
15470
|
+
const opt = rest[0];
|
|
15471
|
+
const type = typeof opt === "string" ? opt : opt?.type ?? warning?.name;
|
|
15472
|
+
if (type === "ExperimentalWarning" && /SQLite/i.test(text)) return;
|
|
15473
|
+
return original.call(process, warning, ...rest);
|
|
15474
|
+
};
|
|
15475
|
+
try {
|
|
15476
|
+
return process.getBuiltinModule("node:sqlite");
|
|
15477
|
+
} finally {
|
|
15478
|
+
process.emitWarning = original;
|
|
15479
|
+
}
|
|
15480
|
+
}
|
|
15466
15481
|
function openDatabase(path) {
|
|
15467
15482
|
const db = new DatabaseSync(path);
|
|
15468
15483
|
try {
|
|
@@ -15544,12 +15559,11 @@ function normalizeParam(v) {
|
|
|
15544
15559
|
if (typeof v === "boolean") return v ? 1 : 0;
|
|
15545
15560
|
return v;
|
|
15546
15561
|
}
|
|
15547
|
-
var
|
|
15562
|
+
var DatabaseSync;
|
|
15548
15563
|
var init_sqlite_adapter = __esm({
|
|
15549
15564
|
"../../packages/local-shared/src/sqlite-adapter.ts"() {
|
|
15550
15565
|
"use strict";
|
|
15551
|
-
|
|
15552
|
-
DatabaseSync = nodeSqlite.DatabaseSync;
|
|
15566
|
+
DatabaseSync = loadNodeSqlite().DatabaseSync;
|
|
15553
15567
|
}
|
|
15554
15568
|
});
|
|
15555
15569
|
|