ai-engineering-loop 1.0.12 → 1.0.13

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/judge.md CHANGED
@@ -14,6 +14,10 @@ Finish in at most 4 tool calls, then emit the verdict. Read the Finding Ledger a
14
14
 
15
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
16
 
17
+ AC source is the Goal Contract **file** only. Chat `setuju` and the parent transcript are not AC. Do not PASS because the parent agreed in chat. `CONTEXT_ISOLATION_ONLY` does not relax this.
18
+
19
+ ITERATE if verification is missing, vague, non-zero, proves a different artifact than the AC names, or is only a source grep.
20
+
17
21
  ## Axes
18
22
 
19
23
  Do not merge Spec and Standards into one ranking.
@@ -5,7 +5,7 @@ description: Run the AI Engineering Loop on Antigravity (init, status, refresh,
5
5
 
6
6
  Follow `policies/review-budget.md`. Parent is Maker plus orchestrator. Do not use `browser_subagent`.
7
7
 
8
- Stage 1: grill if the task is ambiguous (`core/grill-policy.md`), then freeze the Goal Contract. On `adapter_type: dot`, that grill includes `task-impact-inquiry` (Antigravity skill under `~/.gemini/config/skills/`); do not run a second interview. Use `.ai-engineering-loop/glossary.md`. Name test seams. Maker: TDD at those seams (`policies/tdd-policy.md`). Bugs: red repro first (`core/root-cause-analysis.md`). Mid-loop stop: `core/handoff-policy.md`.
8
+ Stage 1: if the user asks for ideas, list a short menu and wait; do not implement. Grill if the task is ambiguous (`core/grill-policy.md`), then freeze the Goal Contract file. Chat agreement is not freeze. On `adapter_type: dot`, that grill includes `task-impact-inquiry` (Antigravity skill under `~/.gemini/config/skills/`); do not run a second interview. Use `.ai-engineering-loop/glossary.md`. Name test seams. Maker: TDD at those seams (`policies/tdd-policy.md`). Bugs: red repro first (`core/root-cause-analysis.md`). Mid-loop stop: `core/handoff-policy.md`.
9
9
 
10
10
  If `invoke_subagent` (or Task) exists, spawn `devil-advocate` then `judge` as siblings. Wait for each child. Do not run them in the background. Use `general-purpose` only if the named type is rejected.
11
11
 
@@ -15,6 +15,10 @@ Finish in at most 4 tool calls, then emit the verdict. Read the Finding Ledger a
15
15
 
16
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.
17
17
 
18
+ AC source is the Goal Contract **file** only. Chat `setuju` and the parent transcript are not AC. Do not PASS because the parent agreed in chat. `CONTEXT_ISOLATION_ONLY` does not relax this.
19
+
20
+ ITERATE if verification is missing, vague, non-zero, proves a different artifact than the AC names, or is only a source grep.
21
+
18
22
  ## Axes
19
23
 
20
24
  Do not merge Spec and Standards into one ranking.
@@ -32,7 +32,7 @@ Claude Code talks to strict proxies (including Kiro). Follow this exactly:
32
32
  Parent session is Maker plus orchestrator. Spawn Devil's Advocate and Judge as **siblings**, not nested.
33
33
 
34
34
  1. Stage 0: `npx ai-engineering-loop sync-hosts` then `npx ai-engineering-loop status` (init or refresh if missing or stale). Read `.ai-engineering-loop/glossary.md`. If sync-hosts copied files, tell the user a new session is needed for updated skill text; keep going with this session.
35
- 2. Stage 1: Goal Contract (`core/goal-contract.md`). If the task is ambiguous and the user can answer, grill first (`core/grill-policy.md`): design tree, recommended answers, do not ask look-up facts. Skip grill if the contract is already frozen or the user waived it. On `adapter_type: dot`, that grill includes the four-pillar blast radius (state, sibling, approval, queues). Do not run a second interview. Freeze before any production edit. Name test seams. Use glossary terms.
35
+ 2. Stage 1: Goal Contract (`core/goal-contract.md`). If the user asks for ideas, list a short menu and wait; do not implement. If the task is ambiguous and the user can answer, grill first (`core/grill-policy.md`): design tree, recommended answers, do not ask look-up facts. Skip grill if the contract is already frozen or the user waived it. On `adapter_type: dot`, that grill includes the four-pillar blast radius (state, sibling, approval, queues). Do not run a second interview. Chat agreement is not freeze: every user-visible decision must be a numbered AC in the Goal Contract file. Freeze before any production edit. Name test seams. Use glossary terms.
36
36
  3. Stages 2-4: Maker in the parent. Bugs: red repro first (`core/root-cause-analysis.md`). Features: TDD at named seams (`policies/tdd-policy.md`). Surgical diff.
37
37
  4. Stage 5: run commands from `.ai-engineering-loop/verification.md`. Keep command, exit code, stdout, test counts. Vague "seems green" is invalid.
38
38
  5. Write artifacts, then spawn. Before Devil's Advocate:
@@ -25,7 +25,7 @@ Canonical mode ids: `TRUE_INDEPENDENT_AGENT`, `ISOLATED_AGENT_INSTANCE`, `FRESH_
25
25
  ## Loop
26
26
 
27
27
  1. Stage 0: `npx ai-engineering-loop sync-hosts` then `npx ai-engineering-loop status` (init or refresh if missing or stale). Read `.ai-engineering-loop/glossary.md`. If sync-hosts copied files, tell the user a new session is needed for updated skill text; keep going with this session.
28
- 2. Stage 1: Goal Contract (`core/goal-contract.md`). If the task is ambiguous and the user can answer, grill first (`core/grill-policy.md`): design tree, recommended answers, do not ask look-up facts. Skip grill if the contract is already frozen or the user waived it. On `adapter_type: dot`, that grill includes `task-impact-inquiry` (this host: `~/.gemini/config/skills/task-impact-inquiry`); do not run a second interview. Freeze before any production edit. Name test seams. Use glossary terms.
28
+ 2. Stage 1: Goal Contract (`core/goal-contract.md`). If the user asks for ideas, list a short menu and wait; do not implement. If the task is ambiguous and the user can answer, grill first (`core/grill-policy.md`): design tree, recommended answers, do not ask look-up facts. Skip grill if the contract is already frozen or the user waived it. On `adapter_type: dot`, that grill includes `task-impact-inquiry` (this host: `~/.gemini/config/skills/task-impact-inquiry`); do not run a second interview. Chat agreement is not freeze: every user-visible decision must be a numbered AC in the Goal Contract file. Freeze before any production edit. Name test seams. Use glossary terms.
29
29
  3. Stages 2-4: Maker in the parent. Bugs: red repro first (`core/root-cause-analysis.md`). Features: TDD at named seams (`policies/tdd-policy.md`). Surgical diff.
30
30
  4. Stage 5: run commands from `.ai-engineering-loop/verification.md`. Keep command, exit code, stdout, test counts. Vague "seems green" is invalid.
31
31
  5. Write artifacts, then spawn. Before Devil's Advocate:
@@ -16,6 +16,10 @@ Finish in at most 4 tool calls, then emit the verdict. Read the Finding Ledger a
16
16
 
17
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.
18
18
 
19
+ AC source is the Goal Contract **file** only. Chat `setuju` and the parent transcript are not AC. Do not PASS because the parent agreed in chat. `CONTEXT_ISOLATION_ONLY` does not relax this.
20
+
21
+ ITERATE if verification is missing, vague, non-zero, proves a different artifact than the AC names, or is only a source grep.
22
+
19
23
  ## Axes
20
24
 
21
25
  Do not merge Spec and Standards into one ranking.
@@ -45,7 +45,7 @@ Run `npx ai-engineering-loop <command>` in the target repo. Do not commit unless
45
45
  ### `/ai-engineering-loop [task]`
46
46
 
47
47
  1. Stage 0: `npx ai-engineering-loop sync-hosts` then `npx ai-engineering-loop status` (init/refresh if missing or stale). Read `.ai-engineering-loop/glossary.md`. If sync-hosts copied files, tell the user a new session is needed for updated skill text; keep going with this session.
48
- 2. Stage 1: Goal Contract (`core/goal-contract.md`). If the task is ambiguous and the user can answer, grill first (`core/grill-policy.md`): design tree, recommended answers, do not ask look-up facts. Skip grill if the contract is already frozen or the user waived it. On `adapter_type: dot`, that grill includes the four-pillar blast radius (state, sibling, approval, queues). Do not run a second interview. Freeze before any production edit. Name test seams. Use glossary terms.
48
+ 2. Stage 1: Goal Contract (`core/goal-contract.md`). If the user asks for ideas, list a short menu and wait; do not implement. If the task is ambiguous and the user can answer, grill first (`core/grill-policy.md`): design tree, recommended answers, do not ask look-up facts. Skip grill if the contract is already frozen or the user waived it. On `adapter_type: dot`, that grill includes the four-pillar blast radius (state, sibling, approval, queues). Do not run a second interview. Chat agreement is not freeze: every user-visible decision must be a numbered AC in the Goal Contract file. Freeze before any production edit. Name test seams. Use glossary terms.
49
49
  3. Stages 2–4: Maker work in the **parent**. Bugs: red repro first (`core/root-cause-analysis.md`). Features: TDD at named seams (`policies/tdd-policy.md`). Surgical diff. Parent may be the Maker; do not spawn Maker as a child if you still need to spawn DA/Judge afterward from the same parent.
50
50
  4. Stage 5: run verification from `.ai-engineering-loop/verification.md`. Keep command, exit code, stdout, test counts. Vague "seems green" is invalid.
51
51
  5. Write artifacts to disk so children do not need parent chat:
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.12-purple.svg)](https://github.com/egagofur/ai-engineering-loop/releases)
9
+ [![Release](https://img.shields.io/badge/release-v1.0.13-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
 
@@ -64,7 +64,7 @@ The 8-stage loop stays one OS. These techniques sit **inside** existing stages (
64
64
 
65
65
  | Stage | Technique | Spec |
66
66
  |---|---|---|
67
- | 1 | Grill until the design-tree frontier is empty, then freeze the Goal Contract. Skip if already frozen, waived, or headless with testable AC. | `core/grill-policy.md` |
67
+ | 1 | Grill until the design-tree frontier is empty, then freeze the Goal Contract. Idea requests: menu, wait, then grill the pick. Chat `setuju` is not freeze; user-visible decisions must be numbered AC in the contract file. | `core/grill-policy.md` |
68
68
  | 1 | Ubiquitous language in `.ai-engineering-loop/glossary.md`; load-bearing choices in `.ai-engineering-loop/adrs/` | `core/repo-config-schema.md` |
69
69
  | 2 | Bugs: red repro → minimise → hypothesise → instrument → fix | `core/root-cause-analysis.md` |
70
70
  | 4–5 | Red-green at named **seams**; no implementation-coupled or tautological tests | `policies/tdd-policy.md` |
@@ -8,6 +8,10 @@ Finish in at most 4 tool calls, then emit the verdict. Read the Finding Ledger a
8
8
 
9
9
  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.
10
10
 
11
+ AC source is the Goal Contract **file** only. Chat `setuju` and the parent transcript are not AC. Do not PASS because the parent agreed in chat. `CONTEXT_ISOLATION_ONLY` does not relax this.
12
+
13
+ ITERATE if verification is missing, vague, non-zero, proves a different artifact than the AC names, or is only a source grep.
14
+
11
15
  ## Axes
12
16
 
13
17
  Do not merge Spec and Standards into one ranking.
@@ -21,7 +21,7 @@ const {
21
21
  formatHostSyncReport
22
22
  } = require('../lib/sync-hosts.js');
23
23
 
24
- const VERSION = '1.0.12';
24
+ const VERSION = '1.0.13';
25
25
  const CWD = process.cwd();
26
26
  const CONTEXT_DIR = path.join(CWD, '.ai-engineering-loop');
27
27
 
@@ -275,7 +275,7 @@ function generateContextFiles(rootDir, discovery, trigger = 'init', impact = 'IN
275
275
 
276
276
  // 0. metadata.json (Baseline)
277
277
  const metadataJson = {
278
- contextVersion: '1.0.12',
278
+ contextVersion: '1.0.13',
279
279
  generatedAt: new Date().toISOString(),
280
280
  repositoryRevision: currentRevision,
281
281
  projectProfile: discovery.profile,
@@ -77,6 +77,9 @@ Every Goal Contract MUST adhere to the following schema in Markdown or structure
77
77
  - Neither the Maker Agent nor the Devil's Advocate Agent may alter Acceptance Criteria during an iteration loop to make tests pass or bypass critique.
78
78
  3. **Contract Amendments**:
79
79
  - If during implementation a fundamental contradiction or impossible requirement is discovered, the agent must trigger **Human Escalation**. Only a human user may amend the Goal Contract.
80
+ 4. **Chat is not the contract**:
81
+ - Parent-transcript `setuju` does not freeze AC.
82
+ - Every user-visible grill decision (order of pages, enable flags, layout) MUST appear as AC-1..N in the contract file before Maker starts.
80
83
 
81
84
  ---
82
85
 
@@ -100,3 +103,5 @@ Every single item listed under `Acceptance Criteria` must map to at least one co
100
103
  - **The Parallel Glossary**: Using 20 words for a concept that already has a term in `glossary.md`.
101
104
  - **The Missing Constraint**: Failing to declare out-of-scope files, leading to arbitrary refactoring of adjacent legacy modules.
102
105
  - **The Self-Serving Goal**: Modifying acceptance criteria post-hoc when tests fail rather than fixing the underlying implementation.
106
+ - **The Chat Contract**: Treating "setuju" in the parent transcript as AC. The file is the contract.
107
+ - **The Wrong Artifact**: Tests pass on a `/tmp` build while the sample the user opens omits the feature.
@@ -21,6 +21,30 @@ Skip grill (write the Goal Contract from what is already known) when any of thes
21
21
 
22
22
  Do not interview the user for **facts** you can look up (files, scripts, types, git). Look them up. Grill only **decisions**.
23
23
 
24
+ ## Idea and menu requests
25
+
26
+ If the user asks for ideas, a feature catalog, or "what should we add" without naming one task:
27
+
28
+ 1. Do not implement.
29
+ 2. Do not freeze a Goal Contract.
30
+ 3. List at most five options. Mark one recommended. Wait for a pick.
31
+ 4. After they pick, grill that one task, then freeze.
32
+
33
+ `/ai-engineering-loop` on an idea request still stays this loop: menu, then grill. Do not switch to a parallel brainstorm product.
34
+
35
+ ## Freeze gate
36
+
37
+ Chat `setuju`, `lanjut`, `ok`, or "looks good" is **not** a freeze.
38
+
39
+ Before Maker starts:
40
+
41
+ 1. Every accepted grill decision that changes user-visible output is a numbered AC in the Goal Contract **file** (page order, enable flags, layout, copy, numbering).
42
+ 2. Each of those ACs names the artifact to inspect (sample path, command, seam).
43
+ 3. Write `.ai-engineering-loop/tasks/goal-contract.md` (or the path this repo uses). Show the AC list.
44
+ 4. Freeze only after that file exists and contains those ACs.
45
+
46
+ If a decision was agreed in chat and is missing from the file, the contract is not frozen. Do not start Maker.
47
+
24
48
  ## DOT adapter (`adapter_type: dot`)
25
49
 
26
50
  On DOT repositories, grill is **one** session that includes the four-pillar blast radius from Antigravity skill `task-impact-inquiry` (`~/.gemini/config/skills/task-impact-inquiry/SKILL.md`). Do not run that skill as a second interview after grill.
@@ -52,13 +52,18 @@ The Judge renders decisions based strictly on **Validity + Severity**, then **re
52
52
  3. Zero open `VALID + BLOCKER` or `VALID + HIGH` findings.
53
53
  4. Any `INVALID` findings are formally dismissed with counter-evidence.
54
54
  5. Any `VALID + MEDIUM/LOW` findings are documented as tradeoffs.
55
+ 6. AC source is **only** the Goal Contract file given to the Judge. Chat agreement is not an AC. `CONTEXT_ISOLATION_ONLY` does not relax this.
56
+ 7. Evidence is for the artifact the AC names (sample path, seam, verification command). A `/tmp` build is not proof of a different user-facing file.
57
+ 8. Source `grep` of implementation files is not AC proof (`policies/tdd-policy.md`).
55
58
 
56
59
  ---
57
60
 
58
61
  ### Verdict 2: `ITERATE`
59
62
  - **Conditions**:
60
- 1. One or more `VALID + BLOCKER` or `VALID + HIGH` findings exist.
61
- 2. Active iteration count $< \text{MAX\_ITERATIONS}$ (default 3).
63
+ 1. One or more `VALID + BLOCKER` or `VALID + HIGH` findings exist (Spec, or Standards with `hardConvention: true`).
64
+ 2. Active iteration count is below MAX_ITERATIONS (default 3).
65
+ 3. Maker or verification cites chat agreement for behavior that is not an AC in the Goal Contract file.
66
+ 4. Evidence is for the wrong artifact, is source-grep only, or does not map to written AC ids.
62
67
  - **Maker Directive**: The Maker must adopt the concrete alternative diff or provide an equivalent verified architectural resolution, authoring regression unit tests.
63
68
 
64
69
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-engineering-loop",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
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": {
@@ -25,6 +25,7 @@ The test reads like a specification of behavior at the seam. Names use `.ai-engi
25
25
 
26
26
  - **Implementation-coupled:** mocks internal collaborators, tests private methods, or asserts through a side channel (raw DB) instead of the seam.
27
27
  - **Tautological:** expected value is computed the same way as the code (`expect(add(a,b)).toBe(a+b)`).
28
+ - **Source grep:** `grep -q 'featureFlag' src/file` is not a test of the AC. Prove behavior at the named seam or on the named artifact.
28
29
  - **Horizontal slicing:** all tests first, then all implementation.
29
30
 
30
31
  ## Evidence
@@ -206,6 +206,33 @@ test('Host skills Stage 0 runs sync-hosts before status', () => {
206
206
  }
207
207
  });
208
208
 
209
+ test('Grill freeze gate and idea menu are in the loop, not a parallel product', () => {
210
+ const grill = readRepo('core/grill-policy.md');
211
+ assert.match(grill, /Idea and menu requests/);
212
+ assert.match(grill, /Do not implement/);
213
+ assert.match(grill, /is \*\*not\*\* a freeze/);
214
+ assert.match(grill, /numbered AC/);
215
+ const contract = readRepo('core/goal-contract.md');
216
+ assert.match(contract, /Chat is not the contract/);
217
+ assert.match(contract, /The Chat Contract/);
218
+ assert.match(contract, /The Wrong Artifact/);
219
+ const judge = readRepo('agents/shared/judge.body.md');
220
+ assert.match(judge, /Goal Contract \*\*file\*\* only/);
221
+ assert.match(judge, /source grep/);
222
+ const tdd = readRepo('policies/tdd-policy.md');
223
+ assert.match(tdd, /Source grep/);
224
+ for (const rel of [
225
+ '.claude/skills/ai-engineering-loop/SKILL.md',
226
+ '.grok/skills/ai-engineering-loop/SKILL.md',
227
+ '.gemini/skills/ai-engineering-loop/SKILL.md',
228
+ '.agents/workflows/ai-engineering-loop.md'
229
+ ]) {
230
+ const text = readRepo(rel);
231
+ assert.match(text, /list a short menu and wait/, rel);
232
+ assert.match(text, /Chat agreement is not freeze/, rel);
233
+ }
234
+ });
235
+
209
236
  test('Host skills absorb grill, TDD, glossary, and two-axis review without splitting the loop', () => {
210
237
  for (const rel of [
211
238
  '.claude/skills/ai-engineering-loop/SKILL.md',