@inerrata-corporation/errata 2.0.0-dev.50 → 2.0.0-dev.52
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 +6 -0
- package/errata.mjs +82 -5
- package/package.json +1 -1
- package/pass-worker.mjs +6 -0
package/consolidate-worker.mjs
CHANGED
|
@@ -15169,6 +15169,12 @@ var init_wire = __esm({
|
|
|
15169
15169
|
/** Client-supplied UUID — one batch; pairs with the payload digest for replay. */
|
|
15170
15170
|
runId: external_exports.string().uuid(),
|
|
15171
15171
|
source: external_exports.enum(INGEST_SOURCES),
|
|
15172
|
+
/** The contributing project (origin key = project; the salted `wp_…` the
|
|
15173
|
+
* daemon already sends as telemetry workspaceId). Stamped onto created nodes
|
|
15174
|
+
* as `authoringProject` so the refute channel's cross-origin gate can tell a
|
|
15175
|
+
* self-refute from an independent one. Optional + additive — absent is
|
|
15176
|
+
* exactly today's wire (and leaves the gate fail-open for that node). */
|
|
15177
|
+
originProject: external_exports.string().min(1).max(120).optional(),
|
|
15172
15178
|
nodes: external_exports.array(CastaliaIngestNodeSchema).max(1e3),
|
|
15173
15179
|
edges: external_exports.array(CastaliaIngestEdgeSchema).max(5e3),
|
|
15174
15180
|
/** Optional symbol→intent-summary sidecar (PP-symbol-intent). Only symbols
|
package/errata.mjs
CHANGED
|
@@ -15472,6 +15472,12 @@ var init_wire = __esm({
|
|
|
15472
15472
|
/** Client-supplied UUID — one batch; pairs with the payload digest for replay. */
|
|
15473
15473
|
runId: external_exports.string().uuid(),
|
|
15474
15474
|
source: external_exports.enum(INGEST_SOURCES),
|
|
15475
|
+
/** The contributing project (origin key = project; the salted `wp_…` the
|
|
15476
|
+
* daemon already sends as telemetry workspaceId). Stamped onto created nodes
|
|
15477
|
+
* as `authoringProject` so the refute channel's cross-origin gate can tell a
|
|
15478
|
+
* self-refute from an independent one. Optional + additive — absent is
|
|
15479
|
+
* exactly today's wire (and leaves the gate fail-open for that node). */
|
|
15480
|
+
originProject: external_exports.string().min(1).max(120).optional(),
|
|
15475
15481
|
nodes: external_exports.array(CastaliaIngestNodeSchema).max(1e3),
|
|
15476
15482
|
edges: external_exports.array(CastaliaIngestEdgeSchema).max(5e3),
|
|
15477
15483
|
/** Optional symbol→intent-summary sidecar (PP-symbol-intent). Only symbols
|
|
@@ -20725,7 +20731,16 @@ function toWirePayload(batch, runId) {
|
|
|
20725
20731
|
};
|
|
20726
20732
|
});
|
|
20727
20733
|
const symbolSummaries = sidecarForNodes(batch.symbolSummaries, nodes);
|
|
20728
|
-
return {
|
|
20734
|
+
return {
|
|
20735
|
+
runId,
|
|
20736
|
+
source: "daemon",
|
|
20737
|
+
// Origin key (= project) for the refute channel's cross-origin gate; absent
|
|
20738
|
+
// for id-less batches (principle sync) → those nodes stay fail-open.
|
|
20739
|
+
...batch.originProject ? { originProject: batch.originProject } : {},
|
|
20740
|
+
nodes,
|
|
20741
|
+
edges,
|
|
20742
|
+
...symbolSummaries ? { symbolSummaries } : {}
|
|
20743
|
+
};
|
|
20729
20744
|
}
|
|
20730
20745
|
function clamp012(x) {
|
|
20731
20746
|
return Math.max(0, Math.min(1, x));
|
|
@@ -20919,6 +20934,11 @@ var init_client = __esm({
|
|
|
20919
20934
|
async me() {
|
|
20920
20935
|
return this.json("GET", "/v2/me");
|
|
20921
20936
|
}
|
|
20937
|
+
/** Current plan/quota/cost status through the gateway. The gateway flushes
|
|
20938
|
+
* this replica's ≤2s usage batch before reading the canonical Hono ledger. */
|
|
20939
|
+
async usage() {
|
|
20940
|
+
return this.json("GET", "/v2/usage");
|
|
20941
|
+
}
|
|
20922
20942
|
// ─── acting-agent switching (gateway control plane, #898) ───────────
|
|
20923
20943
|
/** Agents the authenticated user may act as, plus their default agent.
|
|
20924
20944
|
* Authenticated with the caller's console-signed gateway JWT. */
|
|
@@ -21206,6 +21226,12 @@ var init_client = __esm({
|
|
|
21206
21226
|
async reportContradictions(payload) {
|
|
21207
21227
|
return this.json("POST", "/v2/contradict", payload);
|
|
21208
21228
|
}
|
|
21229
|
+
/** Transport corroborations (an agent leaned on / resolved a shown prior) to
|
|
21230
|
+
* the cloud's corroborationCount (§5.4). Cross-origin gated (this project vs
|
|
21231
|
+
* the node's author — no self-corroboration). Best-effort. */
|
|
21232
|
+
async reportCorroborations(payload) {
|
|
21233
|
+
return this.json("POST", "/v2/corroborate", payload);
|
|
21234
|
+
}
|
|
21209
21235
|
async pushPrinciples(payload) {
|
|
21210
21236
|
return this.json("POST", "/v2/private/principles", payload);
|
|
21211
21237
|
}
|
|
@@ -41216,7 +41242,7 @@ function harvestInlineTags(store, text, opts) {
|
|
|
41216
41242
|
const source = opts.sourceId ? store.getNode(opts.sourceId) : null;
|
|
41217
41243
|
const mintPriors = opts.mintPriors ?? true;
|
|
41218
41244
|
const touched = opts.sessionTouchedIds ?? /* @__PURE__ */ new Set();
|
|
41219
|
-
const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], attempts: [], unresolvedFixes: [], transfers: [], instances: [], patterns: [], refutes: [] };
|
|
41245
|
+
const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], attempts: [], unresolvedFixes: [], transfers: [], instances: [], patterns: [], refutes: [], corroborations: [] };
|
|
41220
41246
|
const tags = parseInlineTags(text);
|
|
41221
41247
|
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);
|
|
41222
41248
|
const bindSymptom = (seq, threadId) => {
|
|
@@ -41252,8 +41278,13 @@ function harvestInlineTags(store, text, opts) {
|
|
|
41252
41278
|
} else if (tag.kind === "fix") {
|
|
41253
41279
|
if (tag.handle) {
|
|
41254
41280
|
const problemId = resolveHandle(store, tag.handle, opts.handleMap);
|
|
41255
|
-
if (problemId)
|
|
41256
|
-
|
|
41281
|
+
if (problemId) {
|
|
41282
|
+
plan.fixes.push({ problemId, ...tag.fixRationale ? { fixNote: tag.fixRationale } : {} });
|
|
41283
|
+
const witnessKey = `corrob:${problemId}:${digest({ h: tag.handle })}`.slice(0, 72);
|
|
41284
|
+
if (!plan.corroborations.some((c) => c.witnessKey === witnessKey)) {
|
|
41285
|
+
plan.corroborations.push({ nodeId: problemId, witnessKey });
|
|
41286
|
+
}
|
|
41287
|
+
} else plan.unresolvedFixes.push({ handle: tag.handle, ...tag.fixRationale ? { fixNote: tag.fixRationale } : {} });
|
|
41257
41288
|
} else if (tag.fixRationale) {
|
|
41258
41289
|
const b = bindSymptom(tag.seq, tag.threadId);
|
|
41259
41290
|
if (b.problemId) {
|
|
@@ -41690,6 +41721,8 @@ function buildClaimIngest(store, profile, daemonVersion, level = 1, ignorePatter
|
|
|
41690
41721
|
const base = {
|
|
41691
41722
|
daemonVersion,
|
|
41692
41723
|
profile: { stack: profile.stack, languages: profile.languages, domains: profile.domains },
|
|
41724
|
+
// origin key (= project) for the refute channel's cross-origin gate.
|
|
41725
|
+
originProject: profile.id,
|
|
41693
41726
|
nodes,
|
|
41694
41727
|
edges: []
|
|
41695
41728
|
};
|
|
@@ -41734,6 +41767,8 @@ function buildDesignProblemIngest(store, profile, daemonVersion, ignorePatterns
|
|
|
41734
41767
|
const base = {
|
|
41735
41768
|
daemonVersion,
|
|
41736
41769
|
profile: { stack: profile.stack, languages: profile.languages, domains: profile.domains },
|
|
41770
|
+
// origin key (= project) for the refute channel's cross-origin gate.
|
|
41771
|
+
originProject: profile.id,
|
|
41737
41772
|
nodes,
|
|
41738
41773
|
edges
|
|
41739
41774
|
};
|
|
@@ -42724,7 +42759,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
|
|
|
42724
42759
|
}
|
|
42725
42760
|
|
|
42726
42761
|
// src/engine.ts
|
|
42727
|
-
var DAEMON_VERSION = true ? "2.0.0-dev.
|
|
42762
|
+
var DAEMON_VERSION = true ? "2.0.0-dev.52" : "2.0.0-alpha.0";
|
|
42728
42763
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
42729
42764
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
42730
42765
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -43538,6 +43573,13 @@ function createWorkspaceEngine(opts) {
|
|
|
43538
43573
|
(err2) => console.warn("[errata] refute transport failed (continuing):", err2 instanceof Error ? err2.message : err2)
|
|
43539
43574
|
);
|
|
43540
43575
|
}
|
|
43576
|
+
if (plan.corroborations.length > 0 && typeof cloud.reportCorroborations === "function") {
|
|
43577
|
+
void cloud.reportCorroborations({ daemonVersion: DAEMON_VERSION, projectId: profile.id, items: plan.corroborations }).then((r) => {
|
|
43578
|
+
if (r?.recorded) console.log(`[errata] corroborate: ${r.recorded} corroboration(s) recorded`);
|
|
43579
|
+
}).catch(
|
|
43580
|
+
(err2) => console.warn("[errata] corroboration transport failed (continuing):", err2 instanceof Error ? err2.message : err2)
|
|
43581
|
+
);
|
|
43582
|
+
}
|
|
43541
43583
|
} catch (err2) {
|
|
43542
43584
|
console.warn("[errata] inline-tag harvest failed:", err2);
|
|
43543
43585
|
}
|
|
@@ -45930,6 +45972,8 @@ async function main() {
|
|
|
45930
45972
|
return cmdStop();
|
|
45931
45973
|
case "status":
|
|
45932
45974
|
return cmdStatus();
|
|
45975
|
+
case "usage":
|
|
45976
|
+
return cmdUsage();
|
|
45933
45977
|
case "login":
|
|
45934
45978
|
return cmdLogin();
|
|
45935
45979
|
case "logout":
|
|
@@ -46016,6 +46060,8 @@ Commands:
|
|
|
46016
46060
|
start Run the daemon (FS watchers + hook receiver + tick loop)
|
|
46017
46061
|
stop Stop a running daemon (reads .errata/daemon.lock for the pid)
|
|
46018
46062
|
status Print workspace + cloud status (incl. version + pending update)
|
|
46063
|
+
usage Show current cloud plan, units remaining, estimated cost,
|
|
46064
|
+
and per-tool usage (reads the gateway's batched Hono ledger)
|
|
46019
46065
|
update [--channel dev|latest] [--check]
|
|
46020
46066
|
Pull the newest build on this machine's channel via npm.
|
|
46021
46067
|
--check only reports; --channel switches + persists channel.
|
|
@@ -46421,6 +46467,37 @@ function applyCloudUrl(cfg, url2) {
|
|
|
46421
46467
|
function cloudPolicyMessage(cfg, inspection) {
|
|
46422
46468
|
return formatCloudEndpointBlock(cfg.cloudUrl, evaluateCloudEndpoint(cfg.cloudUrl, inspection));
|
|
46423
46469
|
}
|
|
46470
|
+
async function cmdUsage() {
|
|
46471
|
+
const cfg = loadConfig();
|
|
46472
|
+
if (!hasCloudCredential(cfg)) {
|
|
46473
|
+
console.error("not logged in \u2014 run `errata login` first");
|
|
46474
|
+
process.exitCode = 1;
|
|
46475
|
+
return;
|
|
46476
|
+
}
|
|
46477
|
+
try {
|
|
46478
|
+
const status = await authedCloudClient(cfg).usage();
|
|
46479
|
+
const quota = status.quota.unlimited ? `${status.quota.units_used.toLocaleString()} used \xB7 unlimited` : `${status.quota.units_used.toLocaleString()} / ${status.quota.effective_unit_limit?.toLocaleString()} used \xB7 ${status.quota.units_remaining?.toLocaleString()} remaining`;
|
|
46480
|
+
console.log(`inErrata usage \u2014 ${status.plan}`);
|
|
46481
|
+
console.log(` period: ${status.period_start.slice(0, 10)} \u2192 ${status.period_end.slice(0, 10)}`);
|
|
46482
|
+
console.log(` units: ${quota}`);
|
|
46483
|
+
console.log(` calls: ${status.totals.event_count.toLocaleString()}`);
|
|
46484
|
+
if (status.quota.units_reserved > 0) {
|
|
46485
|
+
console.log(` held: ${status.quota.units_reserved.toLocaleString()} units reserved by in-flight calls`);
|
|
46486
|
+
}
|
|
46487
|
+
console.log(` cost: $${(status.quota.estimated_cents_current / 100).toFixed(2)} estimated`);
|
|
46488
|
+
console.log(` rate: $${(status.pricing.cents_per_1000_units / 100).toFixed(2)} / 1,000 units${status.pricing.estimate_only ? " (estimate, not an invoice)" : ""}`);
|
|
46489
|
+
if (status.by_tool.length > 0) {
|
|
46490
|
+
console.log(" tools:");
|
|
46491
|
+
for (const row of [...status.by_tool].sort((a, b) => b.units - a.units).slice(0, 10)) {
|
|
46492
|
+
console.log(` ${row.tool.padEnd(24)} ${row.units.toLocaleString().padStart(8)} units ${row.event_count.toLocaleString().padStart(6)} calls`);
|
|
46493
|
+
}
|
|
46494
|
+
}
|
|
46495
|
+
console.log(` as of: ${status.as_of} (ledger + live reservations; poll again after ${Math.ceil(status.poll_after_ms / 1e3)}s)`);
|
|
46496
|
+
} catch (err2) {
|
|
46497
|
+
console.error(`usage unavailable: ${err2 instanceof Error ? err2.message : err2}`);
|
|
46498
|
+
process.exitCode = 1;
|
|
46499
|
+
}
|
|
46500
|
+
}
|
|
46424
46501
|
async function applyToken(cfg, token) {
|
|
46425
46502
|
const inspection = await inspectCloudEndpoint(cfg.cloudUrl);
|
|
46426
46503
|
try {
|
package/package.json
CHANGED
package/pass-worker.mjs
CHANGED
|
@@ -15015,6 +15015,12 @@ var init_wire = __esm({
|
|
|
15015
15015
|
/** Client-supplied UUID — one batch; pairs with the payload digest for replay. */
|
|
15016
15016
|
runId: external_exports.string().uuid(),
|
|
15017
15017
|
source: external_exports.enum(INGEST_SOURCES),
|
|
15018
|
+
/** The contributing project (origin key = project; the salted `wp_…` the
|
|
15019
|
+
* daemon already sends as telemetry workspaceId). Stamped onto created nodes
|
|
15020
|
+
* as `authoringProject` so the refute channel's cross-origin gate can tell a
|
|
15021
|
+
* self-refute from an independent one. Optional + additive — absent is
|
|
15022
|
+
* exactly today's wire (and leaves the gate fail-open for that node). */
|
|
15023
|
+
originProject: external_exports.string().min(1).max(120).optional(),
|
|
15018
15024
|
nodes: external_exports.array(CastaliaIngestNodeSchema).max(1e3),
|
|
15019
15025
|
edges: external_exports.array(CastaliaIngestEdgeSchema).max(5e3),
|
|
15020
15026
|
/** Optional symbol→intent-summary sidecar (PP-symbol-intent). Only symbols
|