Test lazy-fetch fires before materialized fallback

main

Commit

Soph4mo ago

Adds TestRunSyncLazyFetchOnRelayRejection covering the needsLocalSourceClosure=false path through the materialized fallback. Triggering it from the network is essentially impossible (parsed advertisements always have non-nil capabilities, so RelayTargetPolicy.CapabilitiesKnown is always true in practice), so the test constructs a syncSession via newSession and synthesizes the unreachable scenario by setting target.policy.CapabilitiesKnown=false directly. Source has a new commit on a new branch that target genuinely doesn't have; the test asserts that commit object lands on target, which is only possible if fetchClosure ran before executeMaterialized.

Confirmed to fail when the lazy-fetch logic is reverted.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com Entire-Checkpoint: cc7986f5b900

Checkpoints

git-sync sync --tags https://github.com/entireio/cli.git $ARTIFACTS_REMOTE

Claude Code
View session
Checkpoint 1