@inerrata-corporation/errata 2.0.2-dev.135 → 2.0.2-dev.145

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 +38 -7
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -50260,7 +50260,15 @@ function harvestInlineTags(store, text, opts) {
50260
50260
  }
50261
50261
  return plan;
50262
50262
  }
50263
- var CORROBORATABLE_LABELS = /* @__PURE__ */ new Set(["Problem", "Solution", "RootCause"]);
50263
+ var CORROBORATABLE_LABELS = /* @__PURE__ */ new Set([
50264
+ "Problem",
50265
+ "Solution",
50266
+ "RootCause",
50267
+ "Pattern",
50268
+ "AntiPattern",
50269
+ "Technique",
50270
+ "Weakness"
50271
+ ]);
50264
50272
  function stampWitnessOrigin(items, origin) {
50265
50273
  if (!origin) return [...items];
50266
50274
  const o = digest({ p: origin }).slice(0, 12);
@@ -51238,6 +51246,7 @@ async function syncSkills(paths, client, seed, pins = []) {
51238
51246
  }
51239
51247
 
51240
51248
  // src/agent-skills.ts
51249
+ init_src2();
51241
51250
  import {
51242
51251
  cpSync,
51243
51252
  existsSync as existsSync15,
@@ -51270,14 +51279,34 @@ function deriveDescription(title, layer, body2) {
51270
51279
  const when = ` Apply when working on ${layer === "antipattern" ? "code that risks this pitfall" : "problems in this area"}.`;
51271
51280
  return `${lead}${lead.endsWith(".") ? "" : "."}${when}`.slice(0, 1024);
51272
51281
  }
51273
- function renderSkillMd(name2, description, body2) {
51282
+ function renderSkillMd(name2, description, body2, citeHandle) {
51283
+ const footer = citeHandle ? `
51284
+
51285
+ ---
51286
+ When this skill actually helps you, witness it inline in your reply: \`([${citeHandle}])\` \u2014 the citation is recorded and feeds this skill's reliability, so it keeps being served. Untagged help is invisible.
51287
+ ` : "\n";
51274
51288
  return `---
51275
51289
  name: ${name2}
51276
51290
  description: ${yamlScalar(description)}
51277
51291
  ---
51278
51292
 
51279
- ${body2.trimEnd()}
51280
- `;
51293
+ ${body2.trimEnd()}${footer}`;
51294
+ }
51295
+ var LAYER_TO_LABEL = {
51296
+ pattern: "Pattern",
51297
+ antipattern: "AntiPattern",
51298
+ technique: "Technique",
51299
+ weakness: "Weakness"
51300
+ };
51301
+ function skillHandleNodes(skills) {
51302
+ return skills.map((s) => ({
51303
+ id: s.id,
51304
+ label: LAYER_TO_LABEL[s.layer.toLowerCase()] ?? "Pattern",
51305
+ description: s.title
51306
+ }));
51307
+ }
51308
+ function skillCiteHandle(s) {
51309
+ return priorHandle({ id: s.id, description: s.title });
51281
51310
  }
51282
51311
  function reconcileNamespaced(dir, keep) {
51283
51312
  if (!existsSync15(dir)) return 0;
@@ -51335,7 +51364,7 @@ function emitAndProjectSkills(root, skills) {
51335
51364
  mkdirSync7(join19(agentsSkillsDir, slug2), { recursive: true });
51336
51365
  writeFileSync12(
51337
51366
  join19(agentsSkillsDir, slug2, "SKILL.md"),
51338
- renderSkillMd(slug2, description, body2),
51367
+ renderSkillMd(slug2, description, body2, skillCiteHandle(s)),
51339
51368
  "utf8"
51340
51369
  );
51341
51370
  emitted++;
@@ -51840,7 +51869,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
51840
51869
  }
51841
51870
 
51842
51871
  // src/engine.ts
51843
- var DAEMON_VERSION = true ? "2.0.2-dev.135" : "2.0.0-alpha.0";
51872
+ var DAEMON_VERSION = true ? "2.0.2-dev.145" : "2.0.0-alpha.0";
51844
51873
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
51845
51874
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
51846
51875
  var GIT_OP_MUTE_MS = 4e3;
@@ -52906,7 +52935,9 @@ function createWorkspaceEngine(opts) {
52906
52935
  const pins = profile?.projectId ? await cloud.getSkillPins(profile.projectId).then((r) => r.pins).catch(() => []) : [];
52907
52936
  const result = await syncSkills(paths, cloud, skillSeed, pins);
52908
52937
  try {
52909
- emitAndProjectSkills(opts.workspaceRoot, emitInputsFromManifest(paths.configDir, paths.skillsManifest));
52938
+ const inputs = emitInputsFromManifest(paths.configDir, paths.skillsManifest);
52939
+ emitAndProjectSkills(opts.workspaceRoot, inputs);
52940
+ writePrimingHandles(join22(paths.configDir, "priming-handles.json"), skillHandleNodes(inputs));
52910
52941
  } catch (err2) {
52911
52942
  console.warn("[skills] agent-skills projection failed (non-fatal):", err2 instanceof Error ? err2.message : err2);
52912
52943
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.135",
3
+ "version": "2.0.2-dev.145",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {