<delegation_protocol>
- ANALYZE risk and scope: parser semantics, ABI impact, deploy impact, docs-only, or tests-only.
- DECOMPOSE into atomic tasks with non-overlapping file sets.
- CLASSIFY:
- Routine low-risk edits (
tests/*, docs, examples) -> Implementer. - Parser/compiler semantic edits -> Specialist: Parser/Compiler.
- Playground/WASM pipeline edits -> Specialist: Playground.
- Architectural or boundary ambiguity -> Orchestrator or escalate.
- PLAN execution order:
- Serialize grammar/model/compiler edits.
- Parallelize independent tests/docs/playground text updates.
- DELEGATE using task format below.
- MONITOR with checkpoints after each acceptance command.
- INTEGRATE and re-run global checks.
- REVIEW before completion. </delegation_protocol>
<task_format>
Objective: [single sentence done-state]
Context:
- Files to read: [absolute or repo-relative paths]
- Files to modify: [exact paths]
- Files to create: [exact paths]
- Related symbols: [functions/types/rules]
Acceptance criteria:
- Behavior change validated by targeted test(s):
cargo test --test <file> - Global tests pass:
cargo test - Formatting passes:
cargo fmt --check - If playground changed:
./playground/build.sh
Constraints:
- Do NOT modify outside listed files.
- Do NOT edit gated files without explicit approval.
- Time box: [estimate]
Handoff:
- Report changed files, command results, unresolved risks. </task_format>
<state_machine> PENDING -> ASSIGNED -> IN_PROGRESS -> REVIEW -> APPROVED -> DONE PENDING -> ASSIGNED -> IN_PROGRESS -> REVIEW -> REJECTED -> IN_PROGRESS IN_PROGRESS -> BLOCKED -> ASSIGNED IN_PROGRESS -> CANCELLED
Rules:
- Only Orchestrator transitions PENDING -> ASSIGNED.
- BLOCKED requires: blocker, attempts, and required inputs.
- REVIEW -> REJECTED must include concrete failure and expected fix.
- BLOCKED for >30 minutes -> escalate to human. </state_machine>
<parallel_execution> Safe to parallelize:
- Distinct test files in
tests/ - Docs updates in
README.md/docs/ - Playground text/style updates not touching compiler semantics
Must serialize:
src/parser/grammar.pestwithsrc/parser/mod.rssrc/models/mod.rswithsrc/compiler/mod.rsCargo.tomldependency updates.github/workflows/*changes
Conflict protocol:
- Compare planned file lists before assignment.
- If overlap exists, assign explicit priority.
- Lower priority waits, then rebases and revalidates commands.
- Escalate unresolved merge conflicts to Orchestrator. </parallel_execution>
Format: ESCALATION: [one-line summary] Context: [current task] Blocker: [specific issue] Options:
- [Option A] - Tradeoff: [impact]
- [Option B] - Tradeoff: [impact] Recommendation: [best option] Impact of delay: [what stalls]