Skip to content

fix(review): hydrate blob sizes from bounded trees - #1518

Merged
RomneyDa merged 1 commit into
mainfrom
fix/review-tree-blob-metadata
Sep 10, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/review-tree-blob-metadata

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Summary

  • hydrate historical review blob sizes from the existing bounded recursive-tree REST metadata route
  • cache one complete metadata map per distinct base/head revision
  • preserve fail-closed handling when a tree is truncated or a diff blob is absent

Why

The private-workspace admission deployed in #1488 made exact OpenClaw reviews depend on per-object GraphQL lookups. Under the current review burst, those workers repeatedly failed before model execution with review_checkout_unavailable / “remote blob size metadata is unavailable.” The durable queue retried the same exact heads without producing artifacts.

Every blob in a base-to-head diff must belong to either the exact base tree or exact head tree. ClawSweeper already has a bounded recursive-tree resolver that rejects truncated responses, invalid entries, and repositories over the tracked-file limit, so source hydration can use that complete metadata instead of amplifying GraphQL requests per object batch.

Behavior proof

  • Claim: exact review source admission can resolve both sides of a real OpenClaw PR diff without per-object GraphQL metadata.
  • Surface: githubReviewTreeBlobSizes through the revised hydration resolver.
  • Scenario: OpenClaw Wave 13 completion PR base 46af4a9582b34444d11cc98310838060e1aae5ca and head 4cc522493abf6cbacafc272251d832d52a2ed2a3.
  • Environment: local Node 24 process using authenticated live gh api REST reads.
  • Result: both recursive trees were complete and untruncated, each yielded 39,880 unique blob identities, and the changed file’s base/head blobs resolved to 39,361 and 38,117 bytes.
  • Limits: this proves live metadata acquisition and exact revision binding, not hosted workflow deployment; CI and a post-merge exact review provide that final proof.

Validation

  • pnpm run build:all
  • node --test test/review-blob-hydration.test.ts test/review-command-workflow.test.ts — 122 passed
  • focused live API behavior proof above
  • committed-head autoreview P3 — clean, 0.91 confidence
  • pnpm run check — 5,941 passed, 32 skipped; one unrelated macOS-only failure because system Bash lacks mapfile in apply-drift-refresh E2E. Linux CI is the platform-complete authority.

OpenClaw Bay

Not affected. This changes private review source admission only; no queue, status, telemetry, or Bay data contract changes.

@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added 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. labels Sep 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 8:44 PM ET / September 10, 2026, 00:44 UTC (Revision 2).

ClawSweeper review

What this changes

Review source preparation now obtains missing blob sizes from cached GitHub tree metadata for the exact base and head revisions.

Merge readiness

✅ Ready for maintainer review

The change remains useful: current main still uses per-object GraphQL metadata for historical diff hydration. No actionable defect was found in the introduced patch, and the recorded live REST evidence supports its bounded metadata claim.

Priority: P2
Reviewed head: fef77a67db3de58445e229e5dfbacbdde8eb0e74

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant live metadata evidence, existing safety coverage, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body records the revised hydration resolver using live GitHub REST reads from Node 24 to resolve both sides of a real PR diff, with complete trees and observed byte sizes; hosted deployment recovery remains outside that claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records the revised hydration resolver using live GitHub REST reads from Node 24 to resolve both sides of a real PR diff, with complete trees and observed byte sizes; hosted deployment recovery remains outside that claim.
Evidence reviewed 6 items Introduced patch and safety checks: The resolver caches metadata by exact revision and selects sizes by blob identity from either endpoint. The downstream owner still rejects absent or invalid sizes and excessive aggregate bytes before fetching missing objects.
Existing bounded resolver: The reused resolver validates repository and revision syntax, requires an explicitly untruncated tree, limits entry count, and checks blob sizes. Its existing checkout-materialization caller establishes this as an established metadata path rather than a competing implementation.
Current-main necessity: Live GitHub reads confirmed main remains at the pinned base and this PR remains open and unmerged. Inspection of that base shows historical hydration still calling the GraphQL resolver; no merged replacement is established by the supplied related context.
Findings None None.
Security None None.

How this fits together

ClawSweeper prepares PR source before scanning it and starting a review. This subsystem checks missing file sizes against admission limits before downloading the Git blobs needed for the diff.

flowchart TD
  A[Pinned PR revisions] --> B[Identify missing diff blobs]
  B --> C[Read cached GitHub tree metadata]
  C --> D{Complete sizes within limits?}
  D -->|Yes| E[Fetch required blobs]
  D -->|No| F[Stop source admission]
  E --> G[Scan source and prepare review]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta Production +22/-7; tests +14/-12 The small production increase implements revision caching and reuses the existing bounded resolver.

Technical review

Best possible solution:

Use the existing bounded tree resolver for both diff endpoints while preserving complete-size admission and exact revision binding.

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

No independent high-confidence reproduction of the burst-dependent GraphQL failure was established; current source confirms that dependency, and the PR records successful replacement metadata reads.

Is this the best way to solve the issue?

Yes. Reusing the existing bounded resolver is a narrow solution, and every required diff blob belongs to one of the two inspected endpoint trees.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0940b82e3c3a.

Labels

Label justifications:

  • P2: This is a focused reliability repair for review source preparation with no demonstrated urgent product-wide outage.
  • 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 (live_output): The captured body records the revised hydration resolver using live GitHub REST reads from Node 24 to resolve both sides of a real PR diff, with complete trees and observed byte sizes; hosted deployment recovery remains outside that claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records the revised hydration resolver using live GitHub REST reads from Node 24 to resolve both sides of a real PR diff, with complete trees and observed byte sizes; hosted deployment recovery remains outside that claim.

Evidence

What I checked:

  • Introduced patch and safety checks: The resolver caches metadata by exact revision and selects sizes by blob identity from either endpoint. The downstream owner still rejects absent or invalid sizes and excessive aggregate bytes before fetching missing objects. (src/clawsweeper-context-hydration.ts:980, fef77a67db3d)
  • Existing bounded resolver: The reused resolver validates repository and revision syntax, requires an explicitly untruncated tree, limits entry count, and checks blob sizes. Its existing checkout-materialization caller establishes this as an established metadata path rather than a competing implementation. (src/clawsweeper-review-blobs.ts:1081, fef77a67db3d)
  • Current-main necessity: Live GitHub reads confirmed main remains at the pinned base and this PR remains open and unmerged. Inspection of that base shows historical hydration still calling the GraphQL resolver; no merged replacement is established by the supplied related context. (src/clawsweeper-context-hydration.ts:981, 0940b82e3c3a)
  • Recorded live behavior proof: The captured PR body at source revision 625f3ea55ee78b880c4aa6ffa9462053627df5cf9224b7643846179b26c29d63 reports Node 24 with authenticated live gh REST reads through the revised resolver: two complete trees, 39,880 unique blob identities each, and changed-file sizes of 39,361 and 38,117 bytes. This demonstrates metadata acquisition and endpoint binding, not hosted workflow recovery. The body explicitly records no Bay contract impact. (fef77a67db3d)
  • Regression coverage and review continuity: The adjusted fixture supplies REST tree metadata to actual source preparation, checks historical-blob failure reporting, then verifies successful preparation and an identical offline binary patch. Existing resolver coverage rejects truncated responses. The prior completed review examined the same head and recorded no findings; this review executed no tests or target code. (test/review-blob-hydration.test.ts:1499, fef77a67db3d)
  • Related history and routing: Recent file history connects Vincent Koc and Peter Steinberger to source admission and ancestry handling. GitHub commit metadata identifies vincentkoc for the merged bounded-admission change at fix(review): require opt-in for retained local output #1488. Deeper local blame and pickaxe inspection failed when an unavailable historical object required fetching; no introduction claim relies on those failed commands. (src/clawsweeper-review-blobs.ts:1081, 0940b82e3c3a)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-10T00:40:49.595Z sha fef77a6 :: needs maintainer review before merge. :: none

@RomneyDa
RomneyDa merged commit cd76da8 into main Sep 10, 2026
23 checks passed
@RomneyDa
RomneyDa deleted the fix/review-tree-blob-metadata branch September 10, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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