@inerrata-corporation/errata 2.0.20-dev.3658 → 2.0.20-dev.3682

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 CHANGED
@@ -137,6 +137,9 @@ var init_castalia = __esm({
137
137
  "probe-failed"
138
138
  ];
139
139
  ROUTING_REASONS = [
140
+ "trusted-system-public",
141
+ "public-target-staged",
142
+ "source-membrane",
140
143
  /** Harness org (CTF lane, e2e battery, canary) — forced org-private. */
141
144
  "harness-clamp",
142
145
  "witnessed-vulnerability-private",
@@ -21681,7 +21684,11 @@ function priorsForFile(store, relPath) {
21681
21684
  const resolvedProblems = [];
21682
21685
  const seenProblem = /* @__PURE__ */ new Set();
21683
21686
  const related = /* @__PURE__ */ new Map();
21684
- for (const e of store.inEdges(file2.id, ["ANCHORED_AT"])) {
21687
+ const anchorEdges = [
21688
+ ...store.inEdges(file2.id, ["ANCHORED_AT"]),
21689
+ ...store.outEdges(file2.id, ["DEFINES"]).flatMap((d) => store.inEdges(d.to, ["ANCHORED_AT"]))
21690
+ ];
21691
+ for (const e of anchorEdges) {
21685
21692
  const n = store.getNode(e.from);
21686
21693
  if (!n) continue;
21687
21694
  if (n.label === "Problem" || n.label === "Vulnerability") {
@@ -21929,12 +21936,21 @@ function resolveDesignProblemByStatement(store, statement, fixNote, t) {
21929
21936
  const problemId = identityId({ kind: "DesignProblem", statement });
21930
21937
  return closeDesignProblem(store, problemId, fixNote, t);
21931
21938
  }
21939
+ function closableByCaller(node2) {
21940
+ if (node2.attrs["source"] !== "cloud") return true;
21941
+ const visibility = node2.attrs["visibility"];
21942
+ return typeof visibility === "string" && MEMBER_VISIBILITIES.has(visibility);
21943
+ }
21944
+ function isVerdictable(node2) {
21945
+ return node2.label === "Problem" && node2.attrs["resolvedAt"] == null && (node2.validTo ?? null) === null && !isConstraintProblem(node2) && node2.attrs["kind"] !== "todo";
21946
+ }
21932
21947
  function resolveDesignProblemById(store, id, fixNote, t) {
21933
21948
  return closeDesignProblem(store, id.trim(), fixNote, t);
21934
21949
  }
21935
21950
  function closeDesignProblem(store, problemId, fixNote, t) {
21936
21951
  const p = store.getNode(problemId);
21937
21952
  if (!p || p.label !== "Problem" && p.label !== "Vulnerability") return false;
21953
+ if (!closableByCaller(p)) return false;
21938
21954
  if (p.attrs["resolvedAs"]) return false;
21939
21955
  if (fixNote?.trim() && !isFragmentFixNote(fixNote)) {
21940
21956
  const sols = store.outEdges(problemId, ["SOLVED_BY"]).map((e) => store.getNode(e.to)).filter((n) => n !== null);
@@ -22007,6 +22023,7 @@ function retractDesignProblemByStatement(store, statement, resolvedAs, reason, t
22007
22023
  function retractDesignProblem(store, problemId, resolvedAs, reason, t) {
22008
22024
  const p = store.getNode(problemId);
22009
22025
  if (!p || p.label !== "Problem" || p.attrs["resolvedAt"]) return false;
22026
+ if (!closableByCaller(p)) return false;
22010
22027
  store.updateNode(problemId, {
22011
22028
  attrs: {
22012
22029
  ...p.attrs,
@@ -22142,7 +22159,7 @@ function priorExposure(store, nodeId, atSeq) {
22142
22159
  if ((n.attrs["evictedCount"] ?? 0) > 0) return "evicted";
22143
22160
  return "unshown";
22144
22161
  }
22145
- var DESIGN_PROMOTE_AT, STATEMENT_ALIAS_CAP, RECURRENCE_DEBOUNCE_MS, PATTERN_DEDUP_COSINE, PATTERN_ALIAS_CAP, DEDUP_STOPWORDS, SAME_ANCHOR_DEDUP_JACCARD, EMPTY_FOLD_REPORT, SAME_ANCHOR_SCOUT_AUTO_COSINE, SAME_ANCHOR_SCOUT_MIN_COSINE, SAME_ANCHOR_NOMINATE_JACCARD, REOPEN_MIN_SOURCES, RECURRENCE_SOURCES_CAP, CITABLE_PRIOR_LABELS, MAX_ANCHOR_FILES, ENCLOSING_SYMBOL_KINDS, ENCLOSING_WALK_DEPTH, FIX_CANDIDATE_ASK_LIMIT;
22162
+ var DESIGN_PROMOTE_AT, STATEMENT_ALIAS_CAP, RECURRENCE_DEBOUNCE_MS, PATTERN_DEDUP_COSINE, PATTERN_ALIAS_CAP, DEDUP_STOPWORDS, SAME_ANCHOR_DEDUP_JACCARD, EMPTY_FOLD_REPORT, SAME_ANCHOR_SCOUT_AUTO_COSINE, SAME_ANCHOR_SCOUT_MIN_COSINE, SAME_ANCHOR_NOMINATE_JACCARD, REOPEN_MIN_SOURCES, RECURRENCE_SOURCES_CAP, CITABLE_PRIOR_LABELS, MAX_ANCHOR_FILES, ENCLOSING_SYMBOL_KINDS, ENCLOSING_WALK_DEPTH, MEMBER_VISIBILITIES, FIX_CANDIDATE_ASK_LIMIT;
22146
22163
  var init_design_problem = __esm({
22147
22164
  "../../packages/local-graph/src/design-problem.ts"() {
22148
22165
  "use strict";
@@ -22219,6 +22236,7 @@ var init_design_problem = __esm({
22219
22236
  "Property"
22220
22237
  ]);
22221
22238
  ENCLOSING_WALK_DEPTH = 8;
22239
+ MEMBER_VISIBILITIES = /* @__PURE__ */ new Set(["project", "team", "org"]);
22222
22240
  FIX_CANDIDATE_ASK_LIMIT = 5;
22223
22241
  }
22224
22242
  });
@@ -25358,6 +25376,7 @@ __export(src_exports2, {
25358
25376
  clearAnsweredRevisits: () => clearAnsweredRevisits,
25359
25377
  clearRevisit: () => clearRevisit,
25360
25378
  clearSettledFixCandidates: () => clearSettledFixCandidates,
25379
+ closableByCaller: () => closableByCaller,
25361
25380
  communityInductionRequests: () => communityInductionRequests,
25362
25381
  communitySeeds: () => communitySeeds,
25363
25382
  compareSemver: () => compareSemver,
@@ -25396,6 +25415,7 @@ __export(src_exports2, {
25396
25415
  isFragmentFixNote: () => isFragmentFixNote,
25397
25416
  isPlaceholderStatement: () => isPlaceholderStatement,
25398
25417
  isUnfilledPlaceholder: () => isUnfilledPlaceholder,
25418
+ isVerdictable: () => isVerdictable,
25399
25419
  learnedConductance: () => learnedConductance,
25400
25420
  linkProblemToLanguages: () => linkProblemToLanguages,
25401
25421
  linkProblemToPackages: () => linkProblemToPackages,
@@ -25923,6 +25943,13 @@ function renderSnapshot(s) {
25923
25943
  lines.push("_Priors that speak to it \u2014 cite one with its `[handle]` if you lean on it:_");
25924
25944
  for (const h of si.hits) {
25925
25945
  lines.push(`- **${h.description}** \u2014 \`${h.id}\``);
25946
+ if (h.verdict === "own") {
25947
+ lines.push(
25948
+ ` - still open \u2014 did this work settle it? fixed \u2192 (fix:[${h.id}]) \xB7 not a real problem \u2192 an \`errata-resolved\` block with \`id: ` + h.id + "`, `disposition: false_positive`, `reason: \u2026` \xB7 still open \u2192 say nothing"
25949
+ );
25950
+ } else if (h.verdict === "foreign") {
25951
+ lines.push(` - open in another membrane \u2014 not yours to close: (confirm:[${h.id}]) it held \xB7 (refute:[${h.id}] one line why)`);
25952
+ }
25926
25953
  }
25927
25954
  }
25928
25955
  if (si.remoteHits?.length) {
@@ -32524,7 +32551,10 @@ var init_agent_signals = __esm({
32524
32551
  // lean-on corroboration lived, because only corroboration had an inline path. Grammar
32525
32552
  // single-sourced with parseInlineTags' CONFIRM_PREFIX/REFUTE_PREFIX.
32526
32553
  confirm: (ref) => `(confirm:[${ref}])`,
32527
- refute: (ref) => `(refute:[${ref}] one line why)`
32554
+ refute: (ref) => `(refute:[${ref}] one line why)`,
32555
+ // RETRACT — "not a real problem": the errata-resolved block with a disposition
32556
+ // (parseDesignResolutions, turn.ts). No inline form exists; the block is the grammar.
32557
+ retract: (id) => ["```errata-resolved", `id: ${id}`, "disposition: false_positive", "reason: why it was never a real problem", "```"].join("\n")
32528
32558
  };
32529
32559
  TAG_OPENERS = [
32530
32560
  ...new Set(
@@ -53491,6 +53521,7 @@ __export(webui_exports, {
53491
53521
  asFailedPostToolUse: () => asFailedPostToolUse,
53492
53522
  buildWebUi: () => buildWebUi,
53493
53523
  decideContextInject: () => decideContextInject,
53524
+ editVerdict: () => editVerdict,
53494
53525
  errorRecallTerms: () => errorRecallTerms,
53495
53526
  fileRecall: () => fileRecall,
53496
53527
  fileUriToFsPath: () => fileUriToFsPath,
@@ -53601,6 +53632,26 @@ ${lines.join("\n")}
53601
53632
  card
53602
53633
  };
53603
53634
  }
53635
+ function editVerdict(store, relPath) {
53636
+ const priors = priorsForFile(store, relPath);
53637
+ if (!priors || priors.openProblems.length === 0) return null;
53638
+ const ranked = rankByRelevance(store, priors.file.id, priors.openProblems.map((n) => n.id));
53639
+ const rank = new Map(ranked.map((r, i2) => [r.id, i2]));
53640
+ const asked = [...priors.openProblems].sort((a, b) => (rank.get(a.id) ?? 0) - (rank.get(b.id) ?? 0)).slice(0, 3);
53641
+ const lines = asked.map(
53642
+ (p) => closableByCaller(p) ? recallLine(p, `fixed: ${TAG_EXAMPLE.fix(p.id)} \xB7 not a real problem: retract it (block below) \xB7 still open: say nothing`) : recallLine(p, `another membrane's \u2014 not yours to close: ${TAG_EXAMPLE.confirm(p.id)} it held \xB7 ${TAG_EXAMPLE.refute(p.id)}`)
53643
+ );
53644
+ const retractable = asked.find((p) => closableByCaller(p));
53645
+ const shown = asked.map(deliveredPrior);
53646
+ const headline = `verdict asked: ${plural(shown.length, "open problem")} on ${relPath.split("/").slice(-2).join("/")}`;
53647
+ return {
53648
+ context: `errata \u2014 you just edited ${relPath}; ${plural(priors.openProblems.length, "open problem")} recorded on it. Give each one below a verdict in your reply:
53649
+ ${lines.join("\n")}
53650
+ ` + (retractable ? `Retract (not a real problem):
53651
+ ${TAG_EXAMPLE.retract(retractable.id)}` : ""),
53652
+ card: deliveredCard(store, headline, shown) ?? { headline, items: [] }
53653
+ };
53654
+ }
53604
53655
  function workspacePackageIds(store) {
53605
53656
  const hit = wsPackagesCache.get(store);
53606
53657
  const now = Date.now();
@@ -53671,6 +53722,7 @@ function buildWebUi(deps) {
53671
53722
  const B = deps.basePath ?? "";
53672
53723
  const lastInjectedHash = /* @__PURE__ */ new Map();
53673
53724
  const fileRecallSeen = /* @__PURE__ */ new Map();
53725
+ const editVerdictAsked = /* @__PURE__ */ new Map();
53674
53726
  const lastSubagentInjectAt = /* @__PURE__ */ new Map();
53675
53727
  const noteSessionFrom = (headerOrigin, body2, ended = false) => {
53676
53728
  const { sessionId, agentId } = hookAudience(body2);
@@ -53935,6 +53987,27 @@ function buildWebUi(deps) {
53935
53987
  }
53936
53988
  }
53937
53989
  }
53990
+ if (event === "PostToolUse" && !recall && rel && (tool === "Edit" || tool === "MultiEdit" || tool === "Write" || tool === "NotebookEdit")) {
53991
+ const sid = hookAudience(body2).contextKey;
53992
+ let asked = editVerdictAsked.get(sid);
53993
+ if (!asked) {
53994
+ asked = /* @__PURE__ */ new Set();
53995
+ editVerdictAsked.set(sid, asked);
53996
+ }
53997
+ if (!asked.has(rel)) {
53998
+ const verdict = editVerdict(deps.store, rel);
53999
+ if (verdict) {
54000
+ asked.add(rel);
54001
+ let seen = fileRecallSeen.get(sid);
54002
+ if (!seen) {
54003
+ seen = /* @__PURE__ */ new Set();
54004
+ fileRecallSeen.set(sid, seen);
54005
+ }
54006
+ seen.add(rel);
54007
+ recall = verdict;
54008
+ }
54009
+ }
54010
+ }
53938
54011
  if (event === "PostToolUse" && !recall && rel && (tool === "Read" || tool === "Edit" || tool === "Write" || tool === "NotebookEdit")) {
53939
54012
  const sid = hookAudience(body2).contextKey;
53940
54013
  let seen = fileRecallSeen.get(sid);
@@ -82706,7 +82779,7 @@ function createWatchBreaker(deps) {
82706
82779
  }
82707
82780
 
82708
82781
  // src/engine.ts
82709
- var DAEMON_VERSION = true ? "2.0.20-dev.3658" : "2.0.0-alpha.0";
82782
+ var DAEMON_VERSION = true ? "2.0.20-dev.3682" : "2.0.0-alpha.0";
82710
82783
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
82711
82784
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
82712
82785
  var GIT_OP_MUTE_MS = 4e3;
@@ -83167,7 +83240,8 @@ function createWorkspaceEngine(opts) {
83167
83240
  id: h.node.id,
83168
83241
  label: h.node.label,
83169
83242
  description: h.node.description,
83170
- coverage: h.coverage
83243
+ coverage: h.coverage,
83244
+ ...isVerdictable(h.node) ? { verdict: closableByCaller(h.node) ? "own" : "foreign" } : {}
83171
83245
  })),
83172
83246
  ...collective && collective.hits.length > 0 ? {
83173
83247
  remoteHits: collective.hits.slice(0, 4).map((n) => ({ id: n.id, label: n.label, description: n.description }))
@@ -84176,7 +84250,11 @@ function createWorkspaceEngine(opts) {
84176
84250
  const closed = resolveDesignProblemById(store, pid, fx.fixNote, t);
84177
84251
  if (!closed) {
84178
84252
  const n = store.getNode(pid);
84179
- if (!n || n.label !== "Problem" && n.label !== "Vulnerability" || n.attrs["resolvedAs"] != null) {
84253
+ if (n && n.attrs["resolvedAt"] == null && !closableByCaller(n)) {
84254
+ console.warn(
84255
+ `[errata] fix tag not applied: ${pid.slice(0, 32)} belongs to a membrane you are not in \u2014 a verdict closes only your own problems; cite it with (confirm:[id]) or (refute:[id] why) instead`
84256
+ );
84257
+ } else if (!n || n.label !== "Problem" && n.label !== "Vulnerability" || n.attrs["resolvedAs"] != null) {
84180
84258
  console.warn(
84181
84259
  `[errata] fix tag went nowhere: ${!n ? `id ${pid.slice(0, 32)} unknown` : n.label !== "Problem" ? `${pid.slice(0, 32)} is a ${n.label}, not a Problem` : "the problem was retracted \u2014 a retraction is not fixable"} \u2014 the fix was NOT recorded`
84182
84260
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.20-dev.3658",
3
+ "version": "2.0.20-dev.3682",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -27197,7 +27197,11 @@ function priorsForFile(store2, relPath) {
27197
27197
  const resolvedProblems = [];
27198
27198
  const seenProblem = /* @__PURE__ */ new Set();
27199
27199
  const related = /* @__PURE__ */ new Map();
27200
- for (const e of store2.inEdges(file2.id, ["ANCHORED_AT"])) {
27200
+ const anchorEdges = [
27201
+ ...store2.inEdges(file2.id, ["ANCHORED_AT"]),
27202
+ ...store2.outEdges(file2.id, ["DEFINES"]).flatMap((d) => store2.inEdges(d.to, ["ANCHORED_AT"]))
27203
+ ];
27204
+ for (const e of anchorEdges) {
27201
27205
  const n = store2.getNode(e.from);
27202
27206
  if (!n) continue;
27203
27207
  if (n.label === "Problem" || n.label === "Vulnerability") {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "errata-context",
3
- "version": "2.0.20-dev.3658",
3
+ "version": "2.0.20-dev.3682",
4
4
  "description": "A minimal 3D view of loaded Errata priors and recent graph bursts.",
5
5
  "author": {
6
6
  "name": "inErrata"
@@ -1,4 +1,4 @@
1
- a4c4eac470957cd47bce9b30a7df55e726d8a7eb936c38e6715cf3081de8257d .codex-plugin/plugin.json
1
+ 1a4968f9838a28217386e7d354ba511c588e16739ece36e6bbb7f6feeaa8a4c2 .codex-plugin/plugin.json
2
2
  a7bebae9fb01c838d6c75fc784129e28be571233fa66ff5ee8039b574f35ccf7 assets/icon.png
3
3
  fc38b64e4df1e0b72c35764bef6c4c05430d97c9009ad0ecc8a9e75b4deab232 configure-local.mjs
4
4
  73dc6028b3b070257c7c31f252d11e55a9e096f4aed0f187f10cb21716e1e6d7 dist/client.js