ai-engineering-loop 1.15.0 → 1.17.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.
- package/.agents/skills/ai-engineering-loop/SKILL.md +1 -1
- package/.agents/skills/ai-engineering-loop/references/loop-deliver.md +3 -1
- package/.agents/skills/ai-engineering-loop/references/loop-goal.md +1 -0
- package/.agents/skills/ai-engineering-loop/references/loop-hosts.md +5 -1
- package/.agents/skills/ai-engineering-loop/references/loop-maker.md +7 -1
- package/.agents/skills/ai-engineering-loop/references/loop-review.md +2 -0
- package/.claude/skills/ai-engineering-loop/SKILL.md +1 -1
- package/.claude/skills/ai-engineering-loop/references/loop-deliver.md +3 -1
- package/.claude/skills/ai-engineering-loop/references/loop-goal.md +1 -0
- package/.claude/skills/ai-engineering-loop/references/loop-hosts.md +5 -1
- package/.claude/skills/ai-engineering-loop/references/loop-maker.md +7 -1
- package/.claude/skills/ai-engineering-loop/references/loop-review.md +2 -0
- package/CHANGELOG.md +68 -0
- package/README.md +26 -22
- package/adapters/README.md +22 -0
- package/adapters/dot/README.md +19 -9
- package/adapters/dot/gitlab.md +55 -0
- package/adapters/dot/mattermost.md +10 -0
- package/adapters/dot/skills/dot-dev-workflow/SKILL.md +27 -5
- package/adapters/dot/sonar.md +90 -0
- package/adapters/generate-adapter/SKILL.md +6 -5
- package/adapters/github/pull-request.md +5 -0
- package/adapters/gitlab/merge-request.md +5 -0
- package/adapters/{dot → quality}/skills/task-impact-inquiry/SKILL.md +12 -7
- package/agents/instruction-only/AGENTS.md +24 -0
- package/bin/ai-engineering-loop.js +318 -27
- package/core/blast-radius-map.md +37 -0
- package/core/grill-policy.md +1 -1
- package/core/learnings.md +24 -0
- package/core/orchestration-model.md +11 -0
- package/core/pr-receipt.md +35 -0
- package/core/runtime-safety.md +24 -0
- package/lib/adapter-check.js +102 -0
- package/lib/adapter-detect.js +125 -0
- package/lib/cli-args.js +5 -1
- package/lib/doctor.js +14 -4
- package/lib/gates.js +67 -1
- package/lib/generate-adapter.js +6 -30
- package/lib/guard-hooks.js +115 -0
- package/lib/guard.js +336 -0
- package/lib/host-skill-build.js +10 -0
- package/lib/hosts/commands.js +5 -4
- package/lib/hosts/doctor.js +4 -3
- package/lib/hosts/registry.js +69 -23
- package/lib/hosts/table.js +15 -5
- package/lib/impact-map.js +501 -0
- package/lib/learn.js +303 -0
- package/lib/orchestration.js +39 -6
- package/lib/receipt.js +362 -0
- package/lib/safe-context.js +14 -0
- package/lib/smart-context.js +21 -0
- package/lib/studio-server.js +1 -0
- package/lib/sync-hosts.js +2 -1
- package/package.json +1 -1
- package/schemas/delivery.schema.json +11 -1
- package/schemas/finding-ledger.schema.json +2 -1
- package/schemas/goal-contract.schema.json +9 -0
- package/schemas/impact-map.schema.json +78 -0
- package/schemas/learnings.schema.json +47 -0
- package/schemas/receipt.schema.json +102 -0
- package/schemas/report.schema.json +52 -5
|
@@ -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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
|
|
@@ -29,6 +29,9 @@ gh pr create \
|
|
|
29
29
|
|
|
30
30
|
## Verification
|
|
31
31
|
Commands from `.ai-engineering-loop/verification.md` (exit 0).
|
|
32
|
+
|
|
33
|
+
## Receipt
|
|
34
|
+
<paste RUN_DIR/receipt.md from `deliver` here: one ✅/❌ line per AC with its evidence>
|
|
32
35
|
EOF
|
|
33
36
|
)"
|
|
34
37
|
```
|
|
@@ -36,3 +39,5 @@ EOF
|
|
|
36
39
|
Link an issue with `Fixes #n` in the body when an issue exists.
|
|
37
40
|
|
|
38
41
|
Do not paste raw diffs, tokens, or local machine paths.
|
|
42
|
+
|
|
43
|
+
**Receipt.** Commit the change first, then run `deliver` (it binds the receipt to `HEAD`, or pass `--head <sha>`; link hosted screenshots with `--evidence AC-N=<https-url>`). Paste `RUN_DIR/receipt.md` into the Receipt section as-is. A ❌ line is missing evidence: never delete it or flip it to ✅ by hand. Reviewers or CI check it with `npx ai-engineering-loop verify-receipt --run <runId> --head <pr-head-sha>` (exit 1 on any mismatch). Spec: `docs pr-receipt`.
|
|
@@ -31,6 +31,9 @@ glab mr create \
|
|
|
31
31
|
|
|
32
32
|
## Verification
|
|
33
33
|
Commands from `.ai-engineering-loop/verification.md` (exit 0).
|
|
34
|
+
|
|
35
|
+
## Receipt
|
|
36
|
+
<paste RUN_DIR/receipt.md from `deliver` here: one ✅/❌ line per AC with its evidence>
|
|
34
37
|
EOF
|
|
35
38
|
)" \
|
|
36
39
|
--yes
|
|
@@ -39,3 +42,5 @@ EOF
|
|
|
39
42
|
Link the issue URL in the description when an issue exists.
|
|
40
43
|
|
|
41
44
|
Do not paste raw diffs, tokens, or local machine paths.
|
|
45
|
+
|
|
46
|
+
**Receipt.** Commit the change first, then run `deliver` (it binds the receipt to `HEAD`, or pass `--head <sha>`; link hosted screenshots with `--evidence AC-N=<https-url>`). Paste `RUN_DIR/receipt.md` into the Receipt section as-is. A ❌ line is missing evidence: never delete it or flip it to ✅ by hand. Reviewers or CI check it with `npx ai-engineering-loop verify-receipt --run <runId> --head <pr-head-sha>` (exit 1 on any mismatch). Spec: `docs pr-receipt`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: task-impact-inquiry
|
|
3
|
-
description: Map business blast radius before code. Use for impact, side effects, sibling data, approval, queues, or when a new developer must learn the current flow. Triggers:
|
|
3
|
+
description: Map business blast radius before code. Use for impact, side effects, sibling data, approval, queues, or when a new developer must learn the current flow. Triggers (EN/ID): check the impact, impact analysis, blast radius, side effects, cek impactnya, analisa pengaruh. Not a substitute for ai-engineering-loop.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Task Impact Inquiry
|
|
@@ -9,7 +9,9 @@ Map the **current business flow** and the **blast radius** of a change before an
|
|
|
9
9
|
|
|
10
10
|
This skill fills AI Engineering Loop Stage 1 grill. It is not a parallel engineering OS.
|
|
11
11
|
|
|
12
|
-
If Stage 1 grill already produced this matrix and the user confirmed it, stop. Do not interview again. On commit-bound work, continue in `ai-engineering-loop` (freeze the Goal Contract, then Maker). Do not start
|
|
12
|
+
If Stage 1 grill already produced this matrix and the user confirmed it, stop. Do not interview again. On commit-bound work, continue in `ai-engineering-loop` (freeze the Goal Contract, then Maker). Do not start a second engineering loop from your team's own workflow skill.
|
|
13
|
+
|
|
14
|
+
Works on any adapter. On `adapter_type: dot` it is mandatory in Stage 1; the DOT-only rules live in `adapters/dot/README.md`.
|
|
13
15
|
|
|
14
16
|
## Hard gate
|
|
15
17
|
|
|
@@ -23,13 +25,16 @@ Green unit tests later are not proof that siblings, approvals, or downstream job
|
|
|
23
25
|
|
|
24
26
|
## When to use
|
|
25
27
|
|
|
26
|
-
- "
|
|
28
|
+
- "check the impact", "impact analysis", "blast radius", "side effects"
|
|
29
|
+
- Indonesian: "cek impactnya", "analisa pengaruh", "brainstorming impact"
|
|
27
30
|
- Bug, edge case, or business-logic change
|
|
28
31
|
- Shared service, status transition, calculation, validation, authorization, schema
|
|
29
32
|
- The user is new to the domain and does not know the flow
|
|
30
33
|
|
|
31
34
|
Impact-only (no implementation): run this skill and stop after the report.
|
|
32
35
|
|
|
36
|
+
Inside a Run, the CLI writes a heuristic blast-radius map when the Goal is frozen (`RUN_DIR/impact-map.json`). Use it as the starting matrix, then record the outcome: `npx ai-engineering-loop impact confirm --run <runId> --by <name> [--allow <glob>]... [--remove <path>]...`. The confirmed paths become the Run's allowed scope, and verify reports changes outside it.
|
|
37
|
+
|
|
33
38
|
Commit-bound work: run this inside AEL Stage 1, then freeze. Do not run it a second time after grill.
|
|
34
39
|
|
|
35
40
|
## Host notes
|
|
@@ -47,8 +52,8 @@ Look up facts (files, enums, jobs). Grill only **decisions**.
|
|
|
47
52
|
Read in this order. Skip a source if it is missing. Do not invent statuses.
|
|
48
53
|
|
|
49
54
|
1. `.ai-engineering-loop/glossary.md`
|
|
50
|
-
2. Existing FSD if present (`docs/fsd/`, `specs-book/fsd/`, especially `impact-matrix.md`). Read only. Do not generate an FSD.
|
|
51
|
-
3. Status enums, services, validators, listeners,
|
|
55
|
+
2. Existing functional spec (FSD/PRD) if present (`docs/fsd/`, `specs-book/fsd/`, especially `impact-matrix.md`). Read only. Do not generate an FSD.
|
|
56
|
+
3. Status enums, services, validators, listeners, queue / cron / job processors
|
|
52
57
|
4. Matching FE pages, routes, and permission guards when both FE and BE are in the workspace
|
|
53
58
|
|
|
54
59
|
Cite the path for each claim. If FE or BE is missing, say so.
|
|
@@ -76,7 +81,7 @@ If the flow cannot be determined from the repo, say what is missing.
|
|
|
76
81
|
|
|
77
82
|
**Actor and approval.** Who creates, who may edit, who must re-approve? When is an existing approval void, and when must it be kept?
|
|
78
83
|
|
|
79
|
-
**Downstream.**
|
|
84
|
+
**Downstream.** Queues, cron, listeners, billing, dashboard totals.
|
|
80
85
|
|
|
81
86
|
### 4. Where it hits (hit map + blast picture)
|
|
82
87
|
|
|
@@ -152,4 +157,4 @@ Next: freeze Goal Contract | stop (impact-only)
|
|
|
152
157
|
- Mermaid or LaTeX
|
|
153
158
|
- Claiming isolation because unit tests passed
|
|
154
159
|
- Inventing business rules the repo and the user did not supply
|
|
155
|
-
- Generating an FSD or starting
|
|
160
|
+
- Generating an FSD or starting another workflow skill as a second loop
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Generated from skill-src/ by npm run build:skills; do not edit. -->
|
|
2
|
+
# AI Engineering Loop (digest)
|
|
3
|
+
|
|
4
|
+
For hosts with no subagent tool (certification `instruction-only`). Full skill: `~/.agents/skills/ai-engineering-loop/SKILL.md` after `sync-hosts`. Stage details: `npx ai-engineering-loop docs loop-<goal|maker|verify|review|deliver>`.
|
|
5
|
+
|
|
6
|
+
Loop: Specify (0-1), Make (2-4), Review (5-7), Deliver (8). You are Maker. Devil's Advocate (DA) and Judge run in this session as `CONTEXT_ISOLATION_ONLY`, with the same budgets; never claim independent review.
|
|
7
|
+
|
|
8
|
+
1. `npx ai-engineering-loop run --json` gives runId, tier, budget. Read `.ai-engineering-loop/glossary.md`.
|
|
9
|
+
2. Goal Contract: AC is a failure table (happy, empty, boundary, error). Only after the human freezes: `goal freeze --latest --run <runId> --by human`. Chat agreement is not freeze.
|
|
10
|
+
3. Maker: one red test per AC row before the fix, then `gate maker`.
|
|
11
|
+
4. `verify --cmd <test command>`, then write claimed-vs-reality.md.
|
|
12
|
+
5. DA: re-read only the diff, Goal, and evidence; log findings; `gate review`. Judge: write the verdict from the evidence, then `gate judge`. ITERATE at most 3 times.
|
|
13
|
+
6. Deliver per `.ai-engineering-loop/adapter.md`. ASSISTED: `deliver --approve --by <human>` only after the human says so.
|
|
14
|
+
|
|
15
|
+
Never: edit `state.json`/`current.json`, skip a gate, infer approval, invent usage counts, or put secrets in messages. A gate failure overrides prose.
|
|
16
|
+
|
|
17
|
+
Report header:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Execution Mode: CONTEXT_ISOLATION_ONLY
|
|
21
|
+
Independent LLM Execution: NOT PROVEN
|
|
22
|
+
Native Subagent Invocation: UNAVAILABLE
|
|
23
|
+
Review Method: Clean-Slate Artifact Isolation Barrier
|
|
24
|
+
```
|