codeharness 0.10.0 → 0.11.0

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/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.10.0" : "0.0.0-dev";
1351
+ var HARNESS_VERSION = true ? "0.11.0" : "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";
@@ -2405,10 +2405,13 @@ function buildSpawnArgs(opts) {
2405
2405
  if (opts.live) {
2406
2406
  args.push("--live");
2407
2407
  }
2408
+ if (opts.reset) {
2409
+ args.push("--reset");
2410
+ }
2408
2411
  return args;
2409
2412
  }
2410
2413
  function registerRunCommand(program) {
2411
- program.command("run").description("Execute the autonomous coding loop").option("--max-iterations <n>", "Maximum loop iterations", "50").option("--timeout <seconds>", "Total loop timeout in seconds", "14400").option("--iteration-timeout <minutes>", "Per-iteration timeout in minutes", "30").option("--live", "Show live output streaming", false).option("--calls <n>", "Max API calls per hour", "100").option("--max-story-retries <n>", "Max retries per story before flagging", "3").action(async (options, cmd) => {
2414
+ program.command("run").description("Execute the autonomous coding loop").option("--max-iterations <n>", "Maximum loop iterations", "50").option("--timeout <seconds>", "Total loop timeout in seconds", "14400").option("--iteration-timeout <minutes>", "Per-iteration timeout in minutes", "30").option("--live", "Show live output streaming", false).option("--calls <n>", "Max API calls per hour", "100").option("--max-story-retries <n>", "Max retries per story before flagging", "3").option("--reset", "Clear retry counters, flagged stories, and circuit breaker before starting", false).action(async (options, cmd) => {
2412
2415
  const globalOpts = cmd.optsWithGlobals();
2413
2416
  const isJson = !!globalOpts.json;
2414
2417
  const outputOpts = { json: isJson };
@@ -2477,7 +2480,8 @@ function registerRunCommand(program) {
2477
2480
  iterationTimeout,
2478
2481
  calls,
2479
2482
  live: options.live,
2480
- maxStoryRetries
2483
+ maxStoryRetries,
2484
+ reset: options.reset
2481
2485
  });
2482
2486
  const env = { ...process.env };
2483
2487
  if (isJson) {
@@ -3294,7 +3298,7 @@ function validateProofQuality(proofPath) {
3294
3298
  return { verified: 0, pending: 0, escalated: 0, total: 0, passed: false };
3295
3299
  }
3296
3300
  const content = readFileSync10(proofPath, "utf-8");
3297
- const acHeaderPattern = /^## AC \d+:/gm;
3301
+ const acHeaderPattern = /^## AC ?(\d+):/gm;
3298
3302
  const matches = [...content.matchAll(acHeaderPattern)];
3299
3303
  if (matches.length === 0) {
3300
3304
  return { verified: 0, pending: 0, escalated: 0, total: 0, passed: false };
@@ -6783,7 +6787,7 @@ function registerGithubImportCommand(program) {
6783
6787
  }
6784
6788
 
6785
6789
  // src/index.ts
6786
- var VERSION = true ? "0.10.0" : "0.0.0-dev";
6790
+ var VERSION = true ? "0.11.0" : "0.0.0-dev";
6787
6791
  function createProgram() {
6788
6792
  const program = new Command();
6789
6793
  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.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "description": "CLI for codeharness — makes autonomous coding agents produce software that actually works",
6
6
  "bin": {
package/ralph/ralph.sh CHANGED
@@ -50,6 +50,9 @@ CLAUDE_OUTPUT_FORMAT="${CLAUDE_OUTPUT_FORMAT:-json}"
50
50
  CLAUDE_ALLOWED_TOOLS="${CLAUDE_ALLOWED_TOOLS:-}"
51
51
  CLAUDE_USE_CONTINUE="${CLAUDE_USE_CONTINUE:-false}" # Fresh context per iteration by default
52
52
 
53
+ # Reset retry state on start
54
+ RESET_RETRIES=false
55
+
53
56
  # Live output
54
57
  LIVE_OUTPUT=false
55
58
 
@@ -722,6 +725,7 @@ Options:
722
725
  --prompt FILE Prompt file for each iteration
723
726
  --progress FILE Progress file (tasks JSON)
724
727
  --live Show live output streaming
728
+ --reset Clear retry counters, flagged stories, and circuit breaker before starting
725
729
  --reset-circuit Reset circuit breaker and exit
726
730
  --status Show current status and exit
727
731
 
@@ -805,7 +809,20 @@ main() {
805
809
  fi
806
810
  fi
807
811
 
808
- # Preserve retry state across restarts (Task 5.3)
812
+ # Reset retry state if --reset flag was passed
813
+ if [[ "$RESET_RETRIES" == "true" ]]; then
814
+ if [[ -f "$STORY_RETRY_FILE" ]]; then
815
+ rm -f "$STORY_RETRY_FILE"
816
+ log_status "INFO" "Cleared story retry counters"
817
+ fi
818
+ if [[ -f "$FLAGGED_STORIES_FILE" ]]; then
819
+ rm -f "$FLAGGED_STORIES_FILE"
820
+ log_status "INFO" "Cleared flagged stories"
821
+ fi
822
+ reset_circuit_breaker "Reset via --reset flag"
823
+ log_status "INFO" "Circuit breaker reset to CLOSED"
824
+ fi
825
+
809
826
  # .story_retries and .flagged_stories are file-based — they persist automatically
810
827
 
811
828
  log_status "SUCCESS" "Ralph loop starting"
@@ -1056,6 +1073,10 @@ while [[ $# -gt 0 ]]; do
1056
1073
  LIVE_OUTPUT=true
1057
1074
  shift
1058
1075
  ;;
1076
+ --reset)
1077
+ RESET_RETRIES=true
1078
+ shift
1079
+ ;;
1059
1080
  --reset-circuit)
1060
1081
  # Derive state paths so circuit breaker uses the correct directory
1061
1082
  HARNESS_STATE_DIR="$(pwd)/.claude"