@kody-ade/kody-engine 0.4.572 → 0.4.574

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.572",
18
+ version: "0.4.574",
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
  type: "module",
@@ -54,7 +54,7 @@ var init_package = __esm({
54
54
  dependencies: {
55
55
  "@actions/cache": "^6.0.0",
56
56
  "@anthropic-ai/claude-agent-sdk": "0.2.119",
57
- "@kody-ade/engine-contracts": "0.1.0",
57
+ "@kody-ade/engine-contracts": "^0.2.0",
58
58
  "@modelcontextprotocol/sdk": "^1.29.0",
59
59
  ajv: "^8.18.0",
60
60
  convex: "^1.17.0",
@@ -2187,6 +2187,7 @@ function readCapabilityFolder(root, slug) {
2187
2187
  },
2188
2188
  rawProfile: contract ? {
2189
2189
  ...contract.execution ? { execution: contract.execution } : {},
2190
+ ...contract.deliveryPolicy ? { deliveryPolicy: contract.deliveryPolicy } : {},
2190
2191
  input: contract.input,
2191
2192
  output: contract.output
2192
2193
  } : {},
@@ -2227,13 +2228,20 @@ function parseCapabilityContract(raw) {
2227
2228
  throw new Error('contract.json requiredSubagents are supported only when execution is "agent"');
2228
2229
  }
2229
2230
  const unsupported = Object.keys(parsed).filter(
2230
- (key) => key !== "execution" && key !== "requirements" && key !== "secrets" && key !== "timeoutMs" && key !== "requiredSubagents" && key !== "input" && key !== "output"
2231
+ (key) => key !== "execution" && key !== "deliveryPolicy" && key !== "requirements" && key !== "secrets" && key !== "timeoutMs" && key !== "requiredSubagents" && key !== "input" && key !== "output"
2231
2232
  );
2232
2233
  if (unsupported.length > 0) {
2233
2234
  throw new Error(`contract.json contains unsupported fields: ${unsupported.join(", ")}`);
2234
2235
  }
2236
+ if (parsed.deliveryPolicy !== void 0 && parsed.deliveryPolicy !== "checkpoint") {
2237
+ throw new Error('contract.json deliveryPolicy must be "checkpoint"');
2238
+ }
2239
+ if (parsed.deliveryPolicy === "checkpoint" && parsed.execution !== "agent") {
2240
+ throw new Error('contract.json deliveryPolicy "checkpoint" is supported only when execution is "agent"');
2241
+ }
2235
2242
  return {
2236
2243
  ...parsed.execution ? { execution: parsed.execution } : {},
2244
+ ...parsed.deliveryPolicy === "checkpoint" ? { deliveryPolicy: "checkpoint" } : {},
2237
2245
  ...requirements ? { requirements } : {},
2238
2246
  ...secrets ? { secrets } : {},
2239
2247
  ...timeoutMs !== void 0 ? { timeoutMs } : {},
@@ -4736,6 +4744,7 @@ var init_task_artifacts = __esm({
4736
4744
  });
4737
4745
 
4738
4746
  // src/workflowValidation.ts
4747
+ import { validateExecutableWorkflow } from "@kody-ade/engine-contracts";
4739
4748
  function validateWorkflow(value, options = {}) {
4740
4749
  const issues = [];
4741
4750
  const workflow = asRecord(value);
@@ -4754,6 +4763,7 @@ function validateWorkflow(value, options = {}) {
4754
4763
  const step = asRecord(entry);
4755
4764
  return Boolean(step && (step.id !== void 0 || step.next !== void 0));
4756
4765
  });
4766
+ const sharedIssues = graphMode ? validateExecutableWorkflow(value, options) : [];
4757
4767
  const steps = rawSteps.map(
4758
4768
  (entry) => typeof entry === "string" ? { capability: entry } : asRecord(entry)
4759
4769
  );
@@ -4814,7 +4824,7 @@ function validateWorkflow(value, options = {}) {
4814
4824
  capability ? options.capabilityInputs?.get(capability) : void 0
4815
4825
  );
4816
4826
  });
4817
- if (!graphMode) return issues;
4827
+ if (!graphMode) return uniqueIssues([...issues, ...sharedIssues]);
4818
4828
  const seen = /* @__PURE__ */ new Set();
4819
4829
  ids.forEach((id, index) => {
4820
4830
  if (seen.has(id)) issue(issues, "duplicate_step_id", `steps[${index}].id`, `workflow step id ${id} is duplicated`);
@@ -4957,7 +4967,16 @@ function validateWorkflow(value, options = {}) {
4957
4967
  issue(issues, "missing_terminal_step", "steps", "workflow has no reachable final step");
4958
4968
  }
4959
4969
  }
4960
- return issues;
4970
+ return uniqueIssues([...issues, ...sharedIssues]);
4971
+ }
4972
+ function uniqueIssues(issues) {
4973
+ const seen = /* @__PURE__ */ new Set();
4974
+ return issues.filter((entry) => {
4975
+ const key = `${entry.code}\0${entry.path}`;
4976
+ if (seen.has(key)) return false;
4977
+ seen.add(key);
4978
+ return true;
4979
+ });
4961
4980
  }
4962
4981
  function validateInputBindings(value, path59, issues, declaredInputs) {
4963
4982
  if (value === void 0) return;
@@ -12186,6 +12205,11 @@ var init_checkCoverageWithRetry = __esm({
12186
12205
  init_coverage();
12187
12206
  init_prompt();
12188
12207
  checkCoverageWithRetry = async (ctx) => {
12208
+ if (ctx.data.capabilityDeliveryPolicy === "checkpoint") {
12209
+ ctx.data.verificationDeferred = true;
12210
+ ctx.data.coverageMisses = [];
12211
+ return;
12212
+ }
12189
12213
  const reqs = ctx.data.coverageRules ?? [];
12190
12214
  if (reqs.length === 0) {
12191
12215
  ctx.data.coverageMisses = [];
@@ -14628,6 +14652,9 @@ function setOutcome(ctx, outcome) {
14628
14652
  ctx.output.prUrl = outcome.url;
14629
14653
  }
14630
14654
  }
14655
+ function deliveryCheckpointReason(data) {
14656
+ return data.capabilityDeliveryPolicy === "checkpoint" ? "Repository-wide verification is deferred to pull request CI." : "";
14657
+ }
14631
14658
  function computeFailureReason(ctx) {
14632
14659
  const expectedTests = collectExpectedTests(ctx.data.coverageMisses);
14633
14660
  if (expectedTests.length > 0) return `missing tests: ${expectedTests.join(", ")}`;
@@ -14697,7 +14724,8 @@ var init_ensurePr = __esm({
14697
14724
  setOutcome(ctx, { kind: "skipped", reason: "no branch context (ctx.data.branch missing)" });
14698
14725
  return;
14699
14726
  }
14700
- const failureReason = computeFailureReason(ctx);
14727
+ const checkpointReason = deliveryCheckpointReason(ctx.data);
14728
+ const failureReason = computeFailureReason(ctx) || checkpointReason;
14701
14729
  const isFailure = failureReason.length > 0;
14702
14730
  const changedFiles = ctx.data.changedFiles ?? [];
14703
14731
  const issue2 = ctx.data.issue;
@@ -16295,6 +16323,9 @@ var init_loadSimpleCapability = __esm({
16295
16323
  ctx.data.jobCapability = slug;
16296
16324
  ctx.data.capabilityInput = input;
16297
16325
  ctx.data.capabilityExecution = capability.contract?.execution ?? "agent";
16326
+ if (capability.contract?.deliveryPolicy) {
16327
+ ctx.data.capabilityDeliveryPolicy = capability.contract.deliveryPolicy;
16328
+ }
16298
16329
  if (capability.contract?.requirements) {
16299
16330
  ctx.data.capabilityRequirements = capability.contract.requirements;
16300
16331
  }
@@ -17881,7 +17912,8 @@ var init_postIssueComment = __esm({
17881
17912
  githubRepo: ctx.config.github?.repo
17882
17913
  });
17883
17914
  postWith(targetType, targetNumber, msg, ctx.cwd);
17884
- if (!isFailure) {
17915
+ const prIsDraft = (prResult?.kind === "created" || prResult?.kind === "updated") && prResult.draft === true;
17916
+ if (!isFailure && !prIsDraft) {
17885
17917
  markPrReadyForReview(ctx, prResult);
17886
17918
  }
17887
17919
  let exitCode = 0;
@@ -21006,6 +21038,12 @@ var init_verifyWithRetry = __esm({
21006
21038
  init_prompt();
21007
21039
  init_verify();
21008
21040
  verifyWithRetry = async (ctx) => {
21041
+ if (ctx.data.capabilityDeliveryPolicy === "checkpoint") {
21042
+ ctx.data.verificationDeferred = true;
21043
+ delete ctx.data.verifyOk;
21044
+ delete ctx.data.verifyReason;
21045
+ return;
21046
+ }
21009
21047
  await runVerify(ctx);
21010
21048
  if (ctx.data.verifyOk !== false) return;
21011
21049
  if (ctx.abortSignal?.aborted) {
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.572",
3
+ "version": "0.4.574",
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
  "type": "module",
@@ -12,10 +12,34 @@
12
12
  "templates",
13
13
  "kody.config.schema.json"
14
14
  ],
15
+ "scripts": {
16
+ "kody:run": "tsx bin/kody.ts",
17
+ "serve": "tsx bin/kody.ts serve",
18
+ "serve:vscode": "tsx bin/kody.ts serve vscode",
19
+ "serve:claude": "tsx bin/kody.ts serve claude",
20
+ "clean:dist": "node scripts/clean-dist.cjs",
21
+ "build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
22
+ "check:modularity": "tsx scripts/check-script-modularity.ts",
23
+ "pretest": "pnpm check:modularity",
24
+ "test": "vitest run tests/unit tests/int --coverage",
25
+ "posttest": "tsx scripts/check-coverage-floor.ts",
26
+ "test:smoke": "vitest run tests/smoke --no-coverage",
27
+ "test:e2e": "vitest run tests/e2e --no-coverage",
28
+ "verify:live-release": "tsx scripts/live-release-gate.ts",
29
+ "test:runtime-services": "node --test \"tests/runtime-services/*.test.mjs\"",
30
+ "test:all": "vitest run tests --no-coverage",
31
+ "typecheck": "tsc --noEmit",
32
+ "lint": "biome check",
33
+ "lint:fix": "biome check --write",
34
+ "format": "biome format --write",
35
+ "verify:package": "node scripts/verify-package-tarball.cjs",
36
+ "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain --build-arg KODY_ENGINE_REF=$(git rev-parse HEAD) -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner",
37
+ "prepublishOnly": "pnpm typecheck && pnpm test:runtime-services && pnpm build && pnpm verify:package"
38
+ },
15
39
  "dependencies": {
16
40
  "@actions/cache": "^6.0.0",
17
41
  "@anthropic-ai/claude-agent-sdk": "0.2.119",
18
- "@kody-ade/engine-contracts": "0.1.0",
42
+ "@kody-ade/engine-contracts": "^0.2.0",
19
43
  "@modelcontextprotocol/sdk": "^1.29.0",
20
44
  "ajv": "^8.18.0",
21
45
  "convex": "^1.17.0",
@@ -38,28 +62,5 @@
38
62
  "url": "git+https://github.com/aharonyaircohen/kody-engine.git"
39
63
  },
40
64
  "homepage": "https://github.com/aharonyaircohen/kody-engine",
41
- "bugs": "https://github.com/aharonyaircohen/kody-engine/issues",
42
- "scripts": {
43
- "kody:run": "tsx bin/kody.ts",
44
- "serve": "tsx bin/kody.ts serve",
45
- "serve:vscode": "tsx bin/kody.ts serve vscode",
46
- "serve:claude": "tsx bin/kody.ts serve claude",
47
- "clean:dist": "node scripts/clean-dist.cjs",
48
- "build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
49
- "check:modularity": "tsx scripts/check-script-modularity.ts",
50
- "pretest": "pnpm check:modularity",
51
- "test": "vitest run tests/unit tests/int --coverage",
52
- "posttest": "tsx scripts/check-coverage-floor.ts",
53
- "test:smoke": "vitest run tests/smoke --no-coverage",
54
- "test:e2e": "vitest run tests/e2e --no-coverage",
55
- "verify:live-release": "tsx scripts/live-release-gate.ts",
56
- "test:runtime-services": "node --test \"tests/runtime-services/*.test.mjs\"",
57
- "test:all": "vitest run tests --no-coverage",
58
- "typecheck": "tsc --noEmit",
59
- "lint": "biome check",
60
- "lint:fix": "biome check --write",
61
- "format": "biome format --write",
62
- "verify:package": "node scripts/verify-package-tarball.cjs",
63
- "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain --build-arg KODY_ENGINE_REF=$(git rev-parse HEAD) -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner"
64
- }
65
- }
65
+ "bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
66
+ }