---
title: Branch management
description: >-
  Start issues with in-progress and verify linked branches before
  implementation.
---
> ## Documentation Index
> Fetch the complete documentation index at: https://docs.page/vypdev/copilot/llms.txt
> Use this file to discover all available pages before exploring further.

# Branch management

Adding `in-progress` starts every admitted issue workflow. Opening an issue or adding its type label only classifies it. When `issue-managed-branches: true` (the default), the Action creates the issue branch, verifies the exact linked remote branch, and then adds `branched`. `branched` is a readiness result; adding it yourself cannot start work.

| Issue kind | After `in-progress` |
| --- | --- |
| Feature, bugfix, docs, chore | Create a branch from `development-branch` when branch management is enabled. |
| Hotfix | Create from the selected production version tag after form and membership checks. |
| Release | Create from `development-branch` after form and membership checks. |
| Help | Answer the issue without a branch or `branched`. |

To work without Action-managed branches, set `issue-managed-branches: false`. The issue still starts with `in-progress`; the Action does not add `branched`. Release and hotfix workflows require managed branches. The optional [pre-branch SDD gate](/issues/pre-branch-sdds) also requires managed branches.

## Ready to implement

For a regular branch-bearing issue, the visible sequence is `in-progress` → linked branch → `branched` → implementation. The Action checks the branch's exact GitHub issue link and remote SHA on every issue run. If the link or branch is missing, it removes an unsupported `branched` label. If verification fails, it reports the error and pauses branch-dependent work.

Implementation recommendations also wait for verified branch readiness, including issues that do not require an SDD. A failed or pending verification cannot publish a new “Ready to start” plan. Branchless workflows can still provide guidance without branch evidence.

In private repositories, keep `persist-credentials: false` on the checkout and pass the configured credential through the Action's `token` input. Issue branch preparation authenticates its Git fetches using configuration scoped to each Git process; it does not store credentials in the checkout configuration or remote URL. If preparation fails, inspect the reported error, correct token access if needed, and rerun the same issue workflow.

With `pre-branch-sdd: true`, an eligible feature or behavior-changing issue enters `state:specifying` first. The Action clarifies the contract in issue comments, validates the SDD outside the new branch, creates the linked branch, and publishes the SDD as its first commit. Only after the remote commit is verified does it add `branched` and move to `state:working`.

## Naming and source branches

Branch names follow `<tree>/<issue-number>-<slug>`. The title supplies the slug; `feature-tree`, `bugfix-tree`, `docs-tree`, `chore-tree`, `hotfix-tree`, and `release-tree` configure the prefix. `development-branch` defaults to `develop`; `main-branch` defaults to `master`.

Examples: `feature/123-add-user-login`, `bugfix/456-fix-null-check`, `hotfix/789-critical-payment-fix`, `release/10-v1-2-0`.

If branch creation succeeds but a later step fails, rerun the issue workflow on the same issue. The Action reuses the linked branch and verifies its current remote state. Do not create a second branch to recover an SDD publication failure.

## Related pages

- [Workflow setup](/issues/workflow-setup)
- [Labels and branch types](/issues/labels-and-branch-types)
- [Pre-branch SDDs](/issues/pre-branch-sdds)

Automatic title formatting keeps the boundaries between hyphenated words. A title containing `issue-to-pr` may display `issue to pr`, while its branch slug remains `issue-to-pr`.

## Progress evidence

Progress assessments use an immutable GitHub comparison of the actual native PR target and the managed branch head. If no open PR owns that exact head branch, they use the configured development base. The agent receives the source patches directly and does not need shell commands. Generated build files contribute metadata only; a percentage does not certify CI or a build.

Copilot accounts for every original nonempty issue line before analyzing patches. It validates the one reserved persisted-configuration block using the same delimiter scanner and supported version as storage; that operational state, including generated implementation plans, cannot define acceptance. The classifier classifies every remaining human line by its original physical source identifier as required, excluded, context or uncertain. Ordinary prose, unrelated HTML, examples and acceptance before or after the reserved state are preserved. All original line/count limits apply before separation, and malformed or unsupported state stops assessment without changing progress. The scope request, comparison parts and final assessment keep complete issue text, extracted scope and model facts inside explicit untrusted-data blocks. Embedded instructions cannot grant workflow authority. Inputs that exceed the fixed UTF-8 budgets are rejected with retained progress rather than shortened to fit. Small comparisons then use one assessment. Larger complete comparisons are reviewed in up to four rounds of 16 parts (64 parts total), each containing complete patches or identified content slices within the unchanged 256,000-byte UTF-8 evidence limit. Every part must return bounded facts for every assigned file or content unit before one final assessment can update progress. These facts preserve uncertainty and do not certify CI. Their final combined summary has a maximum 384,000-byte budget. Copilot reserves every admitted path and the complete security/schema/task envelope and configured effort suffix inside the unchanged 512 KiB runtime ceiling, then requests concise facts using the same calculated limit in the schema and parser. No returned facts are silently shortened. Source parts and the manifest retain the 256,000-byte limit.

### When a complete comparison exceeds capacity

File count alone does not identify a capacity failure. The
`progress-evidence-capacity-exceeded` recovery reports its phase, dimension,
unit, measured or required count, supported limit and count precision. For
example, a complete native request requiring 524,289 bytes exceeds the
524,288-byte ceiling even if its source part fits 256,000 bytes. Reserved
replacement requests and the complete aggregate are admitted independently.
`at-least` denotes a stopped packing scan; unavailable facts are not zero.

When the source owner can prove them, the same diagnostic retains the actual
base/head, source-manifest identity, separate required/accepted/uncovered path
inventory digests and reconciled totals. At most eight uncovered paths are
shown as inert literals. Accepted progress receipts mean validated model facts,
not passed tests or review. An original physical issue line is retained when
its line bound failed. Missing context remains explicitly unavailable.

Supported parts continue within one invocation. A capacity rejection stops
that attempt and publishes no partial percentage. An identical retry cannot
increase capacity. Preserve the coherent requirements and complete evidence;
report an unsupported complete workload with the diagnostic and run link so
the protocol can be reviewed. After interruption, a fresh invocation recollects
the current source and budgets; it cannot resume previous partial receipts.

### Which comparison is assessed

One native open PR in the same repository selects its actual base branch, including
production or release targets. Copilot verifies the exact head, reads the native
base ref and pins both SHAs. It does not trust a possibly historical PR `base.sha`,
a target named in issue prose, local checkout state or model output. Two matching
PRs, foreign/fork identities, unavailable reads or an invalid head fail closed;
Copilot does not guess a target or silently fall back. A runtime missing this
read capability reports an unsupported configuration.

Before publishing, Copilot rereads the acceptance body, PR ownership and native
refs. A PR closing, appearing, changing target or being replaced, or a source/base
moving, retains the prior progress. Branch names are untrusted data in prompts
and escaped metadata in run logs. The result keeps the configured
`developmentBranch` and separately records `comparisonBaseBranch`,
`comparisonSource` and the actual `baseSha`.

This matters for inherited production binaries. A maintenance PR against master
may have only text changes even though comparing it against develop includes
already-produced libraries. Copilot assesses the complete native-target delta;
it does not filter those libraries or call their metadata a content review.
Standalone work without a PR still uses development. Binary changes genuinely
remaining in the selected comparison require adequate reviewable evidence and
remain unassessed when that evidence is unavailable.

### Omitted or incomplete patches

Copilot checks unified hunks and changed-line totals before using a patch. For
omitted, truncated or oversized text patches it reads exact Git commit, tree and
blob objects using the same repository credential. The preimage is the pinned
comparison merge base; the target is the pinned branch head. Complete directories
prove paths and presence; blob size, canonical base64 and recomputed Git hash
prove bytes. This does not inspect a checkout or execute commands.

Regular UTF-8 text, empty additions/removals and verified renames/copies are
supported. Identical renames require independently resolved old and new paths
with the same blob; zero statistics alone never prove equality. BOM, CRLF and
Unicode bytes are preserved. Binary/non-UTF8 files, symlinks and submodules remain
unsupported recovery inputs. Lockfiles and specification registries receive
complete content, rather than a metadata exemption.

Native recovery uses at most four accounting frames. Each frame admits 64 files,
4,194,304 represented side bytes, 256 Git object requests and 50,000 directory
entries. A new frame continues automatically when a frame is full; total credit
never resets. Total limits are 256 recovered files, 16,777,216 side bytes,
1,024 requests and 200,000 entries. Each verified blob is at most 2,097,152 bytes.
The 299-path complete inventory, 512-unit, 120,000-byte JSON slice,
256,000-byte source/manifest, 384,000-byte fact and 512 KiB full request limits
remain fixed. Cached contents still consume represented side-byte credit.

Every source part and the complete manifest bind the exact base/head/preimage,
paths and units. A fresh host attempt ID and digests bind each model request to
the full issue, extracted scope and locale. Missing, reordered, stale, duplicate
or corrupt parts/responses are rejected before final assessment. All source and
prompt capacity checks finish before the first model request. No source or facts
are shortened to fit; progress is published only after every response and the
existing native freshness checks pass.

Run details show required path/part counts, recovery usage and the current round.
Automatic continuation happens inside the same invocation. After interruption,
rerun the current managed source through the existing progress/Commits workflow;
it collects a fresh complete attempt without reusing partial facts. There is no
durable partial-analysis checkpoint. Coherent specification packages do not need
to split scope, omit registries or retarget a PR to fit the old per-frame limits.

If full recovery is unavailable, the run reports `validation.evidence-unavailable`
and names up to eight unreviewed paths plus their total count. Exhausted total
or analysis capacity reports nonretryable `validation.evidence-too-large` with
retained progress. Inspect the pinned comparison and reported limit; retrying an
identical over-limit input cannot add capacity. A genuine provider outage keeps
its normal retryability.
For unsupported binary/non-text contents, the shared CLI/Job Summary reports
exact unreviewed paths and distinguishes unavailable progress from project
verification. It shows up to eight complete names within an 8,192-byte diagnostic
budget, with total/shown counts; the complete pinned inventory appears in at most
299 numbered run-log records. Names remain reversible JSON literals, with control,
HTML, mention and Markdown characters kept inert. No source or binary bytes are
logged. Inspect the intended PR base and pinned paths. Actually changed binaries
need reviewable source and provenance; zero counters or a successful compile do
not establish binary correctness. Do not retarget a legitimate PR to hide changes
or split production libraries merely to manufacture textual patches.

A failed middle part never publishes partial progress or requests a final
percentage. Replay reloads exact evidence and does not reuse partial facts.

### Scope and verification

Only the original issue defines completion requirements. Each assessment cites a
requirement such as `[R1] Edit and clear inventoried inputs` and explains its
source support or verification uncertainty. Reports and patches can reveal
separate product debt; that debt does not automatically become work required to
finish this issue. Compatibility-only mobile scope does not require device
execution. If search correctness or device journeys are actually required by the
issue, they remain required.

Source changes, reported execution and independently verified execution are
different facts. Repository reports and model summaries are not trusted test
attestations. An execution requirement without independent evidence remains
unverified, rather than becoming a successful test claim. A percentage is an
estimate; it does not replace review, CI, coverage or approval gates.

Commit accounts for every human source span exactly once. It classifies up to
1,024 nonempty lines in groups of 32, with at most 1,200 Unicode code points per
line. Required and uncertain obligations receive stable identities from their
original physical lines. Exclusions, qualifiers and verified SDD case references
remain in the frozen manifest.

The aggregate admits at most 256 obligations and 256 exclusions. Each assessment
contains at most 32 obligations and 64,000 UTF-8 bytes of acceptance scope. The
human scope and identity projection has a 262,144-byte limit. Existing immutable
comparison limits remain applicable. The complete attempt permits 120 agent
calls, including bounded repairs, and 30 minutes. The runtime preflights complete
prompts against its existing 524,288-byte envelope.

Every outcome must cite admitted comparison evidence from the same evaluated
head. The manifest binds the repository, full issue snapshot, owning PR, base,
head and selected SDD publication. A reported SHA without a valid source or unit
reference cannot establish evidence. A missing implementation can be assessed
with a substantiated observation. A missing evidence receipt prevents publication.

All batches must finish before the host reduces their results and rechecks the
issue, SDD authority, PR ownership and Git refs. Compatible duplicates converge
on one semantic publication identity. A stale, incomplete, conflicting or
oversized attempt retains previous progress. Inspect the run and retry against
current complete evidence. Incomplete estimates keep percentage labels at or
below 95 percent, while the progress card retains the assessed estimate.

Scope interpretation and assessment prose are model-derived. Exhaustive source classification, exact citations and
identity validation cannot prove that natural language was interpreted correctly
or that an execution report is true. Review ambiguous scope; neither unknown
verification nor a newly disclosed defect justifies inventing a requirement.

Fact lengths use Unicode code points consistently in the provider schema, local
response validation and progress parser, so supplementary characters share the
same boundary. The evidence and runtime ceilings still count UTF-8 bytes.
Before querying, the host reserves every canonical reference and separator from
the complete requirement inventory. It divides the remaining 8,000-point field
budget across all requirements, with a maximum of 800 points per fact. Every
batch schema and receipt check uses this same hard allocation. Shorter facts do
not transfer their unused allocation to another requirement. This ensures that
all admitted batches fit together, even when every fact uses its full allowance.
The complete-field and freshness checks still run before publication.

If source evidence is missing or any part fails, the Action retains the current progress and reports that it could not assess the revision. A single file, the final aggregate or a comparison exceeding the fixed part budget reports `validation.evidence-too-large` with Retryable: No; inspect the pinned comparison and reported supported capacity. Native multipart recovery continues automatically within its fixed totals; after interruption, rerun the current source for a fresh complete attempt. Retrying identical over-limit evidence cannot add capacity. It also retains state if either head or the issue body changes while the assessment is running. Inspect the run before retrying; an unavailable assessment is not proof of 0% completion.


### Invalid returned assessments

### Complete inventories beyond the compare API ceiling

GitHub compare returns at most 300 file records. When that boundary is reached,
Copilot collects the complete delta from the pinned merge-base and head Git trees.
It verifies every complete directory against its Git object hash and recovers
all changed regular UTF-8 contents. The first 300 records cannot attest completeness.
Renames and copies become exact independent removed/added paths; a canonical path
count can therefore differ from GitHub's rename-record count. This route supplies
complete contents with explicitly unavailable line statistics, rather than invented
zero additions or deletions. The existing generated `build/` and `specs/CATALOG.md`
metadata exceptions remain the only exceptions.

The closed `immutable-tree-v1` profile supports up to 1,024 canonical paths, 4,096
content units and 16 recovery epochs. Each epoch retains the existing 64-file,
4 MiB, 256-read and 50,000-directory-entry limits. Global accounting is shared by
inventory and recovery: at most 1,024 files, 16 MiB represented before/after bytes,
2,048 Git-object reads and 200,000 directory entries. Cached bytes are charged for
each represented side. Each blob remains bounded by 2 MiB; each source part and
the complete manifest by 256,000 bytes; at most 64 parts may be analyzed.

Compact manifests and final facts preserve exact unit/path and request identities;
full content and metadata remain in their digest-bound source parts. All source
parts, complete response receipts and the final assessment must validate. The
384,000-byte aggregate and 512 KiB full runtime prompt limits remain unchanged.
Facts receive an adaptive 16–600-code-point budget; if the minimum cannot fit,
assessment stops before the first model request. These independent capacities
can reject an otherwise supported file count; no text is clipped to fit.

`progress-inventory-incomplete` reports the protocol, finite reason, observed
count, supported limit and an inert bounded path excerpt in the CLI, Check and
Job Summary. `≥` marks a lower bound after collection stopped; `=` marks an exact
count. A zero limit denotes failed integrity rather than a file allowance. The
result is nonretryable for identical unsupported evidence and retains previous
progress. Genuine provider outages keep their own category. Small comparisons
retain the previous protocol, and native PR/ref/issue freshness checks remain
required before publication. No permission or configuration switch is added.

A completed agent operation can return data that violates the progress contract.
Copilot rejects that result and retains the previous progress. Its existing
CLI, Check and Job Summary expose `progress-result-contract-invalid` with a
bounded phase, reason, schema field and verified requirement/original-issue line.
For example, `assessment / requirement-evidence-invalid`,
`$.requirements[1].evidence`, requirement `R2`, original line `L7` identifies the
record needing attention. Response order does not determine the requirement;
repeated issue quotes do not determine the source line. `none` means that an
identity was not verified, so no anchor is guessed.

The line refers to the original issue body supplied to that attempt. Blank lines
retain their physical numbering. These diagnostics contain no raw model output,
unknown returned property names or values. Strict JSON, exact scope, evidence,
locale, size and percentage rules still apply; an invalid response cannot update
labels. Review the named requirement and response schema. A fresh run can help
when the provider can satisfy the unchanged contract, as opposed to changing
acceptance or dropping verification. Process/transport failures retain their
own status and retry guidance. A later optional check-publication warning remains
a separate outcome and cannot replace the primary rejection.

For an over-bound file fact, Copilot verifies the current immutable part,
path/unit, locale and schema before requesting one replacement of that complete
part. Every original and replacement envelope is checked before the first query.
Both framed profiles plan exact per-field encoded JSON bytes within the same
aggregate ceiling and 600-point maximum. Existing admitted schemas never widen;
unframed requests keep their allocation. All ordinary fields validate before a
byte-only rejection can request recovery, and aggregation checks every quota.

Unicode and encoded-byte failures share one replacement. Persistent overflow
identifies `progress-partition-length-invalid` in Unicode code points or
`progress-partition-bytes-invalid` in JSON UTF-8 bytes, with the verified
part/path/unit, field, maximum and observed count. Legacy units use `none`.
No rejected prose is copied, clipped or accepted; no third query or partial
progress update follows. Both exhausted size outcomes are nonretryable. Do not
automatically repeat an unchanged comparison; inspect the named fact and qualify
a corrected Copilot build before one fresh assessment. Other invalid output,
provider failures and cancellation retain their usual categories.

A separate final-stage recovery allows a read-only replacement of the final response when
all other validation succeeds but its percentage contradicts completion. Copilot
uses the same complete pinned evidence, schema, settings and acceptance scope;
it adds only the previous reported percentage and supported/missing/unknown
counts. These are model observations, not test, review, coverage or approval
evidence. Missing and uncertain requirements are not promoted to supported.
Scope extraction and complete source collection run once; a final reassessment
does not repeat multipart queries. Each eligible part retains its own single
replacement independently of the one final-response allowance. A persistent
part failure stops before any final query. The existing capacities
also reserve the entire replacement before the first model query; source and
fact budgets never grow, and no source units are dropped.

Each acceptance batch uses at most two final queries. If the replacement is still inconsistent,
`progress-completion-recovery-exhausted` reports its five numeric facts while
retaining published progress. Inspect the linked run and complete comparison;
start a fresh full assessment only when the provider can meet the same contract.
Provider failures and invalid JSON, schema, locale or evidence do not enter this
completion recovery. A completed native `summary` or `remaining` length rejection
may use the same single allowance only when its measured facts bind to the exact
captured schema, batch receipts, citations, requirement, source anchor and locale,
and the rest of the complete schema validates. It preserves the full batch and
unchanged limits. Persistent length reports `progress-assessment-length-invalid`
with requirement/source IDs, field, maximum and observed Unicode point count.
That exhausted attempt is non-retryable. Do not automatically rerun an unchanged
comparison; validate a corrected Copilot build against the same frozen source
before starting one fresh assessment. The run records the actual requirement
count, batch count and per-text allocation before collecting comparison facts.
Length and completion failures cannot each allocate a replacement: there are
still at most two final queries for a batch. No provisional batches publish.

An otherwise valid native assessment that repeats an admitted source citation
may spend that same single allowance on a complete correction. Both narrative
and closed-fact responses must ultimately contain one to eight distinct admitted
citations per requirement. Copilot preserves the whole original evidence
dictionary, scope, head and profile; it never silently deduplicates model output.
A second repetition stops with non-retryable `progress-batch-retained`, reason
`evidence-duplicate`, and verified requirement/batch IDs. Inspect the run and
qualify a corrected build before a fresh full assessment; do not loop on the
unchanged failed head. Invalid evidence and simultaneous other validation defects
remain blocking without citation correction. Accepted earlier batches remain
provisional, and correction cannot reset the 120-call/30-minute ledger.

Issue-body/open-state, native owning PR/target, base and head checks
still run before publication. Publication failures retain their actual completed
effects and error classification; writes are never automatically replayed.

Commit can reconcile a maintainer SDD seed after the Action verifies its
selection and publication on the linked branch. Repeated scope shares the
verified requirement's identity. Draft-only requirements remain mandatory, and
the assessment retains the original lines and linked case scenarios. When the
selection, publication or assessed revision cannot be verified, Commit retains
existing progress and reports `progress-sdd-seed-unverified`. Confirm the draft
and publication before rerunning Commit.

Larger batched cards show one canonical source location per requirement, such as
`L17` or `SDD L42`. The frozen manifest and assessment requests retain every
original source, alias, case reference and qualifier. Both complete published
text fields must fit their 8,000-code-point budgets. Scoped cards render every
admitted assessment line after secret redaction and GitHub-control sanitization.

`progress-batch-retained` identifies an incomplete or incompatible batch attempt.
The Check and Job Summary show verified and expected batches, the failing batch,
a safe requirement ID and the reason. For example, “Progress retained. Verified
2 of 3 batches. R17 has no evidence for the evaluated head.” Previous labels and
the progress card remain available. Resolve the reported evidence or capacity
condition before starting a complete retry.

Older single-assessment runs can report `progress-scope-clause-limit` for more
than 32 classified obligations or exclusions. Current Commit uses the bounded
batch protocol. Operational state cannot add requirements, and a full issue-body
edit still invalidates an in-flight attempt.

## Completion after a PR merge

For an eligible preparatory PR into the configured non-default development
branch, a maintainer can [declare a staged rollout](./notifications-and-auto-close#staged-rollout-after-a-preparatory-merge).
The issue stays assignable while acceptance is pending. The workflow credential
needs access to read PR reviews, check repository collaborator roles, and write
comments on the managed issue. If tracking registration fails, rerun the failed
jobs from the merge run.

Native issue closure owns completion. Copilot clears obsolete managed active,
waiting, temporary activity and old percentage labels with selective operations.
It retains issue kind, priority, size, branch/SDD history and unrelated labels.
Only a native completed reason permits `100%`; not-planned or unknown closure
removes old progress without asserting completion. No extra timeline comment or
terminal `state:*` label is created.

A repeated merged-PR delivery reconciles already-closed metadata and becomes a
no-op once verified. If the issue was intentionally reopened, the old delivery
stops without reclosing it. Partial errors preserve completed native effects and
report metadata as unverified. Read the run and retry after resolving the cause.
`/copilot status` reads current native state independently of these label writes.


Configured lifecycle names must be distinct from canonical progress labels
(`0%` through `100%`) and protected kind/artifact labels. Invalid configuration
produces no completion metadata writes; keep the native state and correct the
configuration before retrying.


Native duplicate closure is distinct from completed closure: obsolete progress
and activity are removed without adding `100%`. Inconsistent state/reason pairs
stop reconciliation before writes. A reopened issue is never re-closed by an old
merged-PR delivery.

Closed issue events skip open-work branch and SDD preparation. Adding or removing metadata labels after completion preserves the historical `branched` and `SDD` artifacts; reopening produces an open issue event and resumes its normal admission flow.
