Skip to content

[Task] Block reused branches and invalid checkout state #899

Closed

Description

@ashleyshaw

title: "Workflow Branch Validation and Reuse Prevention"
description: "Task proposal for adding workflow checks that reject invalid or reused branches before work proceeds."
file_type: "documentation"
version: "1.0.0"
last_updated: "2026-06-03"
created_date: "2026-06-03"
authors: ["LightSpeed Team"]
maintainer: "LightSpeed Team"
license: "GPL-3.0"
tags: ["workflow", "branching", "validation", "automation"]
domain: "governance"
stability: "experimental"
status: "draft"

Workflow Branch Validation and Reuse Prevention

Scope

Add workflow-level checks that fail early when a batch is started on the wrong
branch or when a branch is being reused across batches.

Requirements

  • validate the current checkout branch before batch work starts
  • reject branch names that do not match the repo branch policy
  • fail if the branch already contains a completed batch marker
  • fail if the workflow is not running from the expected base branch
  • make the failure message explicit so the agent can recover cleanly

Acceptance Criteria

  • a reused work branch is rejected before any mutation step runs
  • invalid branch names are rejected with a clear error
  • the workflow records the branch policy it evaluated against
  • the check is covered by tests or fixtures

Notes

  • This task is about enforcement, not branch naming style alone.
  • The branch state check should be cheap enough to run on every relevant job.

Activity

  1. linear-code commented on Jun 8, 2026

    @linear-code
  2. github-actions commented on Jun 8, 2026

    @github-actions
    Contributor

    🚫 This issue does not follow a required issue template and has been closed automatically.

    Missing required section(s): Definition of Ready (DoR), Definition of Done (DoD)

    Please reopen with one of the official templates:

    If this was opened by automation, update the automation to preserve the template sections.

  3. added a commit that references this issue on Jun 8, 2026
    3711d82
  4. ashleyshaw commented on Jun 8, 2026

    @ashleyshaw
    MemberAuthor

    Project archive sync: the Branch Governance Hardening project pack is now archived at .github/projects/archived/branch-governance-hardening-2026-06-08.

    The archived issue register is the canonical mapping for this chain and has been updated to reflect closed status across #897-#901.

  5. added 2 commits that reference this issue on Jun 9, 2026
    a6ee7bb
    2498e7b
  6. added 2 commits that reference this issue on Jun 18, 2026
    7938e90
    835d72e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions