codeharness 0.31.4 → 0.31.6

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.
@@ -2895,7 +2895,7 @@ function generateDockerfileTemplate(projectDir, stackOrDetections) {
2895
2895
  }
2896
2896
 
2897
2897
  // src/modules/infra/init-project.ts
2898
- var HARNESS_VERSION = true ? "0.31.4" : "0.0.0-dev";
2898
+ var HARNESS_VERSION = true ? "0.31.6" : "0.0.0-dev";
2899
2899
  function failResult(opts, error) {
2900
2900
  return {
2901
2901
  status: "fail",
@@ -16,7 +16,7 @@ import {
16
16
  stopCollectorOnly,
17
17
  stopSharedStack,
18
18
  stopStack
19
- } from "./chunk-WI2XM5WP.js";
19
+ } from "./chunk-ZLOBOEIA.js";
20
20
  export {
21
21
  checkRemoteEndpoint,
22
22
  cleanupOrphanedContainers,
package/dist/index.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  validateDockerfile,
41
41
  warn,
42
42
  writeState
43
- } from "./chunk-WI2XM5WP.js";
43
+ } from "./chunk-ZLOBOEIA.js";
44
44
 
45
45
  // src/index.ts
46
46
  import { Command } from "commander";
@@ -646,6 +646,35 @@ function computeSprintCounts(stories) {
646
646
  }
647
647
  return { total, done, failed, blocked, inProgress };
648
648
  }
649
+ function updateStoryStatus(key, status, detail) {
650
+ const stateResult = getSprintState();
651
+ if (!stateResult.success) {
652
+ return fail2(stateResult.error);
653
+ }
654
+ const current = stateResult.data;
655
+ const existingStory = current.stories[key];
656
+ if (!existingStory) {
657
+ return fail2(`Story '${key}' does not exist in sprint state \u2014 refusing to create phantom entry`);
658
+ }
659
+ const isNewAttempt = status === "in-progress";
660
+ const updatedStory = {
661
+ ...existingStory,
662
+ status,
663
+ attempts: isNewAttempt ? existingStory.attempts + 1 : existingStory.attempts,
664
+ lastAttempt: isNewAttempt ? (/* @__PURE__ */ new Date()).toISOString() : existingStory.lastAttempt,
665
+ lastError: detail?.error ?? existingStory.lastError,
666
+ proofPath: detail?.proofPath ?? existingStory.proofPath,
667
+ acResults: existingStory.acResults
668
+ };
669
+ const updatedStories = { ...current.stories, [key]: updatedStory };
670
+ const updatedSprint = computeSprintCounts(updatedStories);
671
+ const updatedState = {
672
+ ...current,
673
+ sprint: updatedSprint,
674
+ stories: updatedStories
675
+ };
676
+ return writeStateAtomic(updatedState);
677
+ }
649
678
  function updateRunProgress(update) {
650
679
  const stateResult = getSprintState();
651
680
  if (!stateResult.success) {
@@ -1378,6 +1407,9 @@ function validateStateConsistency(statePath2, sprintStatusPath) {
1378
1407
  }
1379
1408
 
1380
1409
  // src/modules/sprint/index.ts
1410
+ function updateStoryStatus2(key, status, detail) {
1411
+ return updateStoryStatus(key, status, detail);
1412
+ }
1381
1413
  function getSprintState2() {
1382
1414
  return getSprintState();
1383
1415
  }
@@ -5202,38 +5234,21 @@ function WorkflowGraph({ flow, currentTask, taskStates, taskMeta }) {
5202
5234
  /* @__PURE__ */ jsx2(TaskNode, { name: tn, status, spinnerFrame, driver }, `lt-${j}`)
5203
5235
  );
5204
5236
  }
5205
- const loopDone = loopBlock.loop.every((t) => (taskStates[`loop:${t}`] ?? taskStates[t]) === "done");
5206
- if (loopDone) {
5207
- let afterLoop = false;
5208
- for (const step of flow) {
5209
- if (afterLoop && typeof step === "string") {
5210
- elements2.push(/* @__PURE__ */ jsx2(Text2, { children: " \u2192 " }, `post-a-${step}`));
5211
- elements2.push(
5212
- /* @__PURE__ */ jsx2(TaskNode, { name: step, status: taskStates[step], spinnerFrame, driver: meta[step]?.driver }, `post-${step}`)
5213
- );
5214
- }
5215
- if (isLoopBlock2(step)) afterLoop = true;
5216
- }
5217
- }
5218
5237
  return /* @__PURE__ */ jsx2(Box2, { flexDirection: "column", children: /* @__PURE__ */ jsxs2(Text2, { children: [
5219
5238
  " ",
5220
5239
  elements2
5221
5240
  ] }) });
5222
5241
  }
5223
5242
  const elements = [];
5224
- let passedCurrent = false;
5225
5243
  for (const step of flow) {
5226
5244
  if (isLoopBlock2(step)) break;
5227
- if (typeof step === "string") {
5228
- if (elements.length > 0) {
5229
- elements.push(/* @__PURE__ */ jsx2(Text2, { children: " \u2192 " }, `a-${step}`));
5230
- }
5231
- elements.push(
5232
- /* @__PURE__ */ jsx2(TaskNode, { name: step, status: taskStates[step], spinnerFrame, driver: meta[step]?.driver }, `t-${step}`)
5233
- );
5234
- if (step === currentTask) passedCurrent = true;
5235
- if (passedCurrent && step !== currentTask) break;
5245
+ if (typeof step !== "string") continue;
5246
+ if (elements.length > 0) {
5247
+ elements.push(/* @__PURE__ */ jsx2(Text2, { children: " \u2192 " }, `a-${step}`));
5236
5248
  }
5249
+ elements.push(
5250
+ /* @__PURE__ */ jsx2(TaskNode, { name: step, status: taskStates[step], spinnerFrame, driver: meta[step]?.driver }, `t-${step}`)
5251
+ );
5237
5252
  }
5238
5253
  return /* @__PURE__ */ jsx2(Box2, { flexDirection: "column", children: /* @__PURE__ */ jsxs2(Text2, { children: [
5239
5254
  " ",
@@ -5678,8 +5693,9 @@ function startRenderer(options) {
5678
5693
  const onQuit = options?.onQuit;
5679
5694
  const inkInstance = inkRender(/* @__PURE__ */ jsx9(App, { state, onCycleLane: () => cycleLane(), onQuit: onQuit ? () => onQuit() : void 0 }), {
5680
5695
  exitOnCtrlC: false,
5681
- patchConsole: !options?._forceTTY,
5682
- maxFps: 15
5696
+ patchConsole: false,
5697
+ // Disable console patching to prevent flicker
5698
+ maxFps: 10
5683
5699
  });
5684
5700
  function rerender() {
5685
5701
  if (!cleaned) {
@@ -5689,7 +5705,7 @@ function startRenderer(options) {
5689
5705
  }
5690
5706
  const heartbeat = setInterval(() => {
5691
5707
  if (!cleaned) rerender();
5692
- }, 200);
5708
+ }, 500);
5693
5709
  function onSigint() {
5694
5710
  cleanupFull();
5695
5711
  }
@@ -6307,6 +6323,7 @@ function registerRunCommand(program) {
6307
6323
  else if (status === "failed") storyEntries.push({ key, status: "failed" });
6308
6324
  }
6309
6325
  renderer.updateStories(storyEntries);
6326
+ renderer.updateWorkflowState(parsedWorkflow.flow, null, { ...taskStates }, { ...taskMeta });
6310
6327
  const onEvent = (event) => {
6311
6328
  if (event.type === "stream-event" && event.streamEvent) {
6312
6329
  renderer.update(event.streamEvent, event.driverName);
@@ -6339,6 +6356,7 @@ function registerRunCommand(program) {
6339
6356
  });
6340
6357
  taskStates[stateKey] = "active";
6341
6358
  renderer.updateWorkflowState(parsedWorkflow.flow, event.taskName, { ...taskStates }, { ...taskMeta });
6359
+ updateStoryStatus2(event.storyKey, "in-progress");
6342
6360
  const idx = storyEntries.findIndex((s) => s.key === event.storyKey);
6343
6361
  if (idx >= 0 && storyEntries[idx].status === "pending") {
6344
6362
  storyEntries[idx] = { ...storyEntries[idx], status: "in-progress" };
@@ -6355,6 +6373,15 @@ function registerRunCommand(program) {
6355
6373
  elapsedMs: (taskMeta[stateKey]?.elapsedMs ?? 0) + (event.elapsedMs ?? 0)
6356
6374
  };
6357
6375
  renderer.updateWorkflowState(parsedWorkflow.flow, event.taskName, { ...taskStates }, { ...taskMeta });
6376
+ if (event.taskName === "verify") {
6377
+ storiesDone++;
6378
+ updateStoryStatus2(event.storyKey, "done");
6379
+ const idx = storyEntries.findIndex((s) => s.key === event.storyKey);
6380
+ if (idx >= 0) {
6381
+ storyEntries[idx] = { ...storyEntries[idx], status: "done" };
6382
+ renderer.updateStories([...storyEntries]);
6383
+ }
6384
+ }
6358
6385
  renderer.updateSprintState({
6359
6386
  storyKey: event.storyKey,
6360
6387
  phase: event.taskName,
@@ -6372,6 +6399,12 @@ function registerRunCommand(program) {
6372
6399
  key: event.storyKey,
6373
6400
  message: `[${event.taskName}] ${event.error?.message ?? "unknown error"}`
6374
6401
  });
6402
+ updateStoryStatus2(event.storyKey, "failed");
6403
+ const idx = storyEntries.findIndex((s) => s.key === event.storyKey);
6404
+ if (idx >= 0) {
6405
+ storyEntries[idx] = { ...storyEntries[idx], status: "failed" };
6406
+ renderer.updateStories([...storyEntries]);
6407
+ }
6375
6408
  }
6376
6409
  };
6377
6410
  const config = {
@@ -11264,7 +11297,7 @@ function registerTeardownCommand(program) {
11264
11297
  } else if (otlpMode === "remote-routed") {
11265
11298
  if (!options.keepDocker) {
11266
11299
  try {
11267
- const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-KXQ6RJW6.js");
11300
+ const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-RHFGKHJV.js");
11268
11301
  stopCollectorOnly2();
11269
11302
  result.docker.stopped = true;
11270
11303
  if (!isJson) {
@@ -11296,7 +11329,7 @@ function registerTeardownCommand(program) {
11296
11329
  info("Shared stack: kept running (other projects may use it)");
11297
11330
  }
11298
11331
  } else if (isLegacyStack) {
11299
- const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-KXQ6RJW6.js");
11332
+ const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-RHFGKHJV.js");
11300
11333
  let stackRunning = false;
11301
11334
  try {
11302
11335
  stackRunning = isStackRunning2(composeFile);
@@ -13929,7 +13962,7 @@ var CodexDriver = class {
13929
13962
  opts.plugins
13930
13963
  );
13931
13964
  }
13932
- const args = ["exec", "--json", "--full-auto"];
13965
+ const args = ["exec", "--json", "--full-auto", "--skip-git-repo-check"];
13933
13966
  const model = opts.model && !opts.model.startsWith("claude-") ? opts.model : void 0;
13934
13967
  if (model) {
13935
13968
  args.push("--model", model);
@@ -14283,7 +14316,7 @@ function registerDriversCommand(program) {
14283
14316
  }
14284
14317
 
14285
14318
  // src/index.ts
14286
- var VERSION = true ? "0.31.4" : "0.0.0-dev";
14319
+ var VERSION = true ? "0.31.6" : "0.0.0-dev";
14287
14320
  function createProgram() {
14288
14321
  const program = new Command();
14289
14322
  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.31.4",
3
+ "version": "0.31.6",
4
4
  "type": "module",
5
5
  "description": "CLI for codeharness — makes autonomous coding agents produce software that actually works",
6
6
  "bin": {