Skip to content

R2 object workload adapter and operation counters #10163

Closed

Description

@dezren39

Problem and goal

Implement R2 object get/put/checksum and native counters. Parent-verified primary R2 conditional operations cover writes (Put/Multipart/Copy), not DeleteObject. Do not claim conditional delete. GC may plain-delete a captured immutable generation-qualified key only after the #9084 owner fence and non-reuse are proven; otherwise delete is unsupported/disabled.

Version and design basis

Version: V2. Settled design: https://github.com/developing-today/code/blob/main/doc/2026-11-13T03-40-00Z_design_id-atlas-summit/part-c/versioned-design.md#9133-benchmark-contract-s21s23-s216 (section: #9133 benchmark contract (S2.1–S2.3, S2.16)).
Tier: recommended.
Statement IDs: S2.1, S2.2, S2.3, S2.16
Enables: R2 parity runs; cloud evidence

Scope and ownership

Parent: #9133 (native component/meta parent).

  • pkgs/id/benchmarks/src/adapters/r2.rs (new; owner: C9133-02-R2)
  • pkgs/id/benchmarks/tests/r2_adapter.rs (new; owner: C9133-02-R2)
    Hard dependencies (native blockers): C9133-01 — benchmark crate manifest, schema, shared workload types and synthetic fixtures
    Soft sequencing (not blockers): none

Test / evidence first

Create or validate pkgs/id/benchmarks/tests/r2_adapter.rs first. Proposed command: cargo test --manifest-path pkgs/id/benchmarks/Cargo.toml --test r2_adapter
Oracle: reference — expected Fake R2 capability fixture verifies conditional writes, opaque generation-qualified locator construction and never-reuse; conditional DeleteObject is unsupported. A stale delete targets only its captured old key and cannot alias a new generation.; verifier: Independent R2 operation capability table and generation-key model; test has no network/provider calls..

Done and rollback

Done when the declared oracle passes and test/evidence output plus changed-file summary is attached. Research evidence: not applicable.
Rollback: Remove R2 adapter module; no bucket objects or credentials are touched.

Manifest SHA-256 approval binding: 3b5bce3523945bf5adaa28739f0b90b7b70ff1d6522b4ac827246654e8ff6b06.

Activity

  1. developing-today commented on Nov 14, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Agent note — task 17013 dependency-blocked on issue #10153 (lane any-c)

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 14, 2026
  4. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1

  5. added and removed
    status/blockedQueue or user escalation state
    queue/blockedQueue or user escalation state
    work/assignedQueue worker lifecycle state
    on Nov 17, 2026
  6. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Agent note — task 17013 preflight CLEARED (lane any-l, 2026-11-17)

    • State: triaged — the native blocker is closed and its deliverable is on main; implementation routed to follow-on task 20687.
    • Fresh verification this run: issue R2 object workload adapter and operation counters #10163 OPEN, no hard-stop labels. Native blocker Benchmark schema and synthetic mapping oracle #10153 (C9133-01: benchmark schema and synthetic mapping oracle) is CLOSED, reason COMPLETED, at 2026-11-17T07:00:50Z via PR id benchmarks: schema, synthetic fixture and reference oracle crate (C9133-01, #10153) #11021. Verified on origin/main @8046b00102: pkgs/id/benchmarks/ exists — Cargo.toml, fixtures/, result-v1.schema.json, src/lib.rs (shared workload model incl. ENGINES, content_id, physical_key, support_level), tests/. This reverses the blocked verdicts of 2026-11-14 (task 17013, lane any-c) and 2026-11-17T05:46Z (task 19122), both correct at their time.
    • No implementation was done under this preflight task (its scope is preflight only) and no production rollout is authorized.
    • Follow-on: task 20687 (small_fix, priority 20) — implement pkgs/id/benchmarks/src/adapters/r2.rs + pkgs/id/benchmarks/tests/r2_adapter.rs against the Fake R2 fixture; oracle per the issue (conditional writes verified; conditional DeleteObject unsupported; stale delete targets only its captured generation-qualified key). Test: cargo test --manifest-path pkgs/id/benchmarks/Cargo.toml --test r2_adapter.
    • Labels: the stale blocked set from this task's earlier blocked period (status/blocked, queue/blocked, work/assigned) is removed; queue/queued added for task 20687.
  7. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: implementation complete (task 20687, lane any-q)
    issue #10163 - C9133-02-R2: R2 object workload adapter + operation counters

    Implemented in the C9133-01 benchmark crate (pkgs/id/benchmarks), test-first, against a Fake R2 capability fixture - no network/provider calls:

    • src/adapters/r2.rs (new): FakeR2 fixture carrying R2's verified conditional surface (put-if-absent, put-if-match, copy-if-match; etag = content identity) and R2Adapter: generation-qualified opaque locators via the crate's content_id/physical_key, get + recomputed-checksum legs, and native operation counters (puts/gets/checksums/copies/conditional accepted+rejected/deletes/refused/unsupported).
    • Delete discipline per the issue's hard rules: conditional DeleteObject is UNSUPPORTED - every conditional-delete call is refused as unsupported and counted, nothing deleted. A plain delete exists only for a captured tombstone key, only after the design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 owner fence is proven to the adapter, and only for a non-live generation - so a stale delete removes exactly its captured old key and cannot alias a newer generation. Generation keys are never reused (ever-used registry, mirroring the reference store).
    • tests/r2_adapter.rs (new): 6 tests named for the oracle clauses - conditional writes verified; get/checksum roundtrip; generation-qualified locators + never-reuse; conditional delete unsupported (cross-checked against the plan's support_level mapping); delete requires the owner fence; stale delete targets only its captured old key.
    • src/lib.rs + src/adapters/mod.rs: one-line module wiring (pub mod adapters) - the only touch outside the slice's two owned files.

    Evidence (laptop, worktree at origin/main 8046b00):

    • cargo test --manifest-path pkgs/id/benchmarks/Cargo.toml --test r2_adapter: 6 passed, 0 failed.
    • cargo test --manifest-path pkgs/id/benchmarks/Cargo.toml (full crate): 6 r2_adapter + 2 workload_oracle passed, 0 failed - no regression in the C9133-01 oracle.
    • cargo fmt --check on the crate: clean.
  8. added a commit that references this issue on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions