@pome-sh/cli 0.23.32 → 0.23.33

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "pome-sh",
3
- "version": "0.23.32",
4
- "git_sha": "07c526747a7654a4aea3b1d8f417da3c9d653238",
5
- "build_time": "2026-08-13T01:00:51.116Z"
3
+ "version": "0.23.33",
4
+ "git_sha": "224f20c230aa9a79b6e074916240940da903dcaf",
5
+ "build_time": "2026-08-13T01:09:10.392Z"
6
6
  }
@@ -3064,7 +3064,22 @@ async function runChecksCommand(twinArg, opts) {
3064
3064
  // src/task/insertCriterion.ts
3065
3065
  var HEADING_RE = /^##\s+Success Criteria\s*$/;
3066
3066
  var NEXT_HEADING_RE = /^##\s+/;
3067
- var CRITERION_RE = /^[-*]\s+\[(?:code|model)(?::[a-z][a-z0-9_-]*)?(?:\s+always-scored)?\]\s+.+$/;
3067
+ var CRITERION_RE = /^[-*]\s+\[(code|model)(?::([a-z][a-z0-9_-]*))?(\s+always-scored)?\]\s+(.+)$/;
3068
+ function identityKey(criterion) {
3069
+ return `${criterion.kind}\0${criterion.twin ?? ""}\0${criterion.text}`;
3070
+ }
3071
+ function readCriterionLine(line) {
3072
+ const match = line.trim().match(CRITERION_RE);
3073
+ if (!match) return void 0;
3074
+ return { kind: match[1], tag: match[2], text: match[4].trim() };
3075
+ }
3076
+ function primaryTwin(source) {
3077
+ try {
3078
+ return readConfigTwins(source)[0];
3079
+ } catch {
3080
+ return void 0;
3081
+ }
3082
+ }
3068
3083
  var MissingCriteriaSectionError = class extends Error {
3069
3084
  constructor(path) {
3070
3085
  super(
@@ -3074,11 +3089,15 @@ var MissingCriteriaSectionError = class extends Error {
3074
3089
  }
3075
3090
  };
3076
3091
  var DuplicateCriterionError = class extends Error {
3077
- constructor(path, line) {
3092
+ constructor(path, line, existing = line) {
3093
+ const differs = existing.trim() !== line.trim();
3078
3094
  super(
3079
3095
  `${path} already has this criterion:
3080
- ${line}
3081
- Adding it again would score it twice and inflate the task's denominator.`
3096
+ ${existing.trim()}
3097
+ ` + (differs ? `which is the same check as the one being added:
3098
+ ${line.trim()}
3099
+ \u2014 a marker annotation or a twin tag does not make it a second check.
3100
+ ` : "") + `Adding it again would score it twice and inflate the task's denominator.`
3082
3101
  );
3083
3102
  this.name = "DuplicateCriterionError";
3084
3103
  }
@@ -3094,13 +3113,33 @@ function insertCriterion(source, line, path = "this task file") {
3094
3113
  break;
3095
3114
  }
3096
3115
  }
3116
+ const primary = primaryTwin(source);
3117
+ const declared = /* @__PURE__ */ new Map();
3118
+ for (const criterion of readCodeCriteria(source)) {
3119
+ declared.set(
3120
+ identityKey({ kind: "code", twin: criterion.twin, text: criterion.text }),
3121
+ `- ${criterion.marker} ${criterion.text}`
3122
+ );
3123
+ }
3097
3124
  let insertAt = -1;
3098
3125
  for (let i = start + 1; i < end; i += 1) {
3099
- const existing = lines[i].trim();
3100
- if (!CRITERION_RE.test(existing)) continue;
3101
- if (existing === line.trim()) throw new DuplicateCriterionError(path, line);
3126
+ const parsed = readCriterionLine(lines[i]);
3127
+ if (!parsed) continue;
3128
+ if (parsed.kind === "model") {
3129
+ declared.set(
3130
+ identityKey({ kind: "model", twin: parsed.tag ?? primary, text: parsed.text }),
3131
+ lines[i].trim()
3132
+ );
3133
+ }
3102
3134
  insertAt = i + 1;
3103
3135
  }
3136
+ const incoming = readCriterionLine(line);
3137
+ if (incoming) {
3138
+ const stored = declared.get(
3139
+ identityKey({ kind: incoming.kind, twin: incoming.tag ?? primary, text: incoming.text })
3140
+ );
3141
+ if (stored !== void 0) throw new DuplicateCriterionError(path, line, stored);
3142
+ }
3104
3143
  if (insertAt === -1) {
3105
3144
  insertAt = lines[start + 1]?.trim() === "" ? start + 2 : start + 1;
3106
3145
  }
@@ -4541,7 +4580,7 @@ var DEFAULT_AGENT_COMMAND = `node ${DEFAULT_AGENT_FILE}`;
4541
4580
  var MANIFEST_SCHEMA_URL = "https://pome.sh/schemas/v1/pome.json";
4542
4581
  var MAX_UNREADABLE_PATHS_SHOWN = 5;
4543
4582
  function readPackageVersion() {
4544
- if ("0.23.32".length > 0) return "0.23.32";
4583
+ if ("0.23.33".length > 0) return "0.23.33";
4545
4584
  try {
4546
4585
  const here = dirname(fileURLToPath(import.meta.url));
4547
4586
  const candidates = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pome-sh/cli",
3
- "version": "0.23.32",
3
+ "version": "0.23.33",
4
4
  "description": "Digital-twin testing for AI agents \u2014 run tasks against resettable local or hosted twins and record tool-call traces for evaluation on pome.sh.",
5
5
  "keywords": [
6
6
  "ai",