@inerrata-corporation/errata 2.0.2-dev.902 → 2.0.2-dev.926

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.
Files changed (2) hide show
  1. package/errata.mjs +48 -9
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -56192,7 +56192,7 @@ function createLivenessWatch(deps) {
56192
56192
  }
56193
56193
 
56194
56194
  // src/engine.ts
56195
- var DAEMON_VERSION = true ? "2.0.2-dev.902" : "2.0.0-alpha.0";
56195
+ var DAEMON_VERSION = true ? "2.0.2-dev.926" : "2.0.0-alpha.0";
56196
56196
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
56197
56197
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
56198
56198
  var GIT_OP_MUTE_MS = 4e3;
@@ -56966,6 +56966,9 @@ function createWorkspaceEngine(opts) {
56966
56966
  };
56967
56967
  const harvestTextsInner = async (sessionId, items) => {
56968
56968
  let minted = 0;
56969
+ let tagsSeen = 0;
56970
+ let tagsRejected = 0;
56971
+ let tagsRestated = 0;
56969
56972
  let resolved = 0;
56970
56973
  let abstracted = 0;
56971
56974
  let triaged = 0;
@@ -57027,6 +57030,7 @@ function createWorkspaceEngine(opts) {
57027
57030
  }
57028
57031
  }
57029
57032
  for (const flag of parseDesignFlags(turn.text)) {
57033
+ tagsSeen++;
57030
57034
  try {
57031
57035
  const r = ingestDesignProblem(store, flag, {
57032
57036
  workspaceId: profile.id,
@@ -57034,6 +57038,8 @@ function createWorkspaceEngine(opts) {
57034
57038
  ts: t
57035
57039
  });
57036
57040
  if (r.created || r.corroborated) minted++;
57041
+ else if (r.rejected) tagsRejected++;
57042
+ else tagsRestated++;
57037
57043
  if (flag.kind !== "constraint") sessionLastProblem.set(sessionId, designProblemId(flag.problem));
57038
57044
  if (r.created || r.corroborated) {
57039
57045
  try {
@@ -57542,6 +57548,13 @@ function createWorkspaceEngine(opts) {
57542
57548
  appendPassLedger(paths.configDir, "capture", Date.now() - t, {
57543
57549
  turns: processedTurns,
57544
57550
  minted,
57551
+ // The denominator `minted` never had. `tagsSeen 0` means the agent said
57552
+ // nothing — not a bug, and now provably not a bug. `tagsSeen > 0` with
57553
+ // `minted 0` is the pipeline eating input, and the two counters beside
57554
+ // it say which way.
57555
+ tagsSeen,
57556
+ tagsRejected,
57557
+ tagsRestated,
57545
57558
  resolved,
57546
57559
  triaged,
57547
57560
  priorEdges,
@@ -58585,6 +58598,10 @@ function contributedWireId(n) {
58585
58598
  return isMembraneSaltedId(cloudId) ? cloudId : n.id;
58586
58599
  }
58587
58600
  var WIRE_CANONICAL_ID_MIN = 6;
58601
+ var SHIP_TERMINAL_REFUSALS = 3;
58602
+ function refusalFingerprint(reason, description) {
58603
+ return digest(`${reason}\0${description}`);
58604
+ }
58588
58605
  function unshippableReason(canonical, label) {
58589
58606
  void label;
58590
58607
  if (canonical.length < WIRE_CANONICAL_ID_MIN) {
@@ -58694,6 +58711,7 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
58694
58711
  notNovel: 0,
58695
58712
  unshippable: 0,
58696
58713
  heldOrphans: 0,
58714
+ terminalRefused: 0,
58697
58715
  privacyRewritten: 0,
58698
58716
  sidecarDropped: 0,
58699
58717
  sidecarDropReasons: {},
@@ -58733,6 +58751,13 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
58733
58751
  composition.autoMint++;
58734
58752
  continue;
58735
58753
  }
58754
+ if (typeof n.attrs["shipRefusedCount"] === "number" && n.attrs["shipRefusedCount"] >= SHIP_TERMINAL_REFUSALS && n.attrs["shipRefusedFingerprint"] === refusalFingerprint(
58755
+ String(n.attrs["shipRefusedReason"] ?? ""),
58756
+ n.description
58757
+ )) {
58758
+ composition.terminalRefused++;
58759
+ continue;
58760
+ }
58736
58761
  if (!noveltyAgainst(n, ref, noveltyOpts).ready) {
58737
58762
  composition.notNovel++;
58738
58763
  continue;
@@ -60520,24 +60545,38 @@ async function startMultiDaemon(opts = {}) {
60520
60545
  };
60521
60546
  let blockedRepeat = 0;
60522
60547
  let rejectedRepeat = 0;
60523
- const noteRefused = (id, repeat) => {
60548
+ const noteRefused = (id, reason, repeat) => {
60524
60549
  const owner = owningStore(id);
60525
60550
  if (!owner) return;
60551
+ const fp = refusalFingerprint(reason, owner.n.description);
60552
+ const same = owner.n.attrs["shipRefusedFingerprint"] === fp;
60553
+ const count = same ? Number(owner.n.attrs["shipRefusedCount"] ?? 0) + 1 : 1;
60526
60554
  if (owner.n.attrs["shipRefusedSinceSeq"] !== void 0) repeat();
60527
- else
60528
- owner.s.updateNode(id, {
60529
- attrs: { ...owner.n.attrs, shipRefusedSinceSeq: seq }
60530
- });
60555
+ owner.s.updateNode(id, {
60556
+ attrs: {
60557
+ ...owner.n.attrs,
60558
+ ...same && owner.n.attrs["shipRefusedSinceSeq"] !== void 0 ? {} : { shipRefusedSinceSeq: seq },
60559
+ shipRefusedCount: count,
60560
+ shipRefusedReason: reason,
60561
+ shipRefusedFingerprint: fp
60562
+ }
60563
+ });
60531
60564
  };
60532
- for (const id of blocked) noteRefused(id, () => blockedRepeat++);
60533
- for (const id of rejected.keys()) noteRefused(id, () => rejectedRepeat++);
60565
+ for (const id of blocked) noteRefused(id, "blocked", () => blockedRepeat++);
60566
+ for (const [id, why] of rejected) noteRefused(id, why, () => rejectedRepeat++);
60534
60567
  for (const n of instances.nodes) {
60535
60568
  const owner = owningStore(n.id);
60536
60569
  if (!owner || !["Problem", "Solution", "RootCause"].includes(owner.n.label)) continue;
60537
60570
  if (blocked.has(n.id)) continue;
60538
60571
  if (rejected.has(n.id)) continue;
60539
60572
  const cloudNodeId = cloudIdByLocal.get(n.id);
60540
- const { shipRefusedSinceSeq: _cleared, ...carried } = owner.n.attrs;
60573
+ const {
60574
+ shipRefusedSinceSeq: _clearedSeq,
60575
+ shipRefusedCount: _clearedCount,
60576
+ shipRefusedReason: _clearedReason,
60577
+ shipRefusedFingerprint: _clearedFp,
60578
+ ...carried
60579
+ } = owner.n.attrs;
60541
60580
  owner.s.updateNode(n.id, {
60542
60581
  attrs: {
60543
60582
  ...carried,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.902",
3
+ "version": "2.0.2-dev.926",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {