Skip to content

Agent-branch lifecycle: per-wave branch creation, merge-sync, slug derivation #10

Description

@Ryan-Atkinson87

Spec: §5.1 (the agent branch), §5.2 (local-only during the wave), §16.3 branches, §4.2 steps 1–2.

Implements the agent-branch model on top of the git wrapper (#9). One agent branch per wave per repo, code-runner/<wave-slug>, created fresh from the integration branch at wave start, kept current with the integration branch by merge if it advances, and deleted after hand-off (deletion itself happens in #14).

Acceptance criteria

  • The wave identifier is slugified to a branch-safe <wave-slug> (e.g. "P3 – Services & Profiles" → p3-services-profiles); deterministic and stable.
  • The branch name is derived from the branches.agent_pattern config (default code-runner/<wave-slug>) — no hardcoded names.
  • At wave start the engine fetches the integration branch (branches.integration, default dev) from origin and creates the agent branch fresh from it.
  • If the integration branch advances during the wave, the agent branch is kept current by merge (per branches.sync_strategy, default merge; the spec mandates merge — rebase is config-allowed but not the default path).
  • Reads the branches block from the loaded project.yaml (project.yaml Pydantic schema and fail-fast loader #4).
  • A pre-existing agent branch (e.g. after a crash/restart) is reused rather than erroring — git is the source of truth (§18.1).
  • Unit tests cover slug derivation (including unicode/punctuation), fresh creation, reuse of an existing branch, and merge-sync when the integration branch advances.
  • Lint, format, and typecheck pass.

Depends on: #9, #4

Ordering: start after #9 (git wrapper) merges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions