← Back to Pull requests

fix(inkless:consolidation): skip the diskless supplement when the local read ends mid-batch [KC-876] #911

Open
unknown opened this pull request with 191 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 27, 2026 14:04 UTC
Author

Why

A byte-limited local read of a consolidating partition can end inside a batch. The batch iterator drops that partial tail, so the supplement starts at the partial batch's base offset. The merge still keeps the partial bytes, so the response holds a truncated batch in front of the diskless batches. The consumer reads the partial header, runs into the diskless bytes, and fails the CRC check.

The local log isn't frozen at the seal, because the consolidation fetcher keeps appending to it. The log end offset that DelayedFetch captures at routing can therefore be stale, which lets the exhaustion guard pass.

The committed data isn't lost, but the consumer can't make progress until a later fetch avoids the same shape.

What changes

buildConsolidationSupplementFetchInfos skips the supplement when the complete batches don't account for all local bytes. The partial batch then stays the last thing in the response, where it's harmless, and the consumer re-fetches from the last complete batch.

This change doesn't move the log end offset that DelayedFetch.onComplete uses. That idea from the ticket is a separate change.

Test plan

  • Add testBuildConsolidationSupplementFetchInfosSkipsWhenLocalReadEndsMidBatch to ReplicaManagerInklessTest. The test fails without the guard and passes with it.

  • Run ReplicaManagerInklessTest (321 tests) and DelayedFetchTest (5 tests) with no failures.

  • Run make vale with no alerts.
  • Fixes KC-876.

    🤖 Generated with Claude Code

    Diff: 191 lines (+143 / -48) across 2 files Reviewer: viktorsomogyi Review duration: 4448m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 191 lines diff across 2 files
    0.36
    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: 35%
    46%
    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.315
    Real PR Conversation Timeline
    1 comments
    "Review active on #911"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 35.9% (MEDIUM) · Higher = larger blast radius
    35.9%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 19.1% · Safe to merge
    19.1%
    Repository