Workflows and Explicit Bounded Loops Development SOP
Prerequisites
Confirm the business owner, success criteria, verification rule, allowed repair scope, permission mode, budgets, and irreversible effects. Stop at design when any of these remain unresolved.
Procedure
- Map input, candidate, verification, repair, and terminal results. Prefer a Workflow for fixed dependencies.
- Put deterministic decisions in normal code, a tool, or
passIf; do not let the model invent acceptance rules at runtime. - Configure
maxIterations,maxRepairs,maxRepeatedAction,onFailure, andonExhaustedfor everyloop. - Declare every tool effect, reversibility, and target field. External effects also need a business idempotency key, receipt, or compensation process.
- Write failure tests first. Verification failure, no progress, exhaustion, budget limits, denied approval, timeout, abort, and transient errors each need an explicit terminal result.
- Verify that every stable transition persists and that resuming the same run ID does not replay completed steps or committed effects.
- Compare the same state sequence and terminal result across CLI/TUI, TypeScript SDK, and Python SDK.
- Run module tests, the golden example, coverage, and
npm run check:modules; preserve traces and human conclusions.
Required commands
powershell
npx vitest run packages/coremind-runtime/src/loop-controller.test.ts packages/coremind-runtime/src/loop-runner.test.ts packages/coremind-runtime/src/retry-policy.test.ts
npx vitest run examples/golden/golden-examples.test.ts
npm run test:coverage
npm run check:modulesStop conditions
Stop for unknown effects, unclear business verification, a configuration-fingerprint mismatch, unavailable real credentials, failed security gates, or access outside the workspace. Do not hide a defect by raising retry counts, changing permission modes, or substituting a provider. Never commit, push, tag, or publish without explicit authorization.