@kody-ade/kody-engine-lite 0.1.14 → 0.1.15

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/cli.js CHANGED
@@ -1721,7 +1721,7 @@ function parseArgs() {
1721
1721
  function findLatestTaskForIssue(issueNumber, projectDir) {
1722
1722
  const tasksDir = path5.join(projectDir, ".tasks");
1723
1723
  if (!fs6.existsSync(tasksDir)) return null;
1724
- const allDirs = fs6.readdirSync(tasksDir).sort().reverse();
1724
+ const allDirs = fs6.readdirSync(tasksDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort().reverse();
1725
1725
  const prefix = `${issueNumber}-`;
1726
1726
  const direct = allDirs.find((d) => d.startsWith(prefix));
1727
1727
  if (direct) return direct;
@@ -1742,7 +1742,7 @@ function findLatestTaskForIssue(issueNumber, projectDir) {
1742
1742
  }
1743
1743
  } catch {
1744
1744
  }
1745
- return allDirs[0] ?? null;
1745
+ return null;
1746
1746
  }
1747
1747
  function generateTaskId() {
1748
1748
  const now = /* @__PURE__ */ new Date();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine-lite",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Autonomous SDLC pipeline: Kody orchestration + Claude Code + LiteLLM",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -174,6 +174,15 @@ jobs:
174
174
  persist-credentials: true
175
175
  token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
176
176
 
177
+ - name: Checkout PR branch (for fix/rerun on PRs)
178
+ if: github.event.issue.pull_request && (needs.parse.outputs.mode == 'fix' || needs.parse.outputs.mode == 'rerun')
179
+ run: |
180
+ PR_NUM="${{ github.event.issue.number }}"
181
+ PR_BRANCH=$(gh pr view "$PR_NUM" --json headRefName -q '.headRefName')
182
+ echo "Checking out PR branch: $PR_BRANCH"
183
+ git checkout "$PR_BRANCH"
184
+ git pull origin "$PR_BRANCH"
185
+
177
186
  - uses: pnpm/action-setup@v4
178
187
  with:
179
188
  version: latest