fix(git-hooks): skip sequencer pre-commit formatting#95842
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 25, 2026, 4:33 AM ET / 08:33 UTC. Summary PR surface: Tests +129, Other +12. Total +141 across 2 files. Reproducibility: yes. source inspection shows current main and Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused guard and regression tests once the current head has matching real-behavior proof or an explicit maintainer proof override. Do we have a high-confidence way to reproduce the issue? Yes, source inspection shows current main and Is this the best way to solve the issue? Yes for the code shape: the early sequencer metadata guard is the narrowest maintainable fix because it avoids formatter selection only during Git operation commits while preserving the normal staged-file path. The current-head proof needs refresh for the added revert case before merge confidence is complete. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c030b305a444. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Tests +129, Other +12. Total +141 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
88c0fe8 to
b0a71cc
Compare
|
Merged via squash.
|
* fix(git-hooks): skip sequencer pre-commit formatting * chore: rerun CI * fix(git-hooks): skip revert sequencer formatting --------- Co-authored-by: Vincent Koc <[email protected]>
* fix(git-hooks): skip sequencer pre-commit formatting * chore: rerun CI * fix(git-hooks): skip revert sequencer formatting --------- Co-authored-by: Vincent Koc <[email protected]>
Summary
git-hooks/pre-commitfrom formatting sequencer-staged files while merge, rebase, or cherry-pick commits are in progress.What problem does this PR solve?
git-hooks/pre-commitcurrently treats the sequencer-created staged index like ordinary local edits, so a merge/rebase/cherry-pick commit can runoxfmt --writeover files staged by the operation.Why does this matter now?
The hook was changed to format staged files directly; during sequencer commits that staged set can include unrelated upstream files.
What is the intended outcome?
Sequencer commits exit the hook successfully before formatter selection, while normal commits still run the formatter on staged format-able files.
What is intentionally out of scope?
No formatter selection rules, helper scripts, package manager behavior, or non-sequencer hook behavior are changed.
What does success look like?
Merge, rebase, and cherry-pick commit states do not invoke the formatter; a normal commit still does.
What should reviewers focus on?
The early Git metadata guard in
git-hooks/pre-commitand the regression coverage intest/git-hooks-pre-commit.test.ts.Linked context
Which issue does this close?
Closes #95841
Which issues, PRs, or discussions are related?
Related: none found in open/closed issue and PR searches for this hook behavior.
Was this requested by a maintainer or owner?
No.
Real behavior proof (required for external PRs)
git-hooks/pre-commitshould skip formatter invocation while merge/rebase/cherry-pick sequencer metadata is present, and should still format normal staged files.ca8140e300caea46af70858a7f28a709eff81d22, with temp Git repos invoking the realgit-hooks/pre-commitfrom this branch.A separate temp-repo shell repro invoked this branch's real
git-hooks/pre-commitin merge, cherry-pick, rebase, and normal commit states while stubbing only the downstream formatter runner to record whether it was called.Terminal capture from the temp-repo hook repro after this patch:
Focused test output after this patch:
oxfmt --write --no-error-on-unmatched-pattern changed.ts. The focused hook test file passed all 12 tests.pnpm checkand the full hosted CI matrix were not run locally.oxfmt; the hook script under test is the real branch file.Terminal capture from current
upstream/mainbefore this patch:Tests and validation
Which commands did you run?
What regression coverage was added or updated?
Added coverage that the hook skips formatter invocation for real merge metadata and for cherry-pick/rebase metadata paths, plus a non-regression test proving normal staged files still reach the formatter.
What failed before this fix, if known?
The new skip tests failed before the hook guard because the formatter runner was called with
oxfmt --write --no-error-on-unmatched-pattern changed.ts.If no test was added, why not?
N/A; regression tests were added.
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes, for contributor Git hook behavior during merge/rebase/cherry-pick commits.
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No new execution surface. The change reduces formatter execution in sequencer commit states only.
What is the highest-risk area?
Accidentally disabling normal pre-commit formatting.
How is that risk mitigated?
The normal commit regression test and temp-repo proof both show a staged
.tsfile still invokes the formatter when no sequencer metadata is present.Current review state
What is the next action?
Ready for maintainer review after PR CI starts.
What is still waiting on author, maintainer, CI, or external proof?
Hosted PR CI and maintainer review.
Which bot or reviewer comments were addressed?
None yet.
Disclosure: AI-assisted; contributor manually reviewed and is responsible for the change.