codeharness 0.17.2 → 0.17.4

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.
@@ -140,7 +140,7 @@ exporters:
140
140
  tls:
141
141
  insecure: true
142
142
 
143
- otlp/traces:
143
+ otlphttp/traces:
144
144
  endpoint: ${tracesUrl}
145
145
  tls:
146
146
  insecure: true
@@ -167,7 +167,7 @@ service:
167
167
  processors:
168
168
  - resource/default
169
169
  exporters:
170
- - otlp/traces
170
+ - otlphttp/traces
171
171
  `;
172
172
  }
173
173
  function otelCollectorConfigTemplate() {
@@ -198,8 +198,8 @@ exporters:
198
198
  tls:
199
199
  insecure: true
200
200
 
201
- otlp/traces:
202
- endpoint: http://victoria-traces:14268
201
+ otlphttp/traces:
202
+ endpoint: http://victoria-traces:4318
203
203
  tls:
204
204
  insecure: true
205
205
 
@@ -225,7 +225,7 @@ service:
225
225
  processors:
226
226
  - resource/default
227
227
  exporters:
228
- - otlp/traces
228
+ - otlphttp/traces
229
229
  `;
230
230
  }
231
231
 
@@ -14,7 +14,7 @@ import {
14
14
  stopCollectorOnly,
15
15
  stopSharedStack,
16
16
  stopStack
17
- } from "./chunk-CVXXI3N6.js";
17
+ } from "./chunk-MQTUWYSN.js";
18
18
  export {
19
19
  checkRemoteEndpoint,
20
20
  getCollectorHealth,
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  startSharedStack,
14
14
  stopCollectorOnly,
15
15
  stopSharedStack
16
- } from "./chunk-CVXXI3N6.js";
16
+ } from "./chunk-MQTUWYSN.js";
17
17
 
18
18
  // src/index.ts
19
19
  import { Command } from "commander";
@@ -357,7 +357,7 @@ var DEPENDENCY_REGISTRY = [
357
357
  { cmd: "pipx", args: ["install", "beads"] }
358
358
  ],
359
359
  checkCommand: { cmd: "bd", args: ["--version"] },
360
- critical: true
360
+ critical: false
361
361
  }
362
362
  ];
363
363
  function checkInstalled(spec) {
@@ -1443,7 +1443,7 @@ function getInstallCommand(stack) {
1443
1443
  }
1444
1444
 
1445
1445
  // src/commands/init.ts
1446
- var HARNESS_VERSION = true ? "0.17.2" : "0.0.0-dev";
1446
+ var HARNESS_VERSION = true ? "0.17.4" : "0.0.0-dev";
1447
1447
  function getProjectName(projectDir) {
1448
1448
  try {
1449
1449
  const pkgPath = join6(projectDir, "package.json");
@@ -1552,9 +1552,9 @@ function registerInitCommand(program) {
1552
1552
  api: options.api
1553
1553
  },
1554
1554
  documentation: {
1555
- agents_md: "created",
1556
- docs_scaffold: "created",
1557
- readme: "created"
1555
+ agents_md: "skipped",
1556
+ docs_scaffold: "skipped",
1557
+ readme: "skipped"
1558
1558
  }
1559
1559
  };
1560
1560
  const statePath = getStatePath(projectDir);
@@ -1588,6 +1588,16 @@ function registerInitCommand(program) {
1588
1588
  }
1589
1589
  }
1590
1590
  result.dependencies = depResults;
1591
+ if (existingState.docker) {
1592
+ result.docker = {
1593
+ compose_file: existingState.docker.compose_file,
1594
+ stack_running: existingState.docker.stack_running,
1595
+ services: [],
1596
+ ports: existingState.docker.ports
1597
+ };
1598
+ } else {
1599
+ result.docker = null;
1600
+ }
1591
1601
  if (isBmadInstalled(projectDir)) {
1592
1602
  try {
1593
1603
  const patchResults = applyAllPatches(projectDir);
@@ -1665,13 +1675,27 @@ function registerInitCommand(program) {
1665
1675
  info(`App type: ${appType}`);
1666
1676
  }
1667
1677
  let dockerAvailable = true;
1668
- if (!options.otelEndpoint) {
1678
+ if (!options.otelEndpoint && !options.logsUrl) {
1669
1679
  if (!isDockerAvailable()) {
1670
1680
  dockerAvailable = false;
1671
- if (!isJson) {
1672
- warn("Docker not available \u2014 observability will use remote mode");
1673
- info("\u2192 Install Docker: https://docs.docker.com/engine/install/");
1674
- info("\u2192 Or use remote endpoints: codeharness init --otel-endpoint <url>");
1681
+ if (options.observability) {
1682
+ result.status = "fail";
1683
+ result.error = "Docker not installed";
1684
+ result.docker = {
1685
+ compose_file: "",
1686
+ stack_running: false,
1687
+ services: [],
1688
+ ports: { logs: 9428, metrics: 8428, traces: 16686, otel_grpc: 4317, otel_http: 4318 }
1689
+ };
1690
+ if (isJson) {
1691
+ jsonOutput(result);
1692
+ } else {
1693
+ fail("Docker not installed");
1694
+ info("\u2192 Install Docker: https://docs.docker.com/engine/install/");
1695
+ info("\u2192 Or skip observability: codeharness init --no-observability");
1696
+ }
1697
+ process.exitCode = 1;
1698
+ return;
1675
1699
  }
1676
1700
  } else {
1677
1701
  if (!isJson) {
@@ -1721,18 +1745,14 @@ function registerInitCommand(program) {
1721
1745
  }
1722
1746
  } catch (err) {
1723
1747
  if (err instanceof BeadsError) {
1724
- result.status = "fail";
1725
1748
  result.beads = { status: "failed", hooks_detected: false, error: err.message };
1726
- result.error = err.message;
1727
- if (isJson) {
1728
- jsonOutput(result);
1729
- } else {
1730
- fail(`Beads init failed: ${err.message}`);
1749
+ if (!isJson) {
1750
+ warn(`Beads init failed: ${err.message}`);
1751
+ info("Beads is optional \u2014 continuing without it");
1731
1752
  }
1732
- process.exitCode = 1;
1733
- return;
1753
+ } else {
1754
+ throw err;
1734
1755
  }
1735
- throw err;
1736
1756
  }
1737
1757
  try {
1738
1758
  const bmadAlreadyInstalled = isBmadInstalled(projectDir);
@@ -1880,7 +1900,13 @@ function registerInitCommand(program) {
1880
1900
  };
1881
1901
  }
1882
1902
  {
1883
- if (options.otelEndpoint) {
1903
+ if (!options.observability) {
1904
+ result.docker = null;
1905
+ writeState(state, projectDir);
1906
+ if (!isJson) {
1907
+ info("Observability: disabled, skipping Docker stack");
1908
+ }
1909
+ } else if (options.otelEndpoint) {
1884
1910
  state.otlp = {
1885
1911
  ...state.otlp,
1886
1912
  endpoint: options.otelEndpoint,
@@ -1996,6 +2022,12 @@ function registerInitCommand(program) {
1996
2022
  }
1997
2023
  }
1998
2024
  } else {
2025
+ result.docker = {
2026
+ compose_file: "",
2027
+ stack_running: false,
2028
+ services: [],
2029
+ ports: { logs: 9428, metrics: 8428, traces: 16686, otel_grpc: 4317, otel_http: 4318 }
2030
+ };
1999
2031
  writeState(state, projectDir);
2000
2032
  if (!isJson) {
2001
2033
  info("Observability: deferred (configure Docker or remote endpoint to activate)");
@@ -5892,7 +5924,7 @@ function registerTeardownCommand(program) {
5892
5924
  } else if (otlpMode === "remote-routed") {
5893
5925
  if (!options.keepDocker) {
5894
5926
  try {
5895
- const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-6TY2FN43.js");
5927
+ const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-3SYWA63Y.js");
5896
5928
  stopCollectorOnly2();
5897
5929
  result.docker.stopped = true;
5898
5930
  if (!isJson) {
@@ -5924,7 +5956,7 @@ function registerTeardownCommand(program) {
5924
5956
  info("Shared stack: kept running (other projects may use it)");
5925
5957
  }
5926
5958
  } else if (isLegacyStack) {
5927
- const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-6TY2FN43.js");
5959
+ const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-3SYWA63Y.js");
5928
5960
  let stackRunning = false;
5929
5961
  try {
5930
5962
  stackRunning = isStackRunning2(composeFile);
@@ -7426,7 +7458,7 @@ function checkVerifyEnv() {
7426
7458
  return result;
7427
7459
  }
7428
7460
  try {
7429
- execFileSync7("docker", ["run", "--rm", IMAGE_TAG, "codeharness", "--version"], {
7461
+ execFileSync7("docker", ["run", "--rm", IMAGE_TAG, "codeharness", "--help"], {
7430
7462
  stdio: "pipe",
7431
7463
  timeout: 3e4
7432
7464
  });
@@ -7788,7 +7820,7 @@ function handleStatus(dir, isJson, filterStory) {
7788
7820
  }
7789
7821
 
7790
7822
  // src/index.ts
7791
- var VERSION = true ? "0.17.2" : "0.0.0-dev";
7823
+ var VERSION = true ? "0.17.4" : "0.0.0-dev";
7792
7824
  function createProgram() {
7793
7825
  const program = new Command();
7794
7826
  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.17.2",
3
+ "version": "0.17.4",
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
@@ -5,10 +5,8 @@
5
5
  #
6
6
  # Usage: ralph/ralph.sh --plugin-dir ./codeharness [OPTIONS]
7
7
 
8
- set -e
9
-
10
- # DEBUG: catch unexpected exits from set -e
11
- trap 'echo "[$(date "+%Y-%m-%d %H:%M:%S")] [FATAL] ralph.sh died at line $LINENO (exit code: $?)" >> "${LOG_DIR:-ralph/logs}/ralph_crash.log" 2>/dev/null' ERR
8
+ # NOTE: set -e intentionally NOT used — it causes silent crashes in the main
9
+ # loop when grep/jq/sed return non-zero. The loop handles errors via exit codes.
12
10
 
13
11
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
12
  source "$SCRIPT_DIR/lib/date_utils.sh"
@@ -624,11 +622,8 @@ execute_iteration() {
624
622
  sleep 10
625
623
  done
626
624
 
627
- # Protect wait from set -e — capture exit code without crashing
628
- set +e
629
625
  wait $claude_pid
630
626
  exit_code=$?
631
- set -e
632
627
  log_status "DEBUG" "Claude exited with code: $exit_code, output size: $(wc -c < "$output_file" 2>/dev/null || echo 0) bytes"
633
628
 
634
629
  # If output is empty and exit code is non-zero, log diagnostic info