Deduplicate project trail resolution and reuse shared helpers

Commit

dipreeyesterday

Branch-to-parent discovery, the selector shape check, and the --repo target guard each existed in two or three copies with drifting error texts. Fold them into openTrailParentTarget, validateProjectTrailSelector, and the existing ensureTrailRepoHasTarget; drop the approval commands' redundant pre-checks and the dead "selector or --branch, not both" guard.

Route project trail HTTP failures through api.CheckResponse so status, request ID, and error code reach callers as the shared *HTTPError. Reuse validateTrailCreateEnums for --type/--priority and printTrailDiscussions for comment list, which now shares the standard discussions JSON shape. Name the api.ChangeResource read shape instead of declaring it anonymously twice, share --repo ID resolution between list and create, and name the list page timeout.

Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com Entire-Checkpoint: 01M46RKQR8D49K6KXF37FFWCS1

Checkpoints

Merge Main and Resolve CLI Conflicts

Claude CodeFable 5.1
View session
Checkpoint 1