Repository navigation
Description
Problem
devops roadmap step fix-conflict cannot reach its tier 1. Its clone is a single-branch shallow clone (--depth=50), so git fetch origin <head> writes only FETCH_HEAD, and git checkout <head> fails (src/devops_cli/roadmap/steps/fix_conflict.py about :670-672). The docs and lockfile path of tier 1 also fails: it passes dict(os.environ, GIT_EDITOR="true") to git rebase --continue, and the process runner refuses that override with SecurityError.
Tier 1 runs project code of the checked-out pull request (uv run devops docs generate, uv lock). The step runs on a workstation with the GitHub token of the person, and it fetches and pushes through the named remote origin. So a fix of the checkout alone must not ship: tier 1 must first run only where the project's other steps run project code.
Expected
--confirmneeds a runner Job (require_runner), and the step makes its process unreadable and adopts orphans before any project code runs, as fix-checks does. Without--confirm, the step only plans and runs no project code.- The step reads the URL of
originright after the clone, and every fetch and push goes throughOriginGit, with a lease on the judged head. - Every local git call of the step runs with hooks off.
rebase --continuetakes the editor from-c core.editor=true, with no environment override.- The checkout of the head branch works in the runner Job.
Proof
Tests that fail on main: a tier-1 program that writes a hook, a push URL or an insteadOf rule into the clone changes neither what the step runs outside a runner nor where it pushes inside one.
Alternatives check of 2026-11-21: none.
Tool: none found.
Reason: Searches for automated git conflict resolution and shallow-clone head checkout found only general Git and MDN documentation, no open tool that gates a fixer on a runner Job, uses OriginGit with a lease, or disables clone hooks. The need is an internal change to fix_conflict.py.
Lacks:
- Runner-Job guard before untrusted project code runs
- OriginGit fetch and push with a lease on the judged head
- Local git calls with hooks disabled
- Rebase continue without a GIT_EDITOR environment override
Proposed design
Problem statement
devops roadmap step fix-conflict can run tier-1 project code on a workstation with the GitHub token of a person. Its shallow single-branch clone cannot check out the pull request head, and its GIT_EDITOR override is refused. The change gates --confirm on a runner Job, hardens the process, routes every fetch and push through OriginGit with a lease, disables hooks and checks out the fetched head.
Acceptance criteria
Requirement: Confirm requires a runner Job
The fix-conflict step SHALL refuse --confirm outside a runner Job before it runs any project code.
Scenario: Confirm outside a runner stops
- WHEN
run_fix_conflictruns withconfirm=Trueand no runner marker. - THEN The test asserts the runner guard refuses the call and no
uvoropenspecproject-code subprocess runs.
Requirement: Confirm hardens the process before project code
When --confirm is set inside a runner Job, the step SHALL make its process unreadable and adopt orphans before it runs any project code.
Scenario: Process hardening runs first
- WHEN
run_fix_conflictruns withconfirm=Trueinside a runner Job and reaches tier 1. - THEN The test asserts the process-hardening calls complete before the first
uvoropenspecsubprocess.
Requirement: No confirm runs only the plan
Without --confirm, the step SHALL plan only and SHALL NOT run tier-1 project code.
Scenario: No confirm skips tier 1
- WHEN
run_fix_conflictruns withconfirm=Falseand tier 1 is enabled. - THEN The test asserts
resolve_tier1and everyuvandopenspecproject-code subprocess are not called.
Requirement: Origin URL is read after the clone
The step SHALL read the URL of origin right after the clone and SHALL use that URL for every OriginGit call.
Scenario: Origin URL is captured after clone
- WHEN The step clones a repository.
- THEN The test asserts
origin_url(worktree)is called once after the clone and before the firstOriginGitfetch or push.
Requirement: Fetch and push use OriginGit
Every fetch and push of the step SHALL go through OriginGit.
Scenario: Direct git fetch and push are absent
- WHEN The step fetches the base and the head and pushes the resolved head.
- THEN The test asserts no
run_subprocesscall runsgit fetchorgit pushandOriginGit.fetchandOriginGit.pushare called.
Requirement: Push leases the judged head
The push SHALL use a lease on the judged head SHA.
Scenario: Push uses the judged head lease
- WHEN Tier 1 resolves a conflict and pushes the new head.
- THEN The test asserts the
OriginGit.pushcall has a lease that namesstatus.head_sha.
Requirement: Local git calls disable hooks
Every local git call of the step SHALL run with -c core.hooksPath=/dev/null.
Scenario: A hook in the clone does not run
- WHEN A tier-1 program writes an executable hook into the clone and the step runs a local git command.
- THEN The test asserts the hook did not run and the git argv contains
-c core.hooksPath=/dev/null.
Requirement: Rebase continue uses the config editor
The step SHALL pass -c core.editor=true to git rebase --continue and SHALL NOT set GIT_EDITOR.
Scenario: Docs and lockfile rebase continues
- WHEN Tier 1 resolves generated docs or lockfile conflicts and continues the rebase.
- THEN The test asserts the argv contains
-c core.editor=trueand no environment override setsGIT_EDITOR.
Requirement: Head checkout works in the runner Job
The step SHALL check out the head commit returned by the OriginGit fetch in the shallow single-branch clone.
Scenario: Shallow clone checks out the fetched head
- WHEN The runner Job fetches the pull request head into a
--depth=50single-branch clone. - THEN The test asserts the local checkout uses the fetched commit SHA and
HEADequalsstatus.head_sha.
Requirement: Clone-written git config cannot redirect the step
A hook, a push URL or an insteadOf rule written into the clone by tier-1 code SHALL NOT change what the step runs outside a runner or where it pushes inside one.
Scenario: Hostile clone config is ignored
- WHEN A tier-1 program writes a hook, a push URL or an
insteadOfrule into the clone. - THEN The test asserts no project code runs outside a runner and the runner push target is the
originURL read after the clone.
Existing Tool Considered
The alternatives check in the issue body records the verdict none on 2026-11-21 and names no tool. No open, maintained tool or library covers this internal roadmap step, so the change builds its own code in src/devops_cli/roadmap/steps/fix_conflict.py and reuses OriginGit and the process-hardening helpers. Written cost: about 4,000 tokens to write the runner guard, the OriginGit wiring, the hook and editor changes and the tests, about 1,500 tokens for each later fix, and about 6 hours of elapsed work.
Key questions
- Where does the current step run tier-1 project code without a runner check?:
_attempt_rebase_and_tier1callsresolve_tier1whensettings.tier1_modeison. Theconfirmflag changes only the stop reason._clone_or_reuse_sourceclones with--depth=50, and the step runs its git calls through the local_githelper. [sources: src/devops_cli/roadmap/steps/fix_conflict.py] - Does the runner gate apply to
fix_rebase_conflict?: No.fix_rebase_conflictis the programmatic helper for the implement runner Job, so it already runs inside a runner. The gate applies to the--confirmpath ofrun_fix_conflict. [sources: src/devops_cli/roadmap/steps/fix_conflict.py, CONTEXT.md] - How should the step gate
--confirmand process hardening?: Call the runner guard of fix-checks and the process-hardening helpers before any project code runs. Without--confirm, do not callresolve_tier1. (best practice) [sources: src/devops_cli/roadmap/steps/fix_conflict.py, src/devops_cli/roadmap/steps/fix_checks_repair.py, src/devops_cli/core/process_hardening.py, CONTEXT.md]- Chosen: Reuse the fix-checks runner guard and hardening helpers. It keeps one runner boundary and one process-hardening path.
- Rejected: Add a second runner check in fix-conflict. It duplicates a security boundary, and the two copies can drift.
- Rejected: Run tier 1 on the workstation when
--confirmis set. The workstation holds the token of a person, and project code is untrusted.
- How should the step check out the pull request head in a shallow single-branch clone?: Fetch the head through
OriginGitand take the commit SHA that the fetch returns. Check out that SHA with a localgit checkout -B <head_ref> <sha>that disables hooks. Do not check out the branch name from the clone. (best practice) [sources: src/devops_cli/roadmap/steps/fix_conflict.py, src/devops_cli/roadmap/implement/git_isolation.py:280]- Chosen: Check out the SHA returned by
OriginGit.fetch. A shallow single-branch clone writes onlyFETCH_HEAD, so the branch name is not local. - Rejected: Keep
git checkout <head_ref>. It fails because the branch is not in the clone. - Rejected: Check out the clone's
FETCH_HEAD.OriginGitfetches in its own bare folder, so the clone'sFETCH_HEADis not the fetched head.
- Chosen: Check out the SHA returned by
- How should every fetch and push use the origin URL and a lease?: Read
origin_url(clone)right after the clone and build oneOriginGitwith that URL. Use that object for every fetch and push. Push with--force-with-leaseonstatus.head_sha. (best practice) [sources: src/devops_cli/commands/roadmap_step_review.py, src/devops_cli/roadmap/implement/git_isolation.py:280]- Chosen: One
OriginGitbuilt from the URL read after the clone. It keeps the trusted URL before tier-1 code can changeorigin. - Rejected: Read
originagain before each fetch or push. Tier-1 code can rewrite the remote URL between the calls. - Rejected: Keep direct
git fetchandgit push. They read the clone configuration that tier-1 code can write.
- Chosen: One
- How should local git calls disable hooks?: One local-git helper adds
-c core.hooksPath=/dev/nullto every call. Use the helper for the direct git calls too. (best practice) [sources: src/devops_cli/roadmap/steps/fix_conflict.py]- Chosen: Set
core.hooksPath=/dev/nullon each local git call. It disables hooks for every subcommand, not only commit and push. - Rejected: Use
--no-verifyon commit and push. It does not cover checkout, rebase, merge-tree or diff. - Rejected: Trust the hook configuration of the clone. Tier-1 code can write an executable hook.
- Chosen: Set
- How should
rebase --continueget its editor?: Pass-c core.editor=truein the git argv and do not passGIT_EDITORin the environment. (best practice) [sources: src/devops_cli/roadmap/steps/fix_conflict.py, src/devops_cli/config/constants.py, tests/core/test_subprocess_env_boundary.py]- Chosen: Use
-c core.editor=true. It is a command-line config and needs no environment override. - Rejected: Keep
dict(os.environ, GIT_EDITOR="true"). The process runner refuses theGIT_EDITORoverride withSecurityError. - Rejected: Unset
GIT_EDITORand rely on the default editor. An interactive editor can block the step.
- Chosen: Use
- What regression test proves that the hostile clone config cannot change the step?: Add a test with a tier-1 program that writes a hook, a push URL and an
insteadOfrule into the clone. Assert that no project code runs outside a runner, and that inside a runner the push target is theoriginURL read after the clone. (best practice) [sources: src/devops_cli/roadmap/steps/fix_conflict.py, src/devops_cli/roadmap/implement/git_isolation.py:280]- Chosen: Hostile clone config regression test. It covers the three ways that the clone can redirect a git call.
- Rejected: Test only the checkout path. It proves neither the push target nor the hook behavior.
- Rejected: Test only the runner guard. It does not prove that
OriginGitignores a rewritten push URL or aninsteadOfrule.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 21, 2026
The step runs untrusted PR code on a workstation with the person's token, which is a live high security vulnerability requiring manual invocation.Both target the fix-conflict step; #5019 delivered it, this candidate fixes its checkout failure, security exposure on a workstation, and missing runner-Job guard.devops-cli-service commentedon Nov 21, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 21, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (3)
Searches run:
Sources:
devops-cli-service commentedon Nov 21, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
fix(roadmap): fix-conflict runs its fixers only in a runner Job
28 remaining items
fix(roadmap): let token and stop errors out of the tier 1 round
fix(roadmap): fix-conflict runs its fixers only in a runner Job
fix(roadmap): settle a fix-conflict round end to end in a runner Job
fix(roadmap): settle fix-conflict rounds with plain git
fix(roadmap): settle each fix-conflict stop as a developer does
fix(roadmap): run each fix-conflict round through one function
test(roadmap): run the fix-conflict push test in a runner
fix(roadmap): stop the implement item once when tier 1 times out
fix(roadmap): let token and stop errors out of the tier 1 round
test(roadmap): patch the record write with monkeypatch
devops-cli-service commentedon Nov 21, 2026
Released in v0.188.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.188.4
devops-cli-service commentedon Nov 21, 2026
Live since 2026-11-21 19:37 UTC