Add R2 buckets to workerd #8507
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 240 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Diff Size
diff_size
0.328
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #8507"
general
weight: 0.35
piscisaureus
workerd has no R2, so a Worker with an
r2Bucketbinding only runs under Miniflare or an embedder's own implementation. This adds R2 to standalone workerd and to a cluster.R2 is a bundled Worker,
/workerd/r2.js, as KV is: it serves the protocol the existing R2 binding already speaks, so the binding is unchanged, and the bucket is named in the binding's props. It stores each R2 object as one object under its own key in abucketservice, which gains a small S3-like HTTP API (HEAD, ranged GET, list, conditional writes, multipart). In a cluster that is the cluster's S3 or Cloud Storage bucket, so S3 and GCS tools read a bucket directly; without one, a local store on disk that several processes can share. There is no index.Values stream both ways. A put is hashed as it is read and written only if its checksums pass. Miniflare's R2 tests pass against it (cloudflare/workers-sdk#17019, draft). Where a plain object store can't be R2, listed at the top of
r2.js:onlyIfisn't fencedNot yet: more than one part in flight (one stream tops out around 12-15 MB/s), and an S3-compatible endpoint.