Problem
Models should be able to author workflows, but raw arbitrary scripts are unsafe and unreliable. CodeWhale needs a small Starlark dialect that compiles to IR and fails closed.
Scope
- Add Starlark parser/bindings for branch, rlm, agent, test, review, search, shell, ctx.parallel, ctx.sequence, ctx.tournament, ctx.loop_until, ctx.when, ctx.expand, ctx.teacher.review.
- Add dialect spec prompt for model-authored workflows.
- Reject imports, classes, while loops, recursion, async/await, direct filesystem/network/provider calls.
- Add safe mechanical rewrite pass for common generated Pythonisms, starting with f-string rewrite where intent is obvious.
- Add one reflect-and-repair pass using parser/validator errors.
- Add compile gate: invalid workflows never run.
Acceptance criteria
- starlark_compiles_to_ir passes.
- starlark_repair_loop passes.
- invalid_workflow_rejected passes.
- Example workflows include rlm_cache_change.star and issue_fix_tournament.star.
Source: /Users/huntermbown/Downloads/CodeWhale_v0_9_0_BranchLeafTeacher_Workflows_UPDATED.md and the Claude workflow-mode observation from June 3, 2026.
Problem
Models should be able to author workflows, but raw arbitrary scripts are unsafe and unreliable. CodeWhale needs a small Starlark dialect that compiles to IR and fails closed.
Scope
Acceptance criteria
Source:
/Users/huntermbown/Downloads/CodeWhale_v0_9_0_BranchLeafTeacher_Workflows_UPDATED.mdand the Claude workflow-mode observation from June 3, 2026.