Skip to content

feat: Fusion plan-merge mode (N planners → unified plan → 1 coder) #393

Description

@Delqhi

Motivation

SIN Fusion v1 has two tournament modes: PoC (first-pass-wins) and Oracle (judge picks best). Both discard N-1 outputs entirely. For planning, discarding is wasteful — the best plan is often a combination of insights from multiple models.

Proposal: ModePlanMerge

1. N models produce plans in parallel (same prompt, different models)
2. LLM judge merges best insights into a Unified Plan
3. One model (worker or judge-selected) codes the Unified Plan
4. Verify-gate validates the result (M3 sacred)

Why plan-merge works where code-merge doesn't

  • Plans are natural language — easy to merge semantically
  • Code has incompatible abstractions/naming/interfaces — merging creates bugs
  • A merged plan captures edge cases that any single model missed
  • The verify-gate catches bad plans downstream anyway

Config

Key Default Purpose
fusion.plan_merge false Enable plan-merge mode
fusion.plan_merge_judge SIN_EVALUATOR_MODEL Judge that merges plans

Tournament mode selection

if fusion.plan_merge → ModePlanMerge (plan → merge → code → verify)
else if fusion.oracle_mode → ModeOracle (all code → judge → best)
else → ModePoC (first correct pass wins)

Non-breaking

  • Additive: new ModePlanMerge constant, new code path in tournament.go
  • Existing PoC and Oracle modes unchanged
  • Default off (fusion.plan_merge = false)

Files to create/modify

  • cmd/sin-code/internal/fusion/plan_merge.go — new
  • cmd/sin-code/internal/fusion/plan_merge_test.go — new
  • cmd/sin-code/internal/fusion/tournament.go — add ModePlanMerge dispatch
  • cmd/sin-code/internal/loopbuilder/builder.go — wire plan_merge config
  • cmd/sin-code/internal/config.go — add FusionPlanMerge field
  • cmd/sin-code/fusion_cmd.go — show plan_merge in status/config output

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions