Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .agents/skills/ael/references/loop-deliver.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Stage 8: Delivery

- After Judge PASS (and `verify --final` if verification was `--related`), run the `after_pass` hook, then the Stage 8 adapter from `.ai-engineering-loop/adapter.md`.
- 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.
- Code changed after PASS: `run --reopen --run <runId> --reason <what>`, then redo the loop. Never abandon.
- Before any push, run `npx ai-engineering-loop doctor`: `✗ adapter-*` (unknown `adapter_type`, missing spec) must be fixed; `! adapter-*` (gh/glab logged out, configured type differs from detected) needs a human look. `deliver` repeats this check: UNATTENDED stops before writing, ASSISTED only warns.
- The PR/MR body includes `Steps to Reproduce & Testing (QA)`; bugfix placeholders must not stay empty. Disclose any `budget record --unavailable`.
- Preview remote payloads; never include context packs, usage ledgers, raw logs, or credentials.
- ASSISTED: never infer approval. When the human says yes, record it at once: `npx ai-engineering-loop deliver --run <runId> --approve --by <name>`. After commit, push and PR/MR, finish with `deliver --run <runId> --destination <where> --summary <text> --approve --by <name>` (writes `delivery.json` with `humanApproved: true`, runs `gate delivery`).
- Long form: `node status --run <runId>`, `node approve delivery-approval --yes --by <name> --run <runId>` for each READY approval node, write `RUN_DIR/delivery.json`, then `gate delivery`. If the gate says a node is not READY, follow its prerequisite hint; never bypass approval.
- Long form: `node status --run <runId>`, `node approve delivery-approval --yes --by <name> --run <runId>` for each READY approval node, write `RUN_DIR/delivery.json`, then `gate delivery`. Node not READY: follow its prerequisite hint; never bypass approval.
- Commit before `deliver` (its receipt binds `HEAD`; videos/screenshots: `--evidence AC-N=<https-url>`, required for `crossComponent` and rubric ACs). Paste `RUN_DIR/receipt.md` into the PR/MR Receipt section unchanged; ❌ stays ❌ (`docs pr-receipt`).
- Only the delivery gate completes the run. It also mines lessons for the next Run.
- Worktree Run: after `deliver`, continue in `cleanup.mainCheckout` (Stage 9).
- Only the delivery gate completes the run. Worktree Run: then continue in `cleanup.mainCheckout`.
- After the PR is open, `npx ai-engineering-loop pr babysit --run <runId>` polls with backoff. Failing checks start a T0 or T1 fix on that same branch and push it. Ready to merge, or changes requested, stops for a human. Merge stays with the human (`docs run-isolation`).

## Report header (execution mode)
Expand Down
1 change: 1 addition & 0 deletions .agents/skills/ael/references/loop-judge.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Read when `gate review` says `judgeRequired`, on T2, or when acting on findings.
- Judge context: only run-summary.md, verification-summary.json (or verification.json), open-findings.json/findings.json, and the Goal hash; it reads the full diff only if those contradict each other. Judge prompt includes "at most 4 tool calls; ledger and contract only; skip css; do not re-review the whole diff".
- Spawn a fresh sibling Judge, wait, `budget record`, write `RUN_DIR/verdict.json` with `modelTier` and any `judgeFindings`, then `gate judge`. A gate failure overrides optimistic prose.
- ITERATE under the recipe cap: fix in the parent, re-verify, spawn a **new** DA (never resume the previous child). At the cap or NO_PROGRESS, ESCALATE to the human.
- Code changed after PASS (DA fixes, test fixes): `run --reopen --run <runId> --reason <what>` starts a new iteration; `gate maker` refuses to overwrite a judged diff (`docs iteration-policy`).

## Acting on findings (DA during ITERATE, or human MR/PR comments)

Expand Down
8 changes: 4 additions & 4 deletions .claude/skills/ael/references/loop-deliver.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Stage 8: Delivery

- After Judge PASS (and `verify --final` if verification was `--related`), run the `after_pass` hook, then the Stage 8 adapter from `.ai-engineering-loop/adapter.md`.
- 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.
- Code changed after PASS: `run --reopen --run <runId> --reason <what>`, then redo the loop. Never abandon.
- Before any push, run `npx ai-engineering-loop doctor`: `✗ adapter-*` (unknown `adapter_type`, missing spec) must be fixed; `! adapter-*` (gh/glab logged out, configured type differs from detected) needs a human look. `deliver` repeats this check: UNATTENDED stops before writing, ASSISTED only warns.
- The PR/MR body includes `Steps to Reproduce & Testing (QA)`; bugfix placeholders must not stay empty. Disclose any `budget record --unavailable`.
- Preview remote payloads; never include context packs, usage ledgers, raw logs, or credentials.
- ASSISTED: never infer approval. When the human says yes, record it at once: `npx ai-engineering-loop deliver --run <runId> --approve --by <name>`. After commit, push and PR/MR, finish with `deliver --run <runId> --destination <where> --summary <text> --approve --by <name>` (writes `delivery.json` with `humanApproved: true`, runs `gate delivery`).
- Long form: `node status --run <runId>`, `node approve delivery-approval --yes --by <name> --run <runId>` for each READY approval node, write `RUN_DIR/delivery.json`, then `gate delivery`. If the gate says a node is not READY, follow its prerequisite hint; never bypass approval.
- Long form: `node status --run <runId>`, `node approve delivery-approval --yes --by <name> --run <runId>` for each READY approval node, write `RUN_DIR/delivery.json`, then `gate delivery`. Node not READY: follow its prerequisite hint; never bypass approval.
- Commit before `deliver` (its receipt binds `HEAD`; videos/screenshots: `--evidence AC-N=<https-url>`, required for `crossComponent` and rubric ACs). Paste `RUN_DIR/receipt.md` into the PR/MR Receipt section unchanged; ❌ stays ❌ (`docs pr-receipt`).
- Only the delivery gate completes the run. It also mines lessons for the next Run.
- Worktree Run: after `deliver`, continue in `cleanup.mainCheckout` (Stage 9).
- Only the delivery gate completes the run. Worktree Run: then continue in `cleanup.mainCheckout`.
- After the PR is open, `npx ai-engineering-loop pr babysit --run <runId>` polls with backoff. Failing checks start a T0 or T1 fix on that same branch and push it. Ready to merge, or changes requested, stops for a human. Merge stays with the human (`docs run-isolation`).

## Report header (execution mode)
Expand Down
1 change: 1 addition & 0 deletions .claude/skills/ael/references/loop-judge.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Read when `gate review` says `judgeRequired`, on T2, or when acting on findings.
- Judge context: only run-summary.md, verification-summary.json (or verification.json), open-findings.json/findings.json, and the Goal hash; it reads the full diff only if those contradict each other. Judge prompt includes "at most 4 tool calls; ledger and contract only; skip css; do not re-review the whole diff".
- Spawn a fresh sibling Judge, wait, `budget record`, write `RUN_DIR/verdict.json` with `modelTier` and any `judgeFindings`, then `gate judge`. A gate failure overrides optimistic prose.
- ITERATE under the recipe cap: fix in the parent, re-verify, spawn a **new** DA (never resume the previous child). At the cap or NO_PROGRESS, ESCALATE to the human.
- Code changed after PASS (DA fixes, test fixes): `run --reopen --run <runId> --reason <what>` starts a new iteration; `gate maker` refuses to overwrite a judged diff (`docs iteration-policy`).

## Acting on findings (DA during ITERATE, or human MR/PR comments)

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project are documented here. Versions follow [Semant

## Unreleased

- **Fixed:** AEL could deliver code the Judge never saw. `verify` recorded evidence against the gated `diff.patch` hash while it ran on the working tree, so a fix made after `gate maker` was verified but never reviewed; and `deliver` never compared the commit with the judged diff, so code added after Judge PASS and committed was delivered. `verify`, `gate verification` and `gate delivery` now compare the Run's change (from the commit the Run started on to the working tree, committed or not) with `diff.patch` and refuse with `DIFF_DRIFT`, naming the files and `run --reopen`. The same change committed or uncommitted still matches.
- **Fixed:** `gate maker --from-git` diffed against `HEAD`, so a change committed before the Maker gate failed with "found no changes against HEAD" and no WHY/FIX. It now diffs against the Run's starting commit; when there really is no change, the error says why and what to do.
- **Added:** bench sandbox scenario `rework` (deliver refuses unjudged code after PASS, `run --reopen`, loop again, deliver).

- **Fixed:** a Run stuck after Judge PASS when the code changed afterwards (for example test fixes for Devil's Advocate findings). `gate maker --from-git` overwrote the judged `diff.patch`, the Run could not take a new Maker diff, and `deliver` failed, so the only way out was `run --abandon`. Now `gate maker --from-git` refuses to overwrite a gated diff and names the new command `run --reopen --run <id> --reason <text>`, which starts a new iteration: the gated diff, evidence, ledger, verdict and approval move to `runs/<id>/iterations/<n>/`, and Maker, verification, review, Judge and delivery run again on the new diff, so the delivered diff is still the judged diff. The verification and stale-artifact gate errors name the same command. See `docs iteration-policy`.

- **Fixed:** DOT delivery could let GitLab close the card on merge. The adapter now says delivery never closes the card: commits and MR text reference the issue only as `Refs #<iid>`, `Related to #<iid>` or the bare URL, never after `Closes`/`Fixes`/`Resolves`/`Implements`, and never via `glab issue close`. The Coreview fix-commit template no longer reads `resolve <...>`. A test scans every DOT adapter file for closing keywords.

- **Fixed:** an approved delivery kept showing as waiting for minutes. The agent recorded your approval only in its last `deliver` call, after committing, pushing and opening the PR, so Studio and the notification kept asking. `deliver --run <id> --approve --by <name>` without a destination now records the approval at once (approval nodes, `delivery.json` with `approvedAt`; repeatable), and the delivery stage tells the agent to run it the moment you say yes; the full `deliver` still finishes the Run. Before, that call approved the nodes and then failed asking for `--destination`.
Expand Down
2 changes: 1 addition & 1 deletion adapters/dot/coreview.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Every Coreview comment must be categorized into one of two paths:
```
3. Commit and push the fix to the branch:
```bash
git commit -m "fix(coreview): resolve <issue summary>"
git commit -m "fix(coreview): <finding summary>"
git push origin <branch-name>
```
4. Cherry-pick the new fix commit to all other active environment branches (`main`, `staging`).
Expand Down
8 changes: 8 additions & 0 deletions adapters/dot/gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ flowchart TD
Triage --> Ready[Move card to Ready to review: Step 4]
```

### Delivery never closes the card

DOT delivery never closes the card: it only moves it to "Ready to review" (Step 4), and closing stays with humans. GitLab closes an issue by itself when a commit or MR description that reaches the default branch puts a closing keyword (`Closes`, `Fixes`, `Resolves`, `Implements`, any tense) before an issue reference or issue URL. So in commit messages, MR titles and MR descriptions:

- Reference the issue only as `Refs #<issue-iid>`, `Related to #<issue-iid>`, or the bare issue URL (as in the MR template's `## Issue` section).
- Never put a closing keyword before an issue reference, and never run `glab issue close`.
- `fix(#300): ...` and `Refs #300` are fine; a closing keyword followed by `#300` is not.

---

## 3. Step 1: Git Context & Remote Repository Inspection
Expand Down
2 changes: 2 additions & 0 deletions adapters/dot/skills/dot-dev-workflow/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ git commit -m "<type>(<scope>): <summary>"

2. Create a GitLab issue if none is linked (`glab issue create` with module title, scope checkboxes, `Steps to Reproduce & Testing (QA)` from `adapters/dot/gitlab.md`, expectation table, label `Ready to Test`). On a bugfix, do not leave those placeholders empty.

Delivery never closes the card; closing stays with humans. GitLab closes an issue on merge to the default branch when a commit or MR text puts `Closes`, `Fixes`, `Resolves` or `Implements` before an issue reference. Reference the issue only as `Refs #<issue-iid>`, `Related to #<issue-iid>` or the bare issue URL, and never run `glab issue close`.

3. Open **one** MR (`glab mr create` onto the live integration base from the topic-branch rules above; description links the issue). Issue and MR descriptions must include `Steps to Reproduce & Testing (QA)` (reproduce + how to test). On a bugfix, do not leave those placeholders empty. Do not cherry-pick to `staging` or `develop` unless the user named those branches this turn. Chat `setuju` is not propagate. Do not open three MRs.

---
Expand Down
1 change: 1 addition & 0 deletions bench/sandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Needs Docker, git and npm on the host. The `gh-logged-out` image downloads the `
| `no-identity` | Node + git | no `user.name` / `user.email` |
| `gh-missing` | Node + git | GitHub remote, `gh` not installed |
| `gh-logged-out` | Node + git + gh | GitHub remote, `gh` not logged in |
| `rework` | Node + git | code changed after Judge PASS: deliver refuses, `run --reopen`, loop again |
| `cli-errors` | Node + git | typos, missing arguments, Run conflicts |
| `empty-folder` | Node only | bare `ael` in an empty folder |
| `host-stale` | Node + git | `~/.claude` exists, skill never installed |
Expand Down
19 changes: 19 additions & 0 deletions bench/sandbox/scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,25 @@ gh-missing|gh-logged-out)
expect_out deliver-warns-adapter 'adapter-auth'
;;

rework)
# The delivered diff is the judged diff: drift after gate maker or after PASS
# is refused and names `run --reopen`, which re-runs the loop on the new diff.
identity; sample_app
c ael init; expect_rc init 0
git add -A && git commit -qm ael-init
drive_to_pass
echo 'exports.boom = () => { throw new Error("unjudged"); };' >> src/math.js
git add -A src test && git commit -qm "add subtract"
c ael deliver --destination pr --summary "add subtract" --approve --by newbie; expect_rc_not0 deliver-refuses-unjudged; expect_out deliver-names-reopen 'run --reopen'
c ael gate maker --from-git; expect_rc_not0 maker-keeps-judged-diff; expect_out maker-names-reopen 'run --reopen'
c ael run --reopen --reason "boom after PASS" --json; expect_rc reopen 0; expect_out reopen-iteration '"iteration": ?2'
c ael gate maker --from-git; expect_rc gate-maker-2 0
c ael verify; expect_rc verify-2 0; expect_out verify-2-state 'VERIFIED'
c ael review-pack --json; expect_rc review-pack-2 0
c ael review ingest --child-id da-2 --file /tmp/da.json --json; expect_rc review-ingest-2 0; expect_out judged-pass-2 'JUDGED_PASS'
c ael deliver --destination pr --summary "add subtract" --approve --by newbie; expect_rc deliver-2 0; expect_out delivered 'DELIVERED'
;;

cli-errors)
identity; sample_app
c ael int
Expand Down
Loading
Loading