ai-engineering-loop 1.15.0 → 1.16.0

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.
Files changed (39) hide show
  1. package/.agents/skills/ai-engineering-loop/SKILL.md +1 -1
  2. package/.agents/skills/ai-engineering-loop/references/loop-deliver.md +1 -0
  3. package/.agents/skills/ai-engineering-loop/references/loop-hosts.md +5 -1
  4. package/.agents/skills/ai-engineering-loop/references/loop-maker.md +6 -1
  5. package/.agents/skills/ai-engineering-loop/references/loop-review.md +2 -0
  6. package/.claude/skills/ai-engineering-loop/SKILL.md +1 -1
  7. package/.claude/skills/ai-engineering-loop/references/loop-deliver.md +1 -0
  8. package/.claude/skills/ai-engineering-loop/references/loop-hosts.md +5 -1
  9. package/.claude/skills/ai-engineering-loop/references/loop-maker.md +6 -1
  10. package/.claude/skills/ai-engineering-loop/references/loop-review.md +2 -0
  11. package/CHANGELOG.md +36 -0
  12. package/README.md +24 -22
  13. package/adapters/README.md +22 -0
  14. package/adapters/dot/README.md +19 -9
  15. package/adapters/dot/gitlab.md +49 -0
  16. package/adapters/dot/mattermost.md +10 -0
  17. package/adapters/dot/skills/dot-dev-workflow/SKILL.md +27 -5
  18. package/adapters/dot/sonar.md +90 -0
  19. package/adapters/generate-adapter/SKILL.md +6 -5
  20. package/adapters/{dot → quality}/skills/task-impact-inquiry/SKILL.md +10 -7
  21. package/agents/instruction-only/AGENTS.md +24 -0
  22. package/bin/ai-engineering-loop.js +24 -23
  23. package/core/grill-policy.md +1 -1
  24. package/core/orchestration-model.md +11 -0
  25. package/lib/adapter-check.js +102 -0
  26. package/lib/adapter-detect.js +125 -0
  27. package/lib/doctor.js +10 -3
  28. package/lib/gates.js +28 -1
  29. package/lib/generate-adapter.js +6 -30
  30. package/lib/host-skill-build.js +10 -0
  31. package/lib/hosts/commands.js +3 -3
  32. package/lib/hosts/doctor.js +3 -2
  33. package/lib/hosts/registry.js +49 -22
  34. package/lib/hosts/table.js +12 -4
  35. package/lib/orchestration.js +39 -6
  36. package/lib/studio-server.js +1 -0
  37. package/lib/sync-hosts.js +2 -1
  38. package/package.json +1 -1
  39. package/schemas/report.schema.json +52 -5
@@ -52,7 +52,7 @@ Native Subagent Invocation: AVAILABLE
52
52
  Review Method: True Independent Agent
53
53
  ```
54
54
 
55
- When no subagent ran:
55
+ When no subagent ran (tool AVAILABLE: mode adds `(reason: <why>)`):
56
56
 
57
57
  ```
58
58
  Execution Mode: CONTEXT_ISOLATION_ONLY
@@ -1,6 +1,7 @@
1
1
  # Stage 8: Delivery
2
2
 
3
3
  - After Judge PASS, run the `after_pass` hook, then the Stage 8 adapter from `.ai-engineering-loop/adapter.md`.
4
+ - Before any push, run `npx ai-engineering-loop doctor`: `✗ adapter-*` (unknown `adapter_type`, missing spec) must be fixed; `! adapter-*` (gh/glab not logged in, configured type differs from the detected one) needs a human look. `deliver` repeats this check: UNATTENDED stops before writing, ASSISTED only warns.
4
5
  - The PR/MR body includes `Steps to Reproduce & Testing (QA)`; bugfix placeholders must not stay empty. Disclose any `budget record --unavailable`.
5
6
  - Preview remote payloads; never include context packs, usage ledgers, raw logs, or credentials.
6
7
  - ASSISTED: wait for explicit human approval and never infer it. Then one call: `npx ai-engineering-loop deliver --run <runId> --destination <where> --summary <text> --approve --by <name>` (approves READY approval nodes, writes `RUN_DIR/delivery.json` with `humanApproved: true`, runs `gate delivery`). Without `--approve` it refuses in ASSISTED.
@@ -1,6 +1,10 @@
1
1
  # Host rules: subagent tools per host
2
2
 
3
- Read only your host's section, before the first Devil's Advocate (DA) or Judge spawn. Every host shares the loop, budgets, and gates; only the spawn mechanics differ. Modes: `TRUE_INDEPENDENT_AGENT`, `ISOLATED_AGENT_INSTANCE`, `FRESH_PROCESS_AGENT`, `CONTEXT_ISOLATION_ONLY`, `UNAVAILABLE`.
3
+ Read only your host's section, before the first Devil's Advocate (DA) or Judge spawn. Every host shares the loop, budgets, and gates; only the spawn mechanics differ. REPORT_ONLY (`audit`) uses the same spawn tool for one `devil-advocate` report review (`loop-maker`); never report CONTEXT_ISOLATION_ONLY next to an AVAILABLE subagent tool without a reason. Modes: `TRUE_INDEPENDENT_AGENT`, `ISOLATED_AGENT_INSTANCE`, `FRESH_PROCESS_AGENT`, `CONTEXT_ISOLATION_ONLY`, `UNAVAILABLE`.
4
+
5
+ ## Certification tiers
6
+
7
+ `hosts list` and `hosts doctor` show each host's tier (`lib/hosts/registry.js`). **full**: a real `default` recipe run with reviewer subagents and every gate is recorded (`certifiedBy`: recipe, AEL version, date). **experimental**: reviewer subagents install, no recorded run; follow your section below and report the mode you actually got. **instruction-only**: no subagents; run DA and Judge in-session as `CONTEXT_ISOLATION_ONLY`. The compact rules for these hosts: `npx ai-engineering-loop docs AGENTS` (≤2 KB). No host is `full` until such a run is recorded.
4
8
 
5
9
  ## Claude Code (and Kiro-backed strict proxies)
6
10
 
@@ -1,8 +1,13 @@
1
1
  # Stages 2-4: Maker
2
2
 
3
3
  - T1/T2: read `docs tdd-policy` before Maker. Use `npx ai-engineering-loop context query <term>` and `context related <file>` before opening broad source files.
4
- - Branch on mode. REPORT_ONLY: never edit repository files; write `RUN_DIR/report.json` with summary and recommendations, run `gate report`, and stop. ASSISTED: the parent (or intern) is Maker; delivery later needs human approval. UNATTENDED: `sandbox create --run <runId>`, Maker works only in the returned worktreePath, never the parent checkout, then `sandbox capture --run <runId>`.
4
+ - Branch on mode. REPORT_ONLY: never edit repository files; write `RUN_DIR/report.json` with summary and recommendations, then the report review below, run `gate report`, and stop. ASSISTED: the parent (or intern) is Maker; delivery later needs human approval. UNATTENDED: `sandbox create --run <runId>`, Maker works only in the returned worktreePath, never the parent checkout, then `sandbox capture --run <runId>`.
5
5
  - Maker intern: read `maker_intern` from workflow.md (missing or `none` = parent is Maker). Confirm it through the host model catalog; otherwise the parent is Maker and you report INVOCATION_UNAVAILABLE. The intern cannot skip later gates or spawn DA/Judge.
6
6
  - Bugs: red repro first. Features: one red test per AC row, then green.
7
7
  - After package and manifest edits are stable, run `npx ai-engineering-loop refresh` once (drift during red-green is expected; do not refresh per test cycle).
8
8
  - ASSISTED: `npx ai-engineering-loop gate maker --from-git` writes the exact working-tree diff (tracked and new files, excluding `.ai-engineering-loop/`) to `RUN_DIR/diff.patch` and gates it; or write that file yourself and run `gate maker`. UNATTENDED: `sandbox capture` writes it, then `gate maker`. The gate can raise the tier from the diff.
9
+
10
+ ## REPORT_ONLY report review (recipe `audit`)
11
+
12
+ - Host has a subagent tool (`loop-hosts`): spawn ONE fresh `devil-advocate` sibling with report.json and the evidence paths it cites; it challenges unsupported or wrong findings with the usual DA budget. No Judge, no iteration loop: fold accepted findings once, drop rejected ones with evidence. Record `"review": {"executionMode": "TRUE_INDEPENDENT_AGENT", "nativeSubagent": "AVAILABLE", "reviewer": "devil-advocate", "childId": "<its own id>"}`.
13
+ - No subagent tool, or the spawn failed: do the same challenge in this session and record `"executionMode": "CONTEXT_ISOLATION_ONLY"` with `"reason"` (required by `gate report` when `nativeSubagent` is `AVAILABLE`). The header shows `Execution Mode: CONTEXT_ISOLATION_ONLY (reason: <why>)`.
@@ -1,5 +1,7 @@
1
1
  # Stages 6-7: Devil's Advocate and Judge
2
2
 
3
+ REPORT_ONLY runs skip these stages; their single report review is in `loop-maker`.
4
+
3
5
  ## Devil's Advocate (T1, T2)
4
6
 
5
7
  - `npx ai-engineering-loop review-pack --run <runId> --json` returns the DA pack path, fast-path, escalation floor, and tier. Keep the lean path when eligible; add `context devil-advocate <files...>` only for files whose hunks are insufficient. The DA reads that pack or `RUN_DIR/diff.patch` (do not also write `tasks/current.diff`).
@@ -52,7 +52,7 @@ Native Subagent Invocation: AVAILABLE
52
52
  Review Method: True Independent Agent
53
53
  ```
54
54
 
55
- When no subagent ran:
55
+ When no subagent ran (tool AVAILABLE: mode adds `(reason: <why>)`):
56
56
 
57
57
  ```
58
58
  Execution Mode: CONTEXT_ISOLATION_ONLY
@@ -1,6 +1,7 @@
1
1
  # Stage 8: Delivery
2
2
 
3
3
  - After Judge PASS, run the `after_pass` hook, then the Stage 8 adapter from `.ai-engineering-loop/adapter.md`.
4
+ - Before any push, run `npx ai-engineering-loop doctor`: `✗ adapter-*` (unknown `adapter_type`, missing spec) must be fixed; `! adapter-*` (gh/glab not logged in, configured type differs from the detected one) needs a human look. `deliver` repeats this check: UNATTENDED stops before writing, ASSISTED only warns.
4
5
  - The PR/MR body includes `Steps to Reproduce & Testing (QA)`; bugfix placeholders must not stay empty. Disclose any `budget record --unavailable`.
5
6
  - Preview remote payloads; never include context packs, usage ledgers, raw logs, or credentials.
6
7
  - ASSISTED: wait for explicit human approval and never infer it. Then one call: `npx ai-engineering-loop deliver --run <runId> --destination <where> --summary <text> --approve --by <name>` (approves READY approval nodes, writes `RUN_DIR/delivery.json` with `humanApproved: true`, runs `gate delivery`). Without `--approve` it refuses in ASSISTED.
@@ -1,6 +1,10 @@
1
1
  # Host rules: subagent tools per host
2
2
 
3
- Read only your host's section, before the first Devil's Advocate (DA) or Judge spawn. Every host shares the loop, budgets, and gates; only the spawn mechanics differ. Modes: `TRUE_INDEPENDENT_AGENT`, `ISOLATED_AGENT_INSTANCE`, `FRESH_PROCESS_AGENT`, `CONTEXT_ISOLATION_ONLY`, `UNAVAILABLE`.
3
+ Read only your host's section, before the first Devil's Advocate (DA) or Judge spawn. Every host shares the loop, budgets, and gates; only the spawn mechanics differ. REPORT_ONLY (`audit`) uses the same spawn tool for one `devil-advocate` report review (`loop-maker`); never report CONTEXT_ISOLATION_ONLY next to an AVAILABLE subagent tool without a reason. Modes: `TRUE_INDEPENDENT_AGENT`, `ISOLATED_AGENT_INSTANCE`, `FRESH_PROCESS_AGENT`, `CONTEXT_ISOLATION_ONLY`, `UNAVAILABLE`.
4
+
5
+ ## Certification tiers
6
+
7
+ `hosts list` and `hosts doctor` show each host's tier (`lib/hosts/registry.js`). **full**: a real `default` recipe run with reviewer subagents and every gate is recorded (`certifiedBy`: recipe, AEL version, date). **experimental**: reviewer subagents install, no recorded run; follow your section below and report the mode you actually got. **instruction-only**: no subagents; run DA and Judge in-session as `CONTEXT_ISOLATION_ONLY`. The compact rules for these hosts: `npx ai-engineering-loop docs AGENTS` (≤2 KB). No host is `full` until such a run is recorded.
4
8
 
5
9
  ## Claude Code (and Kiro-backed strict proxies)
6
10
 
@@ -1,8 +1,13 @@
1
1
  # Stages 2-4: Maker
2
2
 
3
3
  - T1/T2: read `docs tdd-policy` before Maker. Use `npx ai-engineering-loop context query <term>` and `context related <file>` before opening broad source files.
4
- - Branch on mode. REPORT_ONLY: never edit repository files; write `RUN_DIR/report.json` with summary and recommendations, run `gate report`, and stop. ASSISTED: the parent (or intern) is Maker; delivery later needs human approval. UNATTENDED: `sandbox create --run <runId>`, Maker works only in the returned worktreePath, never the parent checkout, then `sandbox capture --run <runId>`.
4
+ - Branch on mode. REPORT_ONLY: never edit repository files; write `RUN_DIR/report.json` with summary and recommendations, then the report review below, run `gate report`, and stop. ASSISTED: the parent (or intern) is Maker; delivery later needs human approval. UNATTENDED: `sandbox create --run <runId>`, Maker works only in the returned worktreePath, never the parent checkout, then `sandbox capture --run <runId>`.
5
5
  - Maker intern: read `maker_intern` from workflow.md (missing or `none` = parent is Maker). Confirm it through the host model catalog; otherwise the parent is Maker and you report INVOCATION_UNAVAILABLE. The intern cannot skip later gates or spawn DA/Judge.
6
6
  - Bugs: red repro first. Features: one red test per AC row, then green.
7
7
  - After package and manifest edits are stable, run `npx ai-engineering-loop refresh` once (drift during red-green is expected; do not refresh per test cycle).
8
8
  - ASSISTED: `npx ai-engineering-loop gate maker --from-git` writes the exact working-tree diff (tracked and new files, excluding `.ai-engineering-loop/`) to `RUN_DIR/diff.patch` and gates it; or write that file yourself and run `gate maker`. UNATTENDED: `sandbox capture` writes it, then `gate maker`. The gate can raise the tier from the diff.
9
+
10
+ ## REPORT_ONLY report review (recipe `audit`)
11
+
12
+ - Host has a subagent tool (`loop-hosts`): spawn ONE fresh `devil-advocate` sibling with report.json and the evidence paths it cites; it challenges unsupported or wrong findings with the usual DA budget. No Judge, no iteration loop: fold accepted findings once, drop rejected ones with evidence. Record `"review": {"executionMode": "TRUE_INDEPENDENT_AGENT", "nativeSubagent": "AVAILABLE", "reviewer": "devil-advocate", "childId": "<its own id>"}`.
13
+ - No subagent tool, or the spawn failed: do the same challenge in this session and record `"executionMode": "CONTEXT_ISOLATION_ONLY"` with `"reason"` (required by `gate report` when `nativeSubagent` is `AVAILABLE`). The header shows `Execution Mode: CONTEXT_ISOLATION_ONLY (reason: <why>)`.
@@ -1,5 +1,7 @@
1
1
  # Stages 6-7: Devil's Advocate and Judge
2
2
 
3
+ REPORT_ONLY runs skip these stages; their single report review is in `loop-maker`.
4
+
3
5
  ## Devil's Advocate (T1, T2)
4
6
 
5
7
  - `npx ai-engineering-loop review-pack --run <runId> --json` returns the DA pack path, fast-path, escalation floor, and tier. Keep the lean path when eligible; add `context devil-advocate <files...>` only for files whose hunks are insufficient. The DA reads that pack or `RUN_DIR/diff.patch` (do not also write `tasks/current.diff`).
package/CHANGELOG.md CHANGED
@@ -6,6 +6,42 @@ All notable changes to this project are documented here. Versions follow [Semant
6
6
 
7
7
  _No changes yet._
8
8
 
9
+ ## 1.16.0 - 2026-10-16
10
+
11
+ ### Host certification tiers and an instruction-only `AGENTS.md` digest (#60)
12
+
13
+ - **Changed (breaking):** the numeric `tier` in `lib/hosts/registry.js` is replaced by `certification: full | experimental | instruction-only` plus `certifiedBy`. **full** requires a recorded real `default` recipe run with reviewer subagents and every gate (`certifiedBy: { recipe, aelVersion, date }`), and the registry test enforces it. No run is recorded yet, so no host is `full`. The 14 hosts with file-based reviewer agents are `experimental`, and the 6 without (Windsurf/Devin, Amp, Zed, Goose, Cline, Roo) are `instruction-only`. `hosts list --json` returns `certification` instead of `tier`.
14
+ - **Added:** the README host table, `hosts list` and `hosts doctor` show the tier.
15
+ - **Added:** a compact digest for instruction-only hosts, generated from `skill-src/ai-engineering-loop/digest.md` to `agents/instruction-only/AGENTS.md` (at most 2 KB; the build fails above that, and `check:skills` catches drift). Read it with `npx ai-engineering-loop docs AGENTS`. Documented in `references/loop-hosts.md`.
16
+
17
+ ### DOT Stage 8: Sonar quality gate and "Ready to review" card move (#65)
18
+
19
+ - **Added:** `adapters/dot/sonar.md`. After the MR, wait for the pipeline and read the Sonar quality gate from the pipeline's Sonar job or the Sonar MR comment (`glab` only, no tokens). It prints a `Sonar Gate` report. `FAIL` loops back to a fix on the same MR. A project without Sonar is `SKIPPED`, never PASS.
20
+ - **Added:** `adapters/dot/gitlab.md` Step 4 moves the issue card to the "Ready to review" board list after a Sonar PASS/SKIPPED gate and the printed Coreview triage. It only swaps board-list labels, is idempotent, and skips cleanly when no card or list exists (`board_ready_label` in `adapter.md` overrides the label).
21
+ - **Changed:** DOT Stage 8 order is now issue → MR → pipeline + Sonar gate → Coreview triage → card to "Ready to review" → Mattermost (`adapters/dot/README.md`, `mattermost.md` preconditions, `dot-dev-workflow` Stages 8a–8e). A Sonar `FAIL` blocks both the card move and the notification.
22
+
23
+ ### `task-impact-inquiry` is adapter-neutral (#64)
24
+
25
+ - **Changed:** the skill moved from `adapters/dot/skills/` to `adapters/quality/skills/task-impact-inquiry/` (still installed by default, not part of the opt-in `quality` pack). Its triggers are now English plus Indonesian, and the DOT-only process references (`dot-dev-workflow`, BullMQ) were replaced with neutral wording. `sync-hosts` installs global skill folders that every project shares, so gating on one project's `adapter_type` could not be correct; neutral content was the safe option. On `adapter_type: dot` the blast-radius grill stays mandatory (`core/grill-policy.md`, `adapters/dot/README.md`).
26
+
27
+ ### Adapter checks in `doctor` and a `deliver` preflight (#63)
28
+
29
+ - **Added:** `doctor` run inside an initialized project now checks the adapter: unknown `adapter_type` (error, with a "did you mean" suggestion), a missing spec (error), `gh`/`glab` missing or not logged in for the chosen type (warning; `dot` checks the DOT host), a missing `adapter.md` (warning), and a configured type that differs from the shared detector (warning). Warnings print with `!` and do not make doctor fail. Doctor on the package itself is unchanged.
30
+ - **Added:** `deliver` runs the same checks before it approves or writes anything. UNATTENDED fails with `ADAPTER_PREFLIGHT_FAILED` on any problem except the detector mismatch; ASSISTED prints warnings and continues.
31
+
32
+ ### One adapter detector for `init`, `generate-adapter` and Studio (#62)
33
+
34
+ - **Fixed:** `generate-adapter` and Studio recommended `gitlab` for a DOT GitLab remote while `init` chose `dot`, so accepting their recommendation silently dropped the DOT pipeline. All three now call `lib/adapter-detect.js` and agree.
35
+ - **Changed:** the remote host now wins over CI files. A GitHub remote without `.github/workflows/` is `github` (was `standard`); CI files only decide when the remote host is unknown or missing.
36
+ - **Changed:** the `origin` remote is read (fallback: the first remote) instead of the first `url =` line in `.git/config`, so submodule URLs and `upstream` no longer win. Linked worktrees (`.git` is a file) are detected.
37
+ - **Added:** `generate-adapter` prints the reason next to `recommended:`, Studio's bootstrap returns `adapters.reason`, and `init` records it in the context evidence.
38
+
39
+ ### Audit / REPORT_ONLY review policy and a non-contradictory header (#57)
40
+
41
+ - **Fixed:** the execution header could say `Execution Mode: CONTEXT_ISOLATION_ONLY` next to `Native Subagent Invocation: AVAILABLE` with no explanation, for example on recipe `audit` runs in Antigravity. Now the mode line carries the reason: `CONTEXT_ISOLATION_ONLY (reason: <why>)`. The independent and no-subagent headers are unchanged.
42
+ - **Changed:** recipe `audit` (REPORT_ONLY) used to skip review entirely, because only Maker runs reach DA and Judge. When the host can invoke a subagent, one fresh `devil-advocate` sibling now challenges `report.json` before `gate report` (no Judge, no iteration loop). Otherwise the same check runs in-session with a reason. The policy is documented in `references/loop-maker.md`, `loop-hosts.md`, `loop-review.md`, and `core/orchestration-model.md`.
43
+ - **Added:** an optional `review` block in `report.json`. `gate report` validates it: an independent mode needs `reviewer: devil-advocate` plus the reviewer's own `childId`, and `CONTEXT_ISOLATION_ONLY` with `nativeSubagent: AVAILABLE` needs `reason`. Reports without the block stay valid.
44
+
9
45
  ## 1.15.0 - 2026-10-11
10
46
 
11
47
  ### Multi-agent hosts: `setup` suggests `auto` detection mode (#54 decision 4)
package/README.md CHANGED
@@ -167,28 +167,30 @@ Under the hood, these moments use eight evidence-backed stages. The rigor is the
167
167
  AI Engineering Loop is designed to work with the tools developers already use:
168
168
 
169
169
  <!-- hosts-table:start (generated from lib/hosts/registry.js; run npm run build:hosts-table) -->
170
- | Host | id | Skill folder | Reviewer agents | Detected by |
171
- |---|---|---|---|---|
172
- | Claude Code | `claude` | `~/.claude/skills` | `~/.claude/agents` | `~/.claude`, `claude` |
173
- | Codex CLI | `codex` | `~/.agents/skills` (shared) | `~/.codex/agents` | `~/.codex`, `codex` |
174
- | Gemini CLI | `gemini` | `~/.agents/skills` (shared) | `~/.gemini/agents` | `~/.gemini`, `gemini` |
175
- | Antigravity (IDE / 2.0) | `antigravity` | `~/.gemini/config/skills` | `~/.gemini/config/agents` | `~/.gemini/antigravity`, `antigravity` |
176
- | Antigravity CLI (agy) | `antigravity-cli` | `~/.gemini/antigravity-cli/skills` | `~/.gemini/config/agents` | `~/.gemini/antigravity-cli`, `agy` |
177
- | Grok CLI | `grok` | `~/.agents/skills` (shared) | `~/.grok/agents` | `~/.grok`, `grok` |
178
- | Cursor (editor + CLI) | `cursor` | `~/.agents/skills` (shared) | `~/.cursor/agents` | `~/.cursor`, `cursor-agent`, `cursor` |
179
- | GitHub Copilot (CLI / VS Code) | `copilot` | `~/.agents/skills` (shared) | `~/.copilot/agents` | `~/.copilot`, `copilot` |
180
- | OpenCode | `opencode` | `~/.agents/skills` (shared) | `~/.config/opencode/agents` | `~/.config/opencode`, `opencode` |
181
- | Windsurf / Devin Desktop | `windsurf` | `~/.agents/skills` (shared) | none (in-session review) | `~/.codeium/windsurf`, `~/.config/devin` |
182
- | Amp | `amp` | `~/.agents/skills` (shared) | none (in-session review) | `~/.config/amp`, `amp` |
183
- | Factory Droid | `factory` | `~/.agents/skills` (shared) | `~/.factory/droids` | `~/.factory`, `droid` |
184
- | Augment (Auggie) | `augment` | `~/.agents/skills` (shared) | `~/.augment/agents` | `~/.augment`, `auggie` |
185
- | Zed | `zed` | `~/.agents/skills` (shared) | none (in-session review) | `~/.config/zed`, `~/Library/Application Support/Zed`, `zed` |
186
- | Goose | `goose` | `~/.agents/skills` (shared) | none (in-session review) | `~/.config/goose`, `goose` |
187
- | Cline | `cline` | `~/.cline/skills` | none (in-session review) | `~/.cline`, `cline` |
188
- | Roo Code | `roo` | `~/.agents/skills` (shared) | none (in-session review) | `~/.roo` |
189
- | Kiro (IDE + CLI) | `kiro` | `~/.kiro/skills` | `~/.kiro/agents` | `~/.kiro`, `kiro-cli`, `kiro` |
190
- | Qwen Code | `qwen` | `~/.qwen/skills` | `~/.qwen/agents` | `~/.qwen`, `qwen` |
191
- | JetBrains Junie | `junie` | `~/.agents/skills` (shared) | `~/.junie/agents` | `~/.junie`, `junie` |
170
+ | Host | id | Certification | Skill folder | Reviewer agents | Detected by |
171
+ |---|---|---|---|---|---|
172
+ | Claude Code | `claude` | experimental | `~/.claude/skills` | `~/.claude/agents` | `~/.claude`, `claude` |
173
+ | Codex CLI | `codex` | experimental | `~/.agents/skills` (shared) | `~/.codex/agents` | `~/.codex`, `codex` |
174
+ | Gemini CLI | `gemini` | experimental | `~/.agents/skills` (shared) | `~/.gemini/agents` | `~/.gemini`, `gemini` |
175
+ | Antigravity (IDE / 2.0) | `antigravity` | experimental | `~/.gemini/config/skills` | `~/.gemini/config/agents` | `~/.gemini/antigravity`, `antigravity` |
176
+ | Antigravity CLI (agy) | `antigravity-cli` | experimental | `~/.gemini/antigravity-cli/skills` | `~/.gemini/config/agents` | `~/.gemini/antigravity-cli`, `agy` |
177
+ | Grok CLI | `grok` | experimental | `~/.agents/skills` (shared) | `~/.grok/agents` | `~/.grok`, `grok` |
178
+ | Cursor (editor + CLI) | `cursor` | experimental | `~/.agents/skills` (shared) | `~/.cursor/agents` | `~/.cursor`, `cursor-agent`, `cursor` |
179
+ | GitHub Copilot (CLI / VS Code) | `copilot` | experimental | `~/.agents/skills` (shared) | `~/.copilot/agents` | `~/.copilot`, `copilot` |
180
+ | OpenCode | `opencode` | experimental | `~/.agents/skills` (shared) | `~/.config/opencode/agents` | `~/.config/opencode`, `opencode` |
181
+ | Windsurf / Devin Desktop | `windsurf` | instruction-only | `~/.agents/skills` (shared) | none (in-session review) | `~/.codeium/windsurf`, `~/.config/devin` |
182
+ | Amp | `amp` | instruction-only | `~/.agents/skills` (shared) | none (in-session review) | `~/.config/amp`, `amp` |
183
+ | Factory Droid | `factory` | experimental | `~/.agents/skills` (shared) | `~/.factory/droids` | `~/.factory`, `droid` |
184
+ | Augment (Auggie) | `augment` | experimental | `~/.agents/skills` (shared) | `~/.augment/agents` | `~/.augment`, `auggie` |
185
+ | Zed | `zed` | instruction-only | `~/.agents/skills` (shared) | none (in-session review) | `~/.config/zed`, `~/Library/Application Support/Zed`, `zed` |
186
+ | Goose | `goose` | instruction-only | `~/.agents/skills` (shared) | none (in-session review) | `~/.config/goose`, `goose` |
187
+ | Cline | `cline` | instruction-only | `~/.cline/skills` | none (in-session review) | `~/.cline`, `cline` |
188
+ | Roo Code | `roo` | instruction-only | `~/.agents/skills` (shared) | none (in-session review) | `~/.roo` |
189
+ | Kiro (IDE + CLI) | `kiro` | experimental | `~/.kiro/skills` | `~/.kiro/agents` | `~/.kiro`, `kiro-cli`, `kiro` |
190
+ | Qwen Code | `qwen` | experimental | `~/.qwen/skills` | `~/.qwen/agents` | `~/.qwen`, `qwen` |
191
+ | JetBrains Junie | `junie` | experimental | `~/.agents/skills` (shared) | `~/.junie/agents` | `~/.junie`, `junie` |
192
+
193
+ Certification: **full** = a real `default` recipe run with reviewer subagents and every gate is recorded for this host; **experimental** = reviewer subagents install, no recorded run; **instruction-only** = no subagents, review runs in-session (`CONTEXT_ISOLATION_ONLY`; compact digest: `npx ai-engineering-loop docs AGENTS`).
192
194
 
193
195
  Not supported (no native skills): Aider, Continue.
194
196
  <!-- hosts-table:end -->
@@ -13,6 +13,28 @@ An adapter is not a second engineering OS. It runs **after Judge `PASS`**. It mu
13
13
  | **`gitlab`** | GitLab.com or self-hosted GitLab (not DOT) | [`gitlab/`](gitlab/) |
14
14
  | **`dot`** | DOT delivery (GitLab + multi-branch + Coreview + Mattermost) | [`dot/`](dot/) |
15
15
 
16
+ `init`, `generate-adapter` and Studio share one detector (`lib/adapter-detect.js`):
17
+
18
+ 1. The `origin` remote host (or the first remote; worktrees work): the DOT GitLab host → `dot`, `github.com` → `github`, other GitLab hosts → `gitlab`.
19
+ 2. If the remote says nothing: `.github/workflows/` → `github`, `.gitlab-ci.yml` → `gitlab`.
20
+ 3. Otherwise `standard`.
21
+
22
+ Each prints the reason it chose a type.
23
+
24
+ ## Check
25
+
26
+ `npx ai-engineering-loop doctor` in a project checks the adapter:
27
+
28
+ | Check | Level | Meaning |
29
+ |---|---|---|
30
+ | `adapter-type` | error | `adapter_type` is not `standard`, `github`, `gitlab`, `dot` or `custom` (suggests the nearest) |
31
+ | `adapter-spec` | error | `adapters/<type>/README.md` (or `.ai-engineering-loop/adapter/delivery.md` for `custom`) is missing |
32
+ | `adapter-auth` | warn | `github` needs `gh auth status`; `gitlab` needs `glab auth status`; `dot` needs `glab auth status --hostname <DOT host>` |
33
+ | `adapter-detected` | warn | configured type differs from the detector |
34
+ | `adapter-config` | warn | no `.ai-engineering-loop/adapter.md` |
35
+
36
+ `deliver` runs the same checks first. UNATTENDED stops on any of them except `adapter-detected`, before writing anything. ASSISTED prints them and continues.
37
+
16
38
  Pick one with `npx ai-engineering-loop generate-adapter`. The agent **asks** (grill). Do not copy a neighbour's adapter.
17
39
 
18
40
  Custom tools (Linear, Slack, Bitbucket): still start from `standard`, then name those tools in `.ai-engineering-loop/adapter.md`. Do not put secrets in the file.
@@ -16,18 +16,24 @@ flowchart TD
16
16
  PASS --> Issue[1. GitLab Issue Card via glab]
17
17
  Issue --> BaseMR[2. One Merge Request via glab]
18
18
  BaseMR --> AskPropagate{User named extra envs this turn?}
19
- AskPropagate -->|No| CoreviewTriage[3. External @coreview-bot Review Triage]
19
+ AskPropagate -->|No| Gate[3. Pipeline + Sonar quality gate]
20
20
  AskPropagate -->|Yes| MultiBranch[Optional cherry-pick staging / develop]
21
- MultiBranch --> CoreviewTriage
22
- CoreviewTriage --> MattermostDispatch[4. Mattermost Markdown Notification via MCP]
21
+ MultiBranch --> Gate
22
+ Gate -->|FAIL| Fix[Fix on the same MR, push]
23
+ Fix --> Gate
24
+ Gate -->|PASS or SKIPPED| CoreviewTriage[4. External @coreview-bot Review Triage]
25
+ CoreviewTriage --> Ready[5. Move card to Ready to review]
26
+ Ready --> MattermostDispatch[6. Mattermost Markdown Notification via MCP]
23
27
  end
24
28
  ```
25
29
 
30
+ **Stage 8 order:** issue → MR → pipeline + Sonar gate → Coreview triage → card to "Ready to review" → Mattermost. A Sonar `FAIL` blocks the card move and the notification until a new pipeline passes.
31
+
26
32
  ---
27
33
 
28
34
  ## 2. Adapter Modules
29
35
 
30
- The DOT adapter is organized into four dedicated specification modules:
36
+ The DOT adapter is organized into five specification modules:
31
37
 
32
38
  1. **[GitLab Integration (`gitlab.md`)](gitlab.md)**:
33
39
  - CLI automation with `glab`.
@@ -38,11 +44,15 @@ The DOT adapter is organized into four dedicated specification modules:
38
44
  - Related `feat/…` or `fix/…`: stay. One MR. Do not open three MRs.
39
45
  - Base: `origin/develop` when develop is in use (default branch is `develop`), including when HEAD is `main`. HEAD being `main` does not override an in-use `develop` default. `origin/main` only when develop is unused leftover (default branch is `main` / `master`). Do not force leftover develop.
40
46
  - Cherry-pick extra envs only if the user named them this turn. Chat `setuju` is not propagate.
41
- 3. **[Coreview External Reviewer Triage (`coreview.md`)](coreview.md)**:
47
+ 3. **[Pipeline and Sonar Quality Gate (`sonar.md`)](sonar.md)**:
48
+ - Wait for the MR pipeline, read the Sonar quality gate from the pipeline job or the MR comment (`glab` only).
49
+ - `FAIL` loops back to a fix on the same MR; it blocks the card move and Mattermost. No Sonar → `SKIPPED`, never a silent PASS.
50
+ 4. **[Coreview External Reviewer Triage (`coreview.md`)](coreview.md)**:
42
51
  - Ingestion of `@coreview-bot` automated PR comments.
43
52
  - Mandatory Phase 8 Triage reporting gate before Mattermost dispatch.
44
53
  - Rigorous evaluation of bot suggestions into `VALID` (fix on the same topic MR; do not cherry-pick unless the user named extra envs this turn) vs `HALU` (false positive pushback) using principles from `gitlab-mr-feedback` and `receiving-code-review`.
45
- 4. **[Mattermost Notifications (`mattermost.md`)](mattermost.md)**:
54
+ - After triage: move the issue card to **"Ready to review"** (`gitlab.md` Step 4; idempotent, skips when no card is linked).
55
+ 5. **[Mattermost Notifications (`mattermost.md`)](mattermost.md)**:
46
56
  - Repository-to-channel resolution using persistent configuration.
47
57
  - MCP `mattermost_send_message` dispatch with mandatory `from: "AI Agent"` attribution.
48
58
  - Environment-tagged Markdown blocks (`[MR DEV]`, `[MR STAGING]`, `[MR MAIN]`) formatted with strict **`no-ai-slop`** human-written standards.
@@ -51,16 +61,16 @@ The DOT adapter is organized into four dedicated specification modules:
51
61
 
52
62
  ## 3. Official DOT Engineering Skills Integration
53
63
 
54
- This adapter composes the DOT skill suite. `task-impact-inquiry` ships in this package (`adapters/dot/skills/task-impact-inquiry/`) and `sync-hosts` upserts it to Claude, Grok, and Gemini. Other DOT skills (router, workflow) still update-if-exists only.
64
+ This adapter composes the DOT skill suite. `task-impact-inquiry` is adapter-neutral and ships in `adapters/quality/skills/task-impact-inquiry/`; `sync-hosts` upserts it to every enabled host. On DOT repos it is mandatory in Stage 1. Other DOT skills (router, workflow) still update-if-exists only.
55
65
 
56
- On a DOT repo (`adapter_type: dot`), **run `ai-engineering-loop`**, not the old 9-phase `dot-dev-workflow`, as the engineering OS. Stage 1 grill **includes** `task-impact-inquiry`. Do not run a second interview. After Judge `PASS`, Stage 8 is `dot-dev-workflow` delivery (GitLab, cherry-pick, Coreview, Mattermost). Canonical copies: `adapters/dot/skills/`. See `core/grill-policy.md`.
66
+ On a DOT repo (`adapter_type: dot`), **run `ai-engineering-loop`**, not the old 9-phase `dot-dev-workflow`, as the engineering OS. Stage 1 grill **includes** `task-impact-inquiry`. Do not run a second interview. After Judge `PASS`, Stage 8 is `dot-dev-workflow` delivery (GitLab, cherry-pick, Coreview, Mattermost). Canonical DOT copies: `adapters/dot/skills/` (`task-impact-inquiry`: `adapters/quality/skills/`). See `core/grill-policy.md`.
57
67
 
58
68
  | Skill | Primary Role & Governance |
59
69
  | :--- | :--- |
60
70
  | **`ai-engineering-loop`** | Engineering OS (Stages 0-7). Use this for DOT bugfix/feature/refactor. |
61
71
  | **`dot-dev-workflow`** | Stage 8 delivery only after Judge PASS. Not a parallel engineering loop. |
62
72
  | **`dot-dev-skill-router`** | Routes commit-bound DOT work to `ai-engineering-loop`, then Stage 8. |
63
- | **`task-impact-inquiry`** | Business blast radius (lifecycle sketch, four pillars, ASCII picture). Canonical: `adapters/dot/skills/task-impact-inquiry/`. Host copies: `~/.claude/skills/`, `~/.agents/skills/` (Codex, Gemini CLI, Grok, and other shared-folder hosts), `~/.gemini/config/skills/` (Antigravity). Fills Stage 1 grill; impact-only stops after the matrix. Not a parallel OS. |
73
+ | **`task-impact-inquiry`** | Business blast radius (lifecycle sketch, four pillars, ASCII picture). Canonical: `adapters/quality/skills/task-impact-inquiry/` (adapter-neutral, EN + ID triggers). Host copies: `~/.claude/skills/`, `~/.agents/skills/` (Codex, Gemini CLI, Grok, and other shared-folder hosts), `~/.gemini/config/skills/` (Antigravity). Fills Stage 1 grill; impact-only stops after the matrix. Not a parallel OS. |
64
74
  | **`backend-development`** | Framework-agnostic backend guidelines (clean naming, database queries, security, error handling). |
65
75
  | **`backend-safety-guardrails`** | 6 architectural backend safety invariants (queue bypass, BigInt, status recalculation loops). |
66
76
  | **`devils-advocate`** | Legacy DOT pre-commit skill. On AEL, Stages 6-7 are package Devil's Advocate + Judge. Do not re-run this skill after Judge PASS. |
@@ -20,6 +20,9 @@ flowchart TD
20
20
 
21
21
  PushBranch --> CreateMR[Create Merge Request via glab]
22
22
  CreateMR --> CaptureMR[Capture MR URL & ID for Multi-Branch / Bot Triage]
23
+ CaptureMR --> Gate[Pipeline + Sonar gate: sonar.md]
24
+ Gate --> Triage[Coreview triage: coreview.md]
25
+ Triage --> Ready[Move card to Ready to review: Step 4]
23
26
  ```
24
27
 
25
28
  ---
@@ -150,3 +153,49 @@ glab mr create \
150
153
  ## Note for Deployment
151
154
  - No manual database migrations required. (or specify migration command if applicable)
152
155
  ```
156
+
157
+ ---
158
+
159
+ ## 6. Step 4: Move the Card to "Ready to review"
160
+
161
+ Run this only when all three hold:
162
+
163
+ 1. The MR pipeline passed and the Sonar gate is PASS or SKIPPED ([`sonar.md`](sonar.md)).
164
+ 2. The Coreview triage report is printed ([`coreview.md`](coreview.md)).
165
+ 3. An issue is linked to this MR (Step 2).
166
+
167
+ If the Sonar gate is FAIL, stop here. Do not move the card, and do not notify.
168
+
169
+ ### A. No card linked: skip cleanly
170
+
171
+ If Step 2 found no issue and none was created (for example, the tracker is not this repo and the user did not name one), print `Card: none linked (skipped)` and continue to Mattermost. Do not create an issue just to move it.
172
+
173
+ ### B. Read the board lists and the card's current labels
174
+
175
+ GitLab board columns are labels. Find the label of the "Ready to review" list and of every other list:
176
+
177
+ ```bash
178
+ glab api "projects/:fullpath/boards" # lists[].label.name per board
179
+ glab api "projects/:fullpath/issues/<issue-iid>" # labels[] on the card
180
+ ```
181
+
182
+ The target label is the list label whose name equals `Ready to review` (case-insensitive). If `.ai-engineering-loop/adapter.md` names `board_ready_label`, use that instead. No such list on any board: print `Card: no "Ready to review" list (skipped)` and continue.
183
+
184
+ ### C. Move it (idempotent)
185
+
186
+ - The card already has the target label and no other list label: print `Card: already in Ready to review` and do nothing.
187
+ - Otherwise add the target label and remove only the **other board-list labels** currently on the card. Leave every non-list label alone.
188
+
189
+ ```bash
190
+ glab issue update <issue-iid> --repo <repo> \
191
+ --label "Ready to review" \
192
+ --unlabel "<other list label currently on the card>"
193
+ ```
194
+
195
+ Re-read the issue and print:
196
+
197
+ ```text
198
+ Card: #<issue-iid> -> Ready to review (removed: <labels or none>)
199
+ ```
200
+
201
+ Running Step 4 twice must not change anything the second time.
@@ -8,6 +8,16 @@ This gives QA, product, and reviewers visibility when the delivery pipeline fini
8
8
 
9
9
  ---
10
10
 
11
+ ## 2. Preconditions (gate)
12
+
13
+ Send only after all of these are printed in the conversation:
14
+
15
+ 1. Sonar Gate report with `Quality gate: PASS` or `SKIPPED` ([`sonar.md`](sonar.md)). On `FAIL`, do not send.
16
+ 2. Phase 8 Triage report ([`coreview.md`](coreview.md)).
17
+ 3. Card line from [`gitlab.md`](gitlab.md) Step 4 (`-> Ready to review`, `already in Ready to review`, or `skipped`).
18
+
19
+ ---
20
+
11
21
  ## 2. Channel Resolution & Dispatch Flow
12
22
 
13
23
  ```text
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dot-dev-workflow
3
- description: DOT Stage 8 delivery after AI Engineering Loop Judge PASS. GitLab issue/MR, one topic-branch MR (extra env cherry-pick only if named this turn), Coreview triage, Mattermost. Not a substitute for ai-engineering-loop.
3
+ description: DOT Stage 8 delivery after AI Engineering Loop Judge PASS. GitLab issue/MR, one topic-branch MR (extra env cherry-pick only if named this turn), pipeline + Sonar gate, Coreview triage, card to Ready to review, Mattermost. Not a substitute for ai-engineering-loop.
4
4
  ---
5
5
 
6
6
  # DOT Delivery Workflow (Stage 8)
@@ -22,7 +22,7 @@ If `ai-engineering-loop` is missing on this host, say so and stop. Do not silent
22
22
  | Phase 2 impact inquiry | AEL Stage 1 grill + `task-impact-inquiry` |
23
23
  | Phase 3-5 code / tests / tsc | AEL Stages 4-5 (`policies/tdd-policy.md`, `.ai-engineering-loop/verification.md`) |
24
24
  | Phase 6 `devils-advocate` | AEL Stages 6-7 (Finding Ledger + Judge PASS/ITERATE/ESCALATE) |
25
- | Phase 7-9 glab / Coreview / Mattermost | **This skill** (AEL Stage 8). Prefer `adapters/dot/` in the AEL package when present. |
25
+ | Phase 7-9 glab / Sonar / Coreview / board / Mattermost | **This skill** (AEL Stage 8). Prefer `adapters/dot/` in the AEL package when present. |
26
26
 
27
27
  `git commit`, `git push`, and `glab mr create` are forbidden until Judge `PASS`.
28
28
 
@@ -63,7 +63,23 @@ git commit -m "<type>(<scope>): <summary>"
63
63
 
64
64
  ---
65
65
 
66
- ## Stage 8b — Coreview and MR discussions
66
+ ## Stage 8b — Pipeline and Sonar gate
67
+
68
+ Follow `adapters/dot/sonar.md` when present. Wait for the MR pipeline, then read the Sonar quality gate from the pipeline's Sonar job (`glab ci trace <job-id>`) or the Sonar MR comment (`glab mr view <id> --comments`). Print:
69
+
70
+ ```text
71
+ Sonar Gate
72
+ MR: !<id>
73
+ Pipeline: #<id> <passed|failed>
74
+ Quality gate: <PASS | FAIL | SKIPPED>
75
+ Action: <none | fix>
76
+ ```
77
+
78
+ FAIL: fix on the same topic MR, re-verify, push, wait for the new pipeline. While FAIL, do not move the card and do not send Mattermost. No Sonar on the project is `SKIPPED`, never PASS. Use `glab` only; no tokens in prompts.
79
+
80
+ ---
81
+
82
+ ## Stage 8c — Coreview and MR discussions
67
83
 
68
84
  Follow `adapters/dot/coreview.md` when present, plus `gitlab-mr-feedback` and `receiving-code-review`.
69
85
 
@@ -91,9 +107,15 @@ glab api "projects/:fullpath/merge_requests/<mr-id>/discussions/<discussion_id>/
91
107
 
92
108
  ---
93
109
 
94
- ## Stage 8c — Mattermost (`no-ai-slop`)
110
+ ## Stage 8d — Card to "Ready to review"
111
+
112
+ Follow `adapters/dot/gitlab.md` Step 4 when present. Only after Sonar PASS/SKIPPED and the printed triage. No linked card: print `Card: none linked (skipped)`. Otherwise add the `Ready to review` list label and remove only other board-list labels (`glab issue update <iid> --label "Ready to review" --unlabel "<old list label>"`). Already there: change nothing.
113
+
114
+ ---
115
+
116
+ ## Stage 8e — Mattermost (`no-ai-slop`)
95
117
 
96
- Follow `adapters/dot/mattermost.md` when present.
118
+ Follow `adapters/dot/mattermost.md` when present. Send only after the Sonar Gate (PASS/SKIPPED), triage, and card lines are printed.
97
119
 
98
120
  1. Resolve channel and PIC from `~/.gemini/config/mattermost-channel-mapping.json`. If PIC is missing, ask the user and save it.
99
121
  2. Send via MCP `mattermost_send_message` with `from: "AI Agent"`. Use the Mattermost CLI only if MCP fails. Do not send twice.
@@ -0,0 +1,90 @@
1
+ # DOT Adapter: Pipeline and Sonar Quality Gate
2
+
3
+ ## 1. Purpose
4
+
5
+ After the MR exists, the MR pipeline and its Sonar quality gate must pass **before** Coreview triage closes, the card moves to "Ready to review", or Mattermost is sent. A green unit-test run on your machine is not a passed quality gate.
6
+
7
+ Use `glab` only. Do not paste tokens, Sonar URLs with tokens, or `SONAR_TOKEN` into prompts, commands, or notes.
8
+
9
+ ---
10
+
11
+ ## 2. Flow
12
+
13
+ ```text
14
+ MR created (gitlab.md Step 3)
15
+ -> wait for the MR pipeline to finish
16
+ -> pipeline failed -> FAIL (fix, push, wait again)
17
+ -> pipeline passed
18
+ -> Sonar result found -> PASS | FAIL
19
+ -> no Sonar on this repo -> SKIPPED (say so; not PASS)
20
+ -> FAIL: do not move the card, do not notify; loop back
21
+ -> PASS or SKIPPED: continue to coreview.md
22
+ ```
23
+
24
+ ---
25
+
26
+ ## 3. Step 1: Wait for the MR pipeline
27
+
28
+ ```bash
29
+ glab ci status --branch <branch-name> --repo <repo>
30
+ glab ci view <branch-name> --repo <repo> # interactive, optional
31
+ glab api "projects/:fullpath/merge_requests/<mr-iid>/pipelines"
32
+ ```
33
+
34
+ Take the newest pipeline for the MR's head commit. `running` / `pending`: wait and check again. Do not report the gate while the pipeline is still running.
35
+
36
+ ---
37
+
38
+ ## 4. Step 2: Read the Sonar quality gate
39
+
40
+ Check both sources. Use whichever the project has.
41
+
42
+ **A. Sonar job in the pipeline** (for example `sonarqube-check`, `sonar`, any job whose name contains `sonar`):
43
+
44
+ ```bash
45
+ glab api "projects/:fullpath/pipelines/<pipeline-id>/jobs"
46
+ glab ci trace <job-id> --repo <repo>
47
+ ```
48
+
49
+ `failed` job, or a log line like `QUALITY GATE STATUS: FAILED` → FAIL. `success` with `QUALITY GATE STATUS: PASSED` → PASS.
50
+
51
+ **B. Sonar comment on the MR** (Sonar's MR decoration bot):
52
+
53
+ ```bash
54
+ glab mr view <mr-iid> --comments --repo <repo>
55
+ ```
56
+
57
+ The newest Sonar note for the current head commit decides: "Quality Gate passed" → PASS, "Quality Gate failed" → FAIL. An older note for an earlier commit does not count.
58
+
59
+ Neither source present → `SKIPPED (no Sonar on this project)`. Do not invent a PASS.
60
+
61
+ ---
62
+
63
+ ## 5. Step 3: Print the gate report (mandatory)
64
+
65
+ ```text
66
+ Sonar Gate
67
+ MR: !<mr-iid>
68
+ Pipeline: #<pipeline-id> <passed|failed>
69
+ Source: <job <name> | MR comment | none>
70
+ Quality gate: <PASS | FAIL | SKIPPED>
71
+ New issues: <n or list, from the job log / comment>
72
+ Coverage on new code: <value or n/a>
73
+ Action: <none | fix>
74
+ ```
75
+
76
+ ---
77
+
78
+ ## 6. On FAIL: loop back
79
+
80
+ 1. List the new issues and the coverage gap from the job log or comment, with file paths.
81
+ 2. Fix surgically on the same topic branch. Re-run the commands in `.ai-engineering-loop/verification.md`.
82
+ 3. Commit and push to the same MR. Do not cherry-pick unless the user named extra envs this turn.
83
+ 4. Go back to Step 1 and wait for the new pipeline.
84
+
85
+ While the gate is FAIL:
86
+
87
+ - Do **not** move the card to "Ready to review" (`gitlab.md` Step 4).
88
+ - Do **not** send Mattermost (`mattermost.md`).
89
+
90
+ If the fix would change the frozen Goal Contract's behavior, stop and ask the user. Do not widen scope to make Sonar green.
@@ -50,12 +50,13 @@ Or run `npx ai-engineering-loop generate-adapter` and use its detected block.
50
50
 
51
51
  Cite the remote host. Do not ask what git already shows.
52
52
 
53
- Recommended type:
53
+ Recommended type (same rules as `init` and Studio; the CLI prints the reason):
54
54
 
55
- - `github.com` → `github`
56
- - GitLab host that is not a named company adapter → `gitlab`
57
- - no remote / unknown → `standard`
58
- - user said they need the DOT pipeline → `dot` (load `adapters/dot/`, do not invent extra tools)
55
+ 1. `origin` remote host (else the first remote): DOT GitLab host → `dot`, `github.com` → `github`, any other host with `gitlab` in it → `gitlab`
56
+ 2. unknown or no remote: `.github/workflows/` → `github`, `.gitlab-ci.yml` → `gitlab`
57
+ 3. otherwise → `standard`
58
+
59
+ Do not downgrade a `dot` recommendation to `gitlab`. `dot` loads `adapters/dot/`; do not invent extra tools.
59
60
 
60
61
  ### 2. Grill (wait)
61
62