codeharness 0.12.2 → 0.13.2

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/dist/index.js +75 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1348,7 +1348,7 @@ function importStoriesToBeads(stories, opts, beadsFns) {
1348
1348
  }
1349
1349
 
1350
1350
  // src/commands/init.ts
1351
- var HARNESS_VERSION = true ? "0.12.2" : "0.0.0-dev";
1351
+ var HARNESS_VERSION = true ? "0.13.2" : "0.0.0-dev";
1352
1352
  function getStackLabel(stack) {
1353
1353
  if (stack === "nodejs") return "Node.js (package.json)";
1354
1354
  if (stack === "python") return "Python";
@@ -2379,7 +2379,7 @@ function countStories(statuses) {
2379
2379
  if (status === "backlog" || status === "ready-for-dev") ready++;
2380
2380
  else if (status === "done") done++;
2381
2381
  else if (status === "in-progress" || status === "review") inProgress++;
2382
- else if (status === "verified") verified++;
2382
+ else if (status === "verifying") verified++;
2383
2383
  }
2384
2384
  return { total, ready, done, inProgress, verified };
2385
2385
  }
@@ -3339,7 +3339,69 @@ function validateProofQuality(proofPath) {
3339
3339
  const inlineMatches = [...content.matchAll(inlineAcPattern)];
3340
3340
  const acNumbers = new Set(inlineMatches.map((m) => m[1]));
3341
3341
  if (acNumbers.size === 0) {
3342
- return { verified: 0, pending: 0, escalated: 0, total: 0, passed: false };
3342
+ const narrativeAcPattern = /=== AC ?(\d+):/g;
3343
+ const narrativeMatches = [...content.matchAll(narrativeAcPattern)];
3344
+ const narrativeAcNumbers = new Set(narrativeMatches.map((m) => m[1]));
3345
+ if (narrativeAcNumbers.size === 0) {
3346
+ const bulletAcPattern = /^- AC ?(\d+)[^:\n]*:/gm;
3347
+ const bulletMatches = [...content.matchAll(bulletAcPattern)];
3348
+ const bulletAcNumbers = new Set(bulletMatches.map((m) => m[1]));
3349
+ if (bulletAcNumbers.size === 0) {
3350
+ return { verified: 0, pending: 0, escalated: 0, total: 0, passed: false };
3351
+ }
3352
+ let bVerified = 0;
3353
+ let bPending = 0;
3354
+ let bEscalated = 0;
3355
+ for (const acNum of bulletAcNumbers) {
3356
+ const bulletPattern = new RegExp(`^- AC ?${acNum}[^:\\n]*:(.*)$`, "m");
3357
+ const bulletMatch = content.match(bulletPattern);
3358
+ if (!bulletMatch) {
3359
+ bPending++;
3360
+ continue;
3361
+ }
3362
+ const bulletText = bulletMatch[1].toLowerCase();
3363
+ if (bulletText.includes("n/a") || bulletText.includes("escalat") || bulletText.includes("superseded")) {
3364
+ bEscalated++;
3365
+ } else {
3366
+ bVerified++;
3367
+ }
3368
+ }
3369
+ const hasAnyEvidence = /```output\n/m.test(content);
3370
+ if (!hasAnyEvidence) {
3371
+ bPending += bVerified;
3372
+ bVerified = 0;
3373
+ }
3374
+ const bTotal = bVerified + bPending + bEscalated;
3375
+ return {
3376
+ verified: bVerified,
3377
+ pending: bPending,
3378
+ escalated: bEscalated,
3379
+ total: bTotal,
3380
+ passed: bPending === 0 && bVerified > 0
3381
+ };
3382
+ }
3383
+ const sortedAcs = narrativeMatches.map((m) => ({ num: m[1], idx: m.index })).filter((v, i, a) => a.findIndex((x) => x.num === v.num) === i).sort((a, b) => a.idx - b.idx);
3384
+ for (let i = 0; i < sortedAcs.length; i++) {
3385
+ const { num: acNum, idx: acIdx } = sortedAcs[i];
3386
+ const regionStart = i > 0 ? sortedAcs[i - 1].idx : 0;
3387
+ const regionEnd = i + 1 < sortedAcs.length ? sortedAcs[i + 1].idx : content.length;
3388
+ const section = content.slice(regionStart, regionEnd);
3389
+ if (section.includes("[ESCALATE]")) {
3390
+ escalated++;
3391
+ } else if (/```output/m.test(section)) {
3392
+ verified++;
3393
+ } else {
3394
+ pending++;
3395
+ }
3396
+ }
3397
+ const narrativeTotal = verified + pending + escalated;
3398
+ return {
3399
+ verified,
3400
+ pending,
3401
+ escalated,
3402
+ total: narrativeTotal,
3403
+ passed: pending === 0 && verified > 0
3404
+ };
3343
3405
  }
3344
3406
  for (const acNum of acNumbers) {
3345
3407
  const acPattern = new RegExp(`--- AC ?${acNum}:`, "g");
@@ -3539,7 +3601,15 @@ function verifyStory(storyId, isJson, root) {
3539
3601
  } else {
3540
3602
  showboatStatus = showboatResult.passed ? "pass" : "fail";
3541
3603
  if (!showboatResult.passed) {
3542
- fail(`Showboat verify failed: ${showboatResult.output}`, { json: isJson });
3604
+ if (isJson) {
3605
+ jsonOutput({
3606
+ status: "fail",
3607
+ message: `Showboat verify failed: ${showboatResult.output}`,
3608
+ proofQuality: { verified: proofQuality.verified, pending: proofQuality.pending, escalated: proofQuality.escalated, total: proofQuality.total }
3609
+ });
3610
+ } else {
3611
+ fail(`Showboat verify failed: ${showboatResult.output}`);
3612
+ }
3543
3613
  process.exitCode = 1;
3544
3614
  return;
3545
3615
  }
@@ -6827,7 +6897,7 @@ function registerGithubImportCommand(program) {
6827
6897
  }
6828
6898
 
6829
6899
  // src/index.ts
6830
- var VERSION = true ? "0.12.2" : "0.0.0-dev";
6900
+ var VERSION = true ? "0.13.2" : "0.0.0-dev";
6831
6901
  function createProgram() {
6832
6902
  const program = new Command();
6833
6903
  program.name("codeharness").description("Makes autonomous coding agents produce software that actually works").version(VERSION).option("--json", "Output in machine-readable JSON format");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeharness",
3
- "version": "0.12.2",
3
+ "version": "0.13.2",
4
4
  "type": "module",
5
5
  "description": "CLI for codeharness — makes autonomous coding agents produce software that actually works",
6
6
  "bin": {