codeharness 0.19.4 → 0.19.5
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 +18 -8
- package/package.json +1 -1
- package/ralph/ralph.sh +6 -2
package/dist/index.js
CHANGED
|
@@ -1941,7 +1941,7 @@ async function scaffoldDocs(opts) {
|
|
|
1941
1941
|
}
|
|
1942
1942
|
|
|
1943
1943
|
// src/modules/infra/init-project.ts
|
|
1944
|
-
var HARNESS_VERSION = true ? "0.19.
|
|
1944
|
+
var HARNESS_VERSION = true ? "0.19.5" : "0.0.0-dev";
|
|
1945
1945
|
function failResult(opts, error) {
|
|
1946
1946
|
return {
|
|
1947
1947
|
status: "fail",
|
|
@@ -2743,16 +2743,13 @@ function buildSpawnArgs(opts) {
|
|
|
2743
2743
|
if (opts.maxStoryRetries !== void 0) {
|
|
2744
2744
|
args.push("--max-story-retries", String(opts.maxStoryRetries));
|
|
2745
2745
|
}
|
|
2746
|
-
if (opts.live) {
|
|
2747
|
-
args.push("--live");
|
|
2748
|
-
}
|
|
2749
2746
|
if (opts.reset) {
|
|
2750
2747
|
args.push("--reset");
|
|
2751
2748
|
}
|
|
2752
2749
|
return args;
|
|
2753
2750
|
}
|
|
2754
2751
|
function registerRunCommand(program) {
|
|
2755
|
-
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", "43200").option("--iteration-timeout <minutes>", "Per-iteration timeout in minutes", "30").option("--
|
|
2752
|
+
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", "43200").option("--iteration-timeout <minutes>", "Per-iteration timeout in minutes", "30").option("--quiet", "Suppress terminal output (background mode)", false).option("--calls <n>", "Max API calls per hour", "100").option("--max-story-retries <n>", "Max retries per story before flagging", "10").option("--reset", "Clear retry counters, flagged stories, and circuit breaker before starting", false).action(async (options, cmd) => {
|
|
2756
2753
|
const globalOpts = cmd.optsWithGlobals();
|
|
2757
2754
|
const isJson = !!globalOpts.json;
|
|
2758
2755
|
const outputOpts = { json: isJson };
|
|
@@ -2820,7 +2817,7 @@ function registerRunCommand(program) {
|
|
|
2820
2817
|
timeout,
|
|
2821
2818
|
iterationTimeout,
|
|
2822
2819
|
calls,
|
|
2823
|
-
|
|
2820
|
+
quiet: options.quiet,
|
|
2824
2821
|
maxStoryRetries,
|
|
2825
2822
|
reset: options.reset
|
|
2826
2823
|
});
|
|
@@ -2829,11 +2826,24 @@ function registerRunCommand(program) {
|
|
|
2829
2826
|
env.CLAUDE_OUTPUT_FORMAT = "json";
|
|
2830
2827
|
}
|
|
2831
2828
|
try {
|
|
2829
|
+
const quiet = options.quiet;
|
|
2832
2830
|
const child = spawn("bash", args, {
|
|
2833
|
-
stdio: "inherit",
|
|
2831
|
+
stdio: quiet ? "ignore" : ["inherit", "pipe", "pipe"],
|
|
2834
2832
|
cwd: projectDir,
|
|
2835
2833
|
env
|
|
2836
2834
|
});
|
|
2835
|
+
if (!quiet && child.stdout && child.stderr) {
|
|
2836
|
+
const filterOutput = (data) => {
|
|
2837
|
+
const lines = data.toString().split("\n");
|
|
2838
|
+
for (const line of lines) {
|
|
2839
|
+
if (line.includes("[DEBUG]")) continue;
|
|
2840
|
+
if (line.trim().length === 0) continue;
|
|
2841
|
+
process.stdout.write(line + "\n");
|
|
2842
|
+
}
|
|
2843
|
+
};
|
|
2844
|
+
child.stdout.on("data", filterOutput);
|
|
2845
|
+
child.stderr.on("data", filterOutput);
|
|
2846
|
+
}
|
|
2837
2847
|
const exitCode = await new Promise((resolve3, reject) => {
|
|
2838
2848
|
child.on("error", (err) => {
|
|
2839
2849
|
reject(err);
|
|
@@ -10192,7 +10202,7 @@ function outputHuman(p, cycles, allPassed) {
|
|
|
10192
10202
|
}
|
|
10193
10203
|
|
|
10194
10204
|
// src/index.ts
|
|
10195
|
-
var VERSION = true ? "0.19.
|
|
10205
|
+
var VERSION = true ? "0.19.5" : "0.0.0-dev";
|
|
10196
10206
|
function createProgram() {
|
|
10197
10207
|
const program = new Command();
|
|
10198
10208
|
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
package/ralph/ralph.sh
CHANGED
|
@@ -588,8 +588,12 @@ execute_iteration() {
|
|
|
588
588
|
local deadline=$(( $(date +%s) + timeout_seconds ))
|
|
589
589
|
echo "$deadline" > "ralph/.iteration_deadline"
|
|
590
590
|
|
|
591
|
-
# DEBUG: log
|
|
592
|
-
|
|
591
|
+
# DEBUG: log command (truncate prompt content to avoid dumping entire prompt to terminal)
|
|
592
|
+
local cmd_summary="${CLAUDE_CMD_ARGS[*]}"
|
|
593
|
+
if [[ ${#cmd_summary} -gt 200 ]]; then
|
|
594
|
+
cmd_summary="${cmd_summary:0:200}... (truncated)"
|
|
595
|
+
fi
|
|
596
|
+
log_status "DEBUG" "Command: $cmd_summary"
|
|
593
597
|
log_status "DEBUG" "Output file: $output_file"
|
|
594
598
|
log_status "DEBUG" "LIVE_OUTPUT=$LIVE_OUTPUT, timeout=${timeout_seconds}s"
|
|
595
599
|
|