@inerrata-corporation/errata 2.0.16-dev.3355 → 2.0.16
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 +10 -26
- package/errata.mjs +508 -521
- package/package.json +1 -1
- package/pass-worker.mjs +11 -12
package/consolidate-worker.mjs
CHANGED
|
@@ -802,12 +802,6 @@ function identityId(input) {
|
|
|
802
802
|
}
|
|
803
803
|
case "Claim":
|
|
804
804
|
return canonicalClaimId(input.text, input.scope);
|
|
805
|
-
case "WitnessedVulnerability":
|
|
806
|
-
return genericCanonicalId("dvuln", {
|
|
807
|
-
workspaceId: input.workspaceId,
|
|
808
|
-
target: input.target.replace(/\\/g, "/").replace(/^\.\//, ""),
|
|
809
|
-
statement: canonicalClaimId(input.statement.trim())
|
|
810
|
-
});
|
|
811
805
|
case "DesignProblem":
|
|
812
806
|
return `${DESIGN_PROBLEM_PREFIX}${canonicalClaimId(input.statement.trim())}`.slice(
|
|
813
807
|
0,
|
|
@@ -15264,7 +15258,7 @@ var init_edge_rules = __esm({
|
|
|
15264
15258
|
// anchor anything at anything, e.g. at a public `Package`, quietly re-creating
|
|
15265
15259
|
// the code↔collective bridge the membrane exists to prevent.
|
|
15266
15260
|
ANCHORED_AT: {
|
|
15267
|
-
from: ["Problem", "
|
|
15261
|
+
from: ["Problem", "Solution", "RootCause", "Claim"],
|
|
15268
15262
|
to: ["Symbol"]
|
|
15269
15263
|
},
|
|
15270
15264
|
// ── Security spine (v1 taxonomy.ts SECURITY_FORWARD_ONLY commentary) ──
|
|
@@ -15309,7 +15303,7 @@ var init_edge_rules = __esm({
|
|
|
15309
15303
|
// `Component` joined the target set with OM-agent-anchors: an agent-named
|
|
15310
15304
|
// component ("React Router") is the same knowledge→named-unit anchor shape as
|
|
15311
15305
|
// a Tool — the knowledge is ABOUT it, not dependent on it.
|
|
15312
|
-
CONCERNS: { from: ["Problem", "
|
|
15306
|
+
CONCERNS: { from: ["Problem", "Solution", "RootCause", "Claim", "Pattern"], to: ["Tool", "Component"] },
|
|
15313
15307
|
OPERATES_ON: { from: ["Algorithm"], to: ["DataStructure"] },
|
|
15314
15308
|
INVOLVES: { from: ["Problem", "Solution"], to: ["DataStructure"] },
|
|
15315
15309
|
// ── Taxonomy (Track 4 Stream C: MITRE CWE `ChildOf` → `Weakness —IS_A→ Weakness`) ──
|
|
@@ -16416,8 +16410,7 @@ CREATE INDEX IF NOT EXISTS nodes_live ON nodes(label, valid_to);
|
|
|
16416
16410
|
-- its table row. Partial, so it maintains a few thousand rows instead of adding
|
|
16417
16411
|
-- a write to every node write. Its label list is FINGERPRINT_INDEXED_LABELS.
|
|
16418
16412
|
DROP INDEX IF EXISTS nodes_live_fingerprint;
|
|
16419
|
-
|
|
16420
|
-
CREATE INDEX IF NOT EXISTS nodes_instance_fingerprint_v2 ON nodes(label, last_updated_at, last_reinforced_at_seq, created_at_seq) WHERE valid_to IS NULL AND label IN ('Problem','Vulnerability','Solution','RootCause');
|
|
16413
|
+
CREATE INDEX IF NOT EXISTS nodes_instance_fingerprint ON nodes(label, last_updated_at, last_reinforced_at_seq, created_at_seq) WHERE valid_to IS NULL AND label IN ('Problem','Solution','RootCause');
|
|
16421
16414
|
CREATE INDEX IF NOT EXISTS nodes_logical ON nodes(logical_id, version);
|
|
16422
16415
|
CREATE INDEX IF NOT EXISTS edges_live ON edges(valid_to);
|
|
16423
16416
|
-- Expression index on the per-node relPath (stored in attrs_json) so the
|
|
@@ -16488,7 +16481,7 @@ function rowToEdge(r) {
|
|
|
16488
16481
|
attrs: JSON.parse(r.attrs_json)
|
|
16489
16482
|
};
|
|
16490
16483
|
}
|
|
16491
|
-
var FINGERPRINT_INDEXED_LABELS = ["Problem", "
|
|
16484
|
+
var FINGERPRINT_INDEXED_LABELS = ["Problem", "Solution", "RootCause"];
|
|
16492
16485
|
var SqliteGraphStore = class {
|
|
16493
16486
|
db;
|
|
16494
16487
|
// Typed edge lookups build their SQL from the number of types asked for, and
|
|
@@ -17166,8 +17159,8 @@ var SqliteGraphStore = class {
|
|
|
17166
17159
|
const r2 = this.db.prepare(
|
|
17167
17160
|
`SELECT COUNT(*) AS n, MAX(last_updated_at) AS t,
|
|
17168
17161
|
MAX(COALESCE(last_reinforced_at_seq, created_at_seq, 0)) AS s
|
|
17169
|
-
FROM nodes INDEXED BY
|
|
17170
|
-
WHERE valid_to IS NULL AND label IN ('Problem','
|
|
17162
|
+
FROM nodes INDEXED BY nodes_instance_fingerprint
|
|
17163
|
+
WHERE valid_to IS NULL AND label IN ('Problem','Solution','RootCause')`
|
|
17171
17164
|
).get();
|
|
17172
17165
|
return `${r2.n}:${r2.t ?? 0}:${r2.s ?? 0}`;
|
|
17173
17166
|
}
|
|
@@ -19396,7 +19389,7 @@ function generalizeFileRefs(text, fileLexicon, level = 1) {
|
|
|
19396
19389
|
}
|
|
19397
19390
|
|
|
19398
19391
|
// src/instance-ingest.ts
|
|
19399
|
-
var INSTANCE_LABELS = ["Problem", "
|
|
19392
|
+
var INSTANCE_LABELS = ["Problem", "Solution", "RootCause"];
|
|
19400
19393
|
var INSTANCE_EDGES = ["CAUSED_BY", "SOLVED_BY"];
|
|
19401
19394
|
var ANCHOR_EDGES = ["OCCURS_IN", "DEPENDS_ON", "PERTAIN_TO", "CONCERNS"];
|
|
19402
19395
|
var ANCHOR_TARGET_LABELS = ["Language", "Package", "Domain", "Component"];
|
|
@@ -19516,10 +19509,6 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
|
|
|
19516
19509
|
attrs: {
|
|
19517
19510
|
scope: stripCodebaseScope(n.attrs["scope"]),
|
|
19518
19511
|
...n.attrs["kind"] ? { kind: n.attrs["kind"] } : {},
|
|
19519
|
-
...n.attrs["privateFinding"] ? { privateFinding: true } : {},
|
|
19520
|
-
...n.attrs["assessment"] ? { assessment: n.attrs["assessment"] } : {},
|
|
19521
|
-
...n.attrs["sourceClass"] ? { sourceClass: n.attrs["sourceClass"] } : {},
|
|
19522
|
-
...n.attrs["resolutionWitnessed"] ? { resolutionWitnessed: true, resolvedAt: n.attrs["resolvedAt"] } : {},
|
|
19523
19512
|
...n.attrs["resolvedAs"] ? { resolvedAs: n.attrs["resolvedAs"] } : {},
|
|
19524
19513
|
...preserved.length > 0 ? { preservedSymbols: preserved } : {},
|
|
19525
19514
|
...internal.length > 0 ? { internalSymbols: internal } : {}
|
|
@@ -19534,7 +19523,6 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
|
|
|
19534
19523
|
const semanticEndpoints = /* @__PURE__ */ new Map();
|
|
19535
19524
|
const includedByLabel = /* @__PURE__ */ new Map();
|
|
19536
19525
|
const composition = {
|
|
19537
|
-
privateTargetMissing: 0,
|
|
19538
19526
|
candidates: 0,
|
|
19539
19527
|
shipped: 0,
|
|
19540
19528
|
cloudSourced: 0,
|
|
@@ -19580,15 +19568,11 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
|
|
|
19580
19568
|
if (walked.has(n.id)) continue;
|
|
19581
19569
|
walked.add(n.id);
|
|
19582
19570
|
composition.candidates++;
|
|
19583
|
-
if ((n.attrs["privateFinding"] || n.label === "Vulnerability") && !opts.project) {
|
|
19584
|
-
composition.privateTargetMissing++;
|
|
19585
|
-
continue;
|
|
19586
|
-
}
|
|
19587
19571
|
if (n.attrs["source"] === "cloud") {
|
|
19588
19572
|
composition.cloudSourced++;
|
|
19589
19573
|
continue;
|
|
19590
19574
|
}
|
|
19591
|
-
if (n.attrs["resolvedAs"] === PROBLEM_RESOLUTION.FALSE_POSITIVE) {
|
|
19575
|
+
if (label === "Problem" && n.attrs["resolvedAs"] === PROBLEM_RESOLUTION.FALSE_POSITIVE) {
|
|
19592
19576
|
composition.falsePositive++;
|
|
19593
19577
|
continue;
|
|
19594
19578
|
}
|
|
@@ -19611,7 +19595,7 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
|
|
|
19611
19595
|
composition.terminalRefused++;
|
|
19612
19596
|
continue;
|
|
19613
19597
|
}
|
|
19614
|
-
if (!
|
|
19598
|
+
if (!noveltyAgainst(n, ref, noveltyOpts).ready) {
|
|
19615
19599
|
composition.notNovel++;
|
|
19616
19600
|
continue;
|
|
19617
19601
|
}
|
|
@@ -19654,7 +19638,7 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
|
|
|
19654
19638
|
}
|
|
19655
19639
|
if (targets.length === 0) continue;
|
|
19656
19640
|
const shipped = shippedById.get(sourceId);
|
|
19657
|
-
if (shipped
|
|
19641
|
+
if (shipped) {
|
|
19658
19642
|
const anchors = (label) => targets.filter((x) => x.t.label === label).map(
|
|
19659
19643
|
(x) => label === "Language" ? langAnchor(x.t) : label === "Component" ? `component:${x.wireId}` : x.wireId
|
|
19660
19644
|
).filter((a) => a != null).sort();
|