195 lines
5.7 KiB
Markdown
195 lines
5.7 KiB
Markdown
# stage Ground
|
||
|
||
```prompt
|
||
You ground ONE Flutter behaviour for this repository's app/ before any code is written. The run directory is app/ of a dedicated git worktree on its own branch. Read app/AGENTS.md first.
|
||
|
||
The run prompt names one observable behaviour (a parity gap or a bug). Establish the facts, read-only:
|
||
1. The reference: find the behaviour in the web client (../web/src/, ../web/*.css) and, if relevant, the Android client (../android/). Quote exact wording, ordering and conditions with file:line. Check what the web actually RENDERS (e.g. a RENDERED_* list, the view function), not a constant listing every key.
|
||
2. The Flutter code that owns it under lib/, with file:line, and the existing tests under test/ that cover it.
|
||
3. Whether the gap is real today: if main already behaves like the reference, say so and return `done`.
|
||
4. A minimal plan: the files to change (lib/ and test/, normally at most 3 source files and 1–2 test files), and the regression test that will fail now and pass after the fix.
|
||
|
||
Do not edit anything. Report the facts as markdown headings (Reference, Flutter code, Gap, Plan, Regression test).
|
||
```
|
||
|
||
```configs
|
||
provider=openai
|
||
model=gpt-6-luna
|
||
retries=1
|
||
timeout=20m
|
||
```
|
||
|
||
```tools
|
||
read
|
||
glob
|
||
grep
|
||
shell
|
||
```
|
||
|
||
```edges
|
||
success -> Red
|
||
done -> #success
|
||
blocked -> #failure
|
||
error -> #failure
|
||
```
|
||
|
||
# stage Red
|
||
|
||
```prompt
|
||
You write the regression test for the grounded behaviour, and only the test. Read app/AGENTS.md and the previous turn's Plan and Regression test.
|
||
|
||
Write or extend the focused test under test/ so it asserts the reference behaviour (exact wording, order, geometry or requests as grounded). Do not touch lib/. Run only that test file with /Users/alan/development/flutter/bin/flutter test <file> and confirm it FAILS for the expected reason on the current code. Paste the failing assertion. If it passes already, the gap is not what was grounded: return `blocked` with the evidence.
|
||
```
|
||
|
||
```configs
|
||
provider=openai
|
||
model=gpt-6-luna
|
||
retries=1
|
||
timeout=20m
|
||
```
|
||
|
||
```tools
|
||
read
|
||
glob
|
||
grep
|
||
edit
|
||
shell
|
||
```
|
||
|
||
```edges
|
||
success -> Code
|
||
blocked -> #failure
|
||
error -> #failure
|
||
```
|
||
|
||
# stage Code
|
||
|
||
```limits
|
||
{"max_visits":4,"on":["blocked_retryable"]}
|
||
```
|
||
|
||
```prompt
|
||
You implement the smallest change under lib/ that makes the new regression test pass. Read app/AGENTS.md, the grounded facts and the Red turn; on a later visit, address the review's located findings.
|
||
|
||
Rules: one observable behaviour; reuse existing helpers and naming; comments only where the surrounding code has them; no refactors, renames or extra behaviours; never run `dart format` on directories (format only the files you changed); do not edit the regression test except to fix a genuine mistake you explain. Run the regression test and the area's tests (/Users/alan/development/flutter/bin/flutter test test/<area>) and /Users/alan/development/flutter/bin/flutter analyze. Report the exact diff (`git diff`) and results. Use blocked_retryable only for an evidenced transient tool problem.
|
||
```
|
||
|
||
```configs
|
||
provider=openai
|
||
model=gpt-6-luna
|
||
retries=1
|
||
timeout=30m
|
||
```
|
||
|
||
```tools
|
||
read
|
||
glob
|
||
grep
|
||
edit
|
||
shell
|
||
```
|
||
|
||
```edges
|
||
success -> Review
|
||
blocked_retryable -> Code
|
||
blocked -> #failure
|
||
error -> #failure
|
||
```
|
||
|
||
# stage Review
|
||
|
||
```limits
|
||
{"max_visits":3,"on":["rejected"]}
|
||
```
|
||
|
||
```prompt
|
||
You review the full change independently; you do not edit. Read app/AGENTS.md, the grounded Reference and the diff (`git diff` plus `git status` for new files).
|
||
|
||
Check, with evidence:
|
||
1. Behaviour matches the reference exactly (re-read the cited web/Android lines yourself).
|
||
2. Scope: only the planned files; no unrelated formatting churn, renames, refactors or extra behaviour.
|
||
3. The regression test truly guards the change: temporarily revert only the lib/ hunks with `git diff -- lib > /tmp/<run>.patch && git checkout -- lib`, run the test and see it fail, then restore with `git apply /tmp/<run>.patch` and confirm `git diff` is identical. Never use `git stash` (the stash stack is shared with other worktrees).
|
||
4. Conventions: matches surrounding code; no TODOs, debug prints or dead code.
|
||
|
||
Return `rejected` only for a must-fix defect with file:line, evidence and remedy; `advisory` for non-blocking notes; `success` otherwise.
|
||
```
|
||
|
||
```configs
|
||
provider=openai
|
||
model=gpt-6-luna
|
||
retries=1
|
||
timeout=30m
|
||
```
|
||
|
||
```tools
|
||
read
|
||
glob
|
||
grep
|
||
shell
|
||
```
|
||
|
||
```edges
|
||
success -> Verify
|
||
advisory -> Verify
|
||
rejected -> Code
|
||
error -> #failure
|
||
```
|
||
|
||
# stage Verify
|
||
|
||
```prompt
|
||
You run the landing gate on the change merged with the latest main; you do not edit source. From app/: `git merge main --no-edit` (if it conflicts, return `blocked` naming the files), then `sh tool/check_full.sh`. It passes only when it prints `CHECK PASSED`. Report the exact final line and, on failure, the failing tests from build/check/test.log, and return `blocked`.
|
||
```
|
||
|
||
```configs
|
||
provider=openai
|
||
model=gpt-6-luna
|
||
retries=1
|
||
timeout=30m
|
||
```
|
||
|
||
```tools
|
||
read
|
||
glob
|
||
grep
|
||
shell
|
||
```
|
||
|
||
```edges
|
||
success -> Commit
|
||
blocked -> #failure
|
||
error -> #failure
|
||
```
|
||
|
||
# stage Commit
|
||
|
||
```prompt
|
||
You commit this run's verified change locally; you never push, tag, rebase, amend or merge into main (the manager lands it).
|
||
|
||
1. Inspect `git status` and the full diff; stage only this run's change (lib/, test/, and tool/ when the plan touched it). Never stage build/, logs or unrelated work.
|
||
2. Inspect the staged diff before committing.
|
||
3. If nothing is staged, return `success` saying so.
|
||
4. Commit with a concise conventional message (`fix(app): …` or `feat(app): …`) naming the behaviour. The message must contain NO AI or tool attribution: no Co-Authored-By trailer, no "Generated with" line.
|
||
5. Report the commit hash and `git log --oneline -1`.
|
||
```
|
||
|
||
```configs
|
||
provider=openai
|
||
model=gpt-6-luna
|
||
retries=1
|
||
timeout=15m
|
||
```
|
||
|
||
```tools
|
||
read
|
||
glob
|
||
grep
|
||
shell
|
||
```
|
||
|
||
```edges
|
||
success -> #success
|
||
blocked -> #failure
|
||
error -> #failure
|
||
```
|