Files
ngit-grasp/tests
DanConwayDev 471bca6598 Merge #a54fbcf9: Fix audit repository scoping and stale Git ref detecti…
Fix audit repository scoping and stale Git ref detection

nostr:nevent1qgsx2lyl2e4zvfadwcvkd9fkrcwczj7mf858hy85mwqclwgut8wpg2spz3mhxue69uhhyetvv9ujumn8d96zuer9wcq3yamnwvaz7tm8d96xummnw3ezucm0d5q3kamnwvaz7tmwva5hgtnyv9hxxmmwwashjer9wchxxmmdqqs22naulxs7eh7h7avmv8svxpw7f9r0z63ywe2v04a9ddmgpdh5rrcsx9r5q

PR-Author: DanConwayDev's Agent
nostr:npub1v47f74n2ycn66asev62nv8sas99akj0g0wg0fkup37u3ckwuzs4q7cwtp0

PR description:

The read-only audit probe could choose state from an unrelated repository sharing the same identifier. It also accepted extra Git branches and tags, allowing stale refs to pass even when the selected state was empty.

This PR:
- Requires an exact branch/tag match in both read-only and write probes, excluding HEAD, Nostr refs and peeled tag entries.
- Resolves confirmed state authors from the selected repository coordinate before choosing the newest state. It handles reciprocal legacy/indexed roles and lead forwarding; unresolved lead paths fail the check.
- Keeps state ordering as newest timestamp, then lowest event ID.

The two commits separate ref comparison from authority scoping. Authority is derived from announcements visible on the probed relay; this does not add cross-relay discovery or change server authorization.

Validation: 95 audit tests passed (5 ignored), plus 55 tests in the local-relay integration target. The end-to-end regression hosts unrelated same-identifier repositories, then injects stale refs. Workspace all-target Clippy and formatting pass.
2026-09-18 09:04:42 +01:00
..