Files
ngit-grasp/tests
DanConwayDev 16f4e5a2cb test(grasp06): assert PR event promotion + mirror in git-first ordering
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.
2026-05-15 21:59:23 +00:00
..
2026-01-09 19:58:41 +00:00