@inerrata-corporation/errata 2.0.23-dev.4734 → 2.0.23-dev.4796
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/generalize-worker.mjs
CHANGED
|
@@ -16010,7 +16010,8 @@ var SELECT_INDEXES = [
|
|
|
16010
16010
|
"nodes_live_fold_candidate",
|
|
16011
16011
|
"nodes_live_resolved",
|
|
16012
16012
|
"nodes_live_fix_candidate",
|
|
16013
|
-
"nodes_live_anchor_hint"
|
|
16013
|
+
"nodes_live_anchor_hint",
|
|
16014
|
+
"nodes_live_created_v2"
|
|
16014
16015
|
];
|
|
16015
16016
|
var EMBEDDING_DIM_SQL = "(CASE WHEN length(embedding_blob) >= 4 THEN length(embedding_blob) / 4 ELSE COALESCE(json_array_length(embedding_json), 0) END)";
|
|
16016
16017
|
var KEY = /^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;
|
|
@@ -16331,7 +16332,10 @@ CREATE UNIQUE INDEX IF NOT EXISTS edges_triple ON edges(from_id, type, to_id);
|
|
|
16331
16332
|
`;
|
|
16332
16333
|
var TEMPORAL_INDEX_SQL = `
|
|
16333
16334
|
CREATE INDEX IF NOT EXISTS nodes_live ON nodes(label, valid_to);
|
|
16334
|
-
|
|
16335
|
+
-- Dropped: a prefix of nodes_live_page_rank (valid_to, page_rank), which serves
|
|
16336
|
+
-- the live count and the "any live node?" check as a covering index too. It was
|
|
16337
|
+
-- re-keyed on every close and revive: ~11 KB of a symbol flip's ~80 KB.
|
|
16338
|
+
DROP INDEX IF EXISTS nodes_live_count;
|
|
16335
16339
|
-- Problems by recency (the only label read newest-first). Over every live row,
|
|
16336
16340
|
-- each write that stamps last_updated_at moved a code symbol's entry from a
|
|
16337
16341
|
-- scattered leaf: ~19 KB per position-only symbol rewrite on a 1.1 GB store.
|
|
@@ -16343,7 +16347,13 @@ CREATE INDEX IF NOT EXISTS nodes_live_problem_recent ON nodes(label, last_update
|
|
|
16343
16347
|
-- walks nodes_live and reads every live row of the label to test created_at:
|
|
16344
16348
|
-- 56 MB per guard on a 1.1 GB store, to learn there was nothing to do. valid_to
|
|
16345
16349
|
-- is a key column so the planner prefers this over nodes_live (one more term).
|
|
16346
|
-
|
|
16350
|
+
-- last_updated_at rides along for errata.recent on code labels, which names this
|
|
16351
|
+
-- index: the filter runs on index entries, not on every row of the label (79 ms
|
|
16352
|
+
-- \u2192 3 ms for Function on a 1.1 GB store). It costs no extra writes: a close or
|
|
16353
|
+
-- revive already re-keys this index, and mergeNodeIfChanged leaves a symbol's
|
|
16354
|
+
-- last_updated_at alone when only its position moved.
|
|
16355
|
+
DROP INDEX IF EXISTS nodes_live_created;
|
|
16356
|
+
CREATE INDEX IF NOT EXISTS nodes_live_created_v2 ON nodes(label, valid_to, created_at, last_updated_at) WHERE valid_to IS NULL;
|
|
16347
16357
|
-- Community members (the skills pull reads them twice per session boundary):
|
|
16348
16358
|
-- ~15% of semantic nodes carry a localCommunity, and without this every live
|
|
16349
16359
|
-- semantic row was read to find them (168 MB \u2192 18 MB per read).
|
|
@@ -16528,6 +16538,12 @@ function sameSqlValue(a, b) {
|
|
|
16528
16538
|
if (a instanceof Uint8Array && b instanceof Uint8Array) return Buffer.compare(a, b) === 0;
|
|
16529
16539
|
return false;
|
|
16530
16540
|
}
|
|
16541
|
+
var POSITION_ATTRS = ["startByte", "endByte", "startRow"];
|
|
16542
|
+
function attrsJsonWithoutPositions(attrs) {
|
|
16543
|
+
const rest = { ...attrs };
|
|
16544
|
+
for (const k of POSITION_ATTRS) delete rest[k];
|
|
16545
|
+
return JSON.stringify(rest);
|
|
16546
|
+
}
|
|
16531
16547
|
var PRIOR_TAG_MARKER = '"priorTag":true';
|
|
16532
16548
|
var SqliteGraphStore = class {
|
|
16533
16549
|
db;
|
|
@@ -16628,7 +16644,7 @@ var SqliteGraphStore = class {
|
|
|
16628
16644
|
lastUpdatedOf: this.db.prepare("SELECT last_updated_at AS t, attrs_json FROM nodes WHERE id = ?"),
|
|
16629
16645
|
labelOf: this.db.prepare("SELECT label FROM nodes WHERE id = ?"),
|
|
16630
16646
|
nodeContent: this.db.prepare(
|
|
16631
|
-
"SELECT label, description, extraction_confidence, extraction_source, stability, valid_to, attrs_json FROM nodes WHERE id = ?"
|
|
16647
|
+
"SELECT label, description, extraction_confidence, extraction_source, stability, valid_to, last_updated_at, attrs_json FROM nodes WHERE id = ?"
|
|
16632
16648
|
),
|
|
16633
16649
|
edgeContent: this.db.prepare(
|
|
16634
16650
|
"SELECT confidence, valid_to, attrs_json FROM edges WHERE from_id = ? AND type = ? AND to_id = ?"
|
|
@@ -17041,11 +17057,23 @@ var SqliteGraphStore = class {
|
|
|
17041
17057
|
* rank, community, landmark, surprise, hits, tier and the vector belong to
|
|
17042
17058
|
* the passes that compute them, and a skipped write leaves them as they are
|
|
17043
17059
|
* where a merge would have reset them to the producer's defaults. Returns
|
|
17044
|
-
* whether it wrote.
|
|
17060
|
+
* whether it wrote.
|
|
17061
|
+
*
|
|
17062
|
+
* A live row whose only change is its position keeps its lastUpdatedAt, so
|
|
17063
|
+
* that stamp means "this symbol's content changed": what errata.recent lists
|
|
17064
|
+
* and the fix-candidate ask reads, and what lets nodes_live_created_v2 carry
|
|
17065
|
+
* it without being re-keyed by every edit above a symbol. A closed row is
|
|
17066
|
+
* always stamped: reviveReobserved reopens what this pass stamped. */
|
|
17045
17067
|
mergeNodeIfChanged(node) {
|
|
17046
17068
|
const row = this.stmts.nodeContent.get(node.id);
|
|
17047
|
-
if (row
|
|
17048
|
-
|
|
17069
|
+
if (!row || row.valid_to !== null || row.label !== node.label || row.description !== node.description || row.extraction_confidence !== node.extractionConfidence || row.stability !== node.stability || EXPOSURE_ATTRS.some((k) => node.attrs?.[k] !== void 0)) {
|
|
17070
|
+
this.mergeNode(node);
|
|
17071
|
+
return true;
|
|
17072
|
+
}
|
|
17073
|
+
const attrs = node.attrs ?? {};
|
|
17074
|
+
if (row.attrs_json === JSON.stringify(attrs)) return false;
|
|
17075
|
+
const moved = attrsJsonWithoutPositions(JSON.parse(row.attrs_json)) === attrsJsonWithoutPositions(attrs);
|
|
17076
|
+
this.mergeNode(moved ? { ...node, lastUpdatedAt: row.last_updated_at } : node);
|
|
17049
17077
|
return true;
|
|
17050
17078
|
}
|
|
17051
17079
|
updateNode(id, patch) {
|
|
@@ -17125,8 +17153,8 @@ var SqliteGraphStore = class {
|
|
|
17125
17153
|
stmt2 = this.db.prepare(
|
|
17126
17154
|
// Ordered, not left to the planner: readers take "first row wins" (the
|
|
17127
17155
|
// symbol lexicon's name winner and doc pick), and the order otherwise
|
|
17128
|
-
// followed whichever partial index the planner chose.
|
|
17129
|
-
// serves
|
|
17156
|
+
// followed whichever partial index the planner chose. nodes_live_created_v2
|
|
17157
|
+
// serves it, sorting rowids only within an equal created_at.
|
|
17130
17158
|
`SELECT id, description, community, extraction_confidence${cols} FROM nodes WHERE label = ? AND valid_to IS NULL ORDER BY created_at, rowid`
|
|
17131
17159
|
);
|
|
17132
17160
|
this.fieldStmts.set(cacheKey, stmt2);
|
package/package.json
CHANGED
package/pass-worker.mjs
CHANGED
|
@@ -26982,7 +26982,8 @@ var SELECT_INDEXES = [
|
|
|
26982
26982
|
"nodes_live_fold_candidate",
|
|
26983
26983
|
"nodes_live_resolved",
|
|
26984
26984
|
"nodes_live_fix_candidate",
|
|
26985
|
-
"nodes_live_anchor_hint"
|
|
26985
|
+
"nodes_live_anchor_hint",
|
|
26986
|
+
"nodes_live_created_v2"
|
|
26986
26987
|
];
|
|
26987
26988
|
var EMBEDDING_DIM_SQL = "(CASE WHEN length(embedding_blob) >= 4 THEN length(embedding_blob) / 4 ELSE COALESCE(json_array_length(embedding_json), 0) END)";
|
|
26988
26989
|
var KEY = /^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;
|
|
@@ -27303,7 +27304,10 @@ CREATE UNIQUE INDEX IF NOT EXISTS edges_triple ON edges(from_id, type, to_id);
|
|
|
27303
27304
|
`;
|
|
27304
27305
|
var TEMPORAL_INDEX_SQL = `
|
|
27305
27306
|
CREATE INDEX IF NOT EXISTS nodes_live ON nodes(label, valid_to);
|
|
27306
|
-
|
|
27307
|
+
-- Dropped: a prefix of nodes_live_page_rank (valid_to, page_rank), which serves
|
|
27308
|
+
-- the live count and the "any live node?" check as a covering index too. It was
|
|
27309
|
+
-- re-keyed on every close and revive: ~11 KB of a symbol flip's ~80 KB.
|
|
27310
|
+
DROP INDEX IF EXISTS nodes_live_count;
|
|
27307
27311
|
-- Problems by recency (the only label read newest-first). Over every live row,
|
|
27308
27312
|
-- each write that stamps last_updated_at moved a code symbol's entry from a
|
|
27309
27313
|
-- scattered leaf: ~19 KB per position-only symbol rewrite on a 1.1 GB store.
|
|
@@ -27315,7 +27319,13 @@ CREATE INDEX IF NOT EXISTS nodes_live_problem_recent ON nodes(label, last_update
|
|
|
27315
27319
|
-- walks nodes_live and reads every live row of the label to test created_at:
|
|
27316
27320
|
-- 56 MB per guard on a 1.1 GB store, to learn there was nothing to do. valid_to
|
|
27317
27321
|
-- is a key column so the planner prefers this over nodes_live (one more term).
|
|
27318
|
-
|
|
27322
|
+
-- last_updated_at rides along for errata.recent on code labels, which names this
|
|
27323
|
+
-- index: the filter runs on index entries, not on every row of the label (79 ms
|
|
27324
|
+
-- \u2192 3 ms for Function on a 1.1 GB store). It costs no extra writes: a close or
|
|
27325
|
+
-- revive already re-keys this index, and mergeNodeIfChanged leaves a symbol's
|
|
27326
|
+
-- last_updated_at alone when only its position moved.
|
|
27327
|
+
DROP INDEX IF EXISTS nodes_live_created;
|
|
27328
|
+
CREATE INDEX IF NOT EXISTS nodes_live_created_v2 ON nodes(label, valid_to, created_at, last_updated_at) WHERE valid_to IS NULL;
|
|
27319
27329
|
-- Community members (the skills pull reads them twice per session boundary):
|
|
27320
27330
|
-- ~15% of semantic nodes carry a localCommunity, and without this every live
|
|
27321
27331
|
-- semantic row was read to find them (168 MB \u2192 18 MB per read).
|
|
@@ -27500,6 +27510,12 @@ function sameSqlValue(a, b) {
|
|
|
27500
27510
|
if (a instanceof Uint8Array && b instanceof Uint8Array) return Buffer.compare(a, b) === 0;
|
|
27501
27511
|
return false;
|
|
27502
27512
|
}
|
|
27513
|
+
var POSITION_ATTRS = ["startByte", "endByte", "startRow"];
|
|
27514
|
+
function attrsJsonWithoutPositions(attrs) {
|
|
27515
|
+
const rest = { ...attrs };
|
|
27516
|
+
for (const k of POSITION_ATTRS) delete rest[k];
|
|
27517
|
+
return JSON.stringify(rest);
|
|
27518
|
+
}
|
|
27503
27519
|
var PRIOR_TAG_MARKER = '"priorTag":true';
|
|
27504
27520
|
var SqliteGraphStore = class {
|
|
27505
27521
|
db;
|
|
@@ -27600,7 +27616,7 @@ var SqliteGraphStore = class {
|
|
|
27600
27616
|
lastUpdatedOf: this.db.prepare("SELECT last_updated_at AS t, attrs_json FROM nodes WHERE id = ?"),
|
|
27601
27617
|
labelOf: this.db.prepare("SELECT label FROM nodes WHERE id = ?"),
|
|
27602
27618
|
nodeContent: this.db.prepare(
|
|
27603
|
-
"SELECT label, description, extraction_confidence, extraction_source, stability, valid_to, attrs_json FROM nodes WHERE id = ?"
|
|
27619
|
+
"SELECT label, description, extraction_confidence, extraction_source, stability, valid_to, last_updated_at, attrs_json FROM nodes WHERE id = ?"
|
|
27604
27620
|
),
|
|
27605
27621
|
edgeContent: this.db.prepare(
|
|
27606
27622
|
"SELECT confidence, valid_to, attrs_json FROM edges WHERE from_id = ? AND type = ? AND to_id = ?"
|
|
@@ -28013,11 +28029,23 @@ var SqliteGraphStore = class {
|
|
|
28013
28029
|
* rank, community, landmark, surprise, hits, tier and the vector belong to
|
|
28014
28030
|
* the passes that compute them, and a skipped write leaves them as they are
|
|
28015
28031
|
* where a merge would have reset them to the producer's defaults. Returns
|
|
28016
|
-
* whether it wrote.
|
|
28032
|
+
* whether it wrote.
|
|
28033
|
+
*
|
|
28034
|
+
* A live row whose only change is its position keeps its lastUpdatedAt, so
|
|
28035
|
+
* that stamp means "this symbol's content changed": what errata.recent lists
|
|
28036
|
+
* and the fix-candidate ask reads, and what lets nodes_live_created_v2 carry
|
|
28037
|
+
* it without being re-keyed by every edit above a symbol. A closed row is
|
|
28038
|
+
* always stamped: reviveReobserved reopens what this pass stamped. */
|
|
28017
28039
|
mergeNodeIfChanged(node) {
|
|
28018
28040
|
const row = this.stmts.nodeContent.get(node.id);
|
|
28019
|
-
if (row
|
|
28020
|
-
|
|
28041
|
+
if (!row || row.valid_to !== null || row.label !== node.label || row.description !== node.description || row.extraction_confidence !== node.extractionConfidence || row.stability !== node.stability || EXPOSURE_ATTRS.some((k) => node.attrs?.[k] !== void 0)) {
|
|
28042
|
+
this.mergeNode(node);
|
|
28043
|
+
return true;
|
|
28044
|
+
}
|
|
28045
|
+
const attrs = node.attrs ?? {};
|
|
28046
|
+
if (row.attrs_json === JSON.stringify(attrs)) return false;
|
|
28047
|
+
const moved = attrsJsonWithoutPositions(JSON.parse(row.attrs_json)) === attrsJsonWithoutPositions(attrs);
|
|
28048
|
+
this.mergeNode(moved ? { ...node, lastUpdatedAt: row.last_updated_at } : node);
|
|
28021
28049
|
return true;
|
|
28022
28050
|
}
|
|
28023
28051
|
updateNode(id, patch) {
|
|
@@ -28097,8 +28125,8 @@ var SqliteGraphStore = class {
|
|
|
28097
28125
|
stmt2 = this.db.prepare(
|
|
28098
28126
|
// Ordered, not left to the planner: readers take "first row wins" (the
|
|
28099
28127
|
// symbol lexicon's name winner and doc pick), and the order otherwise
|
|
28100
|
-
// followed whichever partial index the planner chose.
|
|
28101
|
-
// serves
|
|
28128
|
+
// followed whichever partial index the planner chose. nodes_live_created_v2
|
|
28129
|
+
// serves it, sorting rowids only within an equal created_at.
|
|
28102
28130
|
`SELECT id, description, community, extraction_confidence${cols} FROM nodes WHERE label = ? AND valid_to IS NULL ORDER BY created_at, rowid`
|
|
28103
28131
|
);
|
|
28104
28132
|
this.fieldStmts.set(cacheKey, stmt2);
|
|
@@ -29130,10 +29158,12 @@ function crystallize(store2, opts = { ts: 0 }) {
|
|
|
29130
29158
|
const s = support(c) + Math.max(0, sourcesCount(c) - 1);
|
|
29131
29159
|
const f = contradictions;
|
|
29132
29160
|
const confidence = (1 + s) / (2 + s + f);
|
|
29133
|
-
|
|
29134
|
-
|
|
29135
|
-
|
|
29136
|
-
|
|
29161
|
+
if (c.attrs["confidence"] !== confidence) {
|
|
29162
|
+
store2.updateNode(c.id, {
|
|
29163
|
+
attrs: { ...c.attrs, confidence },
|
|
29164
|
+
lastUpdatedAt: opts.ts
|
|
29165
|
+
});
|
|
29166
|
+
}
|
|
29137
29167
|
const sup = support(c);
|
|
29138
29168
|
let tier = c.memoryTier;
|
|
29139
29169
|
if (sup >= PERSISTENT_SUPPORT && confidence >= PERSISTENT_CONFIDENCE) tier = "persistent";
|
|
@@ -29201,7 +29231,10 @@ function mergeTruthKind(a, b) {
|
|
|
29201
29231
|
function markBoth(store2, a, b, patch, ts) {
|
|
29202
29232
|
for (const n of [a, b]) {
|
|
29203
29233
|
const fresh = store2.getNode(n.id);
|
|
29204
|
-
|
|
29234
|
+
const next = { ...patch };
|
|
29235
|
+
if (fresh.attrs["revisit"] === true && fresh.attrs["revisitReason"] === next["revisitReason"]) delete next["revisitSinceTs"];
|
|
29236
|
+
if (Object.entries(next).every(([k, v]) => fresh.attrs[k] === v)) continue;
|
|
29237
|
+
store2.updateNode(n.id, { attrs: { ...fresh.attrs, ...next }, lastUpdatedAt: ts });
|
|
29205
29238
|
}
|
|
29206
29239
|
}
|
|
29207
29240
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
65e39d2985c41acb67f59e3b44bd9eeff584addcae3c7cf6db9006fa89c0bea8 .codex-plugin/plugin.json
|
|
2
2
|
a7bebae9fb01c838d6c75fc784129e28be571233fa66ff5ee8039b574f35ccf7 assets/icon.png
|
|
3
3
|
fc38b64e4df1e0b72c35764bef6c4c05430d97c9009ad0ecc8a9e75b4deab232 configure-local.mjs
|
|
4
4
|
73dc6028b3b070257c7c31f252d11e55a9e096f4aed0f187f10cb21716e1e6d7 dist/client.js
|