ai-engineering-loop 1.0.8 → 1.0.9

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.
@@ -7,25 +7,26 @@ model: inherit
7
7
 
8
8
  You are the Devil's Advocate for the AI Engineering Loop. You are read-only. You never modify application source and never commit.
9
9
 
10
- ## When to invoke
10
+ ## Budget (hard stop)
11
11
 
12
- - **After Maker verification.** Tests passed. Review the diff against the Goal Contract.
13
- - **Explicit review request.** The user or orchestrator asks for a devil's advocate pass.
12
+ Finish in at most 8 tool calls, then emit the Finding Ledger. Do not explore the rest of the repo. Do not spawn children. Do not run git log.
14
13
 
15
14
  ## Input barrier
16
15
 
17
- Use only the spawn prompt plus:
16
+ Use only:
18
17
 
19
- - Goal Contract
20
- - `.ai-engineering-loop/` (`architecture.md`, `conventions.md`, `verification.md`)
21
- - The git diff (path in the prompt, or `git diff <base>...HEAD`)
22
- - Verification logs (exit code, stdout, test counts)
18
+ 1. The diff file path in the spawn prompt. Read that file first. Do not run git diff if a diff path was given.
19
+ 2. Goal Contract path (if given).
20
+ 3. Verification log path (if given).
21
+ 4. At most 8 source files that appear as paths in the diff.
23
22
 
24
- Do not ask for Maker rationale. Do not treat parent narration as evidence.
23
+ Skip: `*.css`, files named like `*-css.ts` or `report-css.ts`, generated/vendor dirs, and any file where the diff hunk already contains enough evidence. Prefer quoting the hunk over opening the whole file.
24
+
25
+ Do not ask for Maker rationale.
25
26
 
26
27
  ## Output
27
28
 
28
- Return a Finding Ledger as a fenced JSON block:
29
+ Return a Finding Ledger as a fenced JSON block and stop:
29
30
 
30
31
  ```json
31
32
  {
@@ -42,19 +43,11 @@ Return a Finding Ledger as a fenced JSON block:
42
43
  "acceptanceCriteria": "AC-1",
43
44
  "failureScenario": "Concrete failing case",
44
45
  "reproduction": "Steps to reproduce",
45
- "evidence": "What you read in the diff or source",
46
+ "evidence": "Hunk or line you read",
46
47
  "concreteAlternativeDiff": "diff snippet"
47
48
  }
48
49
  ]
49
50
  }
50
51
  ```
51
52
 
52
- Rules:
53
-
54
- - `validity` is VALID or INVALID.
55
- - `severity` is BLOCKER, HIGH, MEDIUM, or LOW.
56
- - `disposition` is STRONG, ACCEPTABLE, or WEAK.
57
- - Every VALID BLOCKER or HIGH finding must include `concreteAlternativeDiff`.
58
- - Empty `findings` is allowed when the diff is clean against the Goal Contract.
59
-
60
- Use Read, Grep, Glob, and read-only Bash (`git diff`, `git log`, `git show`). Do not write files.
53
+ Rules: validity VALID or INVALID; severity BLOCKER, HIGH, MEDIUM, or LOW; disposition STRONG, ACCEPTABLE, or WEAK. VALID BLOCKER or HIGH must include concreteAlternativeDiff. Empty findings is allowed.
@@ -46,4 +46,4 @@ Return a fenced JSON block:
46
46
 
47
47
  `verdict` must be exactly PASS, ITERATE, or ESCALATE.
48
48
 
49
- Use Read and read-only git. Do not edit source.
49
+ Budget: at most 4 tool calls. Read the ledger and Goal Contract first. Open source only to fact-check a cited location. Do not run git log. Do not edit source.
@@ -6,6 +6,6 @@ allowed-tools: "Read, Grep, Glob, Edit, Write, Task, Bash(npm run *), Bash(npm t
6
6
 
7
7
  Follow `.claude/skills/ai-engineering-loop/SKILL.md`.
8
8
 
9
- Use the Task tool for Devil's Advocate and Judge. Pass only subagent_type, description, and prompt.
9
+ Use the Task tool for Devil's Advocate and Judge. Pass subagent_type, description, and prompt. If the schema includes run_in_background, set it false. Wait for each Task to finish. Write the git diff to a file and pass that path; do not let the reviewer roam the repo.
10
10
 
11
11
  Arguments: init, status, refresh, or a task description.
@@ -17,6 +17,7 @@ Claude Code talks to strict proxies (including Kiro). Follow this exactly:
17
17
  - `subagent_type`
18
18
  - `description`
19
19
  - `prompt`
20
+ - `run_in_background: false` only if that key exists on the Task schema. Never invent other keys.
20
21
  3. Do **not** add any other keys. Extra keys make Kiro return HTTP 400 `REQUEST_BODY_INVALID`.
21
22
  4. If no Task/Agent tool exists, review in this session and label it `CONTEXT_ISOLATION_ONLY`. Do not invent a tool name.
22
23
  5. If Bash or Write returns "cannot determine the safety" or HTTP 400 REQUEST_BODY_INVALID: stop that tool. Do not retry it. Continue with Read, Grep, and Glob. Tell the user to switch off auto permission mode (use default) or add a permissions.allow rule for the verification command, then start a new session.
@@ -34,9 +35,12 @@ Parent session is Maker plus orchestrator. Spawn Devil's Advocate and Judge as *
34
35
  2. Stage 1: write a Goal Contract. Schema: `core/goal-contract.md`.
35
36
  3. Stages 2-4: Maker work in the parent. Surgical diff plus tests.
36
37
  4. Stage 5: run commands from `.ai-engineering-loop/verification.md`. Keep command, exit code, stdout, test counts. Vague "seems green" is invalid.
37
- 5. Write artifact paths (Goal Contract, diff, verification log). Put those paths in child prompts. Do not paste Maker rationale.
38
- 6. Stage 6: Task `subagent_type: devil-advocate` (fallback `general-purpose`). Prompt: artifact paths plus Finding Ledger contract from `agents/devil-advocate.md`.
39
- 7. Stage 7: Task `subagent_type: judge` (fallback `general-purpose`). Prompt: Goal Contract, verification evidence, Finding Ledger. Verdict is PASS, ITERATE, or ESCALATE.
38
+ 5. Write artifacts, then spawn. Before Devil's Advocate:
39
+ - Write `git diff` to a file (for example `.ai-engineering-loop/tasks/current.diff`).
40
+ - Write changed paths (`git diff --name-only`) into the Task prompt as a short list.
41
+ - Put those paths in the child prompt. Do not paste Maker rationale.
42
+ 6. Stage 6: Task `subagent_type: devil-advocate`. Use `general-purpose` only if that type is rejected. If the Task schema includes `run_in_background`, set it false. Then wait for Task to return. Do not start Judge or more Maker work until the Finding Ledger is back. Prompt: diff file path, name-only list, Goal Contract path, verification log path, and "at most 8 tool calls; read the diff file; skip css and generated files".
43
+ 7. Stage 7: Task `subagent_type: judge` the same way (wait, no background). Prompt: Goal Contract, verification evidence, Finding Ledger.
40
44
  8. ITERATE with iteration under 3: fix in the parent, re-verify, spawn a **new** Devil's Advocate (do not resume the previous child).
41
45
  9. Stage 8: delivery from `.ai-engineering-loop/adapter.md`.
42
46
 
@@ -15,12 +15,11 @@ never inherit Maker conversational history.
15
15
 
16
16
  ## Input barrier
17
17
 
18
- Use only what the parent put in the spawn prompt plus these artifacts on disk:
18
+ Use only:
19
19
 
20
- - Goal Contract
21
- - `.ai-engineering-loop/` (`architecture.md`, `conventions.md`, `verification.md`)
22
- - The git diff (path in the prompt, or `git diff <base>...HEAD`)
23
- - Deterministic verification logs (exit code, stdout, test counts)
20
+ 1. The diff file path in the spawn prompt. Read that file first.
21
+ 2. Goal Contract path and verification log path if given.
22
+ 3. At most 8 source files that appear as paths in the diff.
24
23
 
25
24
  Do not ask the parent for Maker rationale. Do not treat parent narration as evidence.
26
25
 
@@ -62,6 +61,10 @@ Rules:
62
61
  - Every VALID BLOCKER or HIGH finding must include `concreteAlternativeDiff`.
63
62
  - Empty `findings` is allowed when the diff is clean against the Goal Contract.
64
63
 
65
- ## Tools
64
+ ## Budget (hard stop)
66
65
 
67
- Use read/search and read-only shell (`git diff`, `git log`, `git show`). Do not write files. Do not spawn subagents (Grok depth limit is 1).
66
+ Finish in at most 8 tool calls, then emit the ledger. Do not run git log. Do not spawn children.
67
+
68
+ Read the diff file path from the prompt first. Do not run git diff if that path was given. Open at most 8 files that appear in the diff. Skip `*.css`, `*report-css*`, generated/vendor, and files whose hunk already proves the finding.
69
+
70
+ Use read/search and read-only shell only if the diff file is missing. Do not write files.
@@ -51,8 +51,8 @@ Run `npx ai-engineering-loop <command>` in the target repo. Do not commit unless
51
51
  - Goal Contract path
52
52
  - `git diff <base>...HEAD` (file)
53
53
  - verification log (file)
54
- 6. Stage 6: `spawn_subagent` Devil's Advocate. `background: false`. `capability_mode: "execute"`. Do **not** pass `resume_from`. Prompt contains only artifact paths + `agents/devil-advocate.md` output contract.
55
- 7. Stage 7: `spawn_subagent` Judge with the ledger the DA returned plus the same artifacts. Prompt follows `agents/judge.md`.
54
+ 6. Stage 6: `spawn_subagent` Devil's Advocate. `background: false`. `capability_mode: "execute"`. Do **not** pass `resume_from`. Wait for the child. Prompt: diff file path, name-only file list, Goal Contract path, verification log path, plus "at most 8 tool calls; skip css and generated files".
55
+ 7. Stage 7: `spawn_subagent` Judge the same way (`background: false`, wait). Prompt follows `agents/judge.md`.
56
56
  8. If Judge says `ITERATE` and iteration < 3, Maker fixes in the parent, re-verify, spawn a **fresh** DA (new spawn, no resume).
57
57
  9. Stage 8: delivery adapter from `.ai-engineering-loop/adapter.md`.
58
58
 
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/egagofur/ai-engineering-loop/pulls)
8
8
  [![AI Engineering](https://img.shields.io/badge/AI-Engineering%20Loop-orange.svg)](https://github.com/egagofur/ai-engineering-loop)
9
- [![Release](https://img.shields.io/badge/release-v1.0.8-purple.svg)](https://github.com/egagofur/ai-engineering-loop/releases)
9
+ [![Release](https://img.shields.io/badge/release-v1.0.9-purple.svg)](https://github.com/egagofur/ai-engineering-loop/releases)
10
10
 
11
11
  **A Reusable, Framework-Agnostic AI Engineering Operating System for Autonomous Coding Agents**
12
12
 
@@ -201,8 +201,10 @@ API Error: 400 [kiro/claude-sonnet-5] REQUEST_BODY_INVALID
201
201
  | Loop role | Claude Code `subagent_type` | Task keys |
202
202
  |---|---|---|
203
203
  | Orchestrator / Maker | parent session | n/a |
204
- | Devil's Advocate | `devil-advocate` (fallback `general-purpose`) | `subagent_type`, `description`, `prompt` |
205
- | Judge | `judge` (fallback `general-purpose`) | `subagent_type`, `description`, `prompt` |
204
+ | Devil's Advocate | `devil-advocate` (fallback `general-purpose`) | `subagent_type`, `description`, `prompt`, wait (no background) |
205
+ | Judge | `judge` (fallback `general-purpose`) | same, after DA returns |
206
+
207
+ Parent writes `git diff` to a file and passes that path. DA is capped at 8 tool calls and skips css/generated blobs so review does not take tens of minutes.
206
208
 
207
209
  Repo-local Claude Code files:
208
210
 
@@ -15,7 +15,7 @@ const path = require('path');
15
15
  const crypto = require('crypto');
16
16
  const { execSync } = require('child_process');
17
17
 
18
- const VERSION = '1.0.8';
18
+ const VERSION = '1.0.9';
19
19
  const CWD = process.cwd();
20
20
  const CONTEXT_DIR = path.join(CWD, '.ai-engineering-loop');
21
21
 
@@ -21,8 +21,10 @@ This is separate from 9router bugs that reject any Anthropic `system` field. Tho
21
21
  | Loop role | Claude Code type | Task keys allowed |
22
22
  |---|---|---|
23
23
  | Orchestrator / Maker | parent session | n/a |
24
- | Devil's Advocate | `devil-advocate` (fallback `general-purpose`) | `subagent_type`, `description`, `prompt` |
25
- | Judge | `judge` (fallback `general-purpose`) | `subagent_type`, `description`, `prompt` |
24
+ | Devil's Advocate | `devil-advocate` (fallback `general-purpose`) | `subagent_type`, `description`, `prompt`, `run_in_background: false` |
25
+ | Judge | `judge` (fallback `general-purpose`) | same; wait for DA first |
26
+
27
+ Parent must write `git diff` to a file and pass that path. DA budget: 8 tool calls, skip css/generated, no git log. Do not leave DA running in the background.
26
28
 
27
29
  Do not pass Grok keys (`spawn_subagent`, `capability_mode`, `resume_from`, `isolation`, `background`) on Claude Code.
28
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-engineering-loop",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "A reusable, framework-agnostic AI Engineering Operating System for autonomous coding agents.",
5
5
  "main": "bin/ai-engineering-loop.js",
6
6
  "bin": {
@@ -38,6 +38,9 @@ test('Claude Code skill is Kiro-safe: no mermaid, latex, HTML breaks, or Grok to
38
38
  assert.match(content, /devil-advocate/);
39
39
  assert.match(content, /\bjudge\b/);
40
40
  assert.match(content, /cannot determine the safety/);
41
+ assert.match(content, /run_in_background/);
42
+ assert.match(content, /current\.diff/);
43
+ assert.match(content, /8 tool calls/);
41
44
  });
42
45
 
43
46
  test('Claude Code agents exist with Claude tool names and Finding Ledger / verdict contracts', () => {
@@ -51,9 +54,13 @@ test('Claude Code agents exist with Claude tool names and Finding Ledger / verdi
51
54
  assert.doesNotMatch(da, /spawn_subagent|capability_mode|resume_from/);
52
55
  assert.doesNotMatch(judge, /spawn_subagent|capability_mode|resume_from/);
53
56
  assert.match(da, /Finding Ledger/);
57
+ assert.match(da, /8 tool calls/);
58
+ assert.match(da, /Skip: `\*\.css`/);
59
+ assert.match(da, /Do not run git log/);
54
60
  assert.match(judge, /PASS/);
55
61
  assert.match(judge, /ITERATE/);
56
62
  assert.match(judge, /ESCALATE/);
63
+ assert.match(judge, /4 tool calls/);
57
64
  });
58
65
 
59
66
  test('Claude Code slash command does not embed Grok spawn keys', () => {