@inerrata-corporation/errata 2.0.8-dev.2956 → 2.0.8-dev.2965
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 +4 -1
- package/errata.mjs +60 -16
- package/package.json +1 -1
- package/pass-worker.mjs +4 -1
package/consolidate-worker.mjs
CHANGED
|
@@ -15351,7 +15351,7 @@ function anchorLabelAttrs(attrs) {
|
|
|
15351
15351
|
...typeof line === "number" && Number.isInteger(line) && line >= 1 && line <= 1e7 ? { labelLine: line } : {}
|
|
15352
15352
|
};
|
|
15353
15353
|
}
|
|
15354
|
-
var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, PROJECT_ONLY_NODE_LABELS, PROJECT_ONLY_NODE_LABEL_SET, PROJECT_ONLY_EDGE_TYPES, PROJECT_ONLY_EDGE_TYPE_SET, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, CastaliaIngestNodeSchema, RouteContextCountWireSchema, ANCHOR_COMMIT_SHA_RE, ANCHOR_BODY_HASH_RE, ANCHOR_SYMBOL_KINDS, ANCHOR_LABEL_KINDS, FILE_ANCHOR_QNAME, ANCHOR_LABEL_PATH_RE, ANCHOR_LABEL_QNAME_RE, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
|
|
15354
|
+
var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, PROJECT_ONLY_NODE_LABELS, PROJECT_ONLY_NODE_LABEL_SET, PROJECT_ONLY_EDGE_TYPES, PROJECT_ONLY_EDGE_TYPE_SET, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, CastaliaIngestNodeSchema, RouteContextCountWireSchema, ANCHOR_COMMIT_SHA_RE, ANCHOR_BODY_HASH_RE, ANCHOR_SYMBOL_KINDS, ANCHOR_LABEL_KINDS, FILE_ANCHOR_QNAME, ANCHOR_LABEL_PATH_RE, ANCHOR_LABEL_QNAME_RE, TRIAGE_DISCRIMINATOR_MAX_LENGTH, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
|
|
15355
15355
|
var init_wire = __esm({
|
|
15356
15356
|
"../../packages/shared/src/wire.ts"() {
|
|
15357
15357
|
"use strict";
|
|
@@ -15470,6 +15470,7 @@ var init_wire = __esm({
|
|
|
15470
15470
|
FILE_ANCHOR_QNAME = "";
|
|
15471
15471
|
ANCHOR_LABEL_PATH_RE = /^(?![/])(?![A-Za-z]:)(?!(?:.*\/)?\.\.(?:\/|$))[^\x00-\x1f\x7f\\`]{1,512}$/;
|
|
15472
15472
|
ANCHOR_LABEL_QNAME_RE = /^[^\x00-\x1f\x7f`]{1,256}$/;
|
|
15473
|
+
TRIAGE_DISCRIMINATOR_MAX_LENGTH = 2e3;
|
|
15473
15474
|
CastaliaIngestEdgeSchema = external_exports.object({
|
|
15474
15475
|
fromCanonicalId: external_exports.string().min(6).max(160),
|
|
15475
15476
|
toCanonicalId: external_exports.string().min(6).max(160),
|
|
@@ -15480,6 +15481,8 @@ var init_wire = __esm({
|
|
|
15480
15481
|
/** Triage route per-context counts (T3 induction). Carried as structured data
|
|
15481
15482
|
* here; stored JSON-encoded on the Neo4j rel (`perContextJson`). */
|
|
15482
15483
|
perContext: external_exports.record(external_exports.string(), RouteContextCountWireSchema).optional(),
|
|
15484
|
+
/** Scrubbed diagnostic check for a triage route, re-scanned at the cloud door. */
|
|
15485
|
+
discriminator: external_exports.string().trim().min(1).max(TRIAGE_DISCRIMINATOR_MAX_LENGTH).optional(),
|
|
15483
15486
|
/** PJ-anchor-version: WHICH version of a symbol an `ANCHORED_AT` was
|
|
15484
15487
|
* witnessed against. Both opaque — the observing checkout's HEAD sha and
|
|
15485
15488
|
* the indexer's 16-hex sha256 of the symbol body. Neither is reversible
|
package/errata.mjs
CHANGED
|
@@ -15732,6 +15732,13 @@ function isSeedProvenance(source) {
|
|
|
15732
15732
|
function isAnchorLabelKind(kind) {
|
|
15733
15733
|
return typeof kind === "string" && ANCHOR_LABEL_KINDS.includes(kind);
|
|
15734
15734
|
}
|
|
15735
|
+
function triageDiscriminatorAttrs(type, attrs) {
|
|
15736
|
+
if (!["CONFIRMS", "INDICATES", "ROUTES_TO"].includes(type)) return {};
|
|
15737
|
+
const value = attrs?.["discriminator"];
|
|
15738
|
+
if (typeof value !== "string") return {};
|
|
15739
|
+
const test = value.trim();
|
|
15740
|
+
return test && test.length <= TRIAGE_DISCRIMINATOR_MAX_LENGTH && !(test.startsWith("<") && test.endsWith(">")) ? { discriminator: test } : {};
|
|
15741
|
+
}
|
|
15735
15742
|
function anchorVersionAttrs(attrs) {
|
|
15736
15743
|
if (!attrs) return {};
|
|
15737
15744
|
const commit = attrs["observedAtCommit"];
|
|
@@ -15792,7 +15799,7 @@ function summarizeIngestResult(r) {
|
|
|
15792
15799
|
...r.patternReconciliation ? { patternReconciliation: r.patternReconciliation } : {}
|
|
15793
15800
|
};
|
|
15794
15801
|
}
|
|
15795
|
-
var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, PROJECT_ONLY_NODE_LABELS, PROJECT_ONLY_NODE_LABEL_SET, PROJECT_ONLY_EDGE_TYPES, PROJECT_ONLY_EDGE_TYPE_SET, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, QUARANTINE_EXTRACTION_SOURCE_PREFIX, MAX_NODES_PER_PAYLOAD, MAX_EDGES_PER_PAYLOAD, CastaliaIngestNodeSchema, RouteContextCountWireSchema, ANCHOR_COMMIT_SHA_RE, ANCHOR_BODY_HASH_RE, ANCHOR_SYMBOL_KINDS, ANCHOR_LABEL_KINDS, FILE_ANCHOR_QNAME, ANCHOR_LABEL_PATH_RE, ANCHOR_LABEL_QNAME_RE, ANCHOR_LABEL_KEYS, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
|
|
15802
|
+
var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, PROJECT_ONLY_NODE_LABELS, PROJECT_ONLY_NODE_LABEL_SET, PROJECT_ONLY_EDGE_TYPES, PROJECT_ONLY_EDGE_TYPE_SET, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, QUARANTINE_EXTRACTION_SOURCE_PREFIX, MAX_NODES_PER_PAYLOAD, MAX_EDGES_PER_PAYLOAD, CastaliaIngestNodeSchema, RouteContextCountWireSchema, ANCHOR_COMMIT_SHA_RE, ANCHOR_BODY_HASH_RE, ANCHOR_SYMBOL_KINDS, ANCHOR_LABEL_KINDS, FILE_ANCHOR_QNAME, ANCHOR_LABEL_PATH_RE, ANCHOR_LABEL_QNAME_RE, ANCHOR_LABEL_KEYS, TRIAGE_DISCRIMINATOR_MAX_LENGTH, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
|
|
15796
15803
|
var init_wire = __esm({
|
|
15797
15804
|
"../../packages/shared/src/wire.ts"() {
|
|
15798
15805
|
"use strict";
|
|
@@ -15915,6 +15922,7 @@ var init_wire = __esm({
|
|
|
15915
15922
|
ANCHOR_LABEL_PATH_RE = /^(?![/])(?![A-Za-z]:)(?!(?:.*\/)?\.\.(?:\/|$))[^\x00-\x1f\x7f\\`]{1,512}$/;
|
|
15916
15923
|
ANCHOR_LABEL_QNAME_RE = /^[^\x00-\x1f\x7f`]{1,256}$/;
|
|
15917
15924
|
ANCHOR_LABEL_KEYS = ["labelRelPath", "labelQname", "labelKind", "labelLine"];
|
|
15925
|
+
TRIAGE_DISCRIMINATOR_MAX_LENGTH = 2e3;
|
|
15918
15926
|
CastaliaIngestEdgeSchema = external_exports.object({
|
|
15919
15927
|
fromCanonicalId: external_exports.string().min(6).max(160),
|
|
15920
15928
|
toCanonicalId: external_exports.string().min(6).max(160),
|
|
@@ -15925,6 +15933,8 @@ var init_wire = __esm({
|
|
|
15925
15933
|
/** Triage route per-context counts (T3 induction). Carried as structured data
|
|
15926
15934
|
* here; stored JSON-encoded on the Neo4j rel (`perContextJson`). */
|
|
15927
15935
|
perContext: external_exports.record(external_exports.string(), RouteContextCountWireSchema).optional(),
|
|
15936
|
+
/** Scrubbed diagnostic check for a triage route, re-scanned at the cloud door. */
|
|
15937
|
+
discriminator: external_exports.string().trim().min(1).max(TRIAGE_DISCRIMINATOR_MAX_LENGTH).optional(),
|
|
15928
15938
|
/** PJ-anchor-version: WHICH version of a symbol an `ANCHORED_AT` was
|
|
15929
15939
|
* witnessed against. Both opaque — the observing checkout's HEAD sha and
|
|
15930
15940
|
* the indexer's 16-hex sha256 of the symbol body. Neither is reversible
|
|
@@ -16827,6 +16837,7 @@ __export(src_exports, {
|
|
|
16827
16837
|
TAXONOMY_EDGES: () => TAXONOMY_EDGES,
|
|
16828
16838
|
TOOL_KINDS: () => TOOL_KINDS,
|
|
16829
16839
|
TRANSFER_EDGES: () => TRANSFER_EDGES,
|
|
16840
|
+
TRIAGE_DISCRIMINATOR_MAX_LENGTH: () => TRIAGE_DISCRIMINATOR_MAX_LENGTH,
|
|
16830
16841
|
TRIAGE_EDGES: () => TRIAGE_EDGES,
|
|
16831
16842
|
TRUTH_KIND: () => TRUTH_KIND,
|
|
16832
16843
|
UnregisteredGraphEventError: () => UnregisteredGraphEventError,
|
|
@@ -16910,6 +16921,7 @@ __export(src_exports, {
|
|
|
16910
16921
|
summaryRejectionReason: () => summaryRejectionReason,
|
|
16911
16922
|
toCloudAttrs: () => toCloudAttrs,
|
|
16912
16923
|
toolCanonicalId: () => toolCanonicalId,
|
|
16924
|
+
triageDiscriminatorAttrs: () => triageDiscriminatorAttrs,
|
|
16913
16925
|
unregisteredGraphEventKeys: () => unregisteredGraphEventKeys,
|
|
16914
16926
|
validateCastaliaPayload: () => validateCastaliaPayload,
|
|
16915
16927
|
versionlessPurl: () => versionlessPurl,
|
|
@@ -22620,7 +22632,8 @@ function pendingDiscriminators(l2, opts = {}) {
|
|
|
22620
22632
|
const perContext = e.attrs["perContext"] ?? {};
|
|
22621
22633
|
const global2 = perContext[TRIAGE_GLOBAL_BUCKET] ?? {};
|
|
22622
22634
|
const observations = Number(global2.confirmed ?? 0);
|
|
22623
|
-
const
|
|
22635
|
+
const inferred = new Set(global2.inferredContributors ?? []);
|
|
22636
|
+
const sources = new Set((global2.contributors ?? []).filter((id) => !inferred.has(id))).size;
|
|
22624
22637
|
if (sources < minSources || observations < minObservations) continue;
|
|
22625
22638
|
out2.push({ route: e.id, presenting: triage.description, cause: "", sources, observations, causeId: e.to });
|
|
22626
22639
|
}
|
|
@@ -22638,7 +22651,7 @@ function markDiscriminatorAsked(l2, routeIds, ts) {
|
|
|
22638
22651
|
}
|
|
22639
22652
|
}
|
|
22640
22653
|
function promoteRouteWithDiscriminator(l2, routeId, discriminator, ts, source) {
|
|
22641
|
-
const test = discriminator.
|
|
22654
|
+
const test = triageDiscriminatorAttrs("CONFIRMS", { discriminator }).discriminator;
|
|
22642
22655
|
if (!test) return false;
|
|
22643
22656
|
if (isUnfilledPlaceholder(test)) return false;
|
|
22644
22657
|
const existing = l2.getEdge(routeId);
|
|
@@ -22740,9 +22753,12 @@ function parseTriageFences(text) {
|
|
|
22740
22753
|
return out2;
|
|
22741
22754
|
}
|
|
22742
22755
|
function harvestTriageFences(l2, text, opts) {
|
|
22756
|
+
const seen = [...text.matchAll(/```errata-triage[^\n]*\n([\s\S]*?)```/g)].length;
|
|
22743
22757
|
let recorded = 0;
|
|
22744
22758
|
let promoted = 0;
|
|
22745
22759
|
for (const f of parseTriageFences(text)) {
|
|
22760
|
+
if ([f.presenting, f.cause, f.test, f.fix, f.route].some((value) => value && isUnfilledPlaceholder(value))) continue;
|
|
22761
|
+
if (f.test && !triageDiscriminatorAttrs("CONFIRMS", { discriminator: f.test }).discriminator) continue;
|
|
22746
22762
|
if (f.route && f.test) {
|
|
22747
22763
|
if (promoteRouteWithDiscriminator(l2, f.route.trim(), f.test, opts.ts, opts.contributor)) promoted++;
|
|
22748
22764
|
continue;
|
|
@@ -22778,7 +22794,7 @@ function harvestTriageFences(l2, text, opts) {
|
|
|
22778
22794
|
}
|
|
22779
22795
|
recorded++;
|
|
22780
22796
|
}
|
|
22781
|
-
return { recorded, promoted };
|
|
22797
|
+
return { seen, recorded, promoted, rejected: seen - recorded - promoted };
|
|
22782
22798
|
}
|
|
22783
22799
|
var COOCCUR_BONUS, routeEdgeId, ROUTE_EDGE_TYPES, routeTypeFor, isRouterRoute, INDUCTED_MARK, DRIFT_VALUES;
|
|
22784
22800
|
var init_triage2 = __esm({
|
|
@@ -24396,7 +24412,7 @@ function renderSnapshot(s) {
|
|
|
24396
24412
|
lines.push("");
|
|
24397
24413
|
lines.push("### \u270D\uFE0F CAPTURE PROTOCOL \u2014 tags are the record");
|
|
24398
24414
|
lines.push(
|
|
24399
|
-
"errata records
|
|
24415
|
+
"For problems and fixes, errata records inline tags: `[!one line]` for every problem you state, `(fix:[id])` when your edit fixed a shown problem, and to JUDGE a prior shown below \u2014 `(confirm:[id])` if it held, `(refute:[id] why)` if it's wrong or didn't hold. Untagged prose is silently lost \u2014 tag as you write. Requested errata-* answer blocks keep their fences; put them in your turn-final reply."
|
|
24400
24416
|
);
|
|
24401
24417
|
lines.push("");
|
|
24402
24418
|
lines.push(SEARCH_IMPERATIVE_HEADER);
|
|
@@ -24682,7 +24698,7 @@ function renderSnapshot(s) {
|
|
|
24682
24698
|
for (const item of reviewItems) {
|
|
24683
24699
|
if (item.kind === "discriminator") {
|
|
24684
24700
|
lines.push(
|
|
24685
|
-
`- **A recurring diagnosis is one cheap check from promoting** \u2014 "${item.presenting}" usually turns out to be: ${item.cause}. If (and only if) you KNOW a cheap ante-hoc check that confirms it,
|
|
24701
|
+
`- **A recurring diagnosis is one cheap check from promoting** \u2014 "${item.presenting}" usually turns out to be: ${item.cause}. If (and only if) you KNOW a cheap ante-hoc check that confirms it, fill this fenced block in your turn-final reply:`
|
|
24686
24702
|
);
|
|
24687
24703
|
lines.push(" ```errata-triage");
|
|
24688
24704
|
lines.push(` route: ${item.route}`);
|
|
@@ -24690,7 +24706,7 @@ function renderSnapshot(s) {
|
|
|
24690
24706
|
lines.push(" ```");
|
|
24691
24707
|
} else {
|
|
24692
24708
|
lines.push(
|
|
24693
|
-
`- **Name the principle this cluster of your beliefs generalizes** \u2014 it ships to the collective only once named
|
|
24709
|
+
`- **Name the principle this cluster of your beliefs generalizes** \u2014 it ships to the collective only once named. Cover ALL members in one sentence; fill this fenced block in your turn-final reply:`
|
|
24694
24710
|
);
|
|
24695
24711
|
for (const m of item.members) lines.push(` - ${m.description}`);
|
|
24696
24712
|
lines.push(" ```errata-abstraction");
|
|
@@ -25196,6 +25212,7 @@ function toWirePayload(batch, runId) {
|
|
|
25196
25212
|
attrs: {
|
|
25197
25213
|
...typeof e.confidence === "number" ? { confidence: clamp012(e.confidence) } : {},
|
|
25198
25214
|
...perContext ? { perContext } : {},
|
|
25215
|
+
...triageDiscriminatorAttrs(e.type, e.attrs),
|
|
25199
25216
|
// PJ-anchor-version: the two opaque version stamps ride on anchors only.
|
|
25200
25217
|
...e.type === "ANCHORED_AT" ? anchorVersionAttrs(e.attrs) : {},
|
|
25201
25218
|
// PJ-anchor-labels: readable labels ride only when the producer set the
|
|
@@ -25802,6 +25819,7 @@ var init_client = __esm({
|
|
|
25802
25819
|
if (q.seed?.length) qs.set("seed", q.seed.join(","));
|
|
25803
25820
|
if (q.q) qs.set("q", q.q);
|
|
25804
25821
|
if (q.channel) qs.set("channel", q.channel);
|
|
25822
|
+
if (q.includeTriage) qs.set("includeTriage", "true");
|
|
25805
25823
|
const publicCtx = process.env["ERRATA_PRIMING_PUBLIC_CONTEXT"];
|
|
25806
25824
|
const usePublicCtx = Boolean(publicCtx && publicCtx !== "0" && q.channel === "priming");
|
|
25807
25825
|
const UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -29016,7 +29034,7 @@ function buildAgentInstruction(opts = {}) {
|
|
|
29016
29034
|
const signals = opts.signals ?? ["prior", "problem", "domain", "fix", "constraint", "triage", "attempt", "link"];
|
|
29017
29035
|
const ref = opts.referent ?? "its-handle";
|
|
29018
29036
|
const token = (s) => s === "problem" ? TAG_EXAMPLE.problem() : s === "constraint" ? TAG_EXAMPLE.constraint() : s === "attempt" ? TAG_EXAMPLE.tried() : s === "domain" ? TAG_EXAMPLE.domain() : s === "link" ? TAG_EXAMPLE.pattern() : s === "verdict" ? TAG_EXAMPLE.confirm(ref) : TAG_EXAMPLE[s](ref);
|
|
29019
|
-
const head2 = `We tag the priors we show you with a short handle like [${opts.handleExample ?? "chokidar-glob"}].
|
|
29037
|
+
const head2 = `We tag the priors we show you with a short handle like [${opts.handleExample ?? "chokidar-glob"}]. Untagged prose is silently lost. Put each tag inline in prose (no fences or backticks). Requested errata-* answer blocks are the exception: keep their fences in your turn-final reply. Tag everything, we filter downstream:`;
|
|
29020
29038
|
const tail = "Mid-turn text (between tool calls) can be dropped by the harness \u2014 RESTATE every tag in your turn-final message; the final message is what reliably survives \u2014 EXCEPT one already shown above with an id: that is captured, so cite `[its-handle]` rather than retyping it (drift mints a duplicate).";
|
|
29021
29039
|
return [
|
|
29022
29040
|
head2,
|
|
@@ -41900,7 +41918,7 @@ function takeDiscriminatorNudge(path2) {
|
|
|
41900
41918
|
return [
|
|
41901
41919
|
`\u26A1 errata \u2014 a known wrong-door is one field from ranking: "${top.presenting.slice(0, 90)}"`,
|
|
41902
41920
|
` usually turns out to be: ${top.cause.slice(0, 90)} (seen ${top.observations}x)`,
|
|
41903
|
-
" Know a CHEAP check that confirms it?
|
|
41921
|
+
" Know a CHEAP check that confirms it? Fill this fenced block in your turn-final reply so the",
|
|
41904
41922
|
" next agent gets it first. Only if you actually know one: a guessed test ranks first",
|
|
41905
41923
|
" and misroutes everyone after you.",
|
|
41906
41924
|
" ```errata-triage",
|
|
@@ -43417,7 +43435,7 @@ var init_mcp = __esm({
|
|
|
43417
43435
|
pending,
|
|
43418
43436
|
...pending.length > 0 ? {
|
|
43419
43437
|
howToAnswer: [
|
|
43420
|
-
"For each route you know a cheap test for, emit an errata-triage fence",
|
|
43438
|
+
"For each route you know a cheap test for, emit an errata-triage fence in your turn-final reply",
|
|
43421
43439
|
"carrying its `route` id and the `test` \u2014 no presenting/cause needed, the",
|
|
43422
43440
|
"route id identifies both endpoints. Attaching a test does NOT count as",
|
|
43423
43441
|
"another sighting, so it cannot inflate the route's evidence.",
|
|
@@ -76967,21 +76985,31 @@ async function pullCloudTriage(shared, cloud, profile, limit = 50) {
|
|
|
76967
76985
|
stack: profile.stack,
|
|
76968
76986
|
domains: profile.domains,
|
|
76969
76987
|
kinds: ["Problem"],
|
|
76988
|
+
includeTriage: true,
|
|
76970
76989
|
limit
|
|
76971
76990
|
});
|
|
76972
76991
|
const byId = new Map(res.nodes.map((n) => [n.id, n]));
|
|
76973
76992
|
const now = Date.now();
|
|
76974
76993
|
let merged = 0;
|
|
76994
|
+
const landedTriages = /* @__PURE__ */ new Set();
|
|
76975
76995
|
const landNode = (id) => {
|
|
76976
|
-
|
|
76996
|
+
const existing = shared.getNode(id);
|
|
76977
76997
|
const n = byId.get(id);
|
|
76998
|
+
if (existing) {
|
|
76999
|
+
if (n && existing.attrs["source"] === "cloud") {
|
|
77000
|
+
shared.updateNode(id, { attrs: { ...existing.attrs, ...n.attrs, source: "cloud" }, lastUpdatedAt: now });
|
|
77001
|
+
}
|
|
77002
|
+
return true;
|
|
77003
|
+
}
|
|
76978
77004
|
if (!n) return false;
|
|
76979
77005
|
shared.mergeNode({ ...n, extractionSource: "bko-inferred", embedding: [], attrs: { ...n.attrs, source: "cloud" } });
|
|
76980
77006
|
return true;
|
|
76981
77007
|
};
|
|
76982
77008
|
for (const edge2 of res.edges) {
|
|
76983
77009
|
if (edge2.type !== "CONFIRMS" && edge2.type !== "ROUTES_TO") continue;
|
|
77010
|
+
if (!triageDiscriminatorAttrs(edge2.type, edge2.attrs).discriminator) continue;
|
|
76984
77011
|
if (!landNode(edge2.from) || !landNode(edge2.to)) continue;
|
|
77012
|
+
landedTriages.add(edge2.from);
|
|
76985
77013
|
const cloudAttrs = { ...edge2.attrs, source: "cloud", provisional: false };
|
|
76986
77014
|
const existing = shared.getEdge(edge2.id);
|
|
76987
77015
|
if (existing && existing.type === "CONFIRMS") {
|
|
@@ -76992,6 +77020,11 @@ async function pullCloudTriage(shared, cloud, profile, limit = 50) {
|
|
|
76992
77020
|
}
|
|
76993
77021
|
merged++;
|
|
76994
77022
|
}
|
|
77023
|
+
for (const edge2 of res.edges) {
|
|
77024
|
+
if (edge2.type !== "TRIAGED_BY" || !landedTriages.has(edge2.to)) continue;
|
|
77025
|
+
if (!landNode(edge2.from)) continue;
|
|
77026
|
+
shared.mergeEdge({ ...edge2, attrs: { ...edge2.attrs, source: "cloud" } });
|
|
77027
|
+
}
|
|
76995
77028
|
return merged;
|
|
76996
77029
|
}
|
|
76997
77030
|
|
|
@@ -80288,7 +80321,7 @@ function createWatchBreaker(deps) {
|
|
|
80288
80321
|
}
|
|
80289
80322
|
|
|
80290
80323
|
// src/engine.ts
|
|
80291
|
-
var DAEMON_VERSION = true ? "2.0.8-dev.
|
|
80324
|
+
var DAEMON_VERSION = true ? "2.0.8-dev.2965" : "2.0.0-alpha.0";
|
|
80292
80325
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
80293
80326
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
80294
80327
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -81174,6 +81207,9 @@ function createWorkspaceEngine(opts) {
|
|
|
81174
81207
|
let resolved = 0;
|
|
81175
81208
|
let abstracted = 0;
|
|
81176
81209
|
let triaged = 0;
|
|
81210
|
+
let triageFencesSeen = 0;
|
|
81211
|
+
let triagePromoted = 0;
|
|
81212
|
+
let triageFencesRejected = 0;
|
|
81177
81213
|
let priorEdges = 0;
|
|
81178
81214
|
let exposureShown = 0;
|
|
81179
81215
|
let exposureEvicted = 0;
|
|
@@ -81237,11 +81273,16 @@ function createWorkspaceEngine(opts) {
|
|
|
81237
81273
|
console.warn("[errata] abstraction harvest failed:", err2);
|
|
81238
81274
|
}
|
|
81239
81275
|
try {
|
|
81240
|
-
|
|
81276
|
+
const triage = harvestTriageFences(opts.sharedStore, turn.text, {
|
|
81241
81277
|
context: { stack: profile.stack, domain: profile.domains[0] },
|
|
81242
81278
|
contributor: sessionId,
|
|
81243
81279
|
ts: t
|
|
81244
|
-
})
|
|
81280
|
+
});
|
|
81281
|
+
triaged += triage.recorded;
|
|
81282
|
+
triageFencesSeen += triage.seen;
|
|
81283
|
+
triagePromoted += triage.promoted;
|
|
81284
|
+
triageFencesRejected += triage.rejected;
|
|
81285
|
+
if (triage.recorded > 0 || triage.promoted > 0) contextDirty = true;
|
|
81245
81286
|
} catch (err2) {
|
|
81246
81287
|
console.warn("[errata] triage harvest failed:", err2);
|
|
81247
81288
|
}
|
|
@@ -81917,8 +81958,8 @@ function createWorkspaceEngine(opts) {
|
|
|
81917
81958
|
if (abstracted > 0) {
|
|
81918
81959
|
console.log(`[errata] abstraction: ${abstracted} principle(s) distilled from the conversation`);
|
|
81919
81960
|
}
|
|
81920
|
-
if (triaged > 0) {
|
|
81921
|
-
console.log(`[errata] triage: ${triaged}
|
|
81961
|
+
if (triaged > 0 || triagePromoted > 0 || triageFencesRejected > 0) {
|
|
81962
|
+
console.log(`[errata] triage: ${triaged} diagnosis(es), ${triagePromoted} route promotion(s), ${triageFencesRejected} rejected fence(s)`);
|
|
81922
81963
|
}
|
|
81923
81964
|
if (processedTurns > 0) {
|
|
81924
81965
|
appendPassLedger(paths.configDir, "capture", Date.now() - t, {
|
|
@@ -81933,6 +81974,9 @@ function createWorkspaceEngine(opts) {
|
|
|
81933
81974
|
tagsRestated,
|
|
81934
81975
|
resolved,
|
|
81935
81976
|
triaged,
|
|
81977
|
+
triageFencesSeen,
|
|
81978
|
+
triagePromoted,
|
|
81979
|
+
triageFencesRejected,
|
|
81936
81980
|
priorEdges,
|
|
81937
81981
|
corroboratedEdges,
|
|
81938
81982
|
// RG-mark: refute witnesses stamped onto local nodes (the local half of
|
package/package.json
CHANGED
package/pass-worker.mjs
CHANGED
|
@@ -15140,7 +15140,7 @@ var init_symbol_intent = __esm({
|
|
|
15140
15140
|
});
|
|
15141
15141
|
|
|
15142
15142
|
// ../../packages/shared/src/wire.ts
|
|
15143
|
-
var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, PROJECT_ONLY_NODE_LABELS, PROJECT_ONLY_NODE_LABEL_SET, PROJECT_ONLY_EDGE_TYPES, PROJECT_ONLY_EDGE_TYPE_SET, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, CastaliaIngestNodeSchema, RouteContextCountWireSchema, ANCHOR_COMMIT_SHA_RE, ANCHOR_BODY_HASH_RE, ANCHOR_SYMBOL_KINDS, ANCHOR_LABEL_KINDS, ANCHOR_LABEL_PATH_RE, ANCHOR_LABEL_QNAME_RE, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
|
|
15143
|
+
var CLOUD_NODE_LABELS, CLOUD_WRITABLE_NODE_LABELS, PROJECT_ONLY_NODE_LABELS, PROJECT_ONLY_NODE_LABEL_SET, PROJECT_ONLY_EDGE_TYPES, PROJECT_ONLY_EDGE_TYPE_SET, CLOUD_WRITABLE_NODE_LABEL_SET, CLOUD_EDGE_TYPES, INGEST_SOURCES, INGEST_EXTRACTION_SOURCES, CastaliaIngestNodeSchema, RouteContextCountWireSchema, ANCHOR_COMMIT_SHA_RE, ANCHOR_BODY_HASH_RE, ANCHOR_SYMBOL_KINDS, ANCHOR_LABEL_KINDS, ANCHOR_LABEL_PATH_RE, ANCHOR_LABEL_QNAME_RE, TRIAGE_DISCRIMINATOR_MAX_LENGTH, CastaliaIngestEdgeSchema, SymbolSummarySidecarSchema, CastaliaIngestPayloadSchema;
|
|
15144
15144
|
var init_wire = __esm({
|
|
15145
15145
|
"../../packages/shared/src/wire.ts"() {
|
|
15146
15146
|
"use strict";
|
|
@@ -15258,6 +15258,7 @@ var init_wire = __esm({
|
|
|
15258
15258
|
ANCHOR_LABEL_KINDS = [...ANCHOR_SYMBOL_KINDS, "File"];
|
|
15259
15259
|
ANCHOR_LABEL_PATH_RE = /^(?![/])(?![A-Za-z]:)(?!(?:.*\/)?\.\.(?:\/|$))[^\x00-\x1f\x7f\\`]{1,512}$/;
|
|
15260
15260
|
ANCHOR_LABEL_QNAME_RE = /^[^\x00-\x1f\x7f`]{1,256}$/;
|
|
15261
|
+
TRIAGE_DISCRIMINATOR_MAX_LENGTH = 2e3;
|
|
15261
15262
|
CastaliaIngestEdgeSchema = external_exports.object({
|
|
15262
15263
|
fromCanonicalId: external_exports.string().min(6).max(160),
|
|
15263
15264
|
toCanonicalId: external_exports.string().min(6).max(160),
|
|
@@ -15268,6 +15269,8 @@ var init_wire = __esm({
|
|
|
15268
15269
|
/** Triage route per-context counts (T3 induction). Carried as structured data
|
|
15269
15270
|
* here; stored JSON-encoded on the Neo4j rel (`perContextJson`). */
|
|
15270
15271
|
perContext: external_exports.record(external_exports.string(), RouteContextCountWireSchema).optional(),
|
|
15272
|
+
/** Scrubbed diagnostic check for a triage route, re-scanned at the cloud door. */
|
|
15273
|
+
discriminator: external_exports.string().trim().min(1).max(TRIAGE_DISCRIMINATOR_MAX_LENGTH).optional(),
|
|
15271
15274
|
/** PJ-anchor-version: WHICH version of a symbol an `ANCHORED_AT` was
|
|
15272
15275
|
* witnessed against. Both opaque — the observing checkout's HEAD sha and
|
|
15273
15276
|
* the indexer's 16-hex sha256 of the symbol body. Neither is reversible
|