Skip to content

bug: Integration branch format mismatch between plan.ts and integration.ts #11

@nigel-dev

Description

@nigel-dev

Description

The integration branch name is constructed differently in two places, meaning one can never find the branch created by the other.

Steps to Reproduce

  1. Create a plan via mc_plan — the spec is saved with integrationBranch using the format from plan.ts.
  2. The orchestrator's startPlan() creates the actual git branch using createIntegrationBranch() from integration.ts.
  3. Any code referencing the saved integrationBranch field from the plan spec will look for the wrong branch name.

Expected Behavior

A single, consistent branch naming format used everywhere.

Actual Behavior

Two different formats are used:

Location Format Example
src/tools/plan.ts:114 mc/integration/${planId.slice(0, 8)} mc/integration/a1b2c3d4
src/lib/integration.ts:29 mc/integration-${planId} mc/integration-a1b2c3d4-e5f6-...

Note the differences:

  • Slash (/) vs hyphen (-) separator
  • Truncated UUID (8 chars) vs full UUID

Proposed Fix

Unify on a single format. Recommend keeping the integration.ts format (mc/integration-${planId}) since that's what creates the actual branch, and updating plan.ts:114 to match. Or extract a shared getIntegrationBranchName(planId) helper.

Files Involved

  • src/tools/plan.ts:114 — sets integrationBranch in the plan spec
  • src/lib/integration.ts:29 — creates the actual git branch

Additional Context

Identified in the master audit report (Section 7: Robustness). This mismatch means plan cleanup and display tools may reference branches that don't exist under the expected name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0: criticalMust fix immediately — blocks core functionalitybugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions