Repository navigation
Description
Split from #5136.
Problem The Copilot setup steps install the pre-commit and pre-push hooks. The branch-name hook refused each commit on a copilot/ branch. #5136 scopes the pattern of that hook so a copilot/ name passes. The branch-current hook can refuse a push when origin/main moves after the agent starts its branch, and the agent cannot rebase. No offline test shows what a live Copilot cloud agent does with the installed hooks. ## Why this part is deferred The proof needs a live Copilot cloud agent run on a test issue. Only GitHub starts that run. The roadmap cannot start it or observe it. The fix of #5136 is testable offline, so this proof waits on an outside event. ## Acceptance criteria - A person assigns the Copilot cloud agent to a test issue on a repository that runs the setup steps. - The agent makes at least one commit on its copilot/ branch with no hook refusal. - The agent pushes its branch with no hook refusal. - When the branch-current hook refuses the push, the run records the failure and a new item scopes that hook for copilot/ branches. ## References - https://docs.github.com/en/copilot/concepts/agents/coding-agent/risks-and-mitigations - https://github.com/orgs/community/discussions/167906
Proposed design
Problem statement
The Copilot setup steps install the pre-commit and the pre-push hooks in the environment of the Copilot cloud agent. No offline test shows what a live Copilot cloud agent does with these hooks. The branch-current hook can refuse a push when origin/main moves after the agent starts its branch, and the agent cannot rebase. This item records one live run in an evidence comment on this item, and it files a new item when a hook refuses.
Acceptance criteria
Requirement: Setup steps install both hook types
The copilot-setup-steps job of a live Copilot run MUST install the pre-commit and the pre-push hook types in the environment of the agent.
Scenario: The setup job installs both hook types
- WHEN A person reads the log of the
copilot-setup-stepsjob of the live run withuv run devops gh run view <run-id> --log. - THEN The log shows the hook install step with a success result, so both hook types of
default_install_hook_typesare installed.
Requirement: Commit on the copilot branch
A live Copilot cloud agent run MUST make at least one commit on its copilot/ branch with no branch-name refusal.
Scenario: The agent commits on its copilot branch
- WHEN A person with write access assigns the Copilot cloud agent to a test issue, and the agent commits its change.
- THEN The log of the run shows the commit on the
copilot/branch with nobranch-namerefusal, and the evidence comment records the commit SHA and the run URL.
Requirement: Push of the copilot branch
A live Copilot cloud agent run MUST push its copilot/ branch with no pre-push hook refusal.
Scenario: The agent pushes its copilot branch
- WHEN The live run pushes the
copilot/branch of the agent to the repository. - THEN The log of the run shows the push with no
pre-pushrefusal, and the evidence comment records the pushed branch, the run URL and whether thepre-pushhook ran.
Requirement: Branch-current refusal is recorded
When the branch-current hook refuses the push, the item MUST record the refusal text and the run URL in the evidence comment, and it MUST file a new roadmap item that scopes branch-current for copilot/ branches.
Scenario: The branch-current hook refuses the push
- WHEN The log of the live run shows that the
branch-currenthook refused the push of thecopilot/branch. - THEN The evidence comment records the refusal text and the run URL, and a new roadmap item names the change that scopes
branch-currentforcopilot/branches.
Existing Tool Considered
No alternatives check has run on this item. pre-commit 4.7.0 (pyproject.toml, dev group) is the open, maintained tool that installs and runs the hooks of .pre-commit-config.yaml. It covers the install and the run of these hooks on a clone, and it needs no code from this repository. It lacks a way to run them in the hosted environment of the Copilot cloud agent, which only a live Copilot run exercises. The item writes no code of its own, so it has no build cost: its cost is one live run that a person starts and reads, and one evidence comment.
Key questions
- Which hook types does
pre-commit installinstall in the environment of the agent?: It installs thepre-commitand thepre-pushhook types, because.pre-commit-config.yamlsetsdefault_install_hook_types: [pre-commit, pre-push]. Thebranch-namehook runs at the commit stage. Thebranch-currenthook runs at the push stage. [sources: .pre-commit-config.yaml:1, .pre-commit-config.yaml] - Does the
branch-namepattern accept acopilot/branch at this commit?: Yes. The lookahead of the pattern acceptscopilot/<slug>, and its comment cites fix(ci): Copilot setup hooks refuse commits on copilot/ branches #5136. Acopilot/name passes the commit hook, so this item needs no further change from fix(ci): Copilot setup hooks refuse commits on copilot/ branches #5136. [sources: .pre-commit-config.yaml] - Which check is the gate for a push of a
copilot/branch?: The required checks of the ruleset are the gate. ADR 0004, as amended by ADR 0014, gives the gate to the required checks and says the pre-push hook runs only the fast static checks. Abranch-currentrefusal stops the push before those checks run, so the evidence comment records it. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, .pre-commit-config.yaml]- Chosen: The required checks of the ruleset. ADR 0004 gives the gate to the required checks.
- Rejected: The
pre-pushhook. ADR 0004 says the hook runs only the fast static checks, and a hook on one clone cannot bind the merge.
- Where does the item record the result of the live run?: In one evidence comment on this item, with the date, the run URL and each hook result. The item stays open until the run ends, and it closes after the comment. (best practice) [sources: CONTEXT.md]
- Chosen: Evidence comment on this item. This item stays open until the run ends, so a reader finds the record at the item that it closes.
- Rejected: Evidence comment on the test issue. A person closes the test issue after the run, so the record goes with it.
- Rejected: A guideline under
docs/guidelines/.CONTEXT.mdforbids an issue number and a date in a guideline, and this result holds both. - Rejected: A mocked test of the hooks. A mocked test runs the hooks on a local clone, so it shows nothing of the cloud agent.
- Which issue serves as the test issue of the live run?: A throwaway issue with no
priority/*label.CONTEXT.mdkeeps an issue with nopriority/*label a candidate, so no roadmap job takes it. A person closes it after the run. (best practice) [sources: CONTEXT.md]- Chosen: A throwaway issue with no
priority/*label.CONTEXT.mdkeeps an issue with nopriority/*label a candidate, so no roadmap job takes it. - Rejected: An existing roadmap item. A run on a real item pushes a
copilot/branch that no plan covers.
- Chosen: A throwaway issue with no
- What does the item do when the
branch-currenthook refuses the push?: The item records the refusal text and the run URL in the evidence comment, and it files a new item that scopesbranch-currentforcopilot/branches. The item relaxes no hook before evidence shows that the hook fires. (best practice) [sources: .pre-commit-config.yaml, docs/adr/0004-ci-is-the-authoritative-gate.md]- Chosen: Record the refusal and file a new item. The live run gives the evidence, and the new item holds the change of the hook.
- Rejected: Relax
branch-currentin this item. No evidence shows that the hook refuses a push on acopilot/branch, and the required checks still gate the merge. - Rejected: Stop the item on the refusal. The run still proves the setup steps and the commit.
- Does the item need code?: No. The item writes no code. It records one live run in an evidence comment, and it files a new item when a hook refuses. The proof needs the hosted environment of the Copilot agent, and no repository code can start or observe that run. (best practice) [sources: AGENTS.md, CONTEXT.md]
- Chosen: No code. The proof needs the hosted Copilot environment, and no repository code can start or observe that run.
- Rejected: A mocked test of the hooks. A mocked test runs on a local clone and shows nothing of the cloud agent.
- What do the installed hooks check, and where do they run?: They run as local git hooks in the clone of the agent.
pre-commitruns them on the machine that holds the clone. A test on a local clone shows the hook behavior, but it does not show the hosted environment of the agent. [sources: .pre-commit-config.yaml, pyproject.toml]
Fit
Fits in one pull request.
Suspected block
A live Copilot cloud agent run on a test issue, which only GitHub starts and a person with write access triggers.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 12, 2026
The proof waits on a live Copilot cloud agent run that only GitHub starts.Both items concern the Copilot setup hooks. #5136 changes the branch-name hook pattern, and the candidate tests the hooks in a live run.devops-cli-service commentedon Nov 20, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 23, 2026
Owner question: See the first point of Open questions and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 23, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 24, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 24, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence