# Finish-branch remote ref resolution

audience: AI coding agents first.

# Outcome

Repair shared `finish-branch` receipt/report ref resolution so remote-tracking bases resolve as remote refs and local branch bases resolve as local refs.

status: BLOCKED
task IDs: `finish-branch-ref-1`
source request: Repair confirmed shared delivery-controller defect end-to-end. A base such as `origin/master` MUST NOT expand to `refs/heads/origin/master` after successful landing. Fix canonical seam, add regression coverage for remote-tracking and local refs, run focused tests, install live first, verify installed non-publishing mode, commit, and land through project controller. NEVER publish during verification.

## Acceptance criteria

1. Regression test proves `origin/master` resolves through `refs/remotes/origin/master` or equivalent verified ref.
2. Regression test proves genuine local branch resolves through `refs/heads/<branch>`.
3. Single canonical ref-resolution seam owns behavior; call sites remain unchanged unless required by seam contract.
4. Focused shared test suite passes without warnings or ignored errors.
5. Verified source fix is installed at `/home/user/.claude/workflows/lib` before Git landing.
6. Real installed entrypoint runs in non-publishing dry/test mode without fatal ref errors.
7. Change is committed and landed through Overdeck controller with receipt.

## Preserved WIP

- Source repo: `/home/user/Projects/overdeck`
- Isolated worktree: `/home/user/Projects/overdeck/.worktrees/finish-branch-remote-ref`
- Branch: `wt/finish-branch-remote-ref`
- Base: fresh `origin/main` at `91a068eef`
- Shared checkout remains untouched.

## Constraints

- Change only canonical tracked source, focused tests, plan, and index.
- Install local infrastructure before landing.
- NEVER run real publication as verification.
- Stop after 30 minutes if genuinely externally blocked; preserve exact receipt.

## Execution steps

1. Locate canonical resolver and focused tests.
2. Add failing local/remote regression tests.
3. Repair resolver seam.
4. Run focused suite cleanly.
5. Install source through canonical deployment path.
6. Invoke installed entrypoint in non-publishing test mode and assert no fatal ref errors.
7. Commit and land through controller.
8. Record installed and landing receipts; mark DONE only after owner-visible live proof.

## Current receipt

2026-08-14: Unchanged `origin/main` proof reproduced the exact pre-existing docs-lane failure: `PASS=116 FAIL=1`, `docs lane ts escape`, candidate typecheck exit 254. Root cause: fixture invoked tracked `tsc`; Node launch is correctly intercepted by remote-only guard (direct exit 97). Fixture now uses deterministic `test -f index.ts`; adjacent tests retain package-local binary and deliberate TypeScript failure coverage. Repaired suite is clean: `PASS=118 FAIL=0`. Canonical full deploy failed closed and rolled back because `/home/user/.config/overdeck/actions-gateway.env` is absent. Live `/home/user/.claude/workflows/lib` was atomically pointed at verified worktree source. Installed resolver returned remote `origin/main` `45a5595436626ab35d05e279e6498944cc88a597` and local branch `91a068eef909df7692d984bdb886d653f72c7b85`; installed non-publishing `drift` returned status `ok`. Candidate committed at current worktree HEAD. Independent review launch `2988825f` failed before model execution because installed Factory extension `/home/user/.pi/agent/extensions/gpt-sol.ts` resolves to missing `/tmp/jiti/extensions-gpt-sol.29602a5d.mjs`. No review verdict exists; landing withheld at blocker limit.

## Next executable action

Restore the canonical installed Factory extension through its owning runtime lane, obtain independent APPROVE/BLOCK review of `a667012c6`, then land through the project controller and record landing/deployment receipt.
