Skip to content

WhaleFlow: Starlark authoring layer, repair loop, and compile gate #2670

@Hmbown

Description

@Hmbown

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv0.9.0Targeting v0.9.0whaleflowWhaleFlow branch/leaf workflow runtime and workflow modeworkflow-runtimeWorkflow IR, executor, control flow, and replay runtime

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions