ai-engineering-loop 1.0.11 → 1.0.12
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 +15 -4
- package/.agents/judge.md +7 -3
- package/.agents/workflows/ai-engineering-loop.md +4 -2
- package/.claude/agents/devil-advocate.md +15 -4
- package/.claude/agents/judge.md +7 -3
- package/.claude/commands/ai-engineering-loop.md +1 -1
- package/.claude/skills/ai-engineering-loop/SKILL.md +6 -5
- package/.gemini/skills/ai-engineering-loop/SKILL.md +59 -0
- package/.grok/agents/devil-advocate.md +15 -4
- package/.grok/agents/judge.md +7 -3
- package/.grok/commands/ai-engineering-loop.md +1 -1
- package/.grok/skills/ai-engineering-loop/SKILL.md +8 -6
- package/README.md +31 -3
- package/README.npm.md +5 -2
- package/adapters/dot/README.md +27 -3
- package/adapters/dot/coreview.md +30 -11
- package/adapters/dot/mattermost.md +31 -19
- package/adapters/dot/skills/dot-dev-skill-router/SKILL.md +55 -0
- package/adapters/dot/skills/dot-dev-workflow/SKILL.md +118 -0
- package/agents/devil-advocate.md +3 -1
- package/agents/maker.md +13 -11
- package/agents/shared/devil-advocate.body.md +15 -4
- package/agents/shared/judge.body.md +7 -3
- package/bin/ai-engineering-loop.js +131 -22
- package/core/context-impact-assessment.md +2 -0
- package/core/definition-of-done.md +2 -0
- package/core/goal-contract.md +18 -4
- package/core/grill-policy.md +70 -0
- package/core/handoff-policy.md +44 -0
- package/core/judge-policy.md +4 -3
- package/core/project-initialization.md +2 -1
- package/core/repo-config-schema.md +15 -1
- package/core/root-cause-analysis.md +30 -0
- package/core/verification-loop.md +3 -1
- package/examples/initialization/discovery-trace.md +1 -1
- package/examples/initialization/generated-context.md +1 -1
- package/lib/orchestration.js +20 -2
- package/lib/sync-hosts.js +195 -0
- package/package.json +2 -1
- package/policies/finding-policy.md +7 -1
- package/policies/review-budget.md +1 -0
- package/policies/tdd-policy.md +32 -0
- package/scripts/init.sh +21 -0
- package/templates/repo-config/adr-readme.md +33 -0
- package/templates/repo-config/glossary.md +18 -0
- package/tests/living-context.test.js +46 -0
- package/tests/orchestration.test.js +80 -0
- package/tests/skill-host-compat.test.js +83 -0
- package/tests/sync-hosts.test.js +119 -0
|
@@ -17,15 +17,24 @@ Use only:
|
|
|
17
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
18
|
2. Goal Contract path (if given).
|
|
19
19
|
3. Verification log path (if given).
|
|
20
|
-
4.
|
|
20
|
+
4. conventions.md path (if given). At most one extra read.
|
|
21
|
+
5. At most 8 source files that appear as paths in the diff.
|
|
21
22
|
|
|
22
23
|
Skip: `*.css`, files named like `*-css.ts` or `report-css.ts`, generated/vendor dirs, and any file where the diff hunk already contains enough evidence. Prefer quoting the hunk over opening the whole file.
|
|
23
24
|
|
|
24
25
|
Do not ask for Maker rationale.
|
|
25
26
|
|
|
26
|
-
##
|
|
27
|
+
## Two axes (do not merge)
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
Report Spec and Standards as separate findings. Do not rerank one axis with the other. A change can pass Spec and fail Standards, or the reverse. Do not spawn children to split axes.
|
|
30
|
+
|
|
31
|
+
**Spec** (`axis: "spec"`): Goal Contract acceptance criteria, correctness, error handling, security, concurrency, tests that fail to prove an AC. BLOCKER or HIGH only for a real AC breach or runtime defect.
|
|
32
|
+
|
|
33
|
+
**Standards** (`axis: "standards"`): `.ai-engineering-loop/conventions.md` plus the smell baseline below. Judgement calls: severity MEDIUM or LOW. Set `hardConvention: true` only when conventions.md states a hard rule that this hunk violates. A smell that hides an AC defect is Spec, not Standards.
|
|
34
|
+
|
|
35
|
+
Skip style nits unless they hide a defect.
|
|
36
|
+
|
|
37
|
+
Smell baseline (judgement only; skip if tooling already enforces; repo conventions override): Mysterious Name; Duplicated Code; Feature Envy; Data Clumps; Primitive Obsession; Repeated Switches; Shotgun Surgery; Divergent Change; Speculative Generality; Message Chains; Middle Man; Refused Bequest.
|
|
29
38
|
|
|
30
39
|
## Output
|
|
31
40
|
|
|
@@ -38,6 +47,8 @@ Return a Finding Ledger as a fenced JSON block and stop:
|
|
|
38
47
|
"findings": [
|
|
39
48
|
{
|
|
40
49
|
"id": "DA-01",
|
|
50
|
+
"axis": "spec",
|
|
51
|
+
"hardConvention": false,
|
|
41
52
|
"topic": "correctness",
|
|
42
53
|
"validity": "VALID",
|
|
43
54
|
"severity": "BLOCKER",
|
|
@@ -53,4 +64,4 @@ Return a Finding Ledger as a fenced JSON block and stop:
|
|
|
53
64
|
}
|
|
54
65
|
```
|
|
55
66
|
|
|
56
|
-
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.
|
|
67
|
+
Rules: axis is spec or standards (default spec). hardConvention is boolean, default false. 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
CHANGED
|
@@ -14,12 +14,16 @@ 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
|
-
##
|
|
17
|
+
## Axes
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
Do not merge Spec and Standards into one ranking.
|
|
20
|
+
|
|
21
|
+
- Spec VALID BLOCKER or HIGH (or missing axis, treated as spec): ITERATE (ESCALATE if iteration is 3 or more)
|
|
22
|
+
- Standards VALID BLOCKER or HIGH: ITERATE only when hardConvention is true
|
|
23
|
+
- Other Standards findings: ACCEPT as tradeoff; may still PASS
|
|
21
24
|
- INVALID findings: DISMISS, cannot block delivery
|
|
22
25
|
- VALID MEDIUM or LOW: ACCEPT as tradeoff; may still PASS
|
|
26
|
+
- Verification missing, vague, or non-zero exit: ITERATE
|
|
23
27
|
- All acceptance criteria proven, verification green, zero open blockers: PASS
|
|
24
28
|
|
|
25
29
|
## Output
|
|
@@ -5,12 +5,14 @@ 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`.
|
|
9
|
+
|
|
8
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.
|
|
9
11
|
|
|
10
12
|
5. Before Devil's Advocate: write `git diff` to `.ai-engineering-loop/tasks/current.diff` and put `git diff --name-only` in the child prompt. Do not paste Maker rationale.
|
|
11
|
-
6. Devil's Advocate 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".
|
|
13
|
+
6. Devil's Advocate prompt: diff file path, name-only list, Goal Contract path, verification log path, conventions.md path, and "at most 8 tool calls; read the diff file; skip css and generated files". Report Spec and Standards axes separately.
|
|
12
14
|
7. Judge 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".
|
|
13
15
|
|
|
14
16
|
If no subagent tool exists, run the same budgets in this session as CONTEXT_ISOLATION_ONLY. Do not claim independent agent execution.
|
|
15
17
|
|
|
16
|
-
Init/status/refresh: `npx ai-engineering-loop <command>`.
|
|
18
|
+
Init/status/refresh/sync-hosts: `npx ai-engineering-loop <command>`. Stage 0: `npx ai-engineering-loop sync-hosts` then `npx ai-engineering-loop status`. If sync-hosts copied files, tell the user a new session is needed for updated skill text; keep going with this session.
|
|
@@ -18,15 +18,24 @@ Use only:
|
|
|
18
18
|
1. The diff file path in the spawn prompt. Read that file first. Do not run git diff if a diff path was given.
|
|
19
19
|
2. Goal Contract path (if given).
|
|
20
20
|
3. Verification log path (if given).
|
|
21
|
-
4.
|
|
21
|
+
4. conventions.md path (if given). At most one extra read.
|
|
22
|
+
5. At most 8 source files that appear as paths in the diff.
|
|
22
23
|
|
|
23
24
|
Skip: `*.css`, files named like `*-css.ts` or `report-css.ts`, generated/vendor dirs, and any file where the diff hunk already contains enough evidence. Prefer quoting the hunk over opening the whole file.
|
|
24
25
|
|
|
25
26
|
Do not ask for Maker rationale.
|
|
26
27
|
|
|
27
|
-
##
|
|
28
|
+
## Two axes (do not merge)
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
Report Spec and Standards as separate findings. Do not rerank one axis with the other. A change can pass Spec and fail Standards, or the reverse. Do not spawn children to split axes.
|
|
31
|
+
|
|
32
|
+
**Spec** (`axis: "spec"`): Goal Contract acceptance criteria, correctness, error handling, security, concurrency, tests that fail to prove an AC. BLOCKER or HIGH only for a real AC breach or runtime defect.
|
|
33
|
+
|
|
34
|
+
**Standards** (`axis: "standards"`): `.ai-engineering-loop/conventions.md` plus the smell baseline below. Judgement calls: severity MEDIUM or LOW. Set `hardConvention: true` only when conventions.md states a hard rule that this hunk violates. A smell that hides an AC defect is Spec, not Standards.
|
|
35
|
+
|
|
36
|
+
Skip style nits unless they hide a defect.
|
|
37
|
+
|
|
38
|
+
Smell baseline (judgement only; skip if tooling already enforces; repo conventions override): Mysterious Name; Duplicated Code; Feature Envy; Data Clumps; Primitive Obsession; Repeated Switches; Shotgun Surgery; Divergent Change; Speculative Generality; Message Chains; Middle Man; Refused Bequest.
|
|
30
39
|
|
|
31
40
|
## Output
|
|
32
41
|
|
|
@@ -39,6 +48,8 @@ Return a Finding Ledger as a fenced JSON block and stop:
|
|
|
39
48
|
"findings": [
|
|
40
49
|
{
|
|
41
50
|
"id": "DA-01",
|
|
51
|
+
"axis": "spec",
|
|
52
|
+
"hardConvention": false,
|
|
42
53
|
"topic": "correctness",
|
|
43
54
|
"validity": "VALID",
|
|
44
55
|
"severity": "BLOCKER",
|
|
@@ -54,4 +65,4 @@ Return a Finding Ledger as a fenced JSON block and stop:
|
|
|
54
65
|
}
|
|
55
66
|
```
|
|
56
67
|
|
|
57
|
-
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.
|
|
68
|
+
Rules: axis is spec or standards (default spec). hardConvention is boolean, default false. 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/.claude/agents/judge.md
CHANGED
|
@@ -15,12 +15,16 @@ 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
|
-
##
|
|
18
|
+
## Axes
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
Do not merge Spec and Standards into one ranking.
|
|
21
|
+
|
|
22
|
+
- Spec VALID BLOCKER or HIGH (or missing axis, treated as spec): ITERATE (ESCALATE if iteration is 3 or more)
|
|
23
|
+
- Standards VALID BLOCKER or HIGH: ITERATE only when hardConvention is true
|
|
24
|
+
- Other Standards findings: ACCEPT as tradeoff; may still PASS
|
|
22
25
|
- INVALID findings: DISMISS, cannot block delivery
|
|
23
26
|
- VALID MEDIUM or LOW: ACCEPT as tradeoff; may still PASS
|
|
27
|
+
- Verification missing, vague, or non-zero exit: ITERATE
|
|
24
28
|
- All acceptance criteria proven, verification green, zero open blockers: PASS
|
|
25
29
|
|
|
26
30
|
## Output
|
|
@@ -8,4 +8,4 @@ Follow `.claude/skills/ai-engineering-loop/SKILL.md`.
|
|
|
8
8
|
|
|
9
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
|
-
Arguments: init, status, refresh, or a task description.
|
|
11
|
+
Arguments: init, status, refresh, sync-hosts, or a task description.
|
|
@@ -24,22 +24,23 @@ Claude Code talks to strict proxies (including Kiro). Follow this exactly:
|
|
|
24
24
|
|
|
25
25
|
## Commands
|
|
26
26
|
|
|
27
|
-
- `init` / `status` / `refresh`: run `npx ai-engineering-loop <command>` in the repo. Do not commit unless asked.
|
|
27
|
+
- `init` / `status` / `refresh` / `sync-hosts`: run `npx ai-engineering-loop <command>` in the repo. Do not commit unless asked.
|
|
28
28
|
- Any other argument: full loop for that task.
|
|
29
29
|
|
|
30
30
|
## Loop
|
|
31
31
|
|
|
32
32
|
Parent session is Maker plus orchestrator. Spawn Devil's Advocate and Judge as **siblings**, not nested.
|
|
33
33
|
|
|
34
|
-
1. Stage 0: `npx ai-engineering-loop status` (init or refresh if missing or stale).
|
|
35
|
-
2. Stage 1:
|
|
36
|
-
3. Stages 2-4: Maker
|
|
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.
|
|
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:
|
|
39
39
|
- Write `git diff` to a file (for example `.ai-engineering-loop/tasks/current.diff`).
|
|
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
|
+
- If stopping mid-loop, write `.ai-engineering-loop/tasks/handoff.md` (`core/handoff-policy.md`).
|
|
43
|
+
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, conventions.md path, and "at most 8 tool calls; read the diff file; skip css and generated files". Report Spec and Standards axes separately.
|
|
43
44
|
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
45
|
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
46
|
9. Stage 8: delivery from `.ai-engineering-loop/adapter.md`.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-engineering-loop
|
|
3
|
+
description: Use when the user runs /ai-engineering-loop, asks to init or refresh living project context, or wants the Maker / Devil's Advocate / Judge engineering loop on Antigravity.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AI Engineering Loop (Antigravity)
|
|
7
|
+
|
|
8
|
+
Canonical specs: if this workspace has `core/`, `agents/`, `policies/`, read those files. Otherwise run `npx ai-engineering-loop` and follow the published specs.
|
|
9
|
+
|
|
10
|
+
Follow `policies/review-budget.md` when that file exists. Parent is Maker plus orchestrator. Do not use `browser_subagent`.
|
|
11
|
+
|
|
12
|
+
## Host rule
|
|
13
|
+
|
|
14
|
+
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.
|
|
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
|
+
Canonical mode ids: `TRUE_INDEPENDENT_AGENT`, `ISOLATED_AGENT_INSTANCE`, `FRESH_PROCESS_AGENT`, `CONTEXT_ISOLATION_ONLY`, `UNAVAILABLE`.
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
- `init` / `status` / `refresh` / `sync-hosts`: run `npx ai-engineering-loop <command>` in the repo. Do not commit unless asked.
|
|
23
|
+
- Any other argument: full loop for that task.
|
|
24
|
+
|
|
25
|
+
## Loop
|
|
26
|
+
|
|
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.
|
|
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
|
+
4. Stage 5: run commands from `.ai-engineering-loop/verification.md`. Keep command, exit code, stdout, test counts. Vague "seems green" is invalid.
|
|
31
|
+
5. Write artifacts, then spawn. Before Devil's Advocate:
|
|
32
|
+
- Write `git diff` to a file (for example `.ai-engineering-loop/tasks/current.diff`).
|
|
33
|
+
- Write changed paths (`git diff --name-only`) into the child prompt as a short list.
|
|
34
|
+
- Put those paths in the child prompt. Do not paste Maker rationale.
|
|
35
|
+
- If stopping mid-loop, write `.ai-engineering-loop/tasks/handoff.md` (`core/handoff-policy.md`).
|
|
36
|
+
6. Stage 6: spawn `devil-advocate`. Wait. Prompt: diff file path, name-only list, Goal Contract path, verification log path, conventions.md path, and "at most 8 tool calls; read the diff file; skip css and generated files". Report Spec and Standards axes separately.
|
|
37
|
+
7. Stage 7: spawn `judge` the same way (wait, no background). 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".
|
|
38
|
+
8. ITERATE with iteration under 3: fix in the parent, re-verify, spawn a **new** Devil's Advocate.
|
|
39
|
+
9. Stage 8: delivery from `.ai-engineering-loop/adapter.md`.
|
|
40
|
+
|
|
41
|
+
## Report header
|
|
42
|
+
|
|
43
|
+
When a child actually returned a result:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Execution Mode: TRUE_INDEPENDENT_AGENT
|
|
47
|
+
Independent LLM Execution: PROVEN
|
|
48
|
+
Native Subagent Invocation: AVAILABLE
|
|
49
|
+
Review Method: True Independent Agent
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
When no subagent tool exists:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Execution Mode: CONTEXT_ISOLATION_ONLY
|
|
56
|
+
Independent LLM Execution: NOT PROVEN
|
|
57
|
+
Native Subagent Invocation: UNAVAILABLE
|
|
58
|
+
Review Method: Clean-Slate Artifact Isolation Barrier
|
|
59
|
+
```
|
|
@@ -19,15 +19,24 @@ Use only:
|
|
|
19
19
|
1. The diff file path in the spawn prompt. Read that file first. Do not run git diff if a diff path was given.
|
|
20
20
|
2. Goal Contract path (if given).
|
|
21
21
|
3. Verification log path (if given).
|
|
22
|
-
4.
|
|
22
|
+
4. conventions.md path (if given). At most one extra read.
|
|
23
|
+
5. At most 8 source files that appear as paths in the diff.
|
|
23
24
|
|
|
24
25
|
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.
|
|
25
26
|
|
|
26
27
|
Do not ask for Maker rationale.
|
|
27
28
|
|
|
28
|
-
##
|
|
29
|
+
## Two axes (do not merge)
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
Report Spec and Standards as separate findings. Do not rerank one axis with the other. A change can pass Spec and fail Standards, or the reverse. Do not spawn children to split axes.
|
|
32
|
+
|
|
33
|
+
**Spec** (`axis: "spec"`): Goal Contract acceptance criteria, correctness, error handling, security, concurrency, tests that fail to prove an AC. BLOCKER or HIGH only for a real AC breach or runtime defect.
|
|
34
|
+
|
|
35
|
+
**Standards** (`axis: "standards"`): `.ai-engineering-loop/conventions.md` plus the smell baseline below. Judgement calls: severity MEDIUM or LOW. Set `hardConvention: true` only when conventions.md states a hard rule that this hunk violates. A smell that hides an AC defect is Spec, not Standards.
|
|
36
|
+
|
|
37
|
+
Skip style nits unless they hide a defect.
|
|
38
|
+
|
|
39
|
+
Smell baseline (judgement only; skip if tooling already enforces; repo conventions override): Mysterious Name; Duplicated Code; Feature Envy; Data Clumps; Primitive Obsession; Repeated Switches; Shotgun Surgery; Divergent Change; Speculative Generality; Message Chains; Middle Man; Refused Bequest.
|
|
31
40
|
|
|
32
41
|
## Output
|
|
33
42
|
|
|
@@ -40,6 +49,8 @@ Return a Finding Ledger as a fenced JSON block and stop:
|
|
|
40
49
|
"findings": [
|
|
41
50
|
{
|
|
42
51
|
"id": "DA-01",
|
|
52
|
+
"axis": "spec",
|
|
53
|
+
"hardConvention": false,
|
|
43
54
|
"topic": "correctness",
|
|
44
55
|
"validity": "VALID",
|
|
45
56
|
"severity": "BLOCKER",
|
|
@@ -55,4 +66,4 @@ Return a Finding Ledger as a fenced JSON block and stop:
|
|
|
55
66
|
}
|
|
56
67
|
```
|
|
57
68
|
|
|
58
|
-
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.
|
|
69
|
+
Rules: axis is spec or standards (default spec). hardConvention is boolean, default false. 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/.grok/agents/judge.md
CHANGED
|
@@ -16,12 +16,16 @@ 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
|
-
##
|
|
19
|
+
## Axes
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
Do not merge Spec and Standards into one ranking.
|
|
22
|
+
|
|
23
|
+
- Spec VALID BLOCKER or HIGH (or missing axis, treated as spec): ITERATE (ESCALATE if iteration is 3 or more)
|
|
24
|
+
- Standards VALID BLOCKER or HIGH: ITERATE only when hardConvention is true
|
|
25
|
+
- Other Standards findings: ACCEPT as tradeoff; may still PASS
|
|
23
26
|
- INVALID findings: DISMISS, cannot block delivery
|
|
24
27
|
- VALID MEDIUM or LOW: ACCEPT as tradeoff; may still PASS
|
|
28
|
+
- Verification missing, vague, or non-zero exit: ITERATE
|
|
25
29
|
- All acceptance criteria proven, verification green, zero open blockers: PASS
|
|
26
30
|
|
|
27
31
|
## Output
|
|
@@ -7,5 +7,5 @@ Follow `.grok/skills/ai-engineering-loop/SKILL.md`.
|
|
|
7
7
|
|
|
8
8
|
Arguments:
|
|
9
9
|
|
|
10
|
-
- `init` / `status` / `refresh` → run `npx ai-engineering-loop <arg>`
|
|
10
|
+
- `init` / `status` / `refresh` / `sync-hosts` → run `npx ai-engineering-loop <arg>`
|
|
11
11
|
- anything else → full 8-stage loop for that task, spawning `devil-advocate` then `judge` via `spawn_subagent`
|
|
@@ -5,6 +5,7 @@ description: >
|
|
|
5
5
|
with native spawn_subagent for Devil's Advocate and Judge (TRUE_INDEPENDENT_AGENT).
|
|
6
6
|
Also handles init/status/refresh of .ai-engineering-loop/ living context.
|
|
7
7
|
Triggers: /ai-engineering-loop, "run the engineering loop", "devil's advocate review".
|
|
8
|
+
user-invocable: true
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
# AI Engineering Loop — Grok CLI Runtime
|
|
@@ -37,21 +38,22 @@ Optional fallback if `devil-advocate` / `judge` types are not registered: `subag
|
|
|
37
38
|
|
|
38
39
|
## Commands
|
|
39
40
|
|
|
40
|
-
### `/ai-engineering-loop init|status|refresh`
|
|
41
|
+
### `/ai-engineering-loop init|status|refresh|sync-hosts`
|
|
41
42
|
|
|
42
|
-
Run `npx ai-engineering-loop <command>` in the target repo. Do not commit unless the user asks.
|
|
43
|
+
Run `npx ai-engineering-loop <command>` in the target repo. Do not commit unless the user asks. `sync-hosts` copies this package's skills/agents/commands into `~/.claude`, `~/.grok`, `~/.gemini`, and `~/.agents` for hosts that already exist.
|
|
43
44
|
|
|
44
45
|
### `/ai-engineering-loop [task]`
|
|
45
46
|
|
|
46
|
-
1. Stage 0: `npx ai-engineering-loop status` (init/refresh if missing or stale).
|
|
47
|
-
2. Stage 1:
|
|
48
|
-
3. Stages 2–4: Maker work in the **parent**.
|
|
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.
|
|
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.
|
|
49
50
|
4. Stage 5: run verification from `.ai-engineering-loop/verification.md`. Keep command, exit code, stdout, test counts. Vague "seems green" is invalid.
|
|
50
51
|
5. Write artifacts to disk so children do not need parent chat:
|
|
51
52
|
- Goal Contract path
|
|
52
53
|
- `git diff` written to `.ai-engineering-loop/tasks/current.diff`
|
|
53
54
|
- verification log (file)
|
|
54
|
-
|
|
55
|
+
- If stopping mid-loop, `.ai-engineering-loop/tasks/handoff.md` (`core/handoff-policy.md`)
|
|
56
|
+
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, conventions.md path, plus "at most 8 tool calls; read the diff file; skip css and generated files". Report Spec and Standards axes separately.
|
|
55
57
|
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
58
|
8. If Judge says `ITERATE` and iteration < 3, Maker fixes in the parent, re-verify, spawn a **fresh** DA (new spawn, no resume).
|
|
57
59
|
9. Stage 8: delivery adapter from `.ai-engineering-loop/adapter.md`.
|
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
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
|
|
|
13
13
|
*Featuring living project context, strict verification evidence contracts, 3-stage capability lifecycle registry, and dual-axis Judge evaluation.*
|
|
14
14
|
|
|
15
|
-
[Overview](#overview--philosophy) • [Runtime Capability Registry](#runtime-capability-registry--execution-modes) • [Verification Evidence](#verification-evidence-contract) • [CLI Commands](#cli-interface--commands) • [Grok CLI](#grok-cli-integration) • [Claude Code](#claude-code-integration) • [Antigravity](#antigravity-agent-integration) • [Lifecycle](#lifecycle-stages) • [Architecture](#architecture--5-layer-configuration) • [Project Profiles](#project-profiles) • [Repository Structure](#repository-structure) • [Reference Examples](#reference-examples) • [Contributing](#contributing)
|
|
15
|
+
[Overview](#overview--philosophy) • [Stage techniques](#stage-techniques) • [Runtime Capability Registry](#runtime-capability-registry--execution-modes) • [Verification Evidence](#verification-evidence-contract) • [CLI Commands](#cli-interface--commands) • [Grok CLI](#grok-cli-integration) • [Claude Code](#claude-code-integration) • [Antigravity](#antigravity-agent-integration) • [Lifecycle](#lifecycle-stages) • [Architecture](#architecture--5-layer-configuration) • [Project Profiles](#project-profiles) • [Repository Structure](#repository-structure) • [Reference Examples](#reference-examples) • [Contributing](#contributing)
|
|
16
16
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
@@ -58,6 +58,23 @@ flowchart TD
|
|
|
58
58
|
|
|
59
59
|
---
|
|
60
60
|
|
|
61
|
+
## Stage techniques
|
|
62
|
+
|
|
63
|
+
The 8-stage loop stays one OS. These techniques sit **inside** existing stages (they are not optional slash-command products):
|
|
64
|
+
|
|
65
|
+
| Stage | Technique | Spec |
|
|
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` |
|
|
68
|
+
| 1 | Ubiquitous language in `.ai-engineering-loop/glossary.md`; load-bearing choices in `.ai-engineering-loop/adrs/` | `core/repo-config-schema.md` |
|
|
69
|
+
| 2 | Bugs: red repro → minimise → hypothesise → instrument → fix | `core/root-cause-analysis.md` |
|
|
70
|
+
| 4–5 | Red-green at named **seams**; no implementation-coupled or tautological tests | `policies/tdd-policy.md` |
|
|
71
|
+
| 6–7 | Spec vs Standards reported separately. Standards BLOCKER/HIGH iterate only when `hardConvention` is true | `policies/finding-policy.md` |
|
|
72
|
+
| any | Mid-loop stop writes `.ai-engineering-loop/tasks/handoff.md` | `core/handoff-policy.md` |
|
|
73
|
+
|
|
74
|
+
`init` now requires `glossary.md` and `adrs/README.md`. Repair fills missing files only; a filled glossary is never overwritten.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
61
78
|
## Runtime Capability Registry & Execution Modes
|
|
62
79
|
|
|
63
80
|
The system maintains a strict distinction between **Configuration Support**, **Invocation Availability**, and **Execution Proof**:
|
|
@@ -160,8 +177,13 @@ npx ai-engineering-loop refresh
|
|
|
160
177
|
|
|
161
178
|
# Verify context readiness and begin engineering loop
|
|
162
179
|
npx ai-engineering-loop run
|
|
180
|
+
|
|
181
|
+
# Copy package skills/agents/commands into ~/.claude ~/.grok ~/.gemini ~/.agents
|
|
182
|
+
npx ai-engineering-loop sync-hosts
|
|
163
183
|
```
|
|
164
184
|
|
|
185
|
+
`sync-hosts` updates only hosts that already exist on the machine. DOT skills (`dot-dev-skill-router`, `dot-dev-workflow`) are updated only if they are already installed. It does not install `task-impact-inquiry`. After a copy, start a new session so the host reloads skill text. `/ai-engineering-loop` Stage 0 and `run` call `sync-hosts` so a published package bump reaches global host files without a manual copy.
|
|
186
|
+
|
|
165
187
|
---
|
|
166
188
|
|
|
167
189
|
## Grok CLI Integration
|
|
@@ -243,7 +265,7 @@ ai-engineering-loop/
|
|
|
243
265
|
├── package.json # CLI package manifest
|
|
244
266
|
│
|
|
245
267
|
├── bin/ # CLI execution entrypoints
|
|
246
|
-
│ └── ai-engineering-loop.js # npx executable CLI (init, status, refresh, run)
|
|
268
|
+
│ └── ai-engineering-loop.js # npx executable CLI (init, status, refresh, run, sync-hosts)
|
|
247
269
|
│
|
|
248
270
|
├── lib/ # Core orchestration & decision engine
|
|
249
271
|
│ └── orchestration.js # 3-stage capability registry, barrier builder, Judge engine
|
|
@@ -276,6 +298,9 @@ ai-engineering-loop/
|
|
|
276
298
|
│ ├── context-refresh-policy.md # Progressive drift hierarchy & living baseline
|
|
277
299
|
│ ├── context-impact-assessment.md # Post-task impact assessment (NONE, TARGETED, MAJOR)
|
|
278
300
|
│ ├── goal-contract.md # Task contract schema & acceptance criteria
|
|
301
|
+
│ ├── grill-policy.md # Stage 1 human alignment (design tree)
|
|
302
|
+
│ ├── root-cause-analysis.md # Stage 2 diagnosis gates
|
|
303
|
+
│ ├── handoff-policy.md # Mid-loop session handoff artifact
|
|
279
304
|
│ ├── verification-loop.md # Dual-layer verification & Evidence Contract
|
|
280
305
|
│ ├── definition-of-done.md # 5 pillars of Done & rejection triggers
|
|
281
306
|
│ ├── iteration-policy.md # Bounded autonomous loop (MAX_ITERATIONS = 3)
|
|
@@ -300,6 +325,7 @@ ai-engineering-loop/
|
|
|
300
325
|
├── policies/ # Operational schemas & algorithms
|
|
301
326
|
│ ├── discovery-safety-policy.md # Secret protection & non-destructive discovery rules
|
|
302
327
|
│ ├── finding-policy.md # Dual-axis finding schema & severity matrix
|
|
328
|
+
│ ├── tdd-policy.md # Red-green at named seams
|
|
303
329
|
│ ├── evidence-policy.md # 5-level evidence hierarchy & Verification Evidence Contract
|
|
304
330
|
│ └── no-progress-policy.md # Finding signature hashing & stagnation detection
|
|
305
331
|
│
|
|
@@ -315,6 +341,8 @@ ai-engineering-loop/
|
|
|
315
341
|
└── repo-config/ # Ready-to-copy .ai-engineering-loop/ files
|
|
316
342
|
├── config.md # Project identity & profile binding
|
|
317
343
|
├── architecture.md # Layers & boundary invariants
|
|
344
|
+
├── glossary.md # Ubiquitous language
|
|
345
|
+
├── adr-readme.md # ADR folder template
|
|
318
346
|
├── conventions.md # Code standards & forbidden patterns
|
|
319
347
|
├── verification.md # CLI test/lint/build commands
|
|
320
348
|
└── adapter.md # Configured release pipeline
|
package/README.npm.md
CHANGED
|
@@ -26,14 +26,17 @@ npx ai-engineering-loop refresh
|
|
|
26
26
|
|
|
27
27
|
# 4. Verify context readiness and begin engineering loop
|
|
28
28
|
npx ai-engineering-loop run
|
|
29
|
+
|
|
30
|
+
# 5. Copy package host skills into ~/.claude ~/.grok ~/.gemini ~/.agents
|
|
31
|
+
npx ai-engineering-loop sync-hosts
|
|
29
32
|
```
|
|
30
33
|
|
|
31
34
|
---
|
|
32
35
|
|
|
33
36
|
## What It Does
|
|
34
37
|
|
|
35
|
-
1. **Zero-Config Discovery (`init`)**: Analyzes repository topology (monorepo vs single app), package manifests (`package.json`, `go.mod`, `Cargo.toml`, etc.), frameworks, and test scripts to generate `.ai-engineering-loop/`.
|
|
36
|
-
2. **Living Project Context**: Tracks repository revisions and manifest checksums in `metadata.json` for instant drift detection.
|
|
38
|
+
1. **Zero-Config Discovery (`init`)**: Analyzes repository topology (monorepo vs single app), package manifests (`package.json`, `go.mod`, `Cargo.toml`, etc.), frameworks, and test scripts to generate `.ai-engineering-loop/` including `glossary.md` and `adrs/`.
|
|
39
|
+
2. **Living Project Context**: Tracks repository revisions and manifest checksums in `metadata.json` for instant drift detection. Stage 1 grill freezes a Goal Contract; Maker uses TDD at named seams; DA reports Spec vs Standards without merging them.
|
|
37
40
|
3. **Multi-Agent Triad**: Coordinates **Maker** (surgical diffs & tests), **Devil's Advocate** (independent adversarial review), and **Judge** (impartial evaluation & PASS certification).
|
|
38
41
|
4. **Context Impact Assessment**: Evaluates completed tasks (`NONE`, `TARGETED`, `MAJOR`) to keep project context fresh without expensive whole-repo re-analysis.
|
|
39
42
|
5. **Grok CLI host**: Native `spawn_subagent` for Devil's Advocate and Judge (`TRUE_INDEPENDENT_AGENT`). Disabled by `GROK_SUBAGENTS=0`.
|
package/adapters/dot/README.md
CHANGED
|
@@ -36,15 +36,39 @@ The DOT adapter is organized into four dedicated specification modules:
|
|
|
36
36
|
- Clean cherry-picking workflow and target-specific test verification.
|
|
37
37
|
3. **[Coreview External Reviewer Triage (`coreview.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/adapters/dot/coreview.md)**:
|
|
38
38
|
- Ingestion of `@coreview-bot` automated PR comments.
|
|
39
|
-
-
|
|
39
|
+
- Mandatory Phase 8 Triage reporting gate before Mattermost dispatch.
|
|
40
|
+
- Rigorous evaluation of bot suggestions into `VALID` (fix & propagate) vs `HALU` (false positive pushback) using principles from `gitlab-mr-feedback` and `receiving-code-review`.
|
|
40
41
|
4. **[Mattermost Notifications (`mattermost.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/adapters/dot/mattermost.md)**:
|
|
41
42
|
- Repository-to-channel resolution using persistent configuration.
|
|
42
43
|
- MCP `mattermost_send_message` dispatch with mandatory `from: "AI Agent"` attribution.
|
|
43
|
-
- Environment-tagged Markdown blocks (`[MR DEV]`, `[MR STAGING]`, `[MR MAIN]`).
|
|
44
|
+
- Environment-tagged Markdown blocks (`[MR DEV]`, `[MR STAGING]`, `[MR MAIN]`) formatted with strict **`no-ai-slop`** human-written standards.
|
|
44
45
|
|
|
45
46
|
---
|
|
46
47
|
|
|
47
|
-
## 3.
|
|
48
|
+
## 3. Official DOT Engineering Skills Integration
|
|
49
|
+
|
|
50
|
+
This adapter composes the DOT skill suite that Antigravity loads from `~/.gemini/config/skills/` (not from `~/.claude/skills/` and not from this npm package). Claude Code and Grok do not get these skills unless the same files are installed on those hosts.
|
|
51
|
+
|
|
52
|
+
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`.
|
|
53
|
+
|
|
54
|
+
| Skill | Primary Role & Governance |
|
|
55
|
+
| :--- | :--- |
|
|
56
|
+
| **`ai-engineering-loop`** | Engineering OS (Stages 0-7). Use this for DOT bugfix/feature/refactor. |
|
|
57
|
+
| **`dot-dev-workflow`** | Stage 8 delivery only after Judge PASS. Not a parallel engineering loop. |
|
|
58
|
+
| **`dot-dev-skill-router`** | Routes commit-bound DOT work to `ai-engineering-loop`, then Stage 8. |
|
|
59
|
+
| **`task-impact-inquiry`** | Antigravity skill at `~/.gemini/config/skills/task-impact-inquiry/`. Four-pillar blast radius (state, sibling, approval, downstream queues). Fills Stage 1 grill on DOT; then freeze the Goal Contract. |
|
|
60
|
+
| **`backend-development`** | Framework-agnostic backend guidelines (clean naming, database queries, security, error handling). |
|
|
61
|
+
| **`backend-safety-guardrails`** | 6 architectural backend safety invariants (queue bypass, BigInt, status recalculation loops). |
|
|
62
|
+
| **`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. |
|
|
63
|
+
| **`requesting-code-review`** | Optional peer-review dispatch. AEL Judge is the pre-commit gate. |
|
|
64
|
+
| **`receiving-code-review`** | Technical rigor in evaluating review feedback without blind compliance. |
|
|
65
|
+
| **`gitlab-mr-feedback`** | GitLab API patterns and thread resolution on MR discussions. |
|
|
66
|
+
| **`auto-mr-issue`** | Automated issue, MR creation, and Mattermost Markdown formatting. |
|
|
67
|
+
| **`no-ai-slop`** | Human-written, crisp, active-voice release notes without AI puffery. |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 4. Separation of Concerns
|
|
48
72
|
|
|
49
73
|
| Generic Core Responsibility | DOT Adapter Responsibility |
|
|
50
74
|
|---|---|
|
package/adapters/dot/coreview.md
CHANGED
|
@@ -5,21 +5,34 @@
|
|
|
5
5
|
In the DOT ecosystem, `@coreview-bot` operates as an external, company-level automated code reviewer attached to GitLab Merge Requests (specifically MRs targeting `develop`).
|
|
6
6
|
|
|
7
7
|
> [!IMPORTANT]
|
|
8
|
-
> **
|
|
9
|
-
>
|
|
10
|
-
>
|
|
11
|
-
>
|
|
8
|
+
> **GATE sebelum Phase 9 (Mattermost Dispatch)**:
|
|
9
|
+
> Dilarang mengirim Mattermost sebelum hasil `glab mr view --comments` **tercetak di pesan ke user**.
|
|
10
|
+
> Jika `comments: 0`, triage kosong tetap wajib dilaporkan sebagai bukti bahwa pengecekan bot telah dilakukan secara riil.
|
|
11
|
+
>
|
|
12
|
+
> Selalu cetak laporan triage dengan format:
|
|
13
|
+
> ```text
|
|
14
|
+
> Phase 8 Triage
|
|
15
|
+
> MR: !<id>
|
|
16
|
+
> Command: glab mr view <id> --comments
|
|
17
|
+
> Comments: <n>
|
|
18
|
+
> Valid: <list atau none>
|
|
19
|
+
> Halu: <list atau none>
|
|
20
|
+
> Action: <none | fix | reply>
|
|
21
|
+
> ```
|
|
12
22
|
|
|
13
23
|
---
|
|
14
24
|
|
|
15
25
|
## 2. Coreview Triage Workflow
|
|
16
26
|
|
|
27
|
+
Mengikuti panduan dari skill `gitlab-mr-feedback` dan `receiving-code-review` (verifikasi teknis menyeluruh sebelum implementasi, tanpa *performative agreement*).
|
|
28
|
+
|
|
17
29
|
```mermaid
|
|
18
30
|
flowchart TD
|
|
19
31
|
MRDev[MR Targeting develop Created] --> FetchBot[Fetch Comments via glab mr view --comments]
|
|
20
|
-
FetchBot -->
|
|
32
|
+
FetchBot --> PrintTriage[Print Phase 8 Triage Report to User]
|
|
33
|
+
PrintTriage --> CheckComments{Bot Comments Found?}
|
|
21
34
|
|
|
22
|
-
CheckComments -->|No| Done([Complete Triage])
|
|
35
|
+
CheckComments -->|No: comments: 0| Done([Complete Triage -> Gate Passed])
|
|
23
36
|
CheckComments -->|Yes| Evaluate{Evaluate Each Comment}
|
|
24
37
|
|
|
25
38
|
Evaluate -->|VALID: Real Defect| Fix[1. Surgical Code Fix<br>2. Run Tests & Linter<br>3. Commit & Cherry-pick to all branches<br>4. Reply with commit hash]
|
|
@@ -63,12 +76,15 @@ Every Coreview comment must be categorized into one of two paths:
|
|
|
63
76
|
git push origin <branch-name>
|
|
64
77
|
```
|
|
65
78
|
4. Cherry-pick the new fix commit to all other active environment branches (`main`, `staging`).
|
|
66
|
-
5. Post a resolution
|
|
79
|
+
5. Post a resolution reply directly **inside the bot's discussion thread**:
|
|
67
80
|
```bash
|
|
68
|
-
|
|
81
|
+
# Get discussion_id: glab api "projects/:fullpath/merge_requests/<mr-id>/discussions"
|
|
82
|
+
glab api "projects/:fullpath/merge_requests/<mr-id>/discussions/<discussion_id>/notes" \
|
|
83
|
+
-X POST \
|
|
84
|
+
-F "body=Fixed in commit <commit-hash>: <technical explanation of the resolution>"
|
|
69
85
|
```
|
|
70
86
|
|
|
71
|
-
### Case B: Feedback is HALU (False Positive /
|
|
87
|
+
### Case B: Feedback is HALU (False Positive / Intended Architecture)
|
|
72
88
|
- **Criteria**:
|
|
73
89
|
- The bot suggests calling an API, library method, or hook that does not exist in the codebase or standard library.
|
|
74
90
|
- The bot flags intentional architecture or established framework patterns as "errors".
|
|
@@ -76,9 +92,12 @@ Every Coreview comment must be categorized into one of two paths:
|
|
|
76
92
|
- The bot misinterprets domain-specific business logic already agreed in the Goal Contract.
|
|
77
93
|
- **Action Plan**:
|
|
78
94
|
1. **DO NOT modify any code.**
|
|
79
|
-
2. Post a polite, evidence-backed technical rebuttal
|
|
95
|
+
2. Post a polite, evidence-backed technical rebuttal directly **inside the bot's discussion thread**:
|
|
80
96
|
```bash
|
|
81
|
-
|
|
97
|
+
# Get discussion_id: glab api "projects/:fullpath/merge_requests/<mr-id>/discussions"
|
|
98
|
+
glab api "projects/:fullpath/merge_requests/<mr-id>/discussions/<discussion_id>/notes" \
|
|
99
|
+
-X POST \
|
|
100
|
+
-F "body=Terima kasih atas masukannya @coreview-bot. <detailed technical explanation with file citations>."
|
|
82
101
|
```
|
|
83
102
|
|
|
84
103
|
---
|