@terreno/agent-plugin 0.0.0-stage → 57.21.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/.claude-plugin/plugin.json +32 -0
- package/CHANGELOG.md +2124 -0
- package/LICENSE +21 -0
- package/README.md +57 -2
- package/agents/pre-commit.md +65 -0
- package/agents/ui-verifier.md +93 -0
- package/package.json +32 -4
- package/references/async-review-bots.md +76 -0
- package/references/documentation-contract.md +61 -0
- package/references/execution-state.schema.json +77 -0
- package/references/github-attention-contract.md +165 -0
- package/references/independent-review.md +31 -0
- package/references/lifecycle-contract.md +211 -0
- package/references/loop-engineering.md +125 -0
- package/references/pick-roast-loop.md +112 -0
- package/references/pr-deployments.md +69 -0
- package/references/product-ci.md +164 -0
- package/references/push-ownership.md +91 -0
- package/references/stage-result.schema.json +82 -0
- package/references/subagent-briefing.md +43 -0
- package/references/testing-plan.md +163 -0
- package/references/user-guide.md +171 -0
- package/skills/1-grow/SKILL.md +145 -0
- package/skills/1-grow/references/grilling.md +243 -0
- package/skills/2-pick/SKILL.md +170 -0
- package/skills/2-pick/references/mocking.md +34 -0
- package/skills/2-pick/references/testing.md +43 -0
- package/skills/3-roast/SKILL.md +168 -0
- package/skills/4-brew/SKILL.md +201 -0
- package/skills/5-taste/SKILL.md +311 -0
- package/skills/ai-prompt-governance/SKILL.md +100 -0
- package/skills/attach-pr-media/SKILL.md +89 -0
- package/skills/attach-pr-media/scripts/upload-pr-media.sh +151 -0
- package/skills/backend-test-env/SKILL.md +64 -0
- package/skills/backfill-regression/SKILL.md +101 -0
- package/skills/backfill-user-guide/SKILL.md +96 -0
- package/skills/bootstrap-mcp-server/SKILL.md +244 -0
- package/skills/building-admin-interfaces/SKILL.md +83 -0
- package/skills/building-admin-interfaces/agents/openai.yaml +4 -0
- package/skills/building-admin-interfaces/references/nav-and-shell.md +42 -0
- package/skills/building-admin-interfaces/references/patterns-and-tools.md +73 -0
- package/skills/building-admin-interfaces/references/screens-and-routes.md +50 -0
- package/skills/building-terreno-apps/SKILL.md +280 -0
- package/skills/building-terreno-apps/agents/openai.yaml +4 -0
- package/skills/building-terreno-apps/references/navigation.md +102 -0
- package/skills/building-terreno-apps/references/route-structure.md +91 -0
- package/skills/building-terreno-apps/references/screen-patterns.md +191 -0
- package/skills/debug-syncdb-with-mcp/SKILL.md +75 -0
- package/skills/deploy-gcp/SKILL.md +73 -0
- package/skills/deploy-gcp/references/troubleshooting.md +29 -0
- package/skills/generate-release-announcements/SKILL.md +145 -0
- package/skills/generate-sdk/SKILL.md +156 -0
- package/skills/mongoose-schema-safety/SKILL.md +164 -0
- package/skills/pick-roast-loop/SKILL.md +152 -0
- package/skills/planning-loop/SKILL.md +161 -0
- package/skills/prd/SKILL.md +138 -0
- package/skills/set-up-social-login/SKILL.md +76 -0
- package/skills/store-assets/SKILL.md +221 -0
- package/skills/store-assets/examples/screenshots.yaml +31 -0
- package/skills/store-assets/examples/storeAssets.config.json +44 -0
- package/skills/store-assets/scripts/banner.ts +165 -0
- package/skills/store-assets/scripts/config.ts +255 -0
- package/skills/store-assets/scripts/devClient.ts +635 -0
- package/skills/store-assets/scripts/devices.ts +286 -0
- package/skills/store-assets/scripts/icon.ts +81 -0
- package/skills/store-assets/scripts/maestro/goHome.yaml +21 -0
- package/skills/store-assets/scripts/maestro/login.yaml +27 -0
- package/skills/store-assets/scripts/maestro/openApp.yaml +26 -0
- package/skills/store-assets/scripts/screenshots.ts +848 -0
- package/skills/taste-sweep/SKILL.md +172 -0
- package/skills/terreno-backend-api/SKILL.md +355 -0
- package/skills/terreno-backend-api/agents/openai.yaml +4 -0
- package/skills/terreno-backend-api/references/custom-routes.md +132 -0
- package/skills/terreno-backend-api/references/model-router.md +116 -0
- package/skills/terreno-backend-api/references/server-setup.md +116 -0
- package/skills/terreno-backend-tests/SKILL.md +176 -0
- package/skills/terreno-data-fetching/SKILL.md +276 -0
- package/skills/terreno-data-fetching/agents/openai.yaml +4 -0
- package/skills/terreno-data-fetching/references/auth-and-tokens.md +93 -0
- package/skills/terreno-data-fetching/references/realtime.md +45 -0
- package/skills/terreno-data-fetching/references/sdk-customization.md +84 -0
- package/skills/terreno-frontend-tests/SKILL.md +190 -0
- package/skills/terreno-mobile-tests/SKILL.md +127 -0
- package/skills/terreno-test-setup/SKILL.md +81 -0
- package/skills/terreno-test-setup/references/backend.md +131 -0
- package/skills/terreno-test-setup/references/frontend.md +169 -0
- package/skills/terreno-test-setup/references/mobile.md +134 -0
- package/skills/terreno-ui/SKILL.md +252 -0
- package/skills/terreno-ui/agents/openai.yaml +4 -0
- package/skills/terreno-ui/references/data-display.md +85 -0
- package/skills/terreno-ui/references/feedback.md +122 -0
- package/skills/terreno-ui/references/forms.md +119 -0
- package/skills/terreno-ui/references/layout.md +124 -0
- package/skills/terreno-ui/references/theming.md +87 -0
- package/skills/update-docs/SKILL.md +82 -0
- package/skills/upgrading-terreno/SKILL.md +86 -0
- package/skills/upgrading-terreno/references/ordering.md +40 -0
- package/skills/verify-ui-changes/SKILL.md +605 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Independent review
|
|
2
|
+
|
|
3
|
+
Review a pinned branch diff without changing code. Keep two axes separate:
|
|
4
|
+
|
|
5
|
+
1. **Repository standards:** applicable instructions/project skills, behavior,
|
|
6
|
+
architecture, security, maintainability, and test quality.
|
|
7
|
+
2. **IP/spec:** missing, partial, incorrect, or unrequested behavior; promised tests/docs
|
|
8
|
+
absent; acceptance criteria not met.
|
|
9
|
+
|
|
10
|
+
Resolve the fixed point. The **parent** builds one [task-scoped briefing](subagent-briefing.md):
|
|
11
|
+
current task, criteria, file list, and the patch for those files only. Give each axis
|
|
12
|
+
to a fresh reviewer **with that briefing** when the harness supports it. Reviewers must
|
|
13
|
+
not rediscover skills, load unnamed lifecycle references, run a full-branch `git diff`,
|
|
14
|
+
or spawn nested reviewers. Require the rule or quoted requirement plus concrete
|
|
15
|
+
file/hunk evidence for every finding. Tool-enforced formatting is not a review finding.
|
|
16
|
+
|
|
17
|
+
Rank severity only within an axis. A clean review has no unresolved material finding in
|
|
18
|
+
either available axis. If no spec exists, state that; never invent one.
|
|
19
|
+
|
|
20
|
+
Return:
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
## Standards
|
|
24
|
+
<findings or "No material findings">
|
|
25
|
+
|
|
26
|
+
## Spec
|
|
27
|
+
<findings, "No material findings", or "No spec available">
|
|
28
|
+
|
|
29
|
+
Summary: <count> standards finding(s); <count> spec finding(s).
|
|
30
|
+
```
|
|
31
|
+
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Lifecycle contract
|
|
2
|
+
|
|
3
|
+
Grow, Pick, Roast, Brew, and Taste are **transitions**, not the orchestration loop.
|
|
4
|
+
`terreno-pick-roast-loop`, `terreno-planning-loop`, and `terreno-taste-sweep` are
|
|
5
|
+
invocable outer loops; they must not be recorded as `stage` values.
|
|
6
|
+
|
|
7
|
+
| Owner | Responsibility |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Outer loop | when to invoke, which agent, persistence, Taste `PENDING` reinvocation, retry, stop, escalation |
|
|
10
|
+
| Pick–Roast inner loop | one task Pick, Roast that task, next task, until the list is done |
|
|
11
|
+
| Lifecycle stage | how to perform one stage correctly and emit evidence |
|
|
12
|
+
| Repository skills | repository commands, architecture, safety rules, and domain conventions |
|
|
13
|
+
| Roast | whether the implementation satisfies the approved IP |
|
|
14
|
+
| State + evidence | what a fresh invocation needs from previous attempts |
|
|
15
|
+
|
|
16
|
+
Every stage reads durable inputs, performs one bounded transition, writes the execution
|
|
17
|
+
state, emits one result document, and exits. Never rely on conversational memory.
|
|
18
|
+
Pick is the exception that still stays bounded: it continues the
|
|
19
|
+
[`pick-roast loop`](pick-roast-loop.md) in-process (one task, then Roast, then the next
|
|
20
|
+
task) until the approved list is done, a `FAIL` that cannot continue, or `BLOCKED`.
|
|
21
|
+
Roast never invokes Pick. Roast proves the current task and returns. Brew and Taste
|
|
22
|
+
include one in-process wait for
|
|
23
|
+
[`async review bots`](async-review-bots.md) (Bugbot, CodeQL, and similar) before that
|
|
24
|
+
exit, so they can react to those results. Taste then waits in-process for product CI
|
|
25
|
+
with [`product-ci.md`](product-ci.md) on every discovered host, using GitHub CLI or
|
|
26
|
+
CircleCI CLI in a watch loop until jobs are terminal or the wait times out. Before any
|
|
27
|
+
push, Taste fetches the latest `master` and merges it only when the PR conflicts, a failure
|
|
28
|
+
traces to base drift, or the branch is otherwise merge-ready, then records last-run failed
|
|
29
|
+
tests from the CI snapshot and re-verifies them locally, then spawns a fresh subagent
|
|
30
|
+
with no parent conversation. The subagent runs the root package's `prepush` script when
|
|
31
|
+
present; that script is the repository-owned gate for lint, typecheck, static analysis,
|
|
32
|
+
tests, and other local policy. When it is absent, Taste falls back to lint, typecheck,
|
|
33
|
+
and locally affected tests in each affected package. Taste then pushes and watches
|
|
34
|
+
product CI. Hosts and tokens are on the product-CI page.
|
|
35
|
+
|
|
36
|
+
Every stage that pushes follows push ownership (`push-ownership.md`, bundled with
|
|
37
|
+
Brew, Taste, and the outer loops): the PR stays
|
|
38
|
+
owned until CI is green on every host and every review-bot comment is addressed, or
|
|
39
|
+
until three fix rounds fail and the human is told. A pushed PR is never left red or
|
|
40
|
+
unwatched.
|
|
41
|
+
|
|
42
|
+
## Discover supporting skills
|
|
43
|
+
|
|
44
|
+
At the start of every stage:
|
|
45
|
+
|
|
46
|
+
1. Inspect skills exposed by the harness and repository (for example skill catalogs and
|
|
47
|
+
repository skill directories).
|
|
48
|
+
2. Match their descriptions to the **files and criteria in this slice**, not the whole
|
|
49
|
+
catalog.
|
|
50
|
+
3. Load applicable `SKILL.md` files before acting. Record their names in `skills`.
|
|
51
|
+
Do not load sibling lifecycle references this stage did not name.
|
|
52
|
+
4. If repository instructions require a capability and it is unavailable, return
|
|
53
|
+
`BLOCKED`; never silently skip it.
|
|
54
|
+
5. If no skill applies, infer conventions from repository instructions, existing code,
|
|
55
|
+
tests, package scripts, and recent analogous changes.
|
|
56
|
+
|
|
57
|
+
Do not assume any particular supporting skill name exists. Lifecycle skills describe
|
|
58
|
+
portable method; repository skills describe the repository.
|
|
59
|
+
|
|
60
|
+
When spawning a fresh subagent, pass a [task-scoped briefing](subagent-briefing.md)
|
|
61
|
+
instead of asking the child to rediscover the repository.
|
|
62
|
+
|
|
63
|
+
## Documentation
|
|
64
|
+
|
|
65
|
+
Every stage follows the [`documentation contract`](documentation-contract.md):
|
|
66
|
+
|
|
67
|
+
- Read architecture and domain docs before acting.
|
|
68
|
+
- Treat docs as the architecture source; code implements them.
|
|
69
|
+
- Update docs in the same slice as the behavior.
|
|
70
|
+
- Write with standard headings, tables, and one minimal example.
|
|
71
|
+
- Missing docs for a user-visible or architectural change is `FAIL`.
|
|
72
|
+
|
|
73
|
+
## Stage result
|
|
74
|
+
|
|
75
|
+
Machine-readable result is for the next skill and the outer loop. It is **not** the
|
|
76
|
+
human-facing answer.
|
|
77
|
+
|
|
78
|
+
Lead the chat with `status`, `next`, and `action` in one or two lines. Put the YAML
|
|
79
|
+
only in a collapsed details block. On a PR, put it only in the Details toggle from the
|
|
80
|
+
[`GitHub attention contract`](github-attention-contract.md). Never paste the YAML in
|
|
81
|
+
visible PR body, comments, or the main chat.
|
|
82
|
+
|
|
83
|
+
When a PR has GitHub Deployments, close every wait-for-human or done message with those
|
|
84
|
+
demo URLs as the **last visible section**, per [`pr-deployments.md`](pr-deployments.md).
|
|
85
|
+
Omit the section when no `environmentUrl` exists. Do not comment the links on the PR.
|
|
86
|
+
|
|
87
|
+
The schema is [`stage-result.schema.json`](stage-result.schema.json) (`v: 2`). Required
|
|
88
|
+
keys are `v`, `stage`, `status`, `next`, and `action`. Omit nulls and empty arrays.
|
|
89
|
+
Status values are exactly `PASS`, `FAIL`, `BLOCKED`, or `PENDING`.
|
|
90
|
+
|
|
91
|
+
Wrap the YAML:
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<details>
|
|
95
|
+
<summary>Stage result</summary>
|
|
96
|
+
</details>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Example payload:
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
v: 2
|
|
103
|
+
stage: roast
|
|
104
|
+
status: FAIL
|
|
105
|
+
ip: example-feature
|
|
106
|
+
task: T2
|
|
107
|
+
attempt: 2
|
|
108
|
+
sha: abc123
|
|
109
|
+
checks:
|
|
110
|
+
- name: cursor-pagination
|
|
111
|
+
status: FAIL
|
|
112
|
+
ev: "bun test: expected 2 records, received 3"
|
|
113
|
+
fail:
|
|
114
|
+
- need: Cursor pagination is backwards compatible
|
|
115
|
+
want: No duplicate records across pages
|
|
116
|
+
got: Final page repeats one record
|
|
117
|
+
ev: test output
|
|
118
|
+
next: pick
|
|
119
|
+
action: Fix duplicate cursor boundary and rerun the failing test
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Evidence in `ev` must be reproducible: command plus outcome, artifact path, API
|
|
123
|
+
response, log location, or PR/check URL. Never persist chain-of-thought or conversational
|
|
124
|
+
transcripts.
|
|
125
|
+
|
|
126
|
+
| Key | Meaning |
|
|
127
|
+
| --- | --- |
|
|
128
|
+
| `sha` | current head |
|
|
129
|
+
| `skills` | supporting skills loaded |
|
|
130
|
+
| `done` | completed work |
|
|
131
|
+
| `fail` | `need` / `want` / `got` / `ev`; optional `sev` |
|
|
132
|
+
| `block` | `kind` / `why` / optional `ev` |
|
|
133
|
+
| `ask` | human questions: `q` / `rec` / optional `opts` |
|
|
134
|
+
| `next` | recommended next stage or `null` |
|
|
135
|
+
| `action` | concrete next action |
|
|
136
|
+
| `wait` | seconds until the next Taste check (`PENDING` after bot timeout, product-CI wait timeout, or a second post-fix push) |
|
|
137
|
+
|
|
138
|
+
## Execution state
|
|
139
|
+
|
|
140
|
+
The IP and task file remain authoritative for design and scope. Execution state is a
|
|
141
|
+
small loop-owned handoff, not another plan.
|
|
142
|
+
|
|
143
|
+
The focused Pick–Roast outer loop may add the schema-defined `ledger` array. Each entry
|
|
144
|
+
records one Pick or Roast task attempt, head, status, summary/evidence, and optional
|
|
145
|
+
files, checks, artifacts, docs, hypothesis, and risks. It is the source for the single
|
|
146
|
+
completion or human-gate report.
|
|
147
|
+
|
|
148
|
+
Use an existing repository convention when present. Otherwise use
|
|
149
|
+
`.terreno/pipeline/<ip-or-task-slug>.json`, conforming to
|
|
150
|
+
[`execution-state.schema.json`](execution-state.schema.json). The outer loop must preserve
|
|
151
|
+
or transport this file between fresh invocations. Do not commit it unless the repository
|
|
152
|
+
explicitly tracks execution state; Brew must exclude loop-owned state from PR commits.
|
|
153
|
+
|
|
154
|
+
Each invocation:
|
|
155
|
+
|
|
156
|
+
1. Read state and verify its branch/sha/PR against reality.
|
|
157
|
+
2. Increment `attempt` for the invoked stage.
|
|
158
|
+
3. Consume `last` and prior `tried` approaches; do not repeat a failed approach
|
|
159
|
+
without new evidence.
|
|
160
|
+
4. Perform the stage.
|
|
161
|
+
5. Replace `last`, merge artifact references, and set `next`.
|
|
162
|
+
6. Emit the same result to the caller so the loop can persist it elsewhere.
|
|
163
|
+
|
|
164
|
+
When `terreno-pick-roast-loop` is driving, append the schema-defined `ledger` entry
|
|
165
|
+
between steps 5 and 6.
|
|
166
|
+
|
|
167
|
+
These six state operations are mandatory whenever a stage says “update execution state.”
|
|
168
|
+
Every result also includes a concrete `action`, even when `next` is `null`. For
|
|
169
|
+
`BLOCKED`, set `next.human: true` only when the blocker is a human decision/policy gate;
|
|
170
|
+
access/environment/external blockers remain false unless human action is genuinely
|
|
171
|
+
required.
|
|
172
|
+
|
|
173
|
+
If no writable artifact exists, still emit the result. If the outer loop cannot preserve
|
|
174
|
+
that result for the next fresh invocation, return `BLOCKED` and name the missing state
|
|
175
|
+
transport.
|
|
176
|
+
|
|
177
|
+
## Failures, blockers, and retries
|
|
178
|
+
|
|
179
|
+
- `FAIL`: objective engineering or verification failure. Preserve exact evidence and
|
|
180
|
+
recommend the smallest evidence-driven retry.
|
|
181
|
+
- `BLOCKED`: no safe engineering action exists now. Classify `human`, `environment`,
|
|
182
|
+
`access`, or `external`; include the exact action or decision required.
|
|
183
|
+
- `PENDING`: changing external state is not terminal (primarily Taste). Include `wait`;
|
|
184
|
+
the **outer loop** waits and invokes again. With no outer loop (a human invoked
|
|
185
|
+
Taste or Brew directly), Taste's standalone entry waits and reacts again itself.
|
|
186
|
+
`PENDING` is never the final answer to a human. Use `PENDING` for review-bot timeout,
|
|
187
|
+
product-CI wait-loop timeout (jobs still pending on GitHub Actions, CircleCI,
|
|
188
|
+
Buildkite, and similar), and after Taste's second post-fix push. Do not emit
|
|
189
|
+
`PENDING` while Bugbot, CodeQL, or similar review bots are still queued or in
|
|
190
|
+
progress; wait per the async-review-bots procedure first. Do not emit `PENDING` for
|
|
191
|
+
unfinished product CI until Taste has run the product-CI wait loop to completion or
|
|
192
|
+
timeout, preferring `gh` / `circleci` watch hooks.
|
|
193
|
+
- `PASS`: this stage's success conditions are proven for the recorded head.
|
|
194
|
+
|
|
195
|
+
Human gates include unresolved product semantics, architecture/security/data ownership,
|
|
196
|
+
destructive or irreversible operations, permissions, public compatibility, significant
|
|
197
|
+
scope growth, and policy-required approval. Include options, tradeoffs, evidence, and a
|
|
198
|
+
recommended default when appropriate.
|
|
199
|
+
|
|
200
|
+
An outer loop requesting human input must first summarize the overall plan state,
|
|
201
|
+
completed work, failed/recovered attempts, decisive evidence, options and impact, and a
|
|
202
|
+
recommended default. It ends with one exact question, then the Demo section when the PR
|
|
203
|
+
has deployment URLs. Objective engineering failures are not human gates while a concrete
|
|
204
|
+
safe action remains.
|
|
205
|
+
|
|
206
|
+
A PR that is still red after three fix rounds is `BLOCKED` and escalated per push
|
|
207
|
+
ownership (`push-ownership.md`, Escalation). No stage or loop ends silently on a red PR.
|
|
208
|
+
|
|
209
|
+
Bounded engineering retries must be hypothesis-driven. Taste waits in-process for
|
|
210
|
+
async review bots and for product CI (bounded watch loop). The outer loop reinvokes
|
|
211
|
+
Taste after `PENDING`. Brew waits in-process only for async review bots.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Loop engineering
|
|
2
|
+
|
|
3
|
+
This file describes orchestration for a runner, human, or automation. The lifecycle
|
|
4
|
+
skills do not implement Grow → Brew → Taste. Pick and Roast **do** implement the
|
|
5
|
+
[`pick-roast inner loop`](pick-roast-loop.md) in-process.
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
Grow PASS → Pick/Roast inner loop → Brew PASS → Taste
|
|
9
|
+
Pick one task → Roast that task
|
|
10
|
+
Roast FAIL → Pick (same task, exact evidence)
|
|
11
|
+
Roast PASS + remaining tasks → Pick (next frontier task)
|
|
12
|
+
Roast PASS + no remaining tasks → Brew
|
|
13
|
+
Brew PENDING (review-bot timeout) ───→ outer loop waits → Taste
|
|
14
|
+
Taste PENDING (CI wait timeout / bot timeout / second push) ───→ outer loop waits → fresh Taste
|
|
15
|
+
Taste waits in-process for Bugbot/CodeQL and product CI (`gh` / `circleci`) ───→ same invocation reacts
|
|
16
|
+
Taste PASS ────────────→ merge-ready
|
|
17
|
+
Any BLOCKED ───────────→ human/external gate
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The loop persists the execution state, starts a fresh agent for Grow, for the first
|
|
21
|
+
Pick or Roast entry, and for Brew/Taste, honors `next`, waits on `PENDING` (`wait`
|
|
22
|
+
seconds), and stops on `PASS` or `BLOCKED` according to policy. It must not turn a human
|
|
23
|
+
decision into retries. It must not reinvoke Pick or Roast between tasks while the inner
|
|
24
|
+
loop can continue. Stage YAML is loop/skill data; keep it collapsed for humans. Brew and
|
|
25
|
+
Taste themselves wait until async review bots on the current head have reported,
|
|
26
|
+
preferring provider CLI watch hooks or harness subscriptions. Taste then waits in a loop
|
|
27
|
+
for product CI using GitHub CLI or CircleCI CLI until jobs are terminal or the wait
|
|
28
|
+
times out. The loop does not need to reinvoke for those in-process waits.
|
|
29
|
+
|
|
30
|
+
Three invocable outer-loop skills ship beside the five stages. They are not stages:
|
|
31
|
+
|
|
32
|
+
| Skill | Loop |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| `terreno-pick-roast-loop` | Drive an approved plan through recoverable Pick/Roast failures, accumulate one run ledger, and stop only at completion or a genuine human gate. |
|
|
35
|
+
| `terreno-planning-loop` | Walk Grow/Pick/Brew/Taste. Default Grow once, then Pick once (Pick owns the pick-roast inner loop). Pass `phases=` (`grow`, `pick`, `roast`, `brew`, `taste`) to restrict. |
|
|
36
|
+
| `terreno-taste-sweep` | Find the author's open non-draft PRs that are conflicting or failing, isolate each one, and reinvoke Taste until mergeable or blocked. |
|
|
37
|
+
|
|
38
|
+
## Invocation packet
|
|
39
|
+
|
|
40
|
+
Give each fresh agent a [task-scoped briefing](subagent-briefing.md):
|
|
41
|
+
|
|
42
|
+
1. lifecycle skill path/name
|
|
43
|
+
2. IP and task path
|
|
44
|
+
3. execution-state artifact
|
|
45
|
+
4. branch and current PR (if any)
|
|
46
|
+
5. previous stage result and referenced evidence
|
|
47
|
+
6. pointer to repository architecture docs for the affected area
|
|
48
|
+
7. this slice's criteria, file list, and patch — not a request to rediscover the catalog
|
|
49
|
+
|
|
50
|
+
The stage discovers repository skills itself, matching this slice's files. The loop may
|
|
51
|
+
suggest known skills but must not replace stage-level discovery. Roast and its children
|
|
52
|
+
must not spawn two unconstrained reviewers.
|
|
53
|
+
|
|
54
|
+
Invoking Pick is enough to run the inner loop until the approved task list is done.
|
|
55
|
+
Invoking Roast proves the current task only and emits `next: pick` or `next: brew`.
|
|
56
|
+
Roast never invokes Pick. Do not start the next task until Roast PASS. Exactly one driver continues after each current-task Roast: Pick owns the inner loop.
|
|
57
|
+
|
|
58
|
+
`terreno-pick-roast-loop` adds recovery around those bounded invocations. It reinvokes
|
|
59
|
+
the named stage when a concrete engineering action remains, but it does not repeat a
|
|
60
|
+
failed approach without a new hypothesis. It keeps cycle details in execution state and
|
|
61
|
+
presents one complete report at the end. At a human gate, the report must explain the
|
|
62
|
+
overall goal/state, completed work, decisive evidence, options and impact, recommendation,
|
|
63
|
+
then one exact question, then PR deployment URLs when a PR has them. It never invokes Grow, Brew, Taste, or product CI.
|
|
64
|
+
|
|
65
|
+
## Feature profile (formerly Grind)
|
|
66
|
+
|
|
67
|
+
For one bounded feature, the loop may use a compact approved task file instead of a full
|
|
68
|
+
IP when repository policy permits:
|
|
69
|
+
|
|
70
|
+
1. Invoke Grow to research/grill and write the compact task contract.
|
|
71
|
+
2. Invoke Pick once. It implements one unblocked task, roasts it, then picks the next
|
|
72
|
+
until the list is done. Do not dispatch parallel Picks and roast once at the end.
|
|
73
|
+
3. When the inner loop emits `PASS` with `next: brew`, invoke Brew, then fresh Taste
|
|
74
|
+
iterations.
|
|
75
|
+
|
|
76
|
+
The inner loop, not a long-lived parent agent outside Pick/Roast, marks tasks, persists
|
|
77
|
+
per-task results in execution state, and continues to the next frontier task.
|
|
78
|
+
|
|
79
|
+
## Backend/API scenario
|
|
80
|
+
|
|
81
|
+
- Grow shapes the model/API contract, acceptance criteria, and discoverable supporting
|
|
82
|
+
skills.
|
|
83
|
+
- Pick loads applicable API, schema, and test-environment skills and implements with TDD
|
|
84
|
+
one task at a time.
|
|
85
|
+
- Roast independently exercises that task's routes, integration/database behavior, and
|
|
86
|
+
regressions before the next task starts.
|
|
87
|
+
- Brew submits only after every in-scope task has Roast `PASS`.
|
|
88
|
+
- Taste reacts to the current CI/review state until the loop receives `PASS`. It waits
|
|
89
|
+
until Bugbot, CodeQL, and similar review bots have reported, then waits in a loop for
|
|
90
|
+
product CI with `gh` or `circleci`, then acts. Before any push it fetches latest
|
|
91
|
+
`master` (merging it only when needed), then spawns a fresh subagent with no parent conversation. When the repository
|
|
92
|
+
root defines a `prepush` package script, the subagent runs that authoritative local gate.
|
|
93
|
+
Otherwise it falls back to lint, typecheck, and locally affected tests in affected
|
|
94
|
+
packages. Before that gate, Taste records last-run failed tests from the CI snapshot and
|
|
95
|
+
re-verifies them locally. Taste then pushes and watches CI.
|
|
96
|
+
|
|
97
|
+
## UI scenario
|
|
98
|
+
|
|
99
|
+
- Grow shapes UX, API, state, and observable verification criteria.
|
|
100
|
+
- Pick loads applicable UI conventions and implements/tests one task's behavior.
|
|
101
|
+
- Roast loads the repository's UI verification capability, launches the real app,
|
|
102
|
+
exercises the changed workflow, and records media evidence before the next task.
|
|
103
|
+
- Brew attaches evidence after the inner loop completes.
|
|
104
|
+
- A Taste fix that changes UI reruns the required UI verification, pushes, and returns
|
|
105
|
+
`PENDING` for the new head.
|
|
106
|
+
|
|
107
|
+
## CI/review scenario
|
|
108
|
+
|
|
109
|
+
1. Brew pushes the PR, uses native watch/subscription hooks where available until
|
|
110
|
+
Bugbot/CodeQL (if running) are terminal, records outcomes, and exits with
|
|
111
|
+
`next: taste` without implementing fixes.
|
|
112
|
+
2. Taste waits if those bots are still running, then runs the product-CI wait loop
|
|
113
|
+
(`gh pr checks --watch` / `gh run watch` / `circleci run watch`) until jobs on SHA A
|
|
114
|
+
are terminal. It sees a branch-caused CI failure, fixes it, fetches latest
|
|
115
|
+
`master` (merging it only when needed), records last-run failed tests and re-verifies them locally, then runs the
|
|
116
|
+
root `prepush` script (or fallback lint, typecheck, and affected
|
|
117
|
+
tests) in a fresh subagent with no parent conversation, pushes SHA B, then watches
|
|
118
|
+
review bots and product CI on B, and acts once on those results. A further push emits
|
|
119
|
+
`PENDING` and exits.
|
|
120
|
+
3. The outer loop uses the same native watch hook only when Taste timed out or pushed a
|
|
121
|
+
second fix (falling back to the requested timer), then invokes fresh Taste. It sees
|
|
122
|
+
green jobs plus an actionable human review comment, fixes it, waits for review bots
|
|
123
|
+
and product CI on the new head, and emits `PENDING` or `PASS`.
|
|
124
|
+
4. When all jobs on every discovered host are terminal/pass, no conflicts, and no
|
|
125
|
+
actionable comments remain, Taste emits `PASS`.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Pick–Roast inner loop
|
|
2
|
+
|
|
3
|
+
Pick and Roast run as one automated inner loop until the approved task list is done.
|
|
4
|
+
The outer loop still owns Grow, Brew, Taste, persistence, Taste `PENDING` reinvocation,
|
|
5
|
+
and escalation. Taste waits in-process for product CI on the current head. The outer
|
|
6
|
+
loop does not wait between Pick and Roast, and it does not wait for a human to reinvoke
|
|
7
|
+
the next frontier task.
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Grow PASS
|
|
11
|
+
→ Pick (one unblocked task)
|
|
12
|
+
→ Roast (that task only)
|
|
13
|
+
FAIL → Pick (same task, exact evidence)
|
|
14
|
+
PASS + remaining unblocked tasks → Pick (next frontier task)
|
|
15
|
+
PASS + no remaining unblocked tasks → Brew
|
|
16
|
+
Any BLOCKED → emit and exit to the named gate
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Bounds
|
|
20
|
+
|
|
21
|
+
The inner loop is bounded by the approved task graph, not by CI or wall-clock:
|
|
22
|
+
|
|
23
|
+
- One Pick implements exactly one current unblocked task.
|
|
24
|
+
- Roast proves that task before any later task starts.
|
|
25
|
+
- Do not start the next task until Roast PASS.
|
|
26
|
+
- Roast FAIL retries the same task with a new hypothesis; do not repeat a failed
|
|
27
|
+
approach without new evidence.
|
|
28
|
+
- Exhausted retries, human/environment/access/external gates, or missing mandatory
|
|
29
|
+
verifiers emit `FAIL` or `BLOCKED` and **exit**. The inner loop does not invent scope.
|
|
30
|
+
- Terminal inner-loop `PASS` requires every in-scope task to have a Roast `PASS` on the
|
|
31
|
+
recorded head. Only then is `next: brew`.
|
|
32
|
+
|
|
33
|
+
Do not pick every task first and roast once at the end. Do not roast the whole IP after
|
|
34
|
+
the first Pick. Do not run independent frontier tasks in parallel inside this loop.
|
|
35
|
+
|
|
36
|
+
## Who executes whom
|
|
37
|
+
|
|
38
|
+
Invoking **Pick** enters this loop. Invoking **Roast** proves the current task only.
|
|
39
|
+
Roast never invokes Pick. Pick owns the inner loop. Exactly one driver continues after
|
|
40
|
+
each current-task Roast — that driver is always Pick. Do not let a parent Pick and a
|
|
41
|
+
Roast subagent both start the next task. A fresh Roast subagent has no conversational
|
|
42
|
+
"who invoked me" signal; prove-only Roast is the durable driver.
|
|
43
|
+
|
|
44
|
+
- After Pick records a completed slice, **invoke Roast to prove that task only**. Prefer
|
|
45
|
+
a fresh context or subagent when the harness allows. Pass a
|
|
46
|
+
[task-scoped briefing](subagent-briefing.md): this task's criteria, file list, and
|
|
47
|
+
patch. Do not ask Roast or its children to rediscover the skill catalog or diff the
|
|
48
|
+
whole branch. Roast must not spawn two unconstrained reviewers. If a fresh context is
|
|
49
|
+
unavailable, execute Roast from durable artifacts only and ignore Pick's completion
|
|
50
|
+
claims.
|
|
51
|
+
- Roast proves, records, and **returns**. It does not reconstruct Pick, does not invoke
|
|
52
|
+
Pick, and does not start the next task. `PASS` with remaining tasks emits `next: pick`.
|
|
53
|
+
`PASS` with none remaining emits `next: brew`. `FAIL` emits `next: pick`.
|
|
54
|
+
- When Pick invoked Roast, returning to Pick is enough. Pick then continues: Reconstruct
|
|
55
|
+
the next frontier task, including architecture docs and supporting skills for that
|
|
56
|
+
slice, or emit `next: brew` when none remain.
|
|
57
|
+
- When Roast is the entry skill, emit `next: pick` or `next: brew`. The caller (human or
|
|
58
|
+
outer loop) runs Pick. Roast still never invokes Pick.
|
|
59
|
+
- After Roast `FAIL`, return evidence to the parent Pick, or emit `next: pick` with the
|
|
60
|
+
exact `need` / `want` / `got` / `ev` evidence when Roast is the entry.
|
|
61
|
+
- Pick never skips Roast. Roast never implements the next slice itself.
|
|
62
|
+
|
|
63
|
+
Each cycle writes execution state (`task`, `attempt`, `last`, `tried`, `next`) before
|
|
64
|
+
continuing. The invocation emits one terminal stage result: the last cycle that stops
|
|
65
|
+
the loop. Intermediate cycle results live in execution state, not as extra human-facing
|
|
66
|
+
YAML dumps.
|
|
67
|
+
|
|
68
|
+
## Commits and pushes
|
|
69
|
+
|
|
70
|
+
Every commit a harness pushes starts a full CI run, so commits track proven behavior,
|
|
71
|
+
not loop bookkeeping:
|
|
72
|
+
|
|
73
|
+
- One behavior-scoped commit per task, made after that task's Roast `PASS`. It carries
|
|
74
|
+
the code, tests, docs, and task-file mark together.
|
|
75
|
+
- Roast-driven fixes amend or squash into the task's unpushed commit. Do not add
|
|
76
|
+
"harden", "strengthen", "prove", or "mark roasted" follow-up commits.
|
|
77
|
+
- Progress lives in execution state (`.terreno/pipeline/<slug>.json`), which is
|
|
78
|
+
git-ignored. Do not commit task-file checkbox edits on their own.
|
|
79
|
+
- Pick and Roast do not push. Brew pushes once after the whole list has Roast `PASS`.
|
|
80
|
+
Taste pushes at most once per reaction. Whoever pushes follows push ownership
|
|
81
|
+
(`push-ownership.md`, bundled with Brew and Taste).
|
|
82
|
+
- Do not start the next task while product CI on the pushed head reports a
|
|
83
|
+
branch-caused failure. Fix it first. Never wait on pending CI, and record
|
|
84
|
+
failures the branch did not cause for Taste instead of blocking on them.
|
|
85
|
+
|
|
86
|
+
## Independence
|
|
87
|
+
|
|
88
|
+
Roast remains the authoritative verifier. Pick's internal reviews are not proof. Roast
|
|
89
|
+
reconstructs the head and artifacts independently, maps in-scope criteria for **the
|
|
90
|
+
current task**, and classifies each with evidence. It does not fix implementation
|
|
91
|
+
defects.
|
|
92
|
+
|
|
93
|
+
When Roast runs in-process after Pick, it still must not trust conversational memory of
|
|
94
|
+
the implementation. Fresh context is preferred, not optional when the harness can spawn
|
|
95
|
+
one.
|
|
96
|
+
|
|
97
|
+
## Entry and exit
|
|
98
|
+
|
|
99
|
+
| Entry | Behavior |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| Grow `PASS` / human invokes Pick | Start at the next unblocked incomplete task |
|
|
102
|
+
| Human invokes Roast after a Pick cycle | Prove the current task, emit `next: pick` or `next: brew`, return |
|
|
103
|
+
| Roast `FAIL` from a prior invocation | Pick retries that task, then Roast, then continue |
|
|
104
|
+
|
|
105
|
+
| Stop | `next` |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| All in-scope tasks have Roast `PASS` | `brew` |
|
|
108
|
+
| Pick or Roast objective failure after focused retry | `pick` or `roast` as named by evidence, and **exit** when the invocation cannot continue safely |
|
|
109
|
+
| Unresolved gate | `null` (`BLOCKED`) |
|
|
110
|
+
|
|
111
|
+
Brew preconditions require this terminal Roast `PASS` across the in-scope task list, not
|
|
112
|
+
a Roast of only the last slice while earlier slices are unproven.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# PR deployments in chat
|
|
2
|
+
|
|
3
|
+
When a pull request has GitHub Deployments attached, the human must see those demo
|
|
4
|
+
URLs without hunting through CI, comments, or the middle of a long reply.
|
|
5
|
+
|
|
6
|
+
This is **chat-only**. Do not post the links as a PR comment. Do not wait for
|
|
7
|
+
deployments to become ready just to print them. Print what is attached now.
|
|
8
|
+
|
|
9
|
+
## When to print
|
|
10
|
+
|
|
11
|
+
Close with the Demo section on every **user-visible** message that either:
|
|
12
|
+
|
|
13
|
+
- waits for human input (grilling round, confirm-and-write, `BLOCKED` human gate,
|
|
14
|
+
`ask`, or any other stop that needs a reply), or
|
|
15
|
+
- ends the invocation (`PASS`, `FAIL`, `BLOCKED`, `PENDING`, completion report)
|
|
16
|
+
|
|
17
|
+
Skip the section when there is no PR, GitHub access cannot list deployments, or the
|
|
18
|
+
PR/head has no `environmentUrl` values. Do not write "no deployments."
|
|
19
|
+
|
|
20
|
+
Do not print this on intermediate tool-only work. Print it on the message the human
|
|
21
|
+
reads.
|
|
22
|
+
|
|
23
|
+
## Where it goes
|
|
24
|
+
|
|
25
|
+
Lead with `status` / `next` / `action` (or the grilling/gate question). Put stage YAML
|
|
26
|
+
in a collapsed Details block. **The last visible section is Demo** whenever URLs exist.
|
|
27
|
+
|
|
28
|
+
A human-gate question still appears in the body. Demo follows it so the links are the
|
|
29
|
+
last thing on screen.
|
|
30
|
+
|
|
31
|
+
## Discover
|
|
32
|
+
|
|
33
|
+
1. Resolve the current PR number and head SHA (`gh pr view --json number,url,headRefOid`
|
|
34
|
+
on this branch, or the PR already in execution state).
|
|
35
|
+
2. List GitHub Deployments for that PR/head. Prefer GraphQL on the pull request:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
gh api graphql -F owner=<owner> -F name=<repo> -F number=<pr> -f query='
|
|
39
|
+
query($owner:String!,$name:String!,$number:Int!){
|
|
40
|
+
repository(owner:$owner,name:$name){
|
|
41
|
+
pullRequest(number:$number){
|
|
42
|
+
deployments(last:20){
|
|
43
|
+
nodes{
|
|
44
|
+
environment
|
|
45
|
+
latestStatus{state environmentUrl createdAt}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
REST fallback: `gh api "repos/<owner>/<repo>/deployments?sha=<headSha>&per_page=20"`,
|
|
54
|
+
then each deployment's statuses for `environment_url`.
|
|
55
|
+
3. Keep rows whose latest status has a non-empty `environmentUrl` (success, in-progress,
|
|
56
|
+
or queued with a preview URL already assigned). Skip statuses that only have a log URL.
|
|
57
|
+
4. Deduplicate by URL. For the same environment name, keep the newest `createdAt`.
|
|
58
|
+
5. Do not invent URLs from job names. Do not scrape PR comments for previews.
|
|
59
|
+
|
|
60
|
+
## How to print
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
## Demo
|
|
64
|
+
|
|
65
|
+
- **<environment>**: <environmentUrl>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Use the deployment environment name as the label. One bullet per unique URL. No extra
|
|
69
|
+
prose. No CI log links in this section.
|