# WIP and Worktree Triage

audience: AI coding agents first.

status: IDLE
task IDs: #1, #2, #3
source request: Owner requests complete read-only triage of overdeck worktrees, branches, WIP, linked plans/specs, activity dates, landed state, merge readiness, conflict risk, progress, and time-to-land. Owner needs plain recommendations preserving all relevant WIP and avoiding rebase/merge pain. Branch deletion may be recommended only when proven landed; tag first so recovery is never one-way. Supplied `/wip-triage` contract defaults this request to `--audit` because no mutation mode was selected.

## Outcome

Produce evidence-based audit and consolidation order. Preserve uncertainty. Do not mutate audited Git state.

## Acceptance criteria

1. Inventory every registered worktree, local branch, remote-tracking branch, detached worktree, stash, dirty/staged/untracked state, and potentially valuable ignored state.
2. Link each workstream to authoritative plan/spec/task where evidence permits; mark missing or contradictory links.
3. Record verified canonical remote/default branch/SHA/fetch receipt.
4. Classify every worktree and branch using exactly one disposition: `RETIRE — LANDED`, `RETIRE — REDUNDANT`, `RECOVER`, `KEEP — ACTIVE`, or `UNKNOWN`; add independent flags and confidence.
5. Prove landed/redundant work with content evidence beyond ancestry. Never recommend deletion below `HIGH` confidence.
6. Report first/latest unique commit date and latest meaningful activity. Say `inactive since`, never infer abandonment.
7. Report progress, remaining work, conflict risk, evidence-based time-to-land range, and concrete next action for every retained lane.
8. Produce conflict-minimizing consolidation and landing order. Prefer reimplementation of stale intent on current baseline over replay when architecture drift makes replay costly.
9. Produce executive recommendation, worktree ledger, branches-without-worktrees ledger, risks, and immediate next actions in plain language.
10. Audit only: create no recovery refs, tags, snapshots, bundles, stashes, commits, branch mutations, worktree removals, or remote mutations.
11. Identify existing project primitive, if any, that keeps incomplete real WIP disabled and permits agent activation only after verified completion. Record exact contract, enforcement seam, and WIP-triage integration; do not invent a new switch when an authoritative primitive exists.
12. Review every file and archived payload under `temp-user/overdeck-git-automation`; reconcile its short-lived trunk-based/feature-flag proposal with current audit recommendations. Distinguish steady-state development policy from one-time recovery of 117 uncertain lanes. Report package defects, unsafe assumptions, usable components, and final project-specific operating model.

## Preserved WIP

- Shared checkout `/home/user/Projects/overdeck` is read-only and already contains unrelated modified/untracked state.
- Audit planning lane: `/home/user/Projects/overdeck/.worktrees/wip-triage-audit`, branch `wt/wip-triage-audit`, created from `origin/main` at `8d36d1468`.
- No audited worktree or branch has been mutated.

## Constraints

- Follow owner-supplied `/wip-triage` audit contract.
- Read `/home/user/Projects/0 DOCS/GIT_FATIGUE.md`; NEVER modify it.
- Preserve first; verify second; mutate only in a separately authorized mode.
- Never inspect or expose secret contents while assessing ignored paths.
- Never use age, name, ancestry, clean status, or divergence alone as deletion proof.
- Never ask owner to choose Git mechanics; provide ranked recommendations.
- Repository instructions require isolated worktree for authored plan files.

## Execution steps

1. Verify canonical remote/default branch; fetch/prune if available; record timestamp and SHA.
2. Capture read-only machine inventory of worktrees, refs, branches, statuses, stashes, dates, divergence, and changed paths.
3. Identify ignored-path categories without reading credentials, dependencies, caches, builds, or logs.
4. Read plan/spec/task registry and map workstreams by branch, commits, paths, and intent.
5. Compare unique commits, trees, patch IDs, and current implementations to prove landed/redundant states.
6. Measure overlap, stale-base risk, progress, missing verification, and remaining acceptance work.
7. Build worktree and branch ledgers with dispositions, flags, confidence, estimates, evidence, and next actions.
8. Recommend preservation/consolidation/landing sequence and safe-retirement candidates. Do not execute it.
9. Update this receipt with audit artifacts and findings before reporting.

## Package reconciliation decision

Reviewed every outer file plus all 49 verified archive entries under `temp-user/overdeck-git-automation`.

1. Correct steady-state policy: short-lived task worktrees; small green slices; continuous current-main integration; applicable behavior lands default-off; exact-SHA controller gate/publish/deploy; automatic retirement.
2. Correct recovery policy: preserve 117 uncertain lanes first; NEVER mass-rebase or merge stale source branches; build disposable fresh-main candidates; keep original refs until landed/archive proof.
3. Prior response correction: “incomplete WIP normally stays off-main” is valid only during current recovery or for an indivisible red slice. It is NOT the target steady-state model. Green incomplete feature slices SHOULD land dark to prevent branch aging.
4. Reject package application as-is. Required test is already red. Implementation creates a parallel standalone controller, deploys from enrolled working tree rather than verified candidate artifact, lacks crash reconciliation around publication, exposes broad filesystem/network in sandbox, cleans without required verified recovery bundle, runs heavy gates locally, lacks content-addressed receipt reuse, and destructively rewrites entrypoints by filename.
5. Reuse concepts, not patch: tracked change-class/feature definition, fail-closed evaluation, candidate isolation, exact-SHA receipts, CAS publication, automatic checkpoint/import/retirement, one lifecycle owner.
6. Activation authority: agent MUST NOT directly toggle runtime state. Controller MAY auto-activate after exact deployed-SHA acceptance and smoke receipts when task acceptance already authorizes activation. Require owner decision only for genuine rollout/product scope (`internal`, `canary`, `on`) not determined by request. This matches ship-end-to-end policy and avoids making owner operate routine delivery.
7. Feature flags are temporary delivery controls, not permanent architecture. Require owner, expiry, rollback default, off/on tests, observability, and cleanup task. Do not flag refactors/docs/tests or ordinary verified fixes.

## Current receipt

- 2026-08-11: Task #1 created and marked for execution.
- 2026-08-11: Read owner-supplied triage contract and canonical Git-fatigue strategy.
- 2026-08-11: Indexed non-secret documentation under `/home/user/Projects/0 DOCS/`; secret and temporary paths excluded.
- 2026-08-11: Created isolated audit planning lane at `8d36d1468`; audited repository state remains untouched.
- 2026-08-11: Read-only baseline verified by `git ls-remote`: `origin/main` = `8d36d146804931c33a0e5fe026de03029f35572b`; local recorded `origin/main` matched. Fetch/prune intentionally skipped because audit mode forbids Git-state mutation.
- 2026-08-11: Inventoried 272 worktrees, 99 local branches without worktrees, 8 stashes, 16 existing recovery refs, 75 dirty worktrees, and 8 detached worktrees.
- 2026-08-11: Generated `.wip-triage-enriched.json`, `.wip-triage-ledger.md`, and `.wip-triage-summary.md` in the audit lane. No audited Git state changed.
- 2026-08-11: Conservative first pass identifies 117 recovery lanes and 254 landed-candidate worktree/branch refs. All 254 retirement candidates remain `MEDIUM` confidence until a second independent strong landing proof, preservation, and active-process check complete; therefore zero deletion recommendations currently pass the deletion gate.
- 2026-08-11: Flags: 63 dirty, 40 untracked-WIP, 16 potentially important ignored-path lanes, 249 stale-base, 8 detached. Ignored contents and secret-named paths were not read.
- 2026-08-11: Automated plan/spec links are candidate links only; semantic review is still required for authoritative consolidation grouping and accurate plan-level progress/ETA.
- 2026-08-11: Feature-completion switch audit: no generic project primitive currently binds incomplete feature state to verified completion and runtime enablement. `GOLIVE.md` is an observed acceptance ledger consumed read-only by `collector/src/adapters/golive.ts`; plan statuses govern workflow; `packaging/web-release.sh activate` atomically activates a whole verified web release; subsystem `enabled` settings are bespoke. Recommended default: incomplete work stays isolated off-main and therefore off. Use an explicit fail-closed feature flag only when partial code must land before activation; require acceptance receipt before the agent changes it from off to on.

- 2026-08-11: Reviewed all four outer package files and all 49 archive entries; manifest hashes and sizes pass. Package required validation is red (`TEST_REPORT.md`: focused exit 2). Reconciled policy: preservation-first is current debt recovery; trunk-based dark launch is steady state. Prior off-main-default recommendation corrected for steady state. Package rejected as executable patch; selected architecture concepts retained in this plan.

- 2026-08-11: External broken-ref signal resolved by owning session, not this lane. `refs/heads/wt/factory-gpt-engine` previously caused `fatal: bad object refs/heads/wt/factory-gpt-engine` and `error: https://github.com/alexcodeplace/overdeck.git did not send all necessary objects`; owner repaired it to `05fff831f3d5971f1be1cee635978d5fac8afe83`. Coordinator independently verified ref resolution, commit-object existence, and clean origin fetch dry-run. Task #24 performed no mutation of that lane.

## Next executable action

Preserve current WIP first. In parallel, specify the smallest controller-integrated dark-launch primitive and lifecycle transition contract; do not install the supplied standalone package.
