@kody-ade/kody-engine 0.4.619 → 0.4.621

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.
Files changed (2) hide show
  1. package/dist/bin/kody.js +26 -9
  2. package/package.json +1 -1
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.619",
18
+ version: "0.4.621",
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: {
@@ -8927,6 +8927,9 @@ function isForbiddenPath(p, deliveryPathAllowlist = []) {
8927
8927
  for (const pre of ALLOWED_PATH_PREFIXES) if (p.startsWith(pre)) return false;
8928
8928
  return false;
8929
8929
  }
8930
+ function isReportableDeliveryOmission(p) {
8931
+ return !GENERATED_PATH_PREFIXES.some((prefix) => p.startsWith(prefix)) && !FORBIDDEN_PATH_SUFFIXES.some((suffix) => p.endsWith(suffix));
8932
+ }
8930
8933
  function isRecord(value) {
8931
8934
  return typeof value === "object" && value !== null && !Array.isArray(value);
8932
8935
  }
@@ -9039,13 +9042,14 @@ function commitAndPush(branch, agentMessage, cwd, deliveryPathAllowlist = [], de
9039
9042
  const allowedFiles = allChanged.filter(
9040
9043
  (f) => !isForbiddenPath(f, deliveryPathAllowlist) || isTrustedConfigActivationChange(f, deliveryPathAllowlist, deliveryConfigAllowlist, cwd)
9041
9044
  );
9042
- const mergeHeadExists = fs29.existsSync(path28.join(cwd ?? process.cwd(), ".git", "MERGE_HEAD"));
9043
- if (allowedFiles.length === 0 && !mergeHeadExists) {
9044
- return { committed: false, pushed: false, sha: "", message: "" };
9045
- }
9046
9045
  const forbiddenFiles = allChanged.filter(
9047
9046
  (f) => isForbiddenPath(f, deliveryPathAllowlist) && !isTrustedConfigActivationChange(f, deliveryPathAllowlist, deliveryConfigAllowlist, cwd)
9048
9047
  );
9048
+ const omittedFiles = forbiddenFiles.filter(isReportableDeliveryOmission);
9049
+ const mergeHeadExists = fs29.existsSync(path28.join(cwd ?? process.cwd(), ".git", "MERGE_HEAD"));
9050
+ if (allowedFiles.length === 0 && !mergeHeadExists) {
9051
+ return { committed: false, pushed: false, sha: "", message: "", omittedFiles };
9052
+ }
9049
9053
  for (const f of forbiddenFiles) {
9050
9054
  try {
9051
9055
  git(["reset", "-q", "--", f], cwd);
@@ -9072,9 +9076,9 @@ function commitAndPush(branch, agentMessage, cwd, deliveryPathAllowlist = [], de
9072
9076
  const sha = git(["rev-parse", "HEAD"], cwd).slice(0, 7);
9073
9077
  const pushResult = pushWithRetry({ cwd, branch, setUpstream: true });
9074
9078
  if (pushResult.ok) {
9075
- return { committed: true, pushed: true, sha, message };
9079
+ return { committed: true, pushed: true, sha, message, omittedFiles };
9076
9080
  }
9077
- return { committed: true, pushed: false, sha, message, pushError: pushResult.reason };
9081
+ return { committed: true, pushed: false, sha, message, pushError: pushResult.reason, omittedFiles };
9078
9082
  }
9079
9083
  function hasCommitsAhead(branch, defaultBranch, cwd) {
9080
9084
  try {
@@ -9089,7 +9093,7 @@ function hasCommitsAhead(branch, defaultBranch, cwd) {
9089
9093
  }
9090
9094
  }
9091
9095
  }
9092
- var GIT_MAX_BUFFER_BYTES, FORBIDDEN_PATH_PREFIXES, ALLOWED_PATH_PREFIXES, FORBIDDEN_PATH_EXACT, FORBIDDEN_PATH_SUFFIXES, ACTIVATION_FIELDS, CONVENTIONAL_PREFIXES;
9096
+ var GIT_MAX_BUFFER_BYTES, FORBIDDEN_PATH_PREFIXES, ALLOWED_PATH_PREFIXES, FORBIDDEN_PATH_EXACT, FORBIDDEN_PATH_SUFFIXES, GENERATED_PATH_PREFIXES, ACTIVATION_FIELDS, CONVENTIONAL_PREFIXES;
9093
9097
  var init_commit = __esm({
9094
9098
  "src/commit.ts"() {
9095
9099
  "use strict";
@@ -9113,6 +9117,14 @@ var init_commit = __esm({
9113
9117
  ALLOWED_PATH_PREFIXES = [];
9114
9118
  FORBIDDEN_PATH_EXACT = /* @__PURE__ */ new Set([".env", ".kody-pip-requirements.txt", "kody.config.json"]);
9115
9119
  FORBIDDEN_PATH_SUFFIXES = [".log"];
9120
+ GENERATED_PATH_PREFIXES = [
9121
+ ".kody-engine/",
9122
+ ".kody-lean/",
9123
+ ".codegraph/",
9124
+ "node_modules/",
9125
+ "dist/",
9126
+ "build/"
9127
+ ];
9116
9128
  ACTIVATION_FIELDS = [
9117
9129
  "activeAgents",
9118
9130
  "activeCapabilities",
@@ -12718,6 +12730,7 @@ var init_commitAndPush = __esm({
12718
12730
  try {
12719
12731
  const result2 = commitAndPush(branch, message, ctx.cwd, deliveryPathAllowlist, deliveryConfigAllowlist);
12720
12732
  ctx.data.commitResult = result2;
12733
+ if (result2.omittedFiles?.length) ctx.data.deliveryOmissions = result2.omittedFiles;
12721
12734
  const postCommitFiles = result2.committed ? listFilesInCommit("HEAD", ctx.cwd) : listChangedFiles(ctx.cwd);
12722
12735
  ctx.data.changedFiles = postCommitFiles.filter((f) => !isForbiddenPath(f, deliveryPathAllowlist));
12723
12736
  if (result2.committed && !result2.pushed) {
@@ -18306,6 +18319,10 @@ function renderMessage(input) {
18306
18319
  }
18307
18320
  }
18308
18321
  function computeFailureReason2(ctx) {
18322
+ const omissions = Array.isArray(ctx.data.deliveryOmissions) ? ctx.data.deliveryOmissions.filter((file) => typeof file === "string") : [];
18323
+ if (omissions.length > 0) {
18324
+ return `delivery blocked protected files: ${omissions.join(", ")}`;
18325
+ }
18309
18326
  const misses = ctx.data.coverageMisses ?? [];
18310
18327
  if (misses.length > 0) return `missing tests: ${misses.map((m) => m.expectedTest).join(", ")}`;
18311
18328
  const agentDone = Boolean(ctx.data.agentDone);
@@ -18439,7 +18456,7 @@ var init_postIssueComment = __esm({
18439
18456
  const agentDone = Boolean(ctx.data.agentDone);
18440
18457
  const verifyOk = ctx.data.verifyOk !== false;
18441
18458
  const misses = ctx.data.coverageMisses ?? [];
18442
- if (!agentDone || misses.length > 0) exitCode = 1;
18459
+ if (isFailure || !agentDone || misses.length > 0) exitCode = 1;
18443
18460
  else if (!verifyOk) exitCode = 2;
18444
18461
  exitCode = Math.max(ctx.output.exitCode ?? 0, exitCode);
18445
18462
  if (exitCode !== 0) markRunFailed(ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.619",
3
+ "version": "0.4.621",
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": {