Tolerate a missing reflog end cut in trace normalizer - #53
Merged
sagnik11 merged 1 commit intoAug 21, 2026
Merged
Conversation
A mutating git command whose reflog end cut never arrives no longer fails the whole trace ingest. This happens when a temp repo is cleaned up before the exit hook delivers its cut. The family key stays recoverable from the worktree, so the command now records with low confidence instead of hitting a hard error in finalize_root_exit. This mirrors how the daemon already tolerates a working directory that vanished mid-operation (is_missing_working_dir_error). Generated-By: PostHog Desktop Task-Id: fb1ea41b-8b9e-406e-bff5-0b25f963e123
sagnik11
marked this pull request as ready for review
August 21, 2026 12:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
checkoutin a temp repo lost its trace attribution entirely: the daemon reported "trace ingest error" and dropped the command.finalize_root_exitinsrc/daemon/trace_normalizer.rsneeds a reflog end cut to work out which refs a mutating command touched. When the cut is absent, the only tolerated commands arecloneandinit— every other command hit a hardAutterError::Generic.family=/tmp/backend-plugin-*/.git) was most likely cleaned up before the exit hook delivered its end cut. The family key is still recoverable from the worktree, so the code entered the mutation branch with no cuts and errored instead of degrading.commit,merge,rebase, and others.Changes
Confidence::Low, log a warning, and still emit the normalized command — rather than failing the whole ingest.is_missing_working_dir_error,src/daemon.rs).checkoutwith no reflog end cut normalizes to a family-scoped command at low confidence.Testing
cargo test --lib trace_normalizer— 20 passed.cargo build— clean.Created with PostHog Desktop from this inbox report.