@kody-ade/kody-engine 0.4.58 → 0.4.60
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 +643 -428
- package/dist/executables/fix/profile.json +4 -1
- package/dist/executables/fix/prompt.md +1 -1
- package/dist/executables/fix-ci/profile.json +4 -1
- package/dist/executables/fix-ci/prompt.md +1 -1
- package/dist/executables/goal-scheduler/scheduler.sh +0 -0
- package/dist/executables/release-deploy/deploy.sh +0 -0
- package/dist/executables/release-prepare/prepare.sh +0 -0
- package/dist/executables/release-publish/publish.sh +0 -0
- package/dist/executables/resolve/apply-prefer.sh +0 -0
- package/dist/executables/revert/revert.sh +0 -0
- package/dist/executables/run/profile.json +4 -1
- package/dist/executables/run/prompt.md +1 -1
- package/dist/executables/types.ts +25 -0
- package/package.json +17 -15
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
"maxTurnTimeoutSec": 1200,
|
|
27
27
|
"systemPromptAppend": null,
|
|
28
28
|
"cacheable": true,
|
|
29
|
+
"enableVerifyTool": true,
|
|
30
|
+
"verifyAttempts": 4,
|
|
29
31
|
"tools": [
|
|
30
32
|
"Read",
|
|
31
33
|
"Write",
|
|
@@ -33,7 +35,8 @@
|
|
|
33
35
|
"Bash",
|
|
34
36
|
"Grep",
|
|
35
37
|
"Glob",
|
|
36
|
-
"mcp__playwright"
|
|
38
|
+
"mcp__playwright",
|
|
39
|
+
"mcp__kody-verify"
|
|
37
40
|
],
|
|
38
41
|
"hooks": ["block-git"],
|
|
39
42
|
"skills": [],
|
|
@@ -32,7 +32,7 @@ If a prior-art block is present above, scan it before editing — those are earl
|
|
|
32
32
|
- Read the **full** contents of every file you intend to change.
|
|
33
33
|
- Read the test file for each of those files, if one exists.
|
|
34
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** —
|
|
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
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
37
|
|
|
38
38
|
```
|
|
@@ -25,13 +25,16 @@
|
|
|
25
25
|
"maxTurnTimeoutSec": 1200,
|
|
26
26
|
"systemPromptAppend": null,
|
|
27
27
|
"cacheable": true,
|
|
28
|
+
"enableVerifyTool": true,
|
|
29
|
+
"verifyAttempts": 4,
|
|
28
30
|
"tools": [
|
|
29
31
|
"Read",
|
|
30
32
|
"Write",
|
|
31
33
|
"Edit",
|
|
32
34
|
"Bash",
|
|
33
35
|
"Grep",
|
|
34
|
-
"Glob"
|
|
36
|
+
"Glob",
|
|
37
|
+
"mcp__kody-verify"
|
|
35
38
|
],
|
|
36
39
|
"hooks": ["block-git"],
|
|
37
40
|
"skills": [],
|
|
@@ -36,7 +36,7 @@ You are Kody, an autonomous engineer. A CI workflow on PR #{{pr.number}} (`{{bra
|
|
|
36
36
|
|
|
37
37
|
2. **Make the minimum edits to fix the root cause.** Do not bundle unrelated cleanups into a CI fix.
|
|
38
38
|
|
|
39
|
-
3. **
|
|
39
|
+
3. **Confirm green via the `verify` tool** — call `mcp__kody-verify__verify` to run the project's typecheck/lint/test gates. If `ok: false`, read the truncated `failures`, fix the root cause, and call `verify` again. Bounded by 4 attempts; after that the tool returns `locked: true` and you must wrap up with FAILED. The postflight verifier still runs after this session as the final ratifier.
|
|
40
40
|
|
|
41
41
|
4. **Final message format** (or `FAILED: <reason>` on failure):
|
|
42
42
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -25,13 +25,16 @@
|
|
|
25
25
|
"maxTurnTimeoutSec": 1200,
|
|
26
26
|
"systemPromptAppend": null,
|
|
27
27
|
"cacheable": true,
|
|
28
|
+
"enableVerifyTool": true,
|
|
29
|
+
"verifyAttempts": 4,
|
|
28
30
|
"tools": [
|
|
29
31
|
"Read",
|
|
30
32
|
"Write",
|
|
31
33
|
"Edit",
|
|
32
34
|
"Bash",
|
|
33
35
|
"Grep",
|
|
34
|
-
"Glob"
|
|
36
|
+
"Glob",
|
|
37
|
+
"mcp__kody-verify"
|
|
35
38
|
],
|
|
36
39
|
"hooks": ["block-git"],
|
|
37
40
|
"skills": [],
|
|
@@ -40,7 +40,7 @@ If a prior-art block is present above, READ THE DIFFS — those are failed or su
|
|
|
40
40
|
2. **Plan** — before any Edit/Write, output a short plan (5–10 lines): what files you'll change, the approach, what could go wrong. No fluff.
|
|
41
41
|
3. **Build** — Edit/Write to implement the change. Stay within the plan; if you discover the plan was wrong, briefly say so and adjust.
|
|
42
42
|
4. **Test** — for every new module you added and every behavior you changed, write or update tests. If the plan above contains a "Test plan" section, treat it as authoritative: every item there must produce a corresponding test. Before writing a test, open the newest existing file in the same test directory (`tests/int/`, `tests/unit/`, `tests/e2e/`, or sibling `*.test.ts`) and copy its imports, setup hooks, and auth pattern **verbatim**. Do NOT introduce a new test infrastructure (own testcontainers, `fetch` against relative URLs, alternate auth headers) when a working pattern already exists in that directory — divergence from the established pattern is a hard failure even if the test passes locally. Cover at least one happy path and one failure path per change. Skipping tests is a hard failure. A change may only be declared untestable if you can name the specific blocker (e.g., "no fake exists for the X SDK and stubbing it would mock the entire call surface"); vague "this is just config" claims are rejected. Untestable changes go in `PLAN_DEVIATIONS:` with the named blocker.
|
|
43
|
-
5. **Verify** —
|
|
43
|
+
5. **Verify** — before declaring DONE, call the `verify` tool (mcp__kody-verify__verify). It runs typecheck/lint/tests with the project's configured commands and returns `{ ok, failures, attemptsRemaining }`. If `ok: true`, you may proceed to DONE. If `ok: false`, read the truncated `failures` list, fix the root cause, commit-equivalent edits, and call `verify` again. You have up to 4 total attempts; the tool will return `locked: true` after that and you must wrap up with FAILED. The postflight verifier runs again after this session ends and is the final ratifier — but it's also the gate that downgrades a self-reported DONE to FAILED if you skipped this step, so calling the tool is strictly cheaper than not.
|
|
44
44
|
6. Your FINAL message must use this exact format (or a single `FAILED: <reason>` line on failure). The `PLAN_DEVIATIONS:` block is REQUIRED whenever a plan was provided.
|
|
45
45
|
|
|
46
46
|
```
|
|
@@ -74,6 +74,16 @@ export interface Profile {
|
|
|
74
74
|
* Defines the in-process step sequence and routing map. See ContainerChild.
|
|
75
75
|
*/
|
|
76
76
|
children?: ContainerChild[]
|
|
77
|
+
/**
|
|
78
|
+
* Whether the container should `git reset --hard HEAD` between
|
|
79
|
+
* children to discard tracked-file modifications a prior child left
|
|
80
|
+
* behind. Default `true` (preserves the legacy bug-safe behaviour
|
|
81
|
+
* — see executor.ts:runContainerLoop notes). Set `false` for
|
|
82
|
+
* containers whose children are expected to share intermediate
|
|
83
|
+
* state (e.g. bug's `reproduce` writing a failing test that `run`
|
|
84
|
+
* then makes pass). Only honoured when `role === "container"`.
|
|
85
|
+
*/
|
|
86
|
+
resetBetweenChildren?: boolean
|
|
77
87
|
/** Absolute directory the profile was loaded from. Used to resolve prompt.md. */
|
|
78
88
|
dir: string
|
|
79
89
|
}
|
|
@@ -177,6 +187,21 @@ export interface ClaudeCodeSpec {
|
|
|
177
187
|
* not support `excludeDynamicSections` (forward-compatible).
|
|
178
188
|
*/
|
|
179
189
|
cacheable?: boolean
|
|
190
|
+
/**
|
|
191
|
+
* Phase 3 opt-in: expose an in-process `verify` MCP tool to the agent
|
|
192
|
+
* so it can iterate on typecheck/lint/test failures inside one SDK
|
|
193
|
+
* session instead of needing a `fix-ci` round trip. The tool is
|
|
194
|
+
* bounded by `verifyAttempts` (default 4). The postflight `verify`
|
|
195
|
+
* script still runs after the agent finishes as the final ratifier.
|
|
196
|
+
* Default false.
|
|
197
|
+
*/
|
|
198
|
+
enableVerifyTool?: boolean
|
|
199
|
+
/**
|
|
200
|
+
* Hard cap on verify-tool invocations per agent session when
|
|
201
|
+
* `enableVerifyTool` is true. Default 4 (≈3 fix iterations after the
|
|
202
|
+
* first attempt). Set to 0 or omit to use the default.
|
|
203
|
+
*/
|
|
204
|
+
verifyAttempts?: number | null
|
|
180
205
|
/** SDK built-in tools this executable is allowed to use (capability pack). */
|
|
181
206
|
tools: string[]
|
|
182
207
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.60",
|
|
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,22 @@
|
|
|
12
12
|
"templates",
|
|
13
13
|
"kody.config.schema.json"
|
|
14
14
|
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"kody": "tsx bin/kody.ts",
|
|
17
|
+
"build": "tsup && node scripts/copy-assets.cjs",
|
|
18
|
+
"test": "vitest run tests/unit tests/int --no-coverage",
|
|
19
|
+
"test:e2e": "vitest run tests/e2e --no-coverage",
|
|
20
|
+
"test:all": "vitest run tests --no-coverage",
|
|
21
|
+
"typecheck": "tsc --noEmit",
|
|
22
|
+
"lint": "biome check",
|
|
23
|
+
"lint:fix": "biome check --write",
|
|
24
|
+
"format": "biome format --write",
|
|
25
|
+
"prepublishOnly": "pnpm build"
|
|
26
|
+
},
|
|
15
27
|
"dependencies": {
|
|
16
28
|
"@actions/cache": "^6.0.0",
|
|
17
|
-
"@anthropic-ai/claude-agent-sdk": "0.2.119"
|
|
29
|
+
"@anthropic-ai/claude-agent-sdk": "0.2.119",
|
|
30
|
+
"zod": "^4.0.0"
|
|
18
31
|
},
|
|
19
32
|
"devDependencies": {
|
|
20
33
|
"@biomejs/biome": "^2.4.12",
|
|
@@ -32,16 +45,5 @@
|
|
|
32
45
|
"url": "git+https://github.com/aharonyaircohen/kody-engine.git"
|
|
33
46
|
},
|
|
34
47
|
"homepage": "https://github.com/aharonyaircohen/kody-engine",
|
|
35
|
-
"bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
|
|
36
|
-
|
|
37
|
-
"kody": "tsx bin/kody.ts",
|
|
38
|
-
"build": "tsup && node scripts/copy-assets.cjs",
|
|
39
|
-
"test": "vitest run tests/unit tests/int --no-coverage",
|
|
40
|
-
"test:e2e": "vitest run tests/e2e --no-coverage",
|
|
41
|
-
"test:all": "vitest run tests --no-coverage",
|
|
42
|
-
"typecheck": "tsc --noEmit",
|
|
43
|
-
"lint": "biome check",
|
|
44
|
-
"lint:fix": "biome check --write",
|
|
45
|
-
"format": "biome format --write"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
+
"bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
|
|
49
|
+
}
|