@kody-ade/kody-engine 0.3.12 → 0.3.14

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.
@@ -79,6 +79,7 @@
79
79
  { "script": "requireFeedbackActions" },
80
80
  { "script": "verify" },
81
81
  { "script": "checkCoverageWithRetry" },
82
+ { "script": "abortUnfinishedGitOps" },
82
83
  { "script": "commitAndPush" },
83
84
  { "script": "ensurePr" },
84
85
  { "script": "postIssueComment" },
@@ -75,6 +75,9 @@
75
75
  {
76
76
  "script": "checkCoverageWithRetry"
77
77
  },
78
+ {
79
+ "script": "abortUnfinishedGitOps"
80
+ },
78
81
  {
79
82
  "script": "commitAndPush"
80
83
  },
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "manager",
3
+ "role": "watch",
4
+ "describe": "Scheduled: for every open issue labeled kody:manager, invoke manager-tick once. No agent on the scheduler itself.",
5
+ "kind": "scheduled",
6
+ "schedule": "*/5 * * * *",
7
+ "inputs": [],
8
+ "claudeCode": {
9
+ "model": "inherit",
10
+ "permissionMode": "default",
11
+ "maxTurns": null,
12
+ "maxThinkingTokens": null,
13
+ "systemPromptAppend": null,
14
+ "tools": [],
15
+ "hooks": [],
16
+ "skills": [],
17
+ "commands": [],
18
+ "subagents": [],
19
+ "plugins": [],
20
+ "mcpServers": []
21
+ },
22
+ "cliTools": [
23
+ {
24
+ "name": "gh",
25
+ "install": {
26
+ "required": true,
27
+ "checkCommand": "command -v gh"
28
+ },
29
+ "verify": "gh auth status",
30
+ "usage": "",
31
+ "allowedUses": ["issue"]
32
+ }
33
+ ],
34
+ "inputArtifacts": [],
35
+ "outputArtifacts": [],
36
+ "scripts": {
37
+ "preflight": [
38
+ {
39
+ "script": "dispatchManagerTicks",
40
+ "with": {
41
+ "label": "kody:manager",
42
+ "color": "1d76db",
43
+ "description": "kody: issue is a manager mission — scheduler will tick it on every cron wake",
44
+ "targetExecutable": "manager-tick",
45
+ "issueArg": "issue"
46
+ }
47
+ }
48
+ ],
49
+ "postflight": []
50
+ }
51
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "manager-tick",
3
+ "role": "primitive",
4
+ "describe": "One classifier tick for one manager issue: read intent + state, decide and execute via gh, emit next state.",
5
+ "kind": "oneshot",
6
+ "inputs": [
7
+ {
8
+ "name": "issue",
9
+ "flag": "--issue",
10
+ "type": "int",
11
+ "required": true,
12
+ "describe": "GitHub issue number that owns this manager mission."
13
+ }
14
+ ],
15
+ "claudeCode": {
16
+ "model": "inherit",
17
+ "permissionMode": "default",
18
+ "maxTurns": 20,
19
+ "maxThinkingTokens": null,
20
+ "systemPromptAppend": null,
21
+ "tools": ["Bash", "Read"],
22
+ "hooks": [],
23
+ "skills": [],
24
+ "commands": [],
25
+ "subagents": [],
26
+ "plugins": [],
27
+ "mcpServers": []
28
+ },
29
+ "cliTools": [
30
+ {
31
+ "name": "gh",
32
+ "install": {
33
+ "required": true,
34
+ "checkCommand": "command -v gh"
35
+ },
36
+ "verify": "gh auth status",
37
+ "usage": "Use `gh` for all GitHub actions: `gh workflow run <workflow> -f <key>=<val>` to spawn a child run, `gh run view <id> --json status,conclusion` to check status, `gh issue comment <n> --body \"...\"` to post narration. NEVER edit files in the working tree.",
38
+ "allowedUses": ["workflow", "run", "issue", "pr", "api"]
39
+ }
40
+ ],
41
+ "inputArtifacts": [],
42
+ "outputArtifacts": [],
43
+ "scripts": {
44
+ "preflight": [
45
+ {
46
+ "script": "loadIssueStateComment",
47
+ "with": {
48
+ "marker": "kody-manager-state",
49
+ "issueArg": "issue"
50
+ }
51
+ },
52
+ {
53
+ "script": "composePrompt"
54
+ }
55
+ ],
56
+ "postflight": [
57
+ {
58
+ "script": "parseIssueStateFromAgentResult",
59
+ "with": {
60
+ "fenceLabel": "kody-manager-next-state"
61
+ }
62
+ },
63
+ {
64
+ "script": "writeIssueStateComment",
65
+ "with": {
66
+ "marker": "kody-manager-state",
67
+ "issueArg": "issue"
68
+ }
69
+ }
70
+ ]
71
+ }
72
+ }
@@ -0,0 +1,54 @@
1
+ You are **kody manager-tick**, the coordinator for one GitHub-issue-scoped mission. You do **not** touch code, do **not** commit, and do **not** edit files. You coordinate other kody executables by dispatching their workflows, observing their runs, and writing back state.
2
+
3
+ ## The mission
4
+
5
+ Issue **#{{issueNumber}}** — *{{issueTitle}}* — owns this mission. The issue description below is authoritative: it states what success looks like, constraints, deadlines, budget, or anything else a human operator has written. Re-read it every tick — the human may have edited it to steer you.
6
+
7
+ ### Mission (issue description)
8
+
9
+ {{issueIntent}}
10
+
11
+ ## Current state
12
+
13
+ This is the state you wrote at the end of the previous tick (or `null` if this is the first tick):
14
+
15
+ ```json
16
+ {{issueStateJson}}
17
+ ```
18
+
19
+ `cursor` is *your* enum — pick whatever labels map cleanly to your mission's phases (e.g. `seed`, `spawn-release`, `waiting-release`, `merge-to-dev`, `finalize`, `done`). `data` is where you stash anything you need on the next tick (run IDs, SHAs, child issue numbers, budget counters). `done: true` tells the scheduler to stop calling you.
20
+
21
+ ## What to do on this tick
22
+
23
+ 1. **Re-read the mission.** If the human has edited the description in a way that changes what "on track" means, adapt.
24
+ 2. **Decide the single next step** based on (cursor, data, mission).
25
+ - If `cursor` is `null`/first-run, initialize: plan the pipeline, pick an initial cursor, record any baseline info in `data`.
26
+ - If you're waiting on a child run, check its status via `gh run view <id> --json status,conclusion`. If still running, just update cursor/data minimally and exit — the next cron wake will check again. If succeeded, advance. If failed, record the failure and either spawn a remediation child or mark `done: true` with an error.
27
+ - If it's time to spawn a child executable, use `gh workflow run kody.yml -f issue_number=<N>` (or the appropriate workflow + inputs for the consumer repo). Capture the dispatched run's ID via `gh run list --workflow=kody.yml --limit 1 --json databaseId --jq '.[0].databaseId'` and stash it in `data`.
28
+ - If the mission is complete, set `done: true` and a terminal cursor like `done`.
29
+ 3. **Optionally post a human-readable narration comment** on the issue summarizing what you just did (spawned run #12345, waiting on CI, etc.). Keep it short. Use `gh issue comment {{issueNumber}} --body "..."`.
30
+ 4. **Emit the new state** at the very end of your response using the fenced block below. Do not include `version` or `rev` — the postflight script manages those.
31
+
32
+ ## Output contract (MANDATORY, exactly once, at the end)
33
+
34
+ End your response with a single fenced block using the `kody-manager-next-state` language tag:
35
+
36
+ ````
37
+ ```kody-manager-next-state
38
+ {
39
+ "cursor": "<your-next-cursor>",
40
+ "data": { ... },
41
+ "done": <true|false>
42
+ }
43
+ ```
44
+ ````
45
+
46
+ If you fail to emit this block, or the JSON is invalid, the tick fails and the state comment is NOT updated. On the next wake you'll see the same prior state and can retry.
47
+
48
+ ## Rules
49
+
50
+ - Never edit, create, or delete files in the working tree.
51
+ - Never commit or push.
52
+ - Only shell calls allowed: `gh` (for workflows, runs, issues, PRs, API). Everything must go through it.
53
+ - Keep each tick focused: do one thing per wake. The cron will call you again.
54
+ - If the state says you're waiting on something, just check and re-emit — don't spawn a duplicate.
@@ -74,6 +74,9 @@
74
74
  {
75
75
  "script": "parseAgentResult"
76
76
  },
77
+ {
78
+ "script": "stageMergeConflicts"
79
+ },
77
80
  {
78
81
  "script": "commitAndPush"
79
82
  },
@@ -54,6 +54,7 @@
54
54
  { "script": "requirePlanDeviations" },
55
55
  { "script": "verify" },
56
56
  { "script": "checkCoverageWithRetry" },
57
+ { "script": "abortUnfinishedGitOps" },
57
58
  { "script": "commitAndPush" },
58
59
  { "script": "ensurePr" },
59
60
  { "script": "postIssueComment" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
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",