@kody-ade/kody-engine 0.4.210 → 0.4.211
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
|
@@ -1542,7 +1542,7 @@ var init_loadCoverageRules = __esm({
|
|
|
1542
1542
|
// package.json
|
|
1543
1543
|
var package_default = {
|
|
1544
1544
|
name: "@kody-ade/kody-engine",
|
|
1545
|
-
version: "0.4.
|
|
1545
|
+
version: "0.4.211",
|
|
1546
1546
|
description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
1547
1547
|
license: "MIT",
|
|
1548
1548
|
type: "module",
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fix-ci",
|
|
3
|
+
"role": "primitive",
|
|
4
|
+
"describe": "Fix a failing CI workflow on an existing PR.",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"name": "pr",
|
|
8
|
+
"flag": "--pr",
|
|
9
|
+
"type": "int",
|
|
10
|
+
"required": true,
|
|
11
|
+
"describe": "GitHub PR number whose CI is failing."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "runId",
|
|
15
|
+
"flag": "--run-id",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"required": false,
|
|
18
|
+
"describe": "Specific failed workflow run ID. Defaults to latest failed run on the PR branch."
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"claudeCode": {
|
|
22
|
+
"model": "inherit",
|
|
23
|
+
"permissionMode": "acceptEdits",
|
|
24
|
+
"maxTurns": null,
|
|
25
|
+
"maxTurnTimeoutSec": 1200,
|
|
26
|
+
"systemPromptAppend": null,
|
|
27
|
+
"cacheable": true,
|
|
28
|
+
"enableVerifyTool": true,
|
|
29
|
+
"verifyAttempts": 4,
|
|
30
|
+
"tools": [
|
|
31
|
+
"Read",
|
|
32
|
+
"Write",
|
|
33
|
+
"Edit",
|
|
34
|
+
"Bash",
|
|
35
|
+
"Grep",
|
|
36
|
+
"Glob",
|
|
37
|
+
"mcp__kody-verify"
|
|
38
|
+
],
|
|
39
|
+
"hooks": ["block-git"],
|
|
40
|
+
"skills": [],
|
|
41
|
+
"commands": [],
|
|
42
|
+
"subagents": [],
|
|
43
|
+
"plugins": [],
|
|
44
|
+
"mcpServers": []
|
|
45
|
+
},
|
|
46
|
+
"cliTools": [],
|
|
47
|
+
"lifecycle": "pr-branch",
|
|
48
|
+
"lifecycleConfig": {
|
|
49
|
+
"label": {
|
|
50
|
+
"name": "kody:fixing-ci",
|
|
51
|
+
"color": "e99695",
|
|
52
|
+
"description": "kody: fixing CI failures"
|
|
53
|
+
},
|
|
54
|
+
"context": "ci-fix",
|
|
55
|
+
"advance": false,
|
|
56
|
+
"finalize": true
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"preflight": [
|
|
60
|
+
{ "script": "fixCiFlow" }
|
|
61
|
+
],
|
|
62
|
+
"postflight": []
|
|
63
|
+
},
|
|
64
|
+
"output": {
|
|
65
|
+
"actionTypes": [
|
|
66
|
+
"FIX_CI_COMPLETED",
|
|
67
|
+
"FIX_CI_FAILED",
|
|
68
|
+
"AGENT_NOT_RUN"
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
You are Kody, an autonomous engineer. A CI workflow on PR #{{pr.number}} (`{{branch}}`) is failing. Read the failed-step log below and fix the root cause. 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
|
+
|
|
8
|
+
# Failing workflow
|
|
9
|
+
- Workflow: {{failedWorkflowName}}
|
|
10
|
+
- Run URL: {{failedRunUrl}}
|
|
11
|
+
|
|
12
|
+
# Failed-step log (truncated, most recent ~30KB)
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
{{failedLogTail}}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
{{conventionsBlock}}{{toolsUsage}}# Current PR diff (truncated)
|
|
19
|
+
|
|
20
|
+
```diff
|
|
21
|
+
{{prDiff}}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
# Required steps
|
|
25
|
+
1. **Classify the failure.** Read the log and identify which type of failure this is. Different failure types call for different strategies; misidentifying the type usually leads to masking the symptom rather than fixing the root cause.
|
|
26
|
+
|
|
27
|
+
| Failure type | Signals in the log | Strategy |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| **Compile / type error** | `error TS…`, `cannot find module`, `undefined symbol`, `mismatched types` | Edit the code to satisfy the compiler. Don't add `any`, `// @ts-ignore`, `# type: ignore`, or weaken the type to dodge the check. |
|
|
30
|
+
| **Failing test** | `expect(...).toBe(...)`, assertion diff, "1 failed, N passed" | Read the test AND the code under test. Fix whichever has the bug — usually the code, sometimes the test if the test encodes wrong expectations. Never fix it by widening the assertion (`toBeTruthy` instead of a real check, `expect.any(Object)` instead of a real shape). |
|
|
31
|
+
| **Lint / format** | `eslint`, `prettier`, `ruff`, `gofmt`, `--check` | Run the formatter / fix the lint rule. Don't disable the rule unless it's a documented project decision. |
|
|
32
|
+
| **Missing dependency** | `Module not found`, `cannot find package`, `command not found` | Check whether the dep should be installed (add to package.json/requirements/go.mod) or whether the import path is wrong. Don't `npm install` a transitive dep that should already be inherited. |
|
|
33
|
+
| **Build / packaging** | tsup/webpack/vite/turbo errors, "out of memory", "duplicate exports" | Read the actual error. Often a real bug (circular import, wrong export shape), occasionally a config gap. |
|
|
34
|
+
| **Flaky / non-deterministic** | passes locally and on retry; race conditions; timing-sensitive assertions | See "Flaky-test escape hatch" below. Do NOT add retries, `setTimeout`, or `--retries=N` to make a real flake green. |
|
|
35
|
+
| **Environmental** | missing secret, broken runner, network failure, unreachable registry | Emit `FAILED: <explanation>`. Code can't fix infrastructure. |
|
|
36
|
+
|
|
37
|
+
2. **Make the minimum edits to fix the root cause.** Do not bundle unrelated cleanups into a CI fix.
|
|
38
|
+
|
|
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
|
+
|
|
41
|
+
4. **Final message format** (or `FAILED: <reason>` on failure):
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
DONE
|
|
45
|
+
COMMIT_MSG: fix(ci): <short root-cause description>
|
|
46
|
+
PR_SUMMARY:
|
|
47
|
+
<2-4 bullets: what was failing, what you changed, why it fixes it>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
# Flaky-test escape hatch
|
|
51
|
+
|
|
52
|
+
If a test passes locally and on a CI retry but fails non-deterministically (timing, race, port collision, network-dependent), do NOT paper over it. Output:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
FAILED: flaky test — <test name / file:line> appears non-deterministic. Local: pass. CI retry: <pass|fail>. Suspected cause: <one line>. Recommend a separate issue to stabilize, not a fix-CI patch.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
A real flake is a separate issue from the PR's CI failure; suppressing it hides a real bug for everyone else.
|
|
59
|
+
|
|
60
|
+
# What you must NEVER do to make CI green
|
|
61
|
+
|
|
62
|
+
These all turn a real failure into a silent one. They are hard failures, even if the resulting CI run is green:
|
|
63
|
+
|
|
64
|
+
- Add `// @ts-ignore`, `// @ts-expect-error`, `# type: ignore`, `# noqa`, or equivalents to silence a real type/lint error.
|
|
65
|
+
- Mark a test `.skip`, `.todo`, `xit`, `xdescribe`, or comment it out.
|
|
66
|
+
- Update a snapshot blindly (`-u`, `--update-snapshots`) without first reading the diff and confirming the new snapshot is intentionally correct.
|
|
67
|
+
- Replace a specific assertion with a permissive one (`expect.any(...)`, `toBeTruthy()`, `toBeDefined()`, removing fields from a matcher).
|
|
68
|
+
- Loosen a regex / matcher to match the unexpected output instead of fixing the output.
|
|
69
|
+
- Add `--retries=N`, `retry` decorators, or `setTimeout` to mask a race.
|
|
70
|
+
- Disable a CI step, change `if: always()`, or comment out a workflow job.
|
|
71
|
+
- Pin a dependency to an older version specifically to avoid a new failing test, when the new dep is otherwise correct.
|
|
72
|
+
|
|
73
|
+
If the only way you can think of to make CI pass falls under one of these, the right answer is `FAILED:` with the actual blocker, not a green run.
|
|
74
|
+
|
|
75
|
+
# Rules
|
|
76
|
+
- Do NOT run git/gh. Wrapper handles it.
|
|
77
|
+
- Stay on `{{branch}}`.
|
|
78
|
+
{{systemPromptAppend}}
|
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.211",
|
|
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",
|