@inerrata-corporation/errata 2.0.0-dev.53 → 2.0.0-dev.55

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.
@@ -133,7 +133,14 @@ var init_castalia = __esm({
133
133
  "REVEALED_BY",
134
134
  "DOCUMENTED_BY",
135
135
  "EXPLAINS",
136
- "REFERENCES"
136
+ "REFERENCES",
137
+ // Agent authorship of contributed KNOWLEDGE (Agent → Problem/Solution/RootCause/…).
138
+ // The v2-native analog of the forum-shaped AUTHORED_ARTIFACT (Agent → Artifact) /
139
+ // WROTE (Agent → Answer): every /v2/ingest write folds the contributing agent in,
140
+ // so knowledge is attributable and co-contributors accrue as distinct edges
141
+ // (multi-agent corroboration is traversable). `authorAgentId` on the node names
142
+ // the originator; the edges name everyone who contributed.
143
+ "CONTRIBUTED"
137
144
  ];
138
145
  CODE_EDGES = [
139
146
  "DEFINES",
@@ -220,6 +227,8 @@ var init_castalia = __esm({
220
227
  PRODUCED: 0.6,
221
228
  MANIFESTED_IN: 0.6,
222
229
  REVEALED_BY: 0.6,
230
+ CONTRIBUTED: 0.2,
231
+ // agent attribution (Agent → knowledge) — provenance, not signal-flow
223
232
  // Structural
224
233
  PROVIDED_BY: 0.4,
225
234
  SUPPORTS: 0.4,
package/errata.mjs CHANGED
@@ -183,7 +183,14 @@ var init_castalia = __esm({
183
183
  "REVEALED_BY",
184
184
  "DOCUMENTED_BY",
185
185
  "EXPLAINS",
186
- "REFERENCES"
186
+ "REFERENCES",
187
+ // Agent authorship of contributed KNOWLEDGE (Agent → Problem/Solution/RootCause/…).
188
+ // The v2-native analog of the forum-shaped AUTHORED_ARTIFACT (Agent → Artifact) /
189
+ // WROTE (Agent → Answer): every /v2/ingest write folds the contributing agent in,
190
+ // so knowledge is attributable and co-contributors accrue as distinct edges
191
+ // (multi-agent corroboration is traversable). `authorAgentId` on the node names
192
+ // the originator; the edges name everyone who contributed.
193
+ "CONTRIBUTED"
187
194
  ];
188
195
  CODE_EDGES = [
189
196
  "DEFINES",
@@ -264,8 +271,10 @@ var init_castalia = __esm({
264
271
  // git topology, not signal-flow
265
272
  "PARENT",
266
273
  // git topology, not signal-flow
267
- "AUTHORED_BY"
274
+ "AUTHORED_BY",
268
275
  // git authorship, not signal-flow
276
+ "CONTRIBUTED"
277
+ // agent attribution (Agent → knowledge), not signal-flow
269
278
  ]);
270
279
  EDGE_WEIGHT = {
271
280
  // Causal — high signal
@@ -301,6 +310,8 @@ var init_castalia = __esm({
301
310
  PRODUCED: 0.6,
302
311
  MANIFESTED_IN: 0.6,
303
312
  REVEALED_BY: 0.6,
313
+ CONTRIBUTED: 0.2,
314
+ // agent attribution (Agent → knowledge) — provenance, not signal-flow
304
315
  // Structural
305
316
  PROVIDED_BY: 0.4,
306
317
  SUPPORTS: 0.4,
@@ -20885,6 +20896,8 @@ var init_client = __esm({
20885
20896
  refreshSkewSec;
20886
20897
  fetchFn;
20887
20898
  timeoutMs;
20899
+ daemonVersion;
20900
+ daemonChannel;
20888
20901
  constructor(opts) {
20889
20902
  this.baseUrl = opts.baseUrl.replace(/\/+$/, "");
20890
20903
  if (opts.apiKey !== void 0) this.apiKey = opts.apiKey;
@@ -20896,6 +20909,8 @@ var init_client = __esm({
20896
20909
  this.refreshSkewSec = opts.refreshSkewSec ?? 60;
20897
20910
  this.fetchFn = opts.fetchFn ?? fetch;
20898
20911
  this.timeoutMs = opts.timeoutMs ?? 15e3;
20912
+ this.daemonVersion = opts.daemonVersion;
20913
+ this.daemonChannel = opts.daemonChannel;
20899
20914
  }
20900
20915
  /**
20901
20916
  * The bearer token to send: a fresh OAuth access token (refreshing it first if
@@ -21193,6 +21208,8 @@ var init_client = __esm({
21193
21208
  async getSkills(context = "daemon skill sync", seed) {
21194
21209
  const qs = new URLSearchParams({ context });
21195
21210
  if (seed && seed.length > 0) qs.set("seed", seed.join(","));
21211
+ if (this.daemonVersion) qs.set("daemonVersion", this.daemonVersion);
21212
+ if (this.daemonChannel) qs.set("daemonChannel", this.daemonChannel);
21196
21213
  return this.json("GET", `/v2/skills?${qs.toString()}`);
21197
21214
  }
21198
21215
  /** CL-induce: request a skill for a locally-detected community's cloud-
@@ -21740,6 +21757,7 @@ function oauthClientId() {
21740
21757
  function authedCloudClient(cfg, opts = {}) {
21741
21758
  const baseUrl = normalizeCloudUrl(cfg.cloudUrl);
21742
21759
  const fetchFn = guardCloudFetch(baseUrl, opts.fetchFn ?? fetch);
21760
+ const versionOpts = opts.daemonVersion ? { daemonVersion: opts.daemonVersion, daemonChannel: cfg.updateChannel } : {};
21743
21761
  if (cfg.accessToken) {
21744
21762
  const tokenEndpoint = cfg.tokenEndpoint;
21745
21763
  return new CloudClient({
@@ -21747,6 +21765,7 @@ function authedCloudClient(cfg, opts = {}) {
21747
21765
  accessToken: cfg.accessToken,
21748
21766
  ...cfg.refreshToken ? { refreshToken: cfg.refreshToken } : {},
21749
21767
  fetchFn,
21768
+ ...versionOpts,
21750
21769
  ...opts.timeoutMs ? { timeoutMs: opts.timeoutMs } : {},
21751
21770
  ...tokenEndpoint && cfg.refreshToken ? {
21752
21771
  refreshFn: (rt) => refreshAccessToken(opts.fetchFn ?? fetch, tokenEndpoint, {
@@ -21767,6 +21786,7 @@ function authedCloudClient(cfg, opts = {}) {
21767
21786
  baseUrl,
21768
21787
  ...cfg.apiKey ? { apiKey: cfg.apiKey } : {},
21769
21788
  fetchFn,
21789
+ ...versionOpts,
21770
21790
  ...opts.timeoutMs ? { timeoutMs: opts.timeoutMs } : {}
21771
21791
  });
21772
21792
  }
@@ -42344,10 +42364,11 @@ function readSkillManifest(manifestPath) {
42344
42364
  }
42345
42365
  async function syncSkills(paths, client, seed) {
42346
42366
  const res = await client.getSkills(void 0, seed);
42367
+ const staleDaemon = res.staleDaemon && res.latestDaemonVersion ? { latest: res.latestDaemonVersion } : void 0;
42347
42368
  mkdirSync5(paths.skillsDir, { recursive: true });
42348
42369
  if (res.skills.length === 0) {
42349
42370
  const existing = readdirSync6(paths.skillsDir).filter((f) => f.endsWith(".md"));
42350
- if (existing.length > 0) return { written: 0, pruned: 0 };
42371
+ if (existing.length > 0) return { written: 0, pruned: 0, ...staleDaemon ? { staleDaemon } : {} };
42351
42372
  }
42352
42373
  const rows = [];
42353
42374
  const keep = /* @__PURE__ */ new Set();
@@ -42379,7 +42400,7 @@ async function syncSkills(paths, client, seed) {
42379
42400
  JSON.stringify({ generatedAt: Date.now(), skills: rows }, null, 2),
42380
42401
  "utf8"
42381
42402
  );
42382
- return { written: rows.length, pruned };
42403
+ return { written: rows.length, pruned, ...staleDaemon ? { staleDaemon } : {} };
42383
42404
  }
42384
42405
 
42385
42406
  // src/working-file-state.ts
@@ -42799,7 +42820,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
42799
42820
  }
42800
42821
 
42801
42822
  // src/engine.ts
42802
- var DAEMON_VERSION = true ? "2.0.0-dev.53" : "2.0.0-alpha.0";
42823
+ var DAEMON_VERSION = true ? "2.0.0-dev.55" : "2.0.0-alpha.0";
42803
42824
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
42804
42825
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
42805
42826
  var GIT_OP_MUTE_MS = 4e3;
@@ -44980,7 +45001,7 @@ async function startMultiDaemon(opts = {}) {
44980
45001
  initialCfg.tokenEndpoint = null;
44981
45002
  initialCfg.oauthClientId = null;
44982
45003
  }
44983
- const cloud = authedCloudClient(initialCfg, { timeoutMs: CLOUD_TIMEOUT_MS });
45004
+ const cloud = authedCloudClient(initialCfg, { timeoutMs: CLOUD_TIMEOUT_MS, daemonVersion: DAEMON_VERSION });
44984
45005
  const cloudNow = () => {
44985
45006
  const c = loadConfig();
44986
45007
  const baseUrl2 = normalizeCloudUrl(opts.cloudUrl ?? c.cloudUrl);
@@ -44992,7 +45013,7 @@ async function startMultiDaemon(opts = {}) {
44992
45013
  current.tokenEndpoint = null;
44993
45014
  current.oauthClientId = null;
44994
45015
  }
44995
- return authedCloudClient(current, { timeoutMs: CLOUD_TIMEOUT_MS });
45016
+ return authedCloudClient(current, { timeoutMs: CLOUD_TIMEOUT_MS, daemonVersion: DAEMON_VERSION });
44996
45017
  };
44997
45018
  const sharedDbPath = sharedStorePath();
44998
45019
  ensureParent(sharedDbPath);
@@ -45011,6 +45032,7 @@ async function startMultiDaemon(opts = {}) {
45011
45032
  for (const r of records) r.engine.markContextDirty();
45012
45033
  }
45013
45034
  }) : null;
45035
+ let serverPending = null;
45014
45036
  const boundaryListeners = [];
45015
45037
  let boundaryFlushing = false;
45016
45038
  const fireBoundary = () => {
@@ -45029,7 +45051,7 @@ async function startMultiDaemon(opts = {}) {
45029
45051
  apiKey: opts.apiKey,
45030
45052
  reviewUrl: () => `${baseUrl}/ws/${id}/review`,
45031
45053
  sharedStore,
45032
- pendingUpdate: () => updatePoller?.current() ?? null,
45054
+ pendingUpdate: () => serverPending ?? updatePoller?.current() ?? null,
45033
45055
  ...opts.skipWatchers ? { skipWatchers: true } : {}
45034
45056
  });
45035
45057
  const webApp = buildWebUi({
@@ -45604,10 +45626,17 @@ async function startMultiDaemon(opts = {}) {
45604
45626
  async syncSkillsAll() {
45605
45627
  let written = 0;
45606
45628
  let pruned2 = 0;
45629
+ let stale;
45607
45630
  for (const r of records) {
45608
45631
  const s = await r.engine.fetchSkills();
45609
45632
  written += s.written;
45610
45633
  pruned2 += s.pruned;
45634
+ if (s.staleDaemon) stale = s.staleDaemon;
45635
+ }
45636
+ const next = stale ? { current: DAEMON_VERSION, latest: stale.latest, channel: loadConfig().updateChannel } : null;
45637
+ if ((next?.latest ?? null) !== (serverPending?.latest ?? null)) {
45638
+ serverPending = next;
45639
+ for (const rec of records) rec.engine.markContextDirty();
45611
45640
  }
45612
45641
  return { written, pruned: pruned2 };
45613
45642
  },
@@ -46003,6 +46032,9 @@ var cmd = argv[0] ?? "help";
46003
46032
  var rest = argv.slice(1);
46004
46033
  var NIGHTLY_INTERVAL_MS = 10 * 6e4;
46005
46034
  async function main() {
46035
+ if (cmd !== "help" && cmd !== "--help" && cmd !== "-h" && (rest.includes("--help") || rest.includes("-h"))) {
46036
+ return printHelp();
46037
+ }
46006
46038
  switch (cmd) {
46007
46039
  case "init":
46008
46040
  return cmdInit();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.0-dev.53",
3
+ "version": "2.0.0-dev.55",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -144,7 +144,14 @@ var init_castalia = __esm({
144
144
  "REVEALED_BY",
145
145
  "DOCUMENTED_BY",
146
146
  "EXPLAINS",
147
- "REFERENCES"
147
+ "REFERENCES",
148
+ // Agent authorship of contributed KNOWLEDGE (Agent → Problem/Solution/RootCause/…).
149
+ // The v2-native analog of the forum-shaped AUTHORED_ARTIFACT (Agent → Artifact) /
150
+ // WROTE (Agent → Answer): every /v2/ingest write folds the contributing agent in,
151
+ // so knowledge is attributable and co-contributors accrue as distinct edges
152
+ // (multi-agent corroboration is traversable). `authorAgentId` on the node names
153
+ // the originator; the edges name everyone who contributed.
154
+ "CONTRIBUTED"
148
155
  ];
149
156
  CODE_EDGES = [
150
157
  "DEFINES",
@@ -225,8 +232,10 @@ var init_castalia = __esm({
225
232
  // git topology, not signal-flow
226
233
  "PARENT",
227
234
  // git topology, not signal-flow
228
- "AUTHORED_BY"
235
+ "AUTHORED_BY",
229
236
  // git authorship, not signal-flow
237
+ "CONTRIBUTED"
238
+ // agent attribution (Agent → knowledge), not signal-flow
230
239
  ]);
231
240
  EDGE_WEIGHT = {
232
241
  // Causal — high signal
@@ -262,6 +271,8 @@ var init_castalia = __esm({
262
271
  PRODUCED: 0.6,
263
272
  MANIFESTED_IN: 0.6,
264
273
  REVEALED_BY: 0.6,
274
+ CONTRIBUTED: 0.2,
275
+ // agent attribution (Agent → knowledge) — provenance, not signal-flow
265
276
  // Structural
266
277
  PROVIDED_BY: 0.4,
267
278
  SUPPORTS: 0.4,