@kody-ade/kody-engine 0.4.651 → 0.4.653

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/bin/kody.js CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "package.json"() {
16
16
  package_default = {
17
17
  name: "@kody-ade/kody-engine",
18
- version: "0.4.651",
18
+ version: "0.4.653",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
20
20
  license: "MIT",
21
21
  repository: {
@@ -24969,7 +24969,8 @@ async function runJob(job, base) {
24969
24969
  });
24970
24970
  }
24971
24971
  if (valid.workflowRunId && workflowIdentity && base.config && result.workflowState) {
24972
- await checkpointTerminalWorkflowState(checkpoint, result.workflowState);
24972
+ await lease?.checkpoint();
24973
+ await writeWorkflowRunState(base.config, base.cwd, workflowIdentity, valid.workflowRunId, result.workflowState);
24973
24974
  }
24974
24975
  if (valid.workflowRunId && workflowIdentity && hasGitHubActionsIdentity() && result.workflowState?.status !== "waiting-approval") {
24975
24976
  const facts = result.workflowState?.facts ?? {};
@@ -25121,7 +25122,7 @@ async function runCapabilityWorkflow(parent, workflow, capability, base, checkpo
25121
25122
  const state = initialWorkflowState(parent, workflow);
25122
25123
  state.status = "blocked";
25123
25124
  state.blocker = invalid;
25124
- await checkpointTerminalWorkflowState(checkpoint, state);
25125
+ await checkpoint?.(state);
25125
25126
  return { exitCode: 64, reason: invalid, workflowState: state };
25126
25127
  }
25127
25128
  return { exitCode: 64, reason: invalid };
@@ -25131,7 +25132,7 @@ async function runCapabilityWorkflow(parent, workflow, capability, base, checkpo
25131
25132
  const state = initialWorkflowState(parent, workflow);
25132
25133
  state.status = "blocked";
25133
25134
  state.blocker = resumeBlocker;
25134
- await checkpointTerminalWorkflowState(checkpoint, state);
25135
+ await checkpoint?.(state);
25135
25136
  return { exitCode: 64, reason: resumeBlocker, workflowState: state };
25136
25137
  }
25137
25138
  const result = isGraphWorkflow(workflow) ? await runGraphCapabilityWorkflow(parent, workflow, capability, base, checkpoint) : await runLinearCapabilityWorkflow(parent, workflow, capability, base, checkpoint);
@@ -25225,7 +25226,7 @@ async function runLinearCapabilityWorkflow(parent, workflow, capability, base, c
25225
25226
  if (result.exitCode !== 0 && !canContinueWorkflow(step, outcome)) {
25226
25227
  state.status = result.capabilityResults?.at(-1)?.status === "blocked" ? "blocked" : "failed";
25227
25228
  state.blocker = result.reason ?? `workflow ${capability.slug} stopped at step ${index + 1}/${workflow.steps.length}: ${label}`;
25228
- await checkpointTerminalWorkflowState(checkpoint, state);
25229
+ await checkpoint?.(state);
25229
25230
  return withWorkflowBoundaryEval(capability, {
25230
25231
  ...result,
25231
25232
  reason: state.blocker,
@@ -25235,7 +25236,7 @@ async function runLinearCapabilityWorkflow(parent, workflow, capability, base, c
25235
25236
  }
25236
25237
  state.status = "done";
25237
25238
  delete state.blocker;
25238
- await checkpointTerminalWorkflowState(checkpoint, state);
25239
+ await checkpoint?.(state);
25239
25240
  return withWorkflowBoundaryEval(capability, { ...result, workflowState: state });
25240
25241
  }
25241
25242
  function isGraphWorkflow(workflow) {
@@ -25334,7 +25335,7 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
25334
25335
  const reason = `workflow ${capability.slug} exceeded ${maxExecutedSteps} executed steps`;
25335
25336
  state.status = "blocked";
25336
25337
  state.blocker = reason;
25337
- await checkpointTerminalWorkflowState(checkpoint, state);
25338
+ await checkpoint?.(state);
25338
25339
  return { ...result, exitCode: 64, reason, workflowState: state };
25339
25340
  }
25340
25341
  const index = workflow.steps.findIndex((step2) => step2.id === state.currentStepId);
@@ -25343,7 +25344,7 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
25343
25344
  const reason = `workflow ${capability.slug} current step ${state.currentStepId} is missing`;
25344
25345
  state.status = "blocked";
25345
25346
  state.blocker = reason;
25346
- await checkpointTerminalWorkflowState(checkpoint, state);
25347
+ await checkpoint?.(state);
25347
25348
  return { ...result, exitCode: 64, reason, workflowState: state };
25348
25349
  }
25349
25350
  const label = step.action ?? step.capability;
@@ -25376,7 +25377,7 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
25376
25377
  output: { status: "blocked", summary: reason },
25377
25378
  completedAt: (/* @__PURE__ */ new Date()).toISOString()
25378
25379
  };
25379
- await checkpointTerminalWorkflowState(checkpoint, state);
25380
+ await checkpoint?.(state);
25380
25381
  return { exitCode: 64, reason, workflowState: state };
25381
25382
  }
25382
25383
  beginWorkflowStep(state, step, child);
@@ -25437,7 +25438,7 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
25437
25438
  const lastResult = result.capabilityResults?.at(-1);
25438
25439
  state.status = lastResult?.status === "blocked" ? "blocked" : "failed";
25439
25440
  state.blocker = result.reason ?? `workflow step ${step.id} failed`;
25440
- await checkpointTerminalWorkflowState(checkpoint, state);
25441
+ await checkpoint?.(state);
25441
25442
  return withWorkflowBoundaryEval(capability, { ...result, workflowState: state });
25442
25443
  }
25443
25444
  if (!step.next || step.next.length === 0) {
@@ -25448,7 +25449,7 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
25448
25449
  const reason = `workflow step ${step.id} did not emit the structured result required by its conditions: ${resultConditionPaths.join(", ")}`;
25449
25450
  state.status = "blocked";
25450
25451
  state.blocker = reason;
25451
- await checkpointTerminalWorkflowState(checkpoint, state);
25452
+ await checkpoint?.(state);
25452
25453
  return { ...result, exitCode: 64, reason, workflowState: state };
25453
25454
  }
25454
25455
  const transition = selectWorkflowTransition(step, chainData, state.transitionCounts);
@@ -25457,7 +25458,7 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
25457
25458
  const reason = exhausted.length > 0 ? `workflow step ${step.id} reached iteration limit: ${exhausted.join(", ")}` : `workflow step ${step.id} has no available connection`;
25458
25459
  state.status = "blocked";
25459
25460
  state.blocker = reason;
25460
- await checkpointTerminalWorkflowState(checkpoint, state);
25461
+ await checkpoint?.(state);
25461
25462
  return { ...result, exitCode: 64, reason, workflowState: state };
25462
25463
  }
25463
25464
  if (transition.maxIterations !== void 0) {
@@ -25473,7 +25474,7 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
25473
25474
  await checkpoint?.(state);
25474
25475
  }
25475
25476
  state.status = "done";
25476
- await checkpointTerminalWorkflowState(checkpoint, state);
25477
+ await checkpoint?.(state);
25477
25478
  return withWorkflowBoundaryEval(capability, { ...result, workflowState: state });
25478
25479
  }
25479
25480
  async function completeWorkflowAtTerminal(capability, state, output, checkpoint) {
@@ -25484,7 +25485,7 @@ async function completeWorkflowAtTerminal(capability, state, output, checkpoint)
25484
25485
  const summary = result?.summary ?? (typeof output.capabilityOutput?.summary === "string" ? output.capabilityOutput.summary : "Workflow ended without a usable result");
25485
25486
  state.status = terminalFailure;
25486
25487
  state.blocker = summary;
25487
- await checkpointTerminalWorkflowState(checkpoint, state);
25488
+ await checkpoint?.(state);
25488
25489
  return withWorkflowBoundaryEval(capability, {
25489
25490
  ...output,
25490
25491
  exitCode: terminalFailure === "failed" ? 1 : 64,
@@ -25495,18 +25496,9 @@ async function completeWorkflowAtTerminal(capability, state, output, checkpoint)
25495
25496
  state.status = "done";
25496
25497
  delete state.currentStepId;
25497
25498
  delete state.blocker;
25498
- await checkpointTerminalWorkflowState(checkpoint, state);
25499
+ await checkpoint?.(state);
25499
25500
  return withWorkflowBoundaryEval(capability, { ...output, workflowState: state });
25500
25501
  }
25501
- async function checkpointTerminalWorkflowState(checkpoint, state) {
25502
- if (!checkpoint) return;
25503
- try {
25504
- await checkpoint(state);
25505
- } catch (error) {
25506
- process.stderr.write(`warning: failed to save terminal Workflow state: ${String(error)}
25507
- `);
25508
- }
25509
- }
25510
25502
  function graphWorkflowExecutionKey(parentExecutionKey, workflowSlug, stepId, transitionCounts) {
25511
25503
  const transitionHistory = Object.entries(transitionCounts).filter(([, count]) => count > 0).sort(([left], [right]) => left.localeCompare(right)).map(([transition, count]) => `${transition}=${count}`).join(",");
25512
25504
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.651",
3
+ "version": "0.4.653",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -47,6 +47,10 @@ on:
47
47
  description: 'Canonical Kody execution request JSON'
48
48
  type: string
49
49
  default: ''
50
+ runRequestBase64:
51
+ description: 'Transport-safe canonical Kody execution request'
52
+ type: string
53
+ default: ''
50
54
  issue_comment:
51
55
  types: [created]
52
56
  pull_request:
@@ -88,8 +92,12 @@ jobs:
88
92
  MODEL: ${{ inputs.model }}
89
93
  DASHBOARD_URL: ${{ inputs.dashboardUrl }}
90
94
  KODY_RUN_REQUEST_JSON: ${{ inputs.runRequest }}
95
+ KODY_RUN_REQUEST_BASE64: ${{ inputs.runRequestBase64 }}
91
96
  working-directory: ${{ github.workspace }}
92
97
  run: |
98
+ if [ -n "$KODY_RUN_REQUEST_BASE64" ]; then
99
+ export KODY_RUN_REQUEST_JSON="$(printf '%s' "$KODY_RUN_REQUEST_BASE64" | base64 --decode)"
100
+ fi
93
101
  npx -y -p @kody-ade/kody-engine@latest kody-engine
94
102
 
95
103
  - name: Upload Quality Run evidence