Skip to main content
Version: 57.2.0

Loop engineering

Terreno separates engineering method from orchestration:

LOOP
orchestrate / persist / wait
retry / stop / escalate
|
v
GROW
shape
|
v
PICK
build
|
v
ROAST
prove
|
v
BREW
submit
|
v
TASTE
react once

Repository knowledge composes underneath every invocation:

lifecycle stage + project skills + IP/task/state + evidence

Why fresh invocations

One enormous agent context accumulates assumptions, stale external state, and confidence in its own implementation. The lifecycle instead makes every stage reconstructable from durable artifacts. Pick can retry from exact Roast evidence; Roast can verify without the implementer's assumptions; Taste can react to the current PR head rather than an old green result.

The outer loop decides when, who, what next, when to retry, when to wait, and when to escalate. Stages decide how to perform one transition correctly.

The five transitions

StageQuestionPrimary evidence
GrowIs the work shaped and approved?IP/tasks, decisions, criterion→verification map
PickWas this slice implemented carefully?red/green tests, checks, internal reviews
RoastDoes the result actually satisfy the IP?independent requirement→evidence verdict
BrewIs the verified result correctly submitted?final checks, commit/head, PR, artifacts
TasteWhat is actionable on the current PR head now?CI, mergeability, reviews, bounded fixes

Roast is not another implementation review. It independently proves or disproves acceptance criteria. Taste is not a resident watcher. It observes once, acts once, emits PASS, FAIL, BLOCKED, or PENDING, then exits.

Portable plugin, local knowledge

The reusable plugin defines contracts, invariants, evidence, and transitions. Repo-local skills define exact API/UI/database patterns, commands, test environments, generated code, deployment, and safety rules.

Each stage inspects available skills and loads those whose descriptions match the affected domain. A useful skill is optional when absent; a capability required by repository policy is a hard gate and produces BLOCKED if unavailable.

Stages also load architecture docs before acting. Docs are the design; code implements them. Missing docs for a user-visible or architectural change is FAIL.

This lets the same Pick method compose with backend API and test-environment knowledge, while Roast composes with UI conventions and real-app verification.

Terreno's current project-skill layer

The canonical sources remain under .rulesync/skills/ and are generated for supported agents. The current high-value composition points include:

DomainRepo-local skills stages may discover
Backend/API/dataterreno-backend-api, mongoose-schema-safety, backend-test-env, generate-sdk, terreno-data-fetching
UI/appterreno-ui, building-terreno-apps, building-native-ui, verify-ui-changes
AI/promptsai-prompt-governance
Docs/submissionupdate-docs, commit, create-pr, fix-conflicts
Deployment/runtimedeploy-gcp, Expo deployment/workflow skills

This inventory is descriptive, not a plugin dependency list. Stages inspect the actual catalog on every invocation.

State and evidence

The IP remains the design/scope source of truth. The task file remains the execution checklist. Lightweight loop-owned state stores only current stage/attempt/task, branch/head/PR, the previous structured result, artifacts, attempted approaches, and next transition.

The fallback state location is .terreno/pipeline/<slug>.json; the outer loop preserves or transports it and Brew excludes it from commits unless repository policy says otherwise. Stage results follow the plugin's JSON-schema-backed YAML contract and never contain chain-of-thought or transcripts.

Retry and stop rules

  • Roast failure returns exact expected/actual evidence to a fresh Pick.
  • Engineering retries require a new hypothesis and preserve failed approaches.
  • Taste PENDING lets the outer loop wait and invoke fresh Taste against current state.
  • Human decisions are BLOCKED, never arbitrary retries.
  • Taste PASS requires all current-head checks terminal/non-failing, no conflicts, and no actionable review findings.

The detailed contract, schemas, and three execution scenarios live under plugins/terreno-planning/references/.