@odla-ai/harness 0.11.14 → 0.11.16

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.
@@ -7,7 +7,7 @@ import {
7
7
  createCodeRuntimeControlClient,
8
8
  createCodeRuntimeSessionSkillLoader,
9
9
  runCodeRuntimeHeartbeatLoop
10
- } from "./chunk-ZXUN2STV.js";
10
+ } from "./chunk-BOYUPB3P.js";
11
11
  import "./chunk-6T26HEWI.js";
12
12
  import {
13
13
  assertPinnedImage,
package/dist/node.cjs CHANGED
@@ -2253,6 +2253,14 @@ function describeReview(review) {
2253
2253
  const head = review.verdict === "approved" ? `Clean verification and independent review passed (score ${review.score}/100).` : `Clean verification passed; independent review REJECTED this candidate (score ${review.score}/100). Address the findings and checkpoint again.`;
2254
2254
  return [head, review.summary, findings].filter(Boolean).join("\n").slice(0, 4e3);
2255
2255
  }
2256
+ function gateOutput(output) {
2257
+ const plain = output.replace(GATE_ANSI, "");
2258
+ if (plain.length <= 1500) return plain;
2259
+ return `${plain.slice(0, 300)}
2260
+ \u2026 [${plain.length - 1500} characters omitted] \u2026
2261
+ ${plain.slice(-1200)}`;
2262
+ }
2263
+ var GATE_ANSI = /\u001b\[[0-9;?]*[A-Za-z]/g;
2256
2264
  function describeGateFailure(evidence) {
2257
2265
  const failed = evidence.receipt.recipes.filter((recipe2) => recipe2.status !== "passed");
2258
2266
  const detail = failed.map((recipe2) => {
@@ -2262,7 +2270,7 @@ ${log?.stderr ?? ""}`.trim();
2262
2270
  const named = describeTapFailures(output);
2263
2271
  return `${recipe2.recipeId}=${recipe2.status}${named ? `
2264
2272
  ${named}` : ""}${output ? `
2265
- ${output.slice(0, 1500)}` : ""}`;
2273
+ ${gateOutput(output)}` : ""}`;
2266
2274
  }).join("\n\n");
2267
2275
  return `Clean verification failed. Fix this and checkpoint again:
2268
2276
  ${detail}`.slice(0, 4e3);
@@ -4270,6 +4278,19 @@ async function graphQuery(context, request, options, policy, registry) {
4270
4278
  return response(request, true, renderWhoTouches(graphs, query));
4271
4279
  }
4272
4280
 
4281
+ // src/code-tool-recipe-output.ts
4282
+ var RECIPE_OUTPUT_HEAD = 4e3;
4283
+ var RECIPE_OUTPUT_TAIL = 24e3;
4284
+ var ANSI = /\u001b\[[0-9;?]*[A-Za-z]/g;
4285
+ function boundedRecipeOutput(output) {
4286
+ const plain = output.replace(ANSI, "");
4287
+ if (plain.length <= RECIPE_OUTPUT_HEAD + RECIPE_OUTPUT_TAIL) return plain;
4288
+ const omitted = plain.length - RECIPE_OUTPUT_HEAD - RECIPE_OUTPUT_TAIL;
4289
+ return `${plain.slice(0, RECIPE_OUTPUT_HEAD)}
4290
+ \u2026 [${omitted} characters omitted; the last ${RECIPE_OUTPUT_TAIL} follow] \u2026
4291
+ ${plain.slice(-RECIPE_OUTPUT_TAIL)}`;
4292
+ }
4293
+
4273
4294
  // src/code-tool-broker.ts
4274
4295
  function createCodeToolBroker(options) {
4275
4296
  validateOptions(options);
@@ -4369,8 +4390,9 @@ async function recipe(context, request, options, recipes, policy) {
4369
4390
  const output = [result.stdout, result.stderr].filter(Boolean).join("\n");
4370
4391
  const ok = result.exitCode === 0 && !result.outputLimitExceeded && !result.timedOut;
4371
4392
  const status = result.timedOut ? "timed out" : result.outputLimitExceeded ? "exceeded output limit" : ok ? "passed" : `failed with exit ${result.exitCode}`;
4372
- return response(request, ok, `Recipe ${recipeId} ${status}.${output ? `
4373
- ${output}` : ""}`, {
4393
+ const shown = boundedRecipeOutput(output);
4394
+ return response(request, ok, `Recipe ${recipeId} ${status}.${shown ? `
4395
+ ${shown}` : ""}`, {
4374
4396
  recipeId,
4375
4397
  exitCode: result.exitCode,
4376
4398
  durationMs: result.durationMs,