@kody-ade/kody-engine 0.4.208 → 0.4.210

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.
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "fix",
3
+ "role": "primitive",
4
+ "describe": "Apply review feedback to an existing PR branch.",
5
+ "inputs": [
6
+ {
7
+ "name": "pr",
8
+ "flag": "--pr",
9
+ "type": "int",
10
+ "required": true,
11
+ "describe": "GitHub PR number to apply feedback to."
12
+ },
13
+ {
14
+ "name": "feedback",
15
+ "flag": "--feedback",
16
+ "type": "string",
17
+ "required": false,
18
+ "bindsCommentRest": true,
19
+ "describe": "Inline override. If absent, the flow reads the latest PR review comment."
20
+ }
21
+ ],
22
+ "claudeCode": {
23
+ "model": "inherit",
24
+ "permissionMode": "acceptEdits",
25
+ "maxTurns": null,
26
+ "maxTurnTimeoutSec": 1200,
27
+ "systemPromptAppend": null,
28
+ "cacheable": true,
29
+ "enableVerifyTool": true,
30
+ "verifyAttempts": 4,
31
+ "tools": [
32
+ "Read",
33
+ "Write",
34
+ "Edit",
35
+ "Bash",
36
+ "Grep",
37
+ "Glob",
38
+ "mcp__playwright",
39
+ "mcp__kody-verify"
40
+ ],
41
+ "hooks": ["block-git"],
42
+ "skills": ["systematic-debugging"],
43
+ "commands": [],
44
+ "subagents": [],
45
+ "plugins": [],
46
+ "mcpServers": [
47
+ {
48
+ "name": "playwright",
49
+ "command": "npx",
50
+ "args": ["-y", "--package=@playwright/mcp@latest", "--", "playwright-mcp"]
51
+ }
52
+ ]
53
+ },
54
+ "cliTools": [
55
+ {
56
+ "name": "playwright",
57
+ "install": {
58
+ "required": false,
59
+ "checkCommand": "ls \"$HOME/.cache/ms-playwright\" 2>/dev/null | grep -q '^chromium'",
60
+ "installCommand": "npx --yes playwright install --with-deps chromium"
61
+ },
62
+ "verify": "ls \"$HOME/.cache/ms-playwright\" 2>/dev/null | grep -q '^chromium'",
63
+ "usage": ""
64
+ }
65
+ ],
66
+ "lifecycle": "pr-branch",
67
+ "lifecycleConfig": {
68
+ "label": {
69
+ "name": "kody:fixing",
70
+ "color": "e99695",
71
+ "description": "kody: applying review feedback"
72
+ },
73
+ "context": "task",
74
+ "finalize": true
75
+ },
76
+ "scripts": {
77
+ "preflight": [
78
+ { "script": "fixFlow" }
79
+ ],
80
+ "postflight": [
81
+ { "script": "requireFeedbackActions" }
82
+ ]
83
+ },
84
+ "output": {
85
+ "actionTypes": [
86
+ "FIX_COMPLETED",
87
+ "FIX_FAILED",
88
+ "AGENT_NOT_RUN"
89
+ ]
90
+ }
91
+ }
@@ -0,0 +1,90 @@
1
+ You are Kody, an autonomous engineer. Apply the feedback below to the existing PR branch `{{branch}}` (already checked out). The wrapper handles git/gh — you do not.
2
+
3
+ # Repo
4
+ - {{repoOwner}}/{{repoName}}, default branch: {{defaultBranch}}
5
+
6
+ # PR #{{pr.number}}: {{pr.title}}
7
+ {{pr.body}}
8
+
9
+ # Feedback to address (AUTHORITATIVE — supersedes the original issue spec)
10
+
11
+ {{feedback}}
12
+
13
+ {{conventionsBlock}}{{coverageBlock}}{{toolsUsage}}# Existing PR diff (current state, truncated)
14
+
15
+ ```diff
16
+ {{prDiff}}
17
+ ```
18
+
19
+ # Prior art (closed/merged PRs that previously attempted this work, if any)
20
+ {{priorArt}}
21
+
22
+ If a prior-art block is present above, scan it before editing — those are earlier attempts (possibly by you, possibly by a human) at the same fix. Note what was rejected and why; do not repeat a discarded approach.
23
+
24
+ {{memoryContext}}
25
+
26
+ # Required steps
27
+ 1. **Extract** every actionable item from the feedback. A structured review uses headings like `### Concerns`, `### Suggestions`, and `### Bugs`; each bullet under those headings is a distinct item. `### Strengths`, `### Summary`, and `### Bottom line` are NOT items — skip them. If the feedback has no headings (plain inline feedback), treat the whole feedback as one item.
28
+ 2. **Number each item** internally (Item 1, Item 2, …). You will account for every one of them in your final message below.
29
+ 3. **Research** — read only what's needed to act on the items. Make the minimum edits required to implement each one. If the feedback or PR body links to external **non-GitHub** URLs (reproduction sites, bug recordings, spec pages), use the **Playwright MCP** tools (`mcp__playwright__browser_navigate`, `mcp__playwright__browser_snapshot`) to load them — do not rely on your interpretation of the URL alone. Do NOT open GitHub URLs (issues, PRs, repo files, gists) in Playwright — the browser session is anonymous and will 404 on private repos. Issue/PR context is already in this prompt; for anything else on GitHub, use the `gh` CLI via Bash.
30
+
31
+ **Research floor (MUST be met before any Edit/Write):**
32
+ - Read the **full** contents of every file you intend to change.
33
+ - Read the test file for each of those files, if one exists.
34
+ - Skipping the floor on the assumption "feedback says exactly what to change" is a hard failure when the change touches code with non-obvious invariants.
35
+ 4. **Verify** — before declaring DONE, call the `verify` tool (mcp__kody-verify__verify). It runs the project's typecheck/lint/test gates and returns `{ ok, failures, attemptsRemaining }`. If `ok: true`, proceed to DONE. If `ok: false`, read the truncated `failures` list, fix what you introduced this round (not pre-existing breakages unrelated to the feedback), and call `verify` again. Bounded by 4 attempts; after that the tool returns `locked: true` and you must wrap up. The postflight verifier still runs after this session as the final ratifier.
36
+ 5. Your FINAL message MUST use this exact format (or a single `FAILED: <reason>` line on failure). The `FEEDBACK_ACTIONS:` block is REQUIRED — omitting it or leaving it empty makes your DONE invalid.
37
+
38
+ ```
39
+ DONE
40
+ FEEDBACK_ACTIONS:
41
+ - Item 1: "<short restatement of the item>" — <fixed: <what you edited> | declined: <specific reason>>
42
+ - Item 2: "<short restatement>" — <fixed: ... | declined: ...>
43
+ - (one line per extracted item; do NOT omit any)
44
+ COMMIT_MSG: <conventional-commit message for this round of fixes>
45
+ PR_SUMMARY:
46
+ <2-4 bullets describing what changed in THIS fix round — not the whole PR>
47
+ ```
48
+
49
+ **Worked example.** Suppose the feedback was:
50
+
51
+ > ### Concerns
52
+ > - The retry loop in `src/queue.ts:42` has no upper bound — could spin forever if the API is down.
53
+ > - `validateInput` accepts negative numbers but the schema says positive.
54
+ >
55
+ > ### Suggestions
56
+ > - Consider extracting the date-parsing logic into a helper.
57
+
58
+ A valid `FEEDBACK_ACTIONS` block:
59
+
60
+ ```
61
+ FEEDBACK_ACTIONS:
62
+ - Item 1: "retry loop has no upper bound" — fixed: src/queue.ts:42 added maxRetries=5 with exponential backoff and a final throw.
63
+ - Item 2: "validateInput accepts negative numbers but schema says positive" — fixed: src/validate.ts:18 changed z.number() to z.number().positive(); added test cases for -1 and 0.
64
+ - Item 3: "extract date-parsing helper" — declined: the parsing only appears in one call site (src/handlers/webhook.ts:71); extracting now would create a one-caller helper. Will revisit if a second call site appears.
65
+ ```
66
+
67
+ Notes on the example:
68
+ - Every extracted item appears as exactly one line. None are dropped, none merged.
69
+ - "Strengths" / "Summary" / "Bottom line" sections from the feedback do NOT become items.
70
+ - `declined:` is paired with concrete evidence (one call site + path), not a vague preference.
71
+
72
+ # Rules
73
+ - **The feedback is the scope.** You are here to address the extracted items — nothing else. Do NOT make unrelated refactors, rename variables the reviewer did not flag, or "tighten" types that were not called out. Every edit in your diff must trace back to a specific Item in `FEEDBACK_ACTIONS`.
74
+ - **Default to `fixed`.** `declined` is only acceptable when (a) the item is factually wrong about the code, or (b) it is explicitly out of scope per the issue body. In both cases the `declined: <reason>` line must point to concrete evidence (a file:line that contradicts the item, or a specific issue-body clause).
75
+ - **Treat each item as a concrete change request, not a code review to argue with.** "Add an X branch" means add an X branch — not document that Y already covers the case. "Already handles it in a different way" is NOT an acceptable reason to decline.
76
+ - **Your DONE is only valid if your diff materially implements each `fixed` item.** A diff that only adds tests asserting the current behavior, or only tweaks comments/docs, does NOT count as addressing a change request. If an item asks for a new code path, the diff MUST contain that new code path.
77
+ - **"Already satisfied" (i.e. skipping the edit because the code already does what's asked) is only allowed when you can cite the exact file:line that already implements it.** If in doubt, make the edit — under `fixed`.
78
+ - **Stale feedback.** If the existing PR diff already addresses an item (the reviewer was looking at an older revision, or another fix round handled it), mark the item `fixed: already addressed at <file:line> in commit <short-sha or "earlier round">` and do NOT re-edit. Re-applying an edit that's already in the diff produces noise and confuses the reviewer about whether their feedback was understood.
79
+ - **Not all feedback is an item.** These are NOT items, even if they appear in the feedback body:
80
+ - Questions ("why did you choose X?") — answer in the PR comment thread, not via an edit.
81
+ - Hedges and asides ("interesting", "let me know", "thoughts?") — no action required.
82
+ - Documentation links and references that aren't tied to a concrete change ask.
83
+ - Praise / strengths bullets, even if they suggest improvements implicitly.
84
+
85
+ When in doubt: an item is something with an imperative or a concrete change that would alter the diff. If editing nothing would still satisfy the reviewer's literal words, it's not an item.
86
+ - Do NOT run git/gh commands. The wrapper handles it.
87
+ - Stay on `{{branch}}`.
88
+ - Do not modify files under `.kody/`, `.kody-engine/`, `.kody/`, `node_modules/`, `dist/`, `build/`, `.env`, `*.log`.
89
+ - If the feedback is ambiguous or conflicts with the issue, err toward what the feedback says.
90
+ {{systemPromptAppend}}
File without changes
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "job-live-verify",
3
+ "role": "primitive",
4
+ "describe": "Live-test executable that verifies job reference injection, staff persona injection, synthetic skill loading, locked duty tools, and state postflight.",
5
+ "kind": "oneshot",
6
+ "dutyTools": ["ensure_issue", "ensure_comment"],
7
+ "inputs": [],
8
+ "claudeCode": {
9
+ "model": "inherit",
10
+ "permissionMode": "default",
11
+ "maxTurns": 20,
12
+ "maxThinkingTokens": null,
13
+ "maxTurnTimeoutSec": 180,
14
+ "systemPromptAppend": "You are running Kody's job-wiring live verification. Use the requested tools, then submit state exactly once.",
15
+ "enableSubmitTool": true,
16
+ "tools": ["Read"],
17
+ "hooks": [],
18
+ "skills": ["kody-live-marker"],
19
+ "commands": [],
20
+ "subagents": [],
21
+ "plugins": [],
22
+ "mcpServers": []
23
+ },
24
+ "cliTools": [],
25
+ "scripts": {
26
+ "preflight": [
27
+ { "script": "loadDutyState" },
28
+ { "script": "buildSyntheticPlugin" },
29
+ { "script": "composePrompt" }
30
+ ],
31
+ "postflight": [
32
+ { "script": "parseJobStateFromAgentResult", "with": { "fenceLabel": "kody-job-next-state" } },
33
+ { "script": "writeJobStateFile" }
34
+ ]
35
+ }
36
+ }
@@ -0,0 +1,42 @@
1
+ You are Kody's live job-wiring verification agent.
2
+
3
+ Your only job is to prove that this model session received the job reference, the staff persona, the duty, the executable, the loaded skill, and the locked duty tools.
4
+
5
+ ## Evidence to collect
6
+
7
+ 1. Read the system-provided `Job reference` block and capture its duty, executable, staff, and description values.
8
+ 2. Read your staff persona and capture the staff-only verification token from it.
9
+ 3. Activate the loaded skill named `kody-live-marker`; capture the exact token and description it tells you to include.
10
+ 4. Use `ensure_issue` with:
11
+ - `key`: `live-job-wiring-proof-2026-06-06`
12
+ - `title`: `Kody live job wiring proof`
13
+ - `body`: a short markdown note that includes the duty, executable, staff, description, staff-only token, and skill token you observed.
14
+ 5. Read the `number` returned by `ensure_issue`; use that exact positive issue number for the next tool call.
15
+ 6. Use `ensure_comment` on that issue with:
16
+ - `key`: `live-job-wiring-proof-comment-2026-06-06`
17
+ - `body`: one markdown line beginning `live job wiring proof:` and including the same observed values.
18
+ 7. Call `submit_state` exactly once, as your final action.
19
+
20
+ ## State to submit
21
+
22
+ Submit:
23
+
24
+ - `cursor`: `verified`
25
+ - `done`: `true`
26
+ - `data`: an object containing:
27
+ - `duty`
28
+ - `executable`
29
+ - `staff`
30
+ - `description`
31
+ - `staffToken`
32
+ - `skillToken`
33
+ - `skillDescription`
34
+ - `issueNumber`
35
+ - `commentStatus`: `posted` when `ensure_comment` returns `posted: true`, or `already-existed` when it returns `posted: false`
36
+ - `toolsUsed`, exactly `["ensure_issue", "ensure_comment", "submit_state"]`
37
+
38
+ ## Rules
39
+
40
+ - Do not use shell, git, or file editing.
41
+ - If a value is missing, write `MISSING` for that value and still submit state.
42
+ - The proof is the tool calls plus submitted state; no prose summary is needed after `submit_state`.
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -31,6 +31,19 @@
31
31
  }
32
32
  }
33
33
  },
34
+ "brain": {
35
+ "type": "object",
36
+ "description": "Brain backend selection. 'brain-serve' is the engine's built-in Node.js brain; 'hermes' is the Hermes Agent API server. The entrypoint reads brain.mode on boot and exports it as BRAIN_BACKEND for the brain-proxy. BRAIN_BACKEND env var on the Fly Machine overrides this config (dev/CI escape hatch).",
37
+ "additionalProperties": false,
38
+ "properties": {
39
+ "mode": {
40
+ "type": "string",
41
+ "enum": ["brain-serve", "hermes"],
42
+ "default": "brain-serve",
43
+ "description": "Which brain backend the proxy routes to. Overridden by BRAIN_BACKEND env var."
44
+ }
45
+ }
46
+ },
34
47
  "github": {
35
48
  "type": "object",
36
49
  "required": ["owner", "repo"],
@@ -48,7 +61,7 @@
48
61
  "model": {
49
62
  "type": "string",
50
63
  "pattern": "^[^/]+/.+$",
51
- "description": "Base provider/model string, for example minimax/MiniMax-M2.7-highspeed or claude/claude-sonnet-4-6."
64
+ "description": "Base provider/model string, for example minimax/MiniMax-M3 or claude/claude-sonnet-4-6."
52
65
  },
53
66
  "perExecutable": {
54
67
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.208",
3
+ "version": "0.4.210",
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",
@@ -12,9 +12,30 @@
12
12
  "templates",
13
13
  "kody.config.schema.json"
14
14
  ],
15
+ "scripts": {
16
+ "kody:run": "tsx bin/kody.ts",
17
+ "serve": "tsx bin/kody.ts serve",
18
+ "serve:vscode": "tsx bin/kody.ts serve vscode",
19
+ "serve:claude": "tsx bin/kody.ts serve claude",
20
+ "build": "tsup && node scripts/copy-assets.cjs",
21
+ "check:modularity": "tsx scripts/check-script-modularity.ts",
22
+ "pretest": "pnpm check:modularity",
23
+ "test": "vitest run tests/unit tests/int --coverage",
24
+ "posttest": "tsx scripts/check-coverage-floor.ts",
25
+ "test:smoke": "vitest run tests/smoke --no-coverage",
26
+ "test:e2e": "vitest run tests/e2e --no-coverage",
27
+ "test:all": "vitest run tests --no-coverage",
28
+ "typecheck": "tsc --noEmit",
29
+ "lint": "biome check",
30
+ "lint:fix": "biome check --write",
31
+ "format": "biome format --write",
32
+ "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner",
33
+ "prepublishOnly": "pnpm typecheck && vitest run tests/unit tests/int --no-coverage && pnpm build"
34
+ },
15
35
  "dependencies": {
16
36
  "@actions/cache": "^6.0.0",
17
37
  "@anthropic-ai/claude-agent-sdk": "0.2.119",
38
+ "@modelcontextprotocol/sdk": "^1.29.0",
18
39
  "zod": "^4.0.0"
19
40
  },
20
41
  "devDependencies": {
@@ -34,24 +55,5 @@
34
55
  "url": "git+https://github.com/aharonyaircohen/kody-engine.git"
35
56
  },
36
57
  "homepage": "https://github.com/aharonyaircohen/kody-engine",
37
- "bugs": "https://github.com/aharonyaircohen/kody-engine/issues",
38
- "scripts": {
39
- "kody:run": "tsx bin/kody.ts",
40
- "serve": "tsx bin/kody.ts serve",
41
- "serve:vscode": "tsx bin/kody.ts serve vscode",
42
- "serve:claude": "tsx bin/kody.ts serve claude",
43
- "build": "tsup && node scripts/copy-assets.cjs",
44
- "check:modularity": "tsx scripts/check-script-modularity.ts",
45
- "pretest": "pnpm check:modularity",
46
- "test": "vitest run tests/unit tests/int --coverage",
47
- "posttest": "tsx scripts/check-coverage-floor.ts",
48
- "test:smoke": "vitest run tests/smoke --no-coverage",
49
- "test:e2e": "vitest run tests/e2e --no-coverage",
50
- "test:all": "vitest run tests --no-coverage",
51
- "typecheck": "tsc --noEmit",
52
- "lint": "biome check",
53
- "lint:fix": "biome check --write",
54
- "format": "biome format --write",
55
- "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner"
56
- }
57
- }
58
+ "bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
59
+ }