@kody-ade/kody-engine 0.3.25 → 0.3.26

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
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@kody-ade/kody-engine",
6
- version: "0.3.25",
6
+ version: "0.3.26",
7
7
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
8
8
  license: "MIT",
9
9
  type: "module",
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env bash
2
2
  #
3
- # release-deploy: promote the integration branch (dev) to the default
4
- # branch (main). Runs AFTER release-publish has tagged the bump commit
5
- # on dev. No agent.
3
+ # release-deploy: open a PR from the integration branch (dev) into the
4
+ # default branch (main) the human gate for production deploy. The
5
+ # orchestrator's chain ENDS with this PR opened; merging it is a manual
6
+ # step. No agent.
6
7
  #
7
8
  # Behavior:
8
9
  # - If release.devBranch is unset OR equals git.defaultBranch:
9
- # no-op success (single-branch repos have nothing to promote).
10
- # - Else: fast-forward `defaultBranch` to `devBranch` and push. If a
11
- # fast-forward isn't possible (defaultBranch has commits dev doesn't
12
- # have), fall back to `git merge --no-ff` so history is preserved.
10
+ # no-op success (single-branch repos have nothing to deploy).
11
+ # - Else: idempotently open PR `devBranch` `defaultBranch`. If an
12
+ # open PR already exists for that pair, reuse its URL.
13
13
  #
14
- # After the merge, runs `release.notifyCommand` (if set) as a best-effort
15
- # post-deploy hook.
14
+ # After the PR is opened, runs `release.notifyCommand` (if set) as a
15
+ # best-effort post-deploy hook.
16
16
  #
17
17
  # Inputs (env):
18
18
  # KODY_ARG_DRY_RUN true|false
@@ -25,6 +25,7 @@
25
25
  # KODY_CFG_RELEASE_TIMEOUTMS per-command timeout in ms (default 600000)
26
26
  #
27
27
  # Stdout signals:
28
+ # KODY_PR_URL=<deploy PR url>
28
29
  # KODY_REASON=<text>
29
30
  # KODY_SKIP_AGENT=true
30
31
 
@@ -44,49 +45,50 @@ read_pkg_version() {
44
45
  version=$(read_pkg_version)
45
46
  echo "→ release deploy: v${version}"
46
47
 
47
- # Single-branch repos: nothing to promote.
48
+ # Single-branch repos: nothing to deploy.
48
49
  if [[ -z "$dev_branch" || "$dev_branch" == "$default_branch" ]]; then
49
- echo "KODY_REASON=no devBranch configured (or equals defaultBranch) — nothing to promote"
50
+ echo "KODY_REASON=no devBranch configured (or equals defaultBranch) — nothing to deploy"
50
51
  echo "KODY_SKIP_AGENT=true"
51
52
  exit 0
52
53
  fi
53
54
 
54
55
  if [[ "$dry_run" == "true" ]]; then
55
- echo "KODY_REASON=dry-run — would merge ${dev_branch} into ${default_branch}"
56
+ echo "KODY_REASON=dry-run — would open PR ${dev_branch} ${default_branch}"
56
57
  echo "KODY_SKIP_AGENT=true"
57
58
  exit 0
58
59
  fi
59
60
 
60
61
  export HUSKY=0 SKIP_HOOKS=1 CI="${CI:-1}"
61
62
 
62
- # Sync local refs.
63
- git fetch origin "$dev_branch" "$default_branch" --tags
63
+ # Idempotency: reuse an open PR for this branch pair if one exists.
64
+ existing=$(gh pr list --head "$dev_branch" --base "$default_branch" --state open --json url --limit 1 2>/dev/null \
65
+ | python3 -c 'import json,sys; data=json.load(sys.stdin); print(data[0]["url"] if data else "")' 2>/dev/null \
66
+ || echo "")
64
67
 
65
- # Move to defaultBranch and reset to its remote tip.
66
- git checkout "$default_branch"
67
- git reset --hard "origin/$default_branch"
68
-
69
- # Try fast-forward first; fall back to a merge commit.
70
- if git merge --ff-only "origin/$dev_branch" 2>/dev/null; then
71
- echo " fast-forwarded ${default_branch} to origin/${dev_branch}"
68
+ if [[ -n "$existing" ]]; then
69
+ echo " reusing existing deploy PR: ${existing}"
70
+ pr_url="$existing"
72
71
  else
73
- echo " fast-forward not possibleusing --no-ff merge"
74
- if ! git -c commit.gpgsign=false merge --no-ff "origin/$dev_branch" -m "chore: deploy ${dev_branch} → ${default_branch} (v${version})"; then
75
- echo "KODY_REASON=release deploy: merge ${dev_branch} into ${default_branch} failed (conflicts?)"
72
+ body="Automated deploy PR opened by kody promotes \`${dev_branch}\` to \`${default_branch}\` for release **v${version}**.
73
+
74
+ Merge this PR to deploy v${version} to \`${default_branch}\`."
75
+ if ! pr_url=$(printf '%s' "$body" | gh pr create --head "$dev_branch" --base "$default_branch" --title "deploy: ${dev_branch} → ${default_branch} (v${version})" --body-file -); then
76
+ echo "KODY_REASON=release deploy: gh pr create failed"
76
77
  echo "KODY_SKIP_AGENT=true"
77
78
  exit 1
78
79
  fi
79
80
  fi
80
81
 
81
- if ! git push origin "$default_branch"; then
82
- echo "KODY_REASON=release deploy: push to origin/${default_branch} failed"
82
+ if [[ -z "$pr_url" ]]; then
83
+ echo "KODY_REASON=release deploy: empty PR URL after gh pr create"
83
84
  echo "KODY_SKIP_AGENT=true"
84
85
  exit 1
85
86
  fi
86
87
 
87
- echo " pushed ${default_branch}"
88
+ echo "RELEASE_DEPLOY_PR=${pr_url}"
89
+ echo "KODY_PR_URL=${pr_url}"
88
90
 
89
- # Optional post-deploy notification.
91
+ # Optional post-deploy notification (e.g. Slack ping that a deploy PR is up).
90
92
  notify_status="skipped"
91
93
  if [[ -n "$notify_cmd" ]]; then
92
94
  cmd="${notify_cmd//\$VERSION/$version}"
@@ -99,5 +101,5 @@ if [[ -n "$notify_cmd" ]]; then
99
101
  fi
100
102
  fi
101
103
 
102
- echo "KODY_REASON=promoted ${dev_branch} → ${default_branch} (notify=${notify_status})"
104
+ echo "KODY_REASON=opened deploy PR ${dev_branch} → ${default_branch} (notify=${notify_status})"
103
105
  echo "KODY_SKIP_AGENT=true"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.3.25",
3
+ "version": "0.3.26",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",