@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.
@@ -1607,6 +1607,14 @@ function describeReview(review) {
1607
1607
  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.`;
1608
1608
  return [head, review.summary, findings].filter(Boolean).join("\n").slice(0, 4e3);
1609
1609
  }
1610
+ function gateOutput(output) {
1611
+ const plain = output.replace(GATE_ANSI, "");
1612
+ if (plain.length <= 1500) return plain;
1613
+ return `${plain.slice(0, 300)}
1614
+ \u2026 [${plain.length - 1500} characters omitted] \u2026
1615
+ ${plain.slice(-1200)}`;
1616
+ }
1617
+ var GATE_ANSI = /\u001b\[[0-9;?]*[A-Za-z]/g;
1610
1618
  function describeGateFailure(evidence) {
1611
1619
  const failed = evidence.receipt.recipes.filter((recipe2) => recipe2.status !== "passed");
1612
1620
  const detail = failed.map((recipe2) => {
@@ -1616,7 +1624,7 @@ ${log?.stderr ?? ""}`.trim();
1616
1624
  const named = describeTapFailures(output);
1617
1625
  return `${recipe2.recipeId}=${recipe2.status}${named ? `
1618
1626
  ${named}` : ""}${output ? `
1619
- ${output.slice(0, 1500)}` : ""}`;
1627
+ ${gateOutput(output)}` : ""}`;
1620
1628
  }).join("\n\n");
1621
1629
  return `Clean verification failed. Fix this and checkpoint again:
1622
1630
  ${detail}`.slice(0, 4e3);
@@ -3624,6 +3632,19 @@ async function graphQuery(context, request, options, policy, registry) {
3624
3632
  return response(request, true, renderWhoTouches(graphs, query));
3625
3633
  }
3626
3634
 
3635
+ // src/code-tool-recipe-output.ts
3636
+ var RECIPE_OUTPUT_HEAD = 4e3;
3637
+ var RECIPE_OUTPUT_TAIL = 24e3;
3638
+ var ANSI = /\u001b\[[0-9;?]*[A-Za-z]/g;
3639
+ function boundedRecipeOutput(output) {
3640
+ const plain = output.replace(ANSI, "");
3641
+ if (plain.length <= RECIPE_OUTPUT_HEAD + RECIPE_OUTPUT_TAIL) return plain;
3642
+ const omitted = plain.length - RECIPE_OUTPUT_HEAD - RECIPE_OUTPUT_TAIL;
3643
+ return `${plain.slice(0, RECIPE_OUTPUT_HEAD)}
3644
+ \u2026 [${omitted} characters omitted; the last ${RECIPE_OUTPUT_TAIL} follow] \u2026
3645
+ ${plain.slice(-RECIPE_OUTPUT_TAIL)}`;
3646
+ }
3647
+
3627
3648
  // src/code-tool-broker.ts
3628
3649
  function createCodeToolBroker(options) {
3629
3650
  validateOptions(options);
@@ -3723,8 +3744,9 @@ async function recipe(context, request, options, recipes, policy) {
3723
3744
  const output = [result.stdout, result.stderr].filter(Boolean).join("\n");
3724
3745
  const ok = result.exitCode === 0 && !result.outputLimitExceeded && !result.timedOut;
3725
3746
  const status = result.timedOut ? "timed out" : result.outputLimitExceeded ? "exceeded output limit" : ok ? "passed" : `failed with exit ${result.exitCode}`;
3726
- return response(request, ok, `Recipe ${recipeId} ${status}.${output ? `
3727
- ${output}` : ""}`, {
3747
+ const shown = boundedRecipeOutput(output);
3748
+ return response(request, ok, `Recipe ${recipeId} ${status}.${shown ? `
3749
+ ${shown}` : ""}`, {
3728
3750
  recipeId,
3729
3751
  exitCode: result.exitCode,
3730
3752
  durationMs: result.durationMs,