Skip to content

fix(review): hydrate the complete pinned source - #1333

Merged
steipete merged 1 commit into
mainfrom
codex/decouple-scan-source-hydration
Sep 1, 2026
Merged

fix(review): hydrate the complete pinned source#1333
steipete merged 1 commit into
mainfrom
codex/decouple-scan-source-hydration

Conversation

@steipete

@steipete steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Full reviews could refuse valid pull requests with incomplete_source when GitHub's bounded file context omitted part of the pinned diff. Source hydration depended on the cache digest and the 80-file API window. A partial clone's head checkout populated current files but left historical and deleted baseline blobs missing, so the raw delta was readable while the scanner's complete binary patch was not.

Prepare source from the exact Git delta, independently of API context and cache eligibility. This removes the duplicate API file/status mapping and keeps the pinned REST base/head identities. Missing-object metadata stays in batches of at most 160 objects; fetching uses the scanner's existing 256 MiB upper bound. The scanner still owns aggregate input accounting and refuses incomplete, unsupported, or changed source.

This follows #1308 and fixes a different source-completeness failure exposed while reviewing #1070 and #1073. Their terminal failures correctly stopped retrying the unchanged revisions.

Live proof

Replayed the actual public PR1070 in a fresh blobless clone, using the production hydration helpers, real GitHub blob-size metadata, and the unchanged production scanner on Node24.20.0.

  • Pinned base: 02c930c53d1c7e22ce89d23ba76e6b547a4e2a7f; head: 8d583a05915f737926cd54e8943aee471e2d35ac.
  • Exact delta: 341 files, 588 unique blobs totaling 21,579,924 bytes. The verified merge base remained the pinned base.
  • Before: raw delta readable; binary patch unreadable; production scanner refused incomplete_source.
  • After: 248 missing historical blobs fetched in two batches (160 + 88); the complete 3,473,391-byte binary patch is readable with lazy fetching disabled; the production scanner passed in 93.423 seconds. Its existing reviewed-synthetic-fixture classification handled the known test URI normally.

Regression coverage extends the existing partial-clone fixture to a historical base, more than 80 files, more than 160 missing objects, binary content, deletion, mode changes, and literal pathspec names. It compares the complete offline patch with the source repository. Negative coverage retains invalid-source/path and over-budget refusal before fetching; bounded API context remains bounded.

Validation

Build and all 24 focused context tests pass. Managed Codex reviews before and after commit are scoped-clean at P0. The committed AWS full check passed 4,252 tests, 14 skipped, zero failures, plus 13/13 focused coverage tests on Node24.18.1 and pnpm11.10.0: https://crabbox.openclaw.ai/portal/runs/run_dc9562e86e1f. Current-head CI, CodeQL, sparse repair build, and Windows launcher checks passed: https://github.com/openclaw/clawsweeper/actions/runs/33489263316.

Maintainer review accepts the bounded preparation cost. The existing two-endpoint preparation can perform two hydration passes; this change removes incomplete API-derived inputs without adding another hydrator. Exact-head functional proof and full validation are complete. Large or incomplete inputs still refuse safely; this is not a maximum-size throughput benchmark.

Preparation remains in full-context collection before restricted checkout inspection. Structural reuse retains its existing pinned-source scan and refusal behavior. The change adds no dependencies or new source-preparation mechanism.

Hydrate the exact pinned Git delta even when the 80-file API context is
truncated or the structural cache is unavailable. Remove duplicate API
file/status mapping and use the scanner's existing byte budget with bounded
blob metadata batches. Preserve source identities and scanner refusal.

Reproduced the historical-blob failure on the actual public PR1070 partial
clone, then verified its complete offline binary patch and real input scan.
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 4:55 AM ET / 08:55 UTC.

ClawSweeper review

What this changes

The PR hydrates all blobs named by the pinned raw Git delta independently of the 80-file API context and review-cache eligibility, then documents and tests that behavior.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for normal maintainer review: the pinned branch contains a focused, source-backed repair for an existing review-hydration failure, with no definite introduced correctness defect found.

Priority: P2
Reviewed head: 5d8539828d51327fd4b8a9bb8b6f8131ce932b42

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-bounded repair with credible production-path evidence and substantial regression coverage.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed production owner is review-blob hydration in src/clawsweeper-review-blobs.ts; the PR records a fresh blobless-clone replay using production hydration, real GitHub metadata, and the unchanged scanner, where missing historical blobs were fetched and the after-fix complete binary patch and scan succeeded for #1070.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed production owner is review-blob hydration in src/clawsweeper-review-blobs.ts; the PR records a fresh blobless-clone replay using production hydration, real GitHub metadata, and the unchanged scanner, where missing historical blobs were fetched and the after-fix complete binary patch and scan succeeded for #1070.
Evidence reviewed 5 items Pinned introduced implementation: The branch derives paths and object IDs from the exact base/head raw Git delta, validates paths and modes, and refuses hydration when source cannot be safely bounded.
Hydration no longer depends on the API file window: Full-context collection invokes source hydration whenever a review Git directory is available rather than gating it on cache digest or complete pull-file context.
Large-delta regression coverage: The focused fixture covers a historical base, 178 changed files, deleted and binary blobs, mode changes, metadata batching, and an offline complete binary-patch comparison.
Findings None None.
Security None None.

How this fits together

ClawSweeper prepares a restricted Git checkout and source blobs before scanning a pull request. Those hydrated blobs let the input scanner inspect the exact pinned change before producing a review decision.

flowchart LR
A[Pull request revisions] --> B[Raw pinned Git delta]
B --> C[Blob size and budget check]
C --> D[Fetch missing blobs]
D --> E[Restricted review checkout]
E --> F[Input scanner]
F --> G[Review result]
Loading

Before merge

  • Resolve merge risk (P1) - For pull requests whose pinned merge base differs from the REST base, preparation can perform two separately bounded hydration passes and batched metadata requests before review; the recorded 21.6 MiB replay is strong functional proof but not a throughput measurement for the largest allowed deltas.
  • Complete next step (P2) - No concrete introduced defect warrants an automated repair; retain this focused PR for normal exact-head validation and maintainer review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Change footprint 7 files; 384 added, 187 removed The patch is concentrated in review-source preparation, its focused tests, and its operating contract.
Code versus tests production 98 added, 112 removed; tests 268 added, 75 removed The implementation is net-smaller while the regression coverage expands substantially.

Merge-risk options

Maintainer options:

  1. Verify the exact-head large-delta path (recommended)
    Let the current full check finish and confirm the bounded hydration path remains green on this commit before merge.
  2. Accept the bounded review-cost tradeoff
    Merge with the documented 256 MiB per-delta and 30-second bounds if maintainers accept that very large review inputs may still refuse safely.

Technical review

Best possible solution:

Land the exact-delta hydrator once the current-head validation completes, retaining fail-closed refusal for incomplete, unsafe, unsupported, or over-budget source.

Do we have a high-confidence way to reproduce the issue?

Yes. The source path is clear, and the PR records a concrete before/after production-helper replay against a blobless checkout of #1070; this review did not independently rerun that GitHub-backed scenario.

Is this the best way to solve the issue?

Yes. Reading the pinned raw Git delta removes the duplicate, incomplete API-file mapping while preserving pinned identities, existing scanner accounting, and fail-closed behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ce04d08fa319.

Labels

Label changes:

  • add P2: This is a bounded review-automation reliability repair with meaningful but limited user and operator impact.
  • add merge-risk: 🚨 automation: The PR changes pre-review Git and GitHub metadata fetching, so large-delta runtime cost remains relevant beyond ordinary unit coverage.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is review-blob hydration in src/clawsweeper-review-blobs.ts; the PR records a fresh blobless-clone replay using production hydration, real GitHub metadata, and the unchanged scanner, where missing historical blobs were fetched and the after-fix complete binary patch and scan succeeded for fix(review): keep trailing markers within their HTML comments #1070.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production owner is review-blob hydration in src/clawsweeper-review-blobs.ts; the PR records a fresh blobless-clone replay using production hydration, real GitHub metadata, and the unchanged scanner, where missing historical blobs were fetched and the after-fix complete binary patch and scan succeeded for fix(review): keep trailing markers within their HTML comments #1070.

Label justifications:

  • P2: This is a bounded review-automation reliability repair with meaningful but limited user and operator impact.
  • merge-risk: 🚨 automation: The PR changes pre-review Git and GitHub metadata fetching, so large-delta runtime cost remains relevant beyond ordinary unit coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production owner is review-blob hydration in src/clawsweeper-review-blobs.ts; the PR records a fresh blobless-clone replay using production hydration, real GitHub metadata, and the unchanged scanner, where missing historical blobs were fetched and the after-fix complete binary patch and scan succeeded for fix(review): keep trailing markers within their HTML comments #1070.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is review-blob hydration in src/clawsweeper-review-blobs.ts; the PR records a fresh blobless-clone replay using production hydration, real GitHub metadata, and the unchanged scanner, where missing historical blobs were fetched and the after-fix complete binary patch and scan succeeded for fix(review): keep trailing markers within their HTML comments #1070.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Goutam Adwant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the completed current-head full-check result before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 1d79ae6 into main Sep 1, 2026
18 checks passed
@steipete
steipete deleted the codex/decouple-scan-source-hydration branch September 1, 2026 09:04
steipete pushed a commit that referenced this pull request Sep 1, 2026
Bound each signed state-blob POST and response-body read to 15 seconds per attempt, preserving the existing four-attempt retry policy and idempotent uploads. The shared publisher covers direct and multipart operations with one added production line.

The Git hydration portion of the original proposal is covered by #1333. Keep this PR focused on the remaining publication hang. Exceptionally slow valid requests intentionally fail through the existing retry path.

Validated with actual signed native HTTP on macOS and AWS Crabbox cbx_cc3f61925287: four stalled attempts terminate, attempt-two recovery succeeds, stalled body consumption terminates, and repeated normal publication remains idempotent. Linux proof: https://crabbox.openclaw.ai/portal/runs/run_de0e80556b08. CI tested the exact current-main merge with 4,256 passing tests, 14 skips, and 13 changed-coverage tests; CodeQL and managed review passed. Hosted review accepted proof with no actionable code findings.

Co-authored-by: Sebastien Tardif <sebtardif@ncf.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant