refactor(strategy): address review — redact URLs, harden push-target guard, tidy marker store

main

Commit

karthik-rameshkumar2mo ago

Applies the multi-agent review findings on the empty-remote guard:

  • Privacy: redact push-target URLs before logging them (they can embed credentials). Use checkpoint/remote.RedactURL in both deferral log lines, matching the package's existing promisor-logging pattern.
  • Correctness: PushTargetsInDir no longer relies on IsURL's bare-'@' heuristic to skip pushurl resolution, which misclassified a remote NAME containing '@' (e.g. "build@ci") as a URL and permanently fail-closed-deferred it. New isConcretePushTarget follows git's own scp detection (colon before any slash). Also returns an explicit error for an empty target instead of a silent []string{""} on the new exported API.
  • Consistency: move the bootstrap marker from the ad-hoc .git/entire/ file to the sibling-convention .git/entire-push-bootstrap/ directory, route reads and writes through os.Root like session state, and read content+mtime from a single open file handle (was ReadFile + Stat). Register the marker with entire clean discovery/deletion so a reset clears it.

Tests: isConcretePushTarget classification (incl. '@' remote name), empty-target error; existing marker/defer/OPF/cleanup suites and the full canary still pass.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 01KXG1Q21WTF76Q8E851XF226A

Checkpoints

Fix Checkpoint Push on Empty Remote

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1