mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-06 07:28:23 +00:00
Adds an integration test (TDD red) for the design doc's "Git-first" flow (docs/explanation/grasp-06-contributor-pr-submission.md lines 204-218): when a /prs/<npub>/<id>.git push arrives before the matching PR event, the event MUST still be promoted out of purgatory on arrival and the cross-service mirror MUST still fire. The existing mirror test only covers event-first ordering — the event is published first, then process_newly_available_git_data (called from the /prs/ receive handler) finds a full PR entry in purgatory and releases it. The git-first ordering hits a different code path: the /prs/ push creates a scoped placeholder, and the PR-event policy in src/nostr/policy/pr_event.rs is responsible for matching the placeholder on event arrival, validating the (signer, identifier, commit) tuple, saving the event, and triggering the mirror. That last step is missing today: git_data_check matches and discards the placeholder, then falls through to find_relevant_repo_paths which returns empty for un-announced coords (the typical GRASP-06 case), returns Ok(false), and the builder re-purgatorises the event as a scopeless full entry. The event silently expires after 30 minutes, the mirror never runs, and the orphan ref at /prs/ survives until startup scan picks up the zero-ref repo. The test fails at exactly this point: is_event_on_relay returns false after the push+event sequence.