@inerrata-corporation/errata 2.0.0-dev.48 → 2.0.0-dev.50
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/errata.mjs +42 -4
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -21200,6 +21200,12 @@ var init_client = __esm({
|
|
|
21200
21200
|
async sendFeedback(payload) {
|
|
21201
21201
|
return this.json("POST", "/v2/feedback", payload);
|
|
21202
21202
|
}
|
|
21203
|
+
/** Transport `(failed:[handle])` refutes to the cloud's contradictionPressure.
|
|
21204
|
+
* Metadata-only (node ids + witness keys); the cloud gates each on cross-origin
|
|
21205
|
+
* independence (this project vs the refuted node's author). Best-effort. */
|
|
21206
|
+
async reportContradictions(payload) {
|
|
21207
|
+
return this.json("POST", "/v2/contradict", payload);
|
|
21208
|
+
}
|
|
21203
21209
|
async pushPrinciples(payload) {
|
|
21204
21210
|
return this.json("POST", "/v2/private/principles", payload);
|
|
21205
21211
|
}
|
|
@@ -21436,7 +21442,10 @@ function defaultConfig() {
|
|
|
21436
21442
|
oauthClientId: null,
|
|
21437
21443
|
userId: null,
|
|
21438
21444
|
email: null,
|
|
21439
|
-
|
|
21445
|
+
// contributePackages defaults ON — the dependency backbone rides project
|
|
21446
|
+
// linking (see ConsentConfig). Still `sync`-gated: nothing ships until the
|
|
21447
|
+
// user opts into sync at all.
|
|
21448
|
+
consent: { sync: false, telemetry: false, contributePackages: true },
|
|
21440
21449
|
notifications: true,
|
|
21441
21450
|
onboardedAt: null,
|
|
21442
21451
|
machineId: null,
|
|
@@ -41049,10 +41058,23 @@ function parseInlineTags(text) {
|
|
|
41049
41058
|
const raw3 = a[3].replace(/\s+/g, " ").trim();
|
|
41050
41059
|
if (raw3.length >= CONSTRAINT_MIN) {
|
|
41051
41060
|
const statement = raw3.length > FLAG_MAX ? `${raw3.slice(0, FLAG_MAX - 1).trimEnd()}\u2026` : raw3;
|
|
41061
|
+
const isFailure = a[1].toLowerCase() === "failed";
|
|
41062
|
+
let refuteHandles;
|
|
41063
|
+
if (isFailure) {
|
|
41064
|
+
HANDLE_RE.lastIndex = 0;
|
|
41065
|
+
const hs = [];
|
|
41066
|
+
let hm;
|
|
41067
|
+
while ((hm = HANDLE_RE.exec(statement)) !== null) {
|
|
41068
|
+
const h = hm[1] ?? hm[2];
|
|
41069
|
+
if (h && !hs.includes(h)) hs.push(h);
|
|
41070
|
+
}
|
|
41071
|
+
if (hs.length) refuteHandles = hs;
|
|
41072
|
+
}
|
|
41052
41073
|
out2.push({
|
|
41053
|
-
kind:
|
|
41074
|
+
kind: isFailure ? "failure" : "attempt",
|
|
41054
41075
|
statement,
|
|
41055
41076
|
...a[2] ? { threadId: a[2] } : {},
|
|
41077
|
+
...refuteHandles ? { refuteHandles } : {},
|
|
41056
41078
|
sentence: sfield
|
|
41057
41079
|
});
|
|
41058
41080
|
}
|
|
@@ -41194,7 +41216,7 @@ function harvestInlineTags(store, text, opts) {
|
|
|
41194
41216
|
const source = opts.sourceId ? store.getNode(opts.sourceId) : null;
|
|
41195
41217
|
const mintPriors = opts.mintPriors ?? true;
|
|
41196
41218
|
const touched = opts.sessionTouchedIds ?? /* @__PURE__ */ new Set();
|
|
41197
|
-
const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], attempts: [], unresolvedFixes: [], transfers: [], instances: [], patterns: [] };
|
|
41219
|
+
const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], attempts: [], unresolvedFixes: [], transfers: [], instances: [], patterns: [], refutes: [] };
|
|
41198
41220
|
const tags = parseInlineTags(text);
|
|
41199
41221
|
const symptomSeqs = tags.filter((t) => (t.kind === "problem" || t.kind === "todo" || t.kind === "constraint") && t.statement).map((t) => ({ seq: t.seq ?? -1, statement: t.statement, threadId: t.threadId })).sort((a, b) => a.seq - b.seq);
|
|
41200
41222
|
const bindSymptom = (seq, threadId) => {
|
|
@@ -41305,6 +41327,15 @@ function harvestInlineTags(store, text, opts) {
|
|
|
41305
41327
|
plan.patterns.push({ patternText: tag.patternText, ...bound });
|
|
41306
41328
|
}
|
|
41307
41329
|
} else if (tag.kind === "attempt" || tag.kind === "failure") {
|
|
41330
|
+
for (const h of tag.refuteHandles ?? []) {
|
|
41331
|
+
const nodeId = resolveHandle(store, h, opts.handleMap);
|
|
41332
|
+
if (nodeId) {
|
|
41333
|
+
const witnessKey = `refute:${nodeId}:${digest({ s: tag.statement ?? "" })}`.slice(0, 72);
|
|
41334
|
+
if (!plan.refutes.some((r) => r.witnessKey === witnessKey)) {
|
|
41335
|
+
plan.refutes.push({ nodeId, witnessKey });
|
|
41336
|
+
}
|
|
41337
|
+
}
|
|
41338
|
+
}
|
|
41308
41339
|
const b = bindSymptom(tag.seq, tag.threadId);
|
|
41309
41340
|
const outcome = tag.kind === "attempt" ? "tried" : "failed";
|
|
41310
41341
|
if (b.problemId) {
|
|
@@ -42693,7 +42724,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
|
|
|
42693
42724
|
}
|
|
42694
42725
|
|
|
42695
42726
|
// src/engine.ts
|
|
42696
|
-
var DAEMON_VERSION = true ? "2.0.0-dev.
|
|
42727
|
+
var DAEMON_VERSION = true ? "2.0.0-dev.50" : "2.0.0-alpha.0";
|
|
42697
42728
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
42698
42729
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
42699
42730
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -43500,6 +43531,13 @@ function createWorkspaceEngine(opts) {
|
|
|
43500
43531
|
mintCiteEdge(solId, targetId, "MAY_RESOLVE", 0.3, { transfer: true, hypothesis: true });
|
|
43501
43532
|
}
|
|
43502
43533
|
}
|
|
43534
|
+
if (plan.refutes.length > 0 && typeof cloud.reportContradictions === "function") {
|
|
43535
|
+
void cloud.reportContradictions({ daemonVersion: DAEMON_VERSION, projectId: profile.id, items: plan.refutes }).then((r) => {
|
|
43536
|
+
if (r?.recorded) console.log(`[errata] refute: ${r.recorded} contradiction(s) recorded`);
|
|
43537
|
+
}).catch(
|
|
43538
|
+
(err2) => console.warn("[errata] refute transport failed (continuing):", err2 instanceof Error ? err2.message : err2)
|
|
43539
|
+
);
|
|
43540
|
+
}
|
|
43503
43541
|
} catch (err2) {
|
|
43504
43542
|
console.warn("[errata] inline-tag harvest failed:", err2);
|
|
43505
43543
|
}
|