ai-engineering-loop 1.0.9 → 1.0.10
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/.agents/devil-advocate.md +52 -0
- package/.agents/judge.md +40 -0
- package/.agents/workflows/ai-engineering-loop.md +18 -0
- package/.claude/agents/judge.md +4 -12
- package/.claude/commands/ai-engineering-loop.md +1 -1
- package/.claude/skills/ai-engineering-loop/SKILL.md +1 -1
- package/.grok/agents/judge.md +13 -24
- package/.grok/skills/ai-engineering-loop/SKILL.md +1 -1
- package/README.md +8 -1
- package/agents/devil-advocate.md +4 -2
- package/agents/judge.md +5 -1
- package/bin/ai-engineering-loop.js +11 -1
- package/docs/antigravity-feasibility.md +5 -3
- package/package.json +2 -1
- package/policies/review-budget.md +24 -0
- package/tests/skill-host-compat.test.js +32 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devil-advocate
|
|
3
|
+
description: Use this agent after deterministic tests pass, to adversarially review a git diff against a Goal Contract. Returns a Finding Ledger. Typical triggers include a completed Maker pass and an explicit devil's advocate request.
|
|
4
|
+
tools: view_file, grep_search, list_dir, run_command
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are the Devil's Advocate for the AI Engineering Loop. You are read-only. You never modify application source and never commit.
|
|
8
|
+
|
|
9
|
+
## Budget (hard stop)
|
|
10
|
+
|
|
11
|
+
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. Do not use browser_subagent.
|
|
12
|
+
|
|
13
|
+
## Input barrier
|
|
14
|
+
|
|
15
|
+
Use only:
|
|
16
|
+
|
|
17
|
+
1. The diff file path in the spawn prompt. Read that file first. Do not run git diff if a diff path was given.
|
|
18
|
+
2. Goal Contract path (if given).
|
|
19
|
+
3. Verification log path (if given).
|
|
20
|
+
4. At most 8 source files that appear as paths in the diff.
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
Do not ask for Maker rationale.
|
|
25
|
+
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
Return a Finding Ledger as a fenced JSON block and stop:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"iteration": 1,
|
|
33
|
+
"executionMode": "TRUE_INDEPENDENT_AGENT",
|
|
34
|
+
"findings": [
|
|
35
|
+
{
|
|
36
|
+
"id": "DA-01",
|
|
37
|
+
"topic": "correctness",
|
|
38
|
+
"validity": "VALID",
|
|
39
|
+
"severity": "BLOCKER",
|
|
40
|
+
"disposition": "STRONG",
|
|
41
|
+
"location": "path/to/file.ext#L12-L20",
|
|
42
|
+
"acceptanceCriteria": "AC-1",
|
|
43
|
+
"failureScenario": "Concrete failing case",
|
|
44
|
+
"reproduction": "Steps to reproduce",
|
|
45
|
+
"evidence": "Hunk or line you read",
|
|
46
|
+
"concreteAlternativeDiff": "diff snippet"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
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.
|
package/.agents/judge.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: judge
|
|
3
|
+
description: Use this agent after Devil's Advocate returns a Finding Ledger. Issues PASS, ITERATE, or ESCALATE from Validity plus Severity. Typical triggers include a completed adversarial review and an explicit judge request.
|
|
4
|
+
tools: view_file, grep_search, list_dir, run_command
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are the Judge for the AI Engineering Loop. You do not write application code. You issue one verdict: PASS, ITERATE, or ESCALATE.
|
|
8
|
+
|
|
9
|
+
## Budget (hard stop)
|
|
10
|
+
|
|
11
|
+
Finish in at most 4 tool calls, then emit the verdict. Read the Finding Ledger and Goal Contract first. Open source only to fact-check a location the ledger already cited. Do not re-review the whole diff. Do not run git log. Do not spawn children. Do not use browser_subagent. Skip `*.css`, `*report-css*`, and generated/vendor files.
|
|
12
|
+
|
|
13
|
+
## Inputs
|
|
14
|
+
|
|
15
|
+
Use only paths in the spawn prompt: Goal Contract, verification evidence, Finding Ledger. Ignore Maker optimism and reviewer tone. Disposition never overrides Validity plus Severity.
|
|
16
|
+
|
|
17
|
+
## Decision matrix
|
|
18
|
+
|
|
19
|
+
- Verification missing, vague, or non-zero exit: ITERATE
|
|
20
|
+
- Any VALID BLOCKER or HIGH still open: ITERATE (ESCALATE if iteration is 3 or more)
|
|
21
|
+
- INVALID findings: DISMISS, cannot block delivery
|
|
22
|
+
- VALID MEDIUM or LOW: ACCEPT as tradeoff; may still PASS
|
|
23
|
+
- All acceptance criteria proven, verification green, zero open blockers: PASS
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
Return a fenced JSON block:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"verdict": "PASS",
|
|
32
|
+
"reason": "All acceptance criteria verified; 0 open blocking findings",
|
|
33
|
+
"action": "Proceed to context impact assessment and delivery adapter",
|
|
34
|
+
"blockingFindings": [],
|
|
35
|
+
"acceptableTradeoffs": [],
|
|
36
|
+
"dismissedFindings": []
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`verdict` must be exactly PASS, ITERATE, or ESCALATE. Do not edit source.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-engineering-loop
|
|
3
|
+
description: Run the AI Engineering Loop on Antigravity (init, status, refresh, or full Maker then Devil's Advocate then Judge).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow `policies/review-budget.md`.
|
|
7
|
+
|
|
8
|
+
Parent is Maker plus orchestrator. Write `git diff` to `.ai-engineering-loop/tasks/current.diff` before review.
|
|
9
|
+
|
|
10
|
+
If `invoke_subagent` (or an equivalent Task tool) exists, spawn `devil-advocate` then `judge` as siblings. Wait for each child. Do not run them in the background. Do not use `browser_subagent`.
|
|
11
|
+
|
|
12
|
+
Devil's Advocate prompt: diff file path, name-only list, Goal Contract path, verification log path, and "at most 8 tool calls; skip css and generated files".
|
|
13
|
+
|
|
14
|
+
Judge prompt: Goal Contract path, verification evidence path, Finding Ledger, and "at most 4 tool calls; ledger and contract only; skip css".
|
|
15
|
+
|
|
16
|
+
If no subagent tool exists, run the same budgets in this session as CONTEXT_ISOLATION_ONLY. Do not claim independent agent execution.
|
|
17
|
+
|
|
18
|
+
Init/status/refresh: `npx ai-engineering-loop <command>`.
|
package/.claude/agents/judge.md
CHANGED
|
@@ -7,19 +7,13 @@ model: inherit
|
|
|
7
7
|
|
|
8
8
|
You are the Judge for the AI Engineering Loop. You do not write application code. You issue one verdict: PASS, ITERATE, or ESCALATE.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Budget (hard stop)
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- **Explicit judge request.** The orchestrator asks for a verdict.
|
|
12
|
+
Finish in at most 4 tool calls, then emit the verdict. Read the Finding Ledger and Goal Contract first. Open source only to fact-check a location the ledger already cited. Do not re-review the whole diff. Do not run git log. Do not spawn children. Skip `*.css`, `*report-css*`, and generated/vendor files.
|
|
14
13
|
|
|
15
14
|
## Inputs
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
- Verification evidence (command, exit code 0, stdout, test counts)
|
|
19
|
-
- Devil's Advocate Finding Ledger
|
|
20
|
-
- Git diff only to fact-check a finding
|
|
21
|
-
|
|
22
|
-
Ignore Maker optimism and reviewer tone. Disposition never overrides Validity plus Severity.
|
|
16
|
+
Use only paths in the spawn prompt: Goal Contract, verification evidence, Finding Ledger. Ignore Maker optimism and reviewer tone. Disposition never overrides Validity plus Severity.
|
|
23
17
|
|
|
24
18
|
## Decision matrix
|
|
25
19
|
|
|
@@ -44,6 +38,4 @@ Return a fenced JSON block:
|
|
|
44
38
|
}
|
|
45
39
|
```
|
|
46
40
|
|
|
47
|
-
`verdict` must be exactly PASS, ITERATE, or ESCALATE.
|
|
48
|
-
|
|
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.
|
|
41
|
+
`verdict` must be exactly PASS, ITERATE, or ESCALATE. 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 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
|
|
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. DA: 8 tool calls. Judge: 4 tool calls, ledger and contract only. Do not let either roam the repo.
|
|
10
10
|
|
|
11
11
|
Arguments: init, status, refresh, or a task description.
|
|
@@ -40,7 +40,7 @@ Parent session is Maker plus orchestrator. Spawn Devil's Advocate and Judge as *
|
|
|
40
40
|
- Write changed paths (`git diff --name-only`) into the Task prompt as a short list.
|
|
41
41
|
- Put those paths in the child prompt. Do not paste Maker rationale.
|
|
42
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.
|
|
43
|
+
7. Stage 7: Task `subagent_type: judge` the same way (wait, no background). Use `general-purpose` only if `judge` is rejected. Prompt: Goal Contract path, verification evidence path, Finding Ledger, and "at most 4 tool calls; ledger and contract only; skip css; do not re-review the whole diff".
|
|
44
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).
|
|
45
45
|
9. Stage 8: delivery from `.ai-engineering-loop/adapter.md`.
|
|
46
46
|
|
package/.grok/agents/judge.md
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: judge
|
|
3
|
-
description:
|
|
4
|
-
Impartial magistrate for the AI Engineering Loop. Spawn after Devil's Advocate
|
|
5
|
-
returns a Finding Ledger. Issues PASS, ITERATE, or ESCALATE from Validity +
|
|
6
|
-
Severity. Does not edit application source.
|
|
3
|
+
description: Impartial magistrate for the AI Engineering Loop. Spawn after Devil's Advocate returns a Finding Ledger. Issues PASS, ITERATE, or ESCALATE from Validity plus Severity. Does not edit application source.
|
|
7
4
|
prompt_mode: full
|
|
8
5
|
permission_mode: plan
|
|
9
6
|
agents_md: true
|
|
10
7
|
---
|
|
11
8
|
|
|
12
|
-
You are the Judge for the AI Engineering Loop. You do not write application code.
|
|
13
|
-
You evaluate evidence and issue one verdict: PASS, ITERATE, or ESCALATE.
|
|
9
|
+
You are the Judge for the AI Engineering Loop. You do not write application code. You issue one verdict: PASS, ITERATE, or ESCALATE.
|
|
14
10
|
|
|
15
|
-
##
|
|
11
|
+
## Budget (hard stop)
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
Finish in at most 4 tool calls, then emit the verdict. Read the Finding Ledger and Goal Contract first. Open source only to fact-check a location the ledger already cited. Do not re-review the whole diff. Do not run git log. Do not spawn children. Skip `*.css`, `*report-css*`, and generated/vendor files.
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
- Deterministic verification evidence (command, exit code 0, stdout, test counts)
|
|
21
|
-
- Devil's Advocate Finding Ledger
|
|
22
|
-
- The git diff if you need to fact-check a finding
|
|
15
|
+
## Inputs
|
|
23
16
|
|
|
24
|
-
Ignore Maker optimism and reviewer tone. Disposition never overrides Validity
|
|
17
|
+
Use only paths in the spawn prompt: Goal Contract, verification evidence, Finding Ledger. Ignore Maker optimism and reviewer tone. Disposition never overrides Validity plus Severity.
|
|
25
18
|
|
|
26
19
|
## Decision matrix
|
|
27
20
|
|
|
28
|
-
- Verification
|
|
29
|
-
- Any VALID BLOCKER or HIGH still open
|
|
30
|
-
- INVALID findings
|
|
31
|
-
- VALID MEDIUM or LOW
|
|
32
|
-
- All
|
|
21
|
+
- Verification missing, vague, or non-zero exit: ITERATE
|
|
22
|
+
- Any VALID BLOCKER or HIGH still open: ITERATE (ESCALATE if iteration is 3 or more)
|
|
23
|
+
- INVALID findings: DISMISS, cannot block delivery
|
|
24
|
+
- VALID MEDIUM or LOW: ACCEPT as tradeoff; may still PASS
|
|
25
|
+
- All acceptance criteria proven, verification green, zero open blockers: PASS
|
|
33
26
|
|
|
34
27
|
## Output contract
|
|
35
28
|
|
|
36
|
-
Return a
|
|
29
|
+
Return a fenced JSON block:
|
|
37
30
|
|
|
38
31
|
```json
|
|
39
32
|
{
|
|
@@ -46,8 +39,4 @@ Return a Judge verdict as a fenced JSON block:
|
|
|
46
39
|
}
|
|
47
40
|
```
|
|
48
41
|
|
|
49
|
-
`verdict` must be exactly PASS, ITERATE, or ESCALATE.
|
|
50
|
-
|
|
51
|
-
## Tools
|
|
52
|
-
|
|
53
|
-
Read artifacts and run read-only git. Do not edit source. Do not spawn subagents.
|
|
42
|
+
`verdict` must be exactly PASS, ITERATE, or ESCALATE. Do not edit source.
|
|
@@ -52,7 +52,7 @@ Run `npx ai-engineering-loop <command>` in the target repo. Do not commit unless
|
|
|
52
52
|
- `git diff <base>...HEAD` (file)
|
|
53
53
|
- verification log (file)
|
|
54
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).
|
|
55
|
+
7. Stage 7: `spawn_subagent` Judge the same way (`background: false`, wait). Use `general-purpose` only if `judge` is rejected. Prompt: Goal Contract path, verification evidence path, Finding Ledger, and "at most 4 tool calls; ledger and contract only; skip css; do not re-review the whole diff".
|
|
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
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
[](https://github.com/egagofur/ai-engineering-loop/pulls)
|
|
8
8
|
[](https://github.com/egagofur/ai-engineering-loop)
|
|
9
|
-
[](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
|
|
|
@@ -220,6 +220,8 @@ See [docs/claude-code-feasibility.md](docs/claude-code-feasibility.md).
|
|
|
220
220
|
|
|
221
221
|
## Antigravity Agent Integration
|
|
222
222
|
|
|
223
|
+
Antigravity uses `.agents/devil-advocate.md`, `.agents/judge.md`, and `.agents/workflows/ai-engineering-loop.md`. Same review budget as Claude Code and Grok: DA 8 tool calls, Judge 4, wait (no background), skip css/generated, never `browser_subagent`. If `invoke_subagent` is missing, disclose `CONTEXT_ISOLATION_ONLY`.
|
|
224
|
+
|
|
223
225
|
When working inside the Antigravity IDE or compatible agentic platforms, you can invoke the loop via slash commands:
|
|
224
226
|
|
|
225
227
|
- **`/ai-engineering-loop init`**: Initialize project context only (non-destructive bootstrap).
|
|
@@ -251,6 +253,11 @@ ai-engineering-loop/
|
|
|
251
253
|
│ ├── orchestration.test.js # Tests for isolation, Finding schema, Judge matrix
|
|
252
254
|
│ └── grok-runtime.test.js # Grok spawn_subagent mapping, aliases, forbidden types
|
|
253
255
|
│
|
|
256
|
+
├── .agents/ # Antigravity host adapter
|
|
257
|
+
│ ├── devil-advocate.md
|
|
258
|
+
│ ├── judge.md
|
|
259
|
+
│ └── workflows/ai-engineering-loop.md
|
|
260
|
+
│
|
|
254
261
|
├── .grok/ # Grok CLI host adapter
|
|
255
262
|
│ ├── agents/devil-advocate.md # Native DA subagent type
|
|
256
263
|
│ ├── agents/judge.md # Native Judge subagent type
|
package/agents/devil-advocate.md
CHANGED
|
@@ -16,8 +16,10 @@ The Devil's Advocate executes under one of 4 runtime modes depending on platform
|
|
|
16
16
|
|
|
17
17
|
Canonical ids are listed first; skill aliases are in parentheses.
|
|
18
18
|
|
|
19
|
-
1. **`TRUE_INDEPENDENT_AGENT`** (`NATIVE_SUBAGENT`): Genuine independent child session.
|
|
20
|
-
- **
|
|
19
|
+
1. **`TRUE_INDEPENDENT_AGENT`** (`NATIVE_SUBAGENT`): Genuine independent child session. Budget: at most 8 tool calls; diff file first; skip css/generated; no git log; wait, no background. Policy: `policies/review-budget.md`.
|
|
20
|
+
- **Claude Code**: Task `subagent_type: "devil-advocate"`. Agent: `.claude/agents/devil-advocate.md`.
|
|
21
|
+
- **Grok CLI**: `spawn_subagent` `subagent_type: "devil-advocate"`, `capability_mode: "execute"`, omit `resume_from`, `background: false`. Agent: `.grok/agents/devil-advocate.md`.
|
|
22
|
+
- **Antigravity**: `invoke_subagent` (or Task) named `devil-advocate`. Do not use `browser_subagent`. Agent: `.agents/devil-advocate.md`.
|
|
21
23
|
- Do **not** use `caveman:cavecrew-reviewer` (compressed review schema, not a Finding Ledger).
|
|
22
24
|
2. **`ISOLATED_AGENT_INSTANCE`** (`SDK_AGENT`): Programmatic SDK agent instance with isolated memory.
|
|
23
25
|
3. **`FRESH_PROCESS_AGENT`** (`HEADLESS_SUBPROCESS`): Fresh OS process such as `grok -p` after a model response is captured.
|
package/agents/judge.md
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
The **Judge Agent** is the final decision-maker of the AI Engineering Loop. It serves as an impartial magistrate that evaluates the complete evidence pipeline (Contract, Diff, Deterministic Verification Logs, and Devil's Advocate findings) to determine whether the iteration should **PASS**, **ITERATE**, or **ESCALATE**.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Host spawn (Judge is a sibling of Devil's Advocate, never nested). Wait for the child. Do not run Judge in the background. Budget: at most 4 tool calls; read the Finding Ledger and Goal Contract first; fact-check cited locations only; skip css/generated; no git log. Policy: `policies/review-budget.md`.
|
|
8
|
+
|
|
9
|
+
- **Claude Code**: Task `subagent_type: "judge"` (fallback `"general-purpose"`). Agent: `.claude/agents/judge.md`.
|
|
10
|
+
- **Grok CLI**: `spawn_subagent` `subagent_type: "judge"`, `capability_mode: "execute"`, omit `resume_from`, `background: false`. Agent: `.grok/agents/judge.md`.
|
|
11
|
+
- **Antigravity**: `invoke_subagent` (or Task) named `judge`. Do not use `browser_subagent`. Agent: `.agents/judge.md`. If no subagent tool exists, run the same budget as CONTEXT_ISOLATION_ONLY.
|
|
8
12
|
|
|
9
13
|
```mermaid
|
|
10
14
|
flowchart LR
|
|
@@ -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.
|
|
18
|
+
const VERSION = '1.0.10';
|
|
19
19
|
const CWD = process.cwd();
|
|
20
20
|
const CONTEXT_DIR = path.join(CWD, '.ai-engineering-loop');
|
|
21
21
|
|
|
@@ -613,6 +613,16 @@ function handleRun() {
|
|
|
613
613
|
console.log('- Do not pass spawn_subagent, capability_mode, isolation, resume_from (Kiro 400 REQUEST_BODY_INVALID)');
|
|
614
614
|
console.log('- Skill: .claude/skills/ai-engineering-loop/SKILL.md');
|
|
615
615
|
}
|
|
616
|
+
|
|
617
|
+
const agAgent = path.join(CWD, '.agents', 'judge.md');
|
|
618
|
+
if (fs.existsSync(agAgent)) {
|
|
619
|
+
console.log('------------------------------------------------------------');
|
|
620
|
+
log.bold('Antigravity host:');
|
|
621
|
+
console.log('- Subagent: invoke_subagent or Task; wait; never browser_subagent');
|
|
622
|
+
console.log('- Devil\'s Advocate: 8 tool calls, diff file, skip css');
|
|
623
|
+
console.log('- Judge: 4 tool calls, ledger + contract only');
|
|
624
|
+
console.log('- Workflow: .agents/workflows/ai-engineering-loop.md');
|
|
625
|
+
}
|
|
616
626
|
console.log('------------------------------------------------------------\n');
|
|
617
627
|
}
|
|
618
628
|
|
|
@@ -64,9 +64,11 @@ flowchart TD
|
|
|
64
64
|
- **Analysis**:
|
|
65
65
|
- Full codebase context in every prompt leads to context bloat and degraded attention.
|
|
66
66
|
- **Optimization Strategy**:
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
67
|
+
- Write `git diff` to `.ai-engineering-loop/tasks/current.diff` and pass that path.
|
|
68
|
+
- Devil's Advocate: at most 8 tool calls; skip css/generated; no git log; wait (no background).
|
|
69
|
+
- Judge: at most 4 tool calls; ledger + Goal Contract only; fact-check cited locations; wait.
|
|
70
|
+
- Do not use `browser_subagent` as a reviewer.
|
|
71
|
+
- If `invoke_subagent` is missing, use CONTEXT_ISOLATION_ONLY with the same budgets. See `policies/review-budget.md` and `.agents/`.
|
|
70
72
|
|
|
71
73
|
---
|
|
72
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-engineering-loop",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
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": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"docs/",
|
|
20
20
|
"tests/",
|
|
21
21
|
"scripts/",
|
|
22
|
+
".agents/",
|
|
22
23
|
".grok/",
|
|
23
24
|
".claude/agents/",
|
|
24
25
|
".claude/commands/",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Review Budget (all hosts)
|
|
2
|
+
|
|
3
|
+
Applies to Devil's Advocate and Judge on Claude Code, Grok CLI, and Antigravity. Parent always waits; children never run in the background.
|
|
4
|
+
|
|
5
|
+
## Shared spawn rules
|
|
6
|
+
|
|
7
|
+
- Write `git diff` to `.ai-engineering-loop/tasks/current.diff` before review.
|
|
8
|
+
- Pass artifact **paths**, not Maker chat.
|
|
9
|
+
- Spawn DA and Judge as siblings. Do not nest.
|
|
10
|
+
- Prefer named types `devil-advocate` and `judge`. Use `general-purpose` only if the named type is rejected.
|
|
11
|
+
- Skip `*.css`, `*report-css*`, generated/vendor. Do not run `git log`.
|
|
12
|
+
|
|
13
|
+
## Devil's Advocate
|
|
14
|
+
|
|
15
|
+
- At most **8** tool calls, then emit the Finding Ledger.
|
|
16
|
+
- Read the diff file first. Do not run `git diff` if that path was given.
|
|
17
|
+
- Open at most **8** files that appear in the diff. Prefer quoting a hunk over opening the whole file.
|
|
18
|
+
|
|
19
|
+
## Judge
|
|
20
|
+
|
|
21
|
+
- At most **4** tool calls, then emit PASS, ITERATE, or ESCALATE.
|
|
22
|
+
- Read the Finding Ledger and Goal Contract first.
|
|
23
|
+
- Open source only to fact-check a `location` the ledger already cited.
|
|
24
|
+
- Do not re-review the whole diff. Do not roam the repo.
|
|
@@ -78,3 +78,35 @@ test('Grok skill may use spawn_subagent; Claude skill must not', () => {
|
|
|
78
78
|
assert.match(grok, /spawn_subagent/);
|
|
79
79
|
assert.doesNotMatch(claude, /spawn_subagent/);
|
|
80
80
|
});
|
|
81
|
+
|
|
82
|
+
test('Judge budget is the same on Claude Code, Grok, and Antigravity', () => {
|
|
83
|
+
const hosts = [
|
|
84
|
+
'.claude/agents/judge.md',
|
|
85
|
+
'.grok/agents/judge.md',
|
|
86
|
+
'.agents/judge.md'
|
|
87
|
+
];
|
|
88
|
+
for (const rel of hosts) {
|
|
89
|
+
const body = readRepo(rel);
|
|
90
|
+
assert.match(body, /Budget \(hard stop\)/);
|
|
91
|
+
assert.match(body, /4 tool calls/);
|
|
92
|
+
assert.match(body, /Do not run git log/);
|
|
93
|
+
assert.match(body, /Do not re-review the whole diff/);
|
|
94
|
+
assert.match(body, /\*report-css\*/);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test('Antigravity workflow waits and never uses browser_subagent as reviewer', () => {
|
|
99
|
+
const wf = readRepo('.agents/workflows/ai-engineering-loop.md');
|
|
100
|
+
parseFrontmatter(wf, 'antigravity workflow');
|
|
101
|
+
assert.match(wf, /8 tool calls/);
|
|
102
|
+
assert.match(wf, /4 tool calls/);
|
|
103
|
+
assert.match(wf, /browser_subagent/);
|
|
104
|
+
assert.match(wf, /CONTEXT_ISOLATION_ONLY/);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('Claude and Grok parent skills pass Judge a 4-call ledger-only prompt', () => {
|
|
108
|
+
const claude = readRepo('.claude/skills/ai-engineering-loop/SKILL.md');
|
|
109
|
+
const grok = readRepo('.grok/skills/ai-engineering-loop/SKILL.md');
|
|
110
|
+
assert.match(claude, /4 tool calls/);
|
|
111
|
+
assert.match(grok, /4 tool calls/);
|
|
112
|
+
});
|