From d392f0bc14bcd687e918d4653ae016226496b4c4 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 3 Feb 2026 21:21:33 +0000 Subject: feat: add diagnostic logging for partial state event matches Improves observability when pushes are rejected due to state events that only partially match the pushed refs. Previously, logs only showed 'No state event found' even when state events existed but didn't match. Changes: - Add diagnose_state_mismatch() to explain why state events don't match - Log specific reasons: missing refs, wrong SHAs, or extra refs - Update rejection message to 'No matching state event found' (more accurate) - Add 4 unit tests for diagnostic function Example diagnostic output: WARN State event abc123 from authorized author doesn't match push: refs/heads/main missing (state declares 9cc3d93b) This addresses the issue where a push with only refs/heads/test was rejected because the state event also declared refs/heads/main, but logs didn't explain why the match failed. --- src/git/handlers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/git/handlers.rs') diff --git a/src/git/handlers.rs b/src/git/handlers.rs index e3a6ad4..7244abb 100644 --- a/src/git/handlers.rs +++ b/src/git/handlers.rs @@ -254,7 +254,7 @@ pub async fn handle_receive_pack( } // GRASP Authorization Check - info!( + debug!( "Authorizing push for {} owned by {} via database query", identifier, owner_pubkey ); -- cgit v1.2.3