← Back to Pull requests

fix lane: deepen a shallow checkout to the merge base before the pack #283

Merged
askalf merged 3 files (281 lines) on Dec 02, 2026 03:10 UTC
View on GitHub
askalf askalf commented on Dec 02, 2026 02:46 UTC
Author

Why

Every fix run with FIX_REVIEW_VIA set has been refused since that setting went on: "review before the push: none (the change could not be packed: Node.js v22.x)". The run's checkout is made at depth 1, and fetchCommit fetches the merge base at depth 1 beside it. buildChange then runs git merge-base <merge base> <commit>; with the head's history cut at the head, there is no common ancestor, git exits 1 with nothing on stderr, and the pack child dies on an uncaught throw. The run kept only the last stderr line, which is node's version.

The change

  • reviewBeforePush deepens the start commit's history until the whole range from the merge base is there: the merge base an ancestor of the start commit, and no shallow boundary left among the commits the pack lists (a merge can reach the base by a short side while its other side is still cut), and the range holding exactly as many commits as GitHub's ahead_by (a cut in the merge base's own history can otherwise let in older commits the head and the merge base share); with no ahead_by nothing short of the whole history shows that, so it is fetched whole. git fetch --deepen in steps of 16, 256 and 4096, then --unshallow as a last resort, and an error naming both commits if the range still is not whole. A failed fetch is a review error, as a failed pack is.

  • Each fetch is bounded by what is left of the run beyond the review's own minimum, and the review's window (reviewWindow: refused below the minimum, else its timeout) is read when the reviewer is about to start, after the fetches and the pack.

  • packError reports a failed pack by its error line (Error: ...), falling back to the last line, the spawn error or the signal.

  • The repository fetched from is ctx.remoteUrl when set (tests), else GitHub's, as before.
  • Checks

    fix.test.mjs on Linux, Node 22: 537 pass, 0 fail. New: a depth-1 clone of a three-commit history, whose merge base sits two commits behind the head, is deepened, packed, reviewed and bundled for the push; a head that merges the base into a twenty-commit topic, deepened until every commit of the range is there (counted against the full repository); a topic from the root that merges a main fifty commits on, deepened until the range is exactly the pull request's commits (compared by id with the full repository), with and without ahead_by; a count that matches while a commit of the range is still cut (deepened on until the range is whole); a pack that takes the run below the review's minimum (the reviewer is not started); reviewWindow at and below the minimum and above the cap; mergeBaseAndAhead with and without ahead_by; packError on an uncaught throw, a single line, and a signal. The remotes are file: URLs from pathToFileURL.

    Mutation pass, 7 mutants each undoing one piece (an ancestor taken as enough, no ahead_by taken as enough, the count, the cut inside the range, the deepening, the window read after the pack, the error line): all 7 fail a named check.

    Diff: 281 lines (+266 / -15) across 3 files Reviewer: None requested Review duration: 24m
    All Vouch review confidence checks passed
    Residual risk 0.31 = Change Risk (0.52) × (1 − Review Confidence (0.40)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 281 lines diff across 3 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    40%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.338
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    1 comments
    "Review active on #283"
    general weight: 0.35
    Reviewers
    None requested
    Assignees
    askalf askalf
    Labels
    risk: low confidence: 40.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 51.7% (MEDIUM) · Higher = larger blast radius
    51.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 40.5% · Lower = rushed or shallow review
    40.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.8% · Safe to merge
    30.8%
    Repository