@kody-ade/kody-engine 0.2.56 → 0.2.57

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/kody2.js +18 -2
  2. package/package.json +1 -1
package/dist/bin/kody2.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@kody-ade/kody-engine",
6
- version: "0.2.56",
6
+ version: "0.2.57",
7
7
  description: "kody2 \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
8
8
  license: "MIT",
9
9
  type: "module",
@@ -4495,7 +4495,7 @@ var GATED_LABEL = "kody:gated";
4495
4495
  var DEFAULT_MAX_FILES = 20;
4496
4496
  var DEFAULT_MAX_DELETIONS = 500;
4497
4497
  var riskGate = async (ctx, profile, _agent, args) => {
4498
- const changedFiles = ctx.data.changedFiles ?? [];
4498
+ const changedFiles = collectBranchChangedFiles(ctx);
4499
4499
  const gatesToRun = parseGates(args?.gates);
4500
4500
  const violations = evaluateGates(ctx, profile.name, changedFiles, gatesToRun, args);
4501
4501
  if (violations.length === 0) {
@@ -4657,6 +4657,22 @@ function isDepFile(p) {
4657
4657
  function isTestFile(p) {
4658
4658
  return /(^|\/)(tests?|__tests__|spec)\//i.test(p) || /\.(test|spec)\.[a-z0-9]+$/i.test(p);
4659
4659
  }
4660
+ function collectBranchChangedFiles(ctx) {
4661
+ const base = ctx.config.git.defaultBranch;
4662
+ for (const ref of [`origin/${base}...HEAD`, `${base}...HEAD`]) {
4663
+ try {
4664
+ const out = execFileSync17("git", ["diff", "--name-only", ref], {
4665
+ cwd: ctx.cwd,
4666
+ encoding: "utf-8",
4667
+ stdio: ["pipe", "pipe", "pipe"]
4668
+ });
4669
+ const files = out.split("\n").map((s) => s.trim()).filter(Boolean);
4670
+ if (files.length > 0) return files;
4671
+ } catch {
4672
+ }
4673
+ }
4674
+ return ctx.data.changedFiles ?? [];
4675
+ }
4660
4676
  function computeDiffStats(ctx) {
4661
4677
  const base = ctx.config.git.defaultBranch;
4662
4678
  for (const ref of [`origin/${base}...HEAD`, `${base}...HEAD`]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.2.56",
3
+ "version": "0.2.57",
4
4
  "description": "kody2 — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",