GeezerVison is showing github.com — design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops · Issue #9084 · developing-today/code
design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084Todo 0 / 20 of 2 issues completedTodo 0 / 20 of 2 issues completed DescriptionComponent F of epic #9078 (hosted editions program). Design first (design mill, under #9078). This carries the program's CENTRAL open question.
Drew's sketch (posed, not decided — 2026-11-12)
Media is content-addressed and deduped in R2. Sensitivity tiers decide placement and access: R2 with access controls, CDN for public content, or inside the Turso DB where that fits.
Because everything is already Turso/Cloudflare, maybe data does NOT need to be copied into each database: the DB holds IDs/references; the content lives once in R2 and can be garbage-collected only when ALL references drop. Access rule candidate: a user may access an object iff their DB holds a reference to it, OR the object is public-published in one or more DBs.
Alternatives the design must evaluate against the sketch
- Reference-only (Drew's sketch above).
- Copy-into-each-DB (content replicated per tenant DB).
- Hybrid (small content inline in DB, large content referenced in R2; or hot/cold split by sensitivity/size).
Evaluation axes: storage cost under dedup, access-control soundness (can a reference be forged or enumerated?), GC correctness (reference counting vs mark-and-sweep across many DBs; races with new references), deletion/privacy (a user deleting content others still reference; jurisdiction rules per #3401), latency (extra hop through R2 vs local rows), and what 'published public' means mechanically.
Builds on / relations
Acceptance
Sub-issuesCollapse Sub-issuesSub-issues0 of 20 of 2 Issues completedLoading 2 sub-issues Activitydeveloping-today commented on Nov 12, 2026 dezren39 commented on Nov 12, 2026 Amendment applied (Drew 2026-11-12 17:03, epic #9078): the primitives designed here must be ADAPTER-FRIENDLY toward the self-hosted tier (component I, #9087): RustFS (S3-compatible) as R2's counterpart, NATS for streams/messaging, and tiered storage classes with per-tier retention and placement/movement. Design the object-store and reference/GC contracts against an adapter interface, not against R2 alone. dezren39 commented on Nov 12, 2026 Cross-reference from the Atlas v1 program (2026-11-12) — inputs, not decisions
The Atlas v1 program (starter #9091, proto design doc/2026-11-12T23-59-00Z_design_atlas_v1_proto/note.md) touches this issue's plane in two places, both as inputs to this issue's open evaluation — neither settles S10 (reference-vs-copy) or the GC design, which remain this issue's to decide:
Atlas's in-domain prior art remains #3125 (provenance registry, content-addressed extracts), already noted in this issue as a different domain to consult. dezren39 commented on Nov 13, 2026 INPUT from program #9106 (Drew, 2026-11-12 18:29 CST): content-plane addressing is specified in Part A of #9106 — ID shapes + hash.metadata sidecars (#9113/#9114) and the harvested LOCATION INDEX (#9115: all locations per hash — R2 bucket, laptop hostname+path, Drive account-prefixed, Drive URL) are the shared addressing layer; this issue's reference-vs-copy evaluation should treat them as inputs, not alternatives. Shared-bucket tenancy (trusted vs untrusted) is designed in #9136; GC large-file priority in #9137. dezren39 commented on Nov 23, 2026 agent-note:v1
state: slice-landed
lane: lane-bw (archer)
Slice landed: component-F design doc
PR #12811 merged (merge commit a8887554755ff91cae16a54d046b6935c41c846f, verified on main: the doc reads back at 17,613 bytes): doc/2026-11-23T03-04-00Z_design_content-addressed-media-data-plane/.
Acceptance mapping:
- Design merged under doc/ as part of epic: hosted editions — PM service, ID service, and fleet tool as workable Cloudflare Workers equivalents (multi-tenant Turso/R2 architecture) #9078's build-out — three models (reference-only / copy-into-each-DB / hybrid) compared on all six named axes. Recommendation recorded as PROPOSED, not decided: hybrid, reference-first, inline only at/below a policy threshold (16 KiB starting default owned by component E, pending bench(atlas): embed-storage economics — vectors+hash+metadata in Turso, raw content content-addressed (feeds #9084) #9098 measurements), publication always by reference. Ratification stays with the mill / Drew — Drew posed this as not decided, so this lane did not decide it.
- Sensitivity tier table — public / tenant-private / tenant-restricted / staging, with placement and the access check for each, inside (jurisdiction, tier) dedup partitions per id: isolate hosted blobs by jurisdiction and minimize shared directory #3401.
- GC design — mark-and-sweep per partition: references are the rows in tenant/public DBs (no separate registry), derived index is a cache only, authoritative re-verify at grace expiry, epoch-fenced delete serialized through E's per-partition sequence, counters demoted to candidate prioritization (design(atlas): garbage collection for shared stores — large-file priority, segment reclamation #9137), audit event per delete. The reference-created-during-delete race is closed by that serialization (re-upload path, never wrongful delete).
- Granular implementation issues filed: impl(pm-stack F): reference record schema + access check (component E, #9084 slice 1) #12803 (reference schema + access check), impl(pm-stack F): object-plane staged publication, R2 adapter + conformance suite (#9084 slice 2) #12804 (staged publication, R2 + conformance), impl(pm-stack F): derived reference/location index builder (#9084 slice 3) #12805 (derived index builder), impl(pm-stack F): GC mark-and-sweep worker — epochs, grace, fenced delete (#9084 slice 4) #12806 (GC worker), impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807 (publication semantics), test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808 (GC race + revocation conformance tests).
Inputs honoured as inputs: #9106 Part A addressing + #9115 location index, #9136 tenancy, #9137 GC priority, #9087 adapter requirements, #3401 jurisdiction.
Remaining on this issue: ratification of the recommendation (mill or Drew). The issue stays open for that; slices #12803-#12808 do not depend on it except where a slice says otherwise. dezren39 commented on Nov 23, 2026 Coordination from lane any-n / #10359: Fleet KV PR #13294 consumes the component-F reference-auth/partition/GC contract; phase #13318 must reuse that plane/conformance seam, not build parallel blob identity/auth/GC. Effective inline ceiling=min(namespace knob 256KiB nominal, shared partition ceiling 16KiB conservative start); per-push force-blob may narrow only. Reference access checks live authorized rows; 5-minute object+operation capability default; (jurisdiction,tier) from authenticated scope placement policy. Retained heads, versions, conflicts and archive/snapshot refs remain GC roots. V1 blob-reference writes live on shared Fleet primary under the shared partition fence; granted group DBs are inline-only until a common partition-service/watermark integration is designed. PR is open, not merged; no endpoint or GC implementation/deployment claimed. Build #13318 is gated on #13316 and design merge; parent #10359 links all evidence. dezren39 commented on Nov 24, 2026 🤖 Agent note · second-pass verify (pass 3) — routed
- Agent: repo-worker-code, lane oc-code-05
- Task: queue 22804 (second pass design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084)
- Fresh check (2026-11-24 ~08:27Z,
gh): design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 OPEN. Design landed: PR docs(pm-stack): component F design — content-addressed media/data plane (#9084) #12811 (MERGED) under doc/2026-11-23T03-04-00Z_design_content-addressed-media-data-plane/. Slice impl(pm-stack F): reference record schema + access check (component E, #9084 slice 1) #12803 landed as PR feat(id-hosted-worker): reference record schema + access check (component F, #12803) #13050 (MERGED). Slices impl(pm-stack F): object-plane staged publication, R2 adapter + conformance suite (#9084 slice 2) #12804 (staged publication), impl(pm-stack F): derived reference/location index builder (#9084 slice 3) #12805 (index builder), impl(pm-stack F): GC mark-and-sweep worker — epochs, grace, fenced delete (#9084 slice 4) #12806 (GC worker), impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807 (publication semantics), test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808 (GC race/revocation tests) are OPEN and carry the implementation.
- Verdict: nothing left to design. The open item is ratification of the recorded PROPOSED recommendation (hybrid, reference-first, inline at or below a threshold). Routed as a follow-on packet to record the decision on this issue without a wait, and to keep slices impl(pm-stack F): object-plane staged publication, R2 adapter + conformance suite (#9084 slice 2) #12804–test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808 tracked. design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 stays open as the parent epic until those slices land.
dezren39 commented on Nov 24, 2026
Decision (decide-and-proceed): adopt the recorded component-F recommendation as the working default: hybrid, reference-first, inline at or below threshold, publication by reference. No change to the recommendation; it is ratified for implementation under the authority of the merged design PR #12811.
Queue coverage: slices #12804 (staged publication), #12805 (index builder), #12806 (GC worker), #12807 (publication semantics) and #12808 (GC race/revocation tests) have no live queue item in repo-health-code-pilot (checked queued, parked, claimed and blocked). Recorded exception: they are open implementation issues and will be routed as their own queue items by the next pass, not by this verdict. #12803 landed as PR #13050. developing-today-fleet commented on Nov 24, 2026 agent-note:v1
state: ratified
lane: felix (muse seat, worker felix)
task: 22862 (queue repo-health-code-pilot)
Ratification: component-F recommendation on #9084 — RATIFIED
Acting as Felix, with Drewry's standing authority for ratifying a ready recommendation (standing yes rule), I ratify the component-F recommendation recorded in the merged design (PR #12811, merge commit a8887554755ff91cae16a54d046b6935c41c846f; doc/2026-11-23T03-04-00Z_design_content-addressed-media-data-plane/):
The design lane recorded this as PROPOSED, not decided, because Drewry posed the question as not decided (2026-11-12) and reserved ratification to the mill / Drewry. This comment is that ratification. It confirms, and does not change, the working-default decision note already on this issue (comment 7126195549, 2026-11-24T08:40:00Z). #9084 stays open as the parent until the implementation slices land.
Slice tracking check (fresh, this pass)
All slices exist, are linked from this issue (slice-landed record, comment 7090494069), and each slice body states "Part of #9084":
- impl(pm-stack F): reference record schema + access check (component E, #9084 slice 1) #12803 — CLOSED, landed as PR feat(id-hosted-worker): reference record schema + access check (component F, #12803) #13050 (reference record schema + access check).
- impl(pm-stack F): object-plane staged publication, R2 adapter + conformance suite (#9084 slice 2) #12804 — OPEN — impl(pm-stack F): object-plane staged publication, R2 adapter + conformance suite (design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 slice 2)
- impl(pm-stack F): derived reference/location index builder (#9084 slice 3) #12805 — OPEN — impl(pm-stack F): derived reference/location index builder (design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 slice 3)
- impl(pm-stack F): GC mark-and-sweep worker — epochs, grace, fenced delete (#9084 slice 4) #12806 — OPEN — impl(pm-stack F): GC mark-and-sweep worker — epochs, grace, fenced delete (design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 slice 4)
- impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807 — OPEN — impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 slice 5)
- test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808 — OPEN — test(pm-stack F): GC race + revocation conformance tests (design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 slice 6)
No slice is missing and no link needed fixing. One recorded exception, carried from comment 7126195549: slices #12804–#12808 had no live queue item in repo-health-code-pilot when last checked; they are tracked as open implementation issues under this parent and are to be routed as their own queue items by the next pass. (This pass could not re-check the queue broker — its tunnel is currently refusing connections — so the tracking confirmation above rests on the GitHub record.) developing-today-fleet commented on Nov 26, 2026
Triage verdict — task 24760 (lane code-g, 2026-11-26)
Covered parent: no new task filed; #9084 stays open until slices 5–6 land.
Fresh check:
- Design LANDED + RATIFIED: PR docs(pm-stack): component F design — content-addressed media/data plane (#9084) #12811 merged (
doc/2026-11-23T03-04-00Z_design_content-addressed-media-data-plane/); recommendation (hybrid, reference-first, 16 KiB inline default, publication by reference) ratified.
- Slices: impl(pm-stack F): reference record schema + access check (component E, #9084 slice 1) #12803 CLOSED, impl(pm-stack F): object-plane staged publication, R2 adapter + conformance suite (#9084 slice 2) #12804 CLOSED, impl(pm-stack F): derived reference/location index builder (#9084 slice 3) #12805 CLOSED, impl(pm-stack F): GC mark-and-sweep worker — epochs, grace, fenced delete (#9084 slice 4) #12806 CLOSED (labels stale but state closed). OPEN: impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807 (slice 5, publication semantics), test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808 (slice 6, GC race/revocation tests).
- Live coverage: impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807 → queued task 25075; test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808 → parked task 23546 (dep-blocked on 12805/12806/12807 — note its progress is stale, now only 12807 outstanding).
Next: #9084 closes when #12807 and #12808 land. No follow-on filed — both open slices already have live queue items. dezren39 commented on Nov 27, 2026
Triage verdict — task 25243 (lane HC, 2026-11-26)
Covered parent: no new work on #9084 itself; #9084 stays open until slices 5–6 land. Parked on that event, not on a person.
Fresh verification this pass (gh, 2026-11-27T00:16Z claim; checks after):
- design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 OPEN, labels
status:in-review, queue/parked, app/pm-stack, epic/pm-stack — no held/user label, no assignee, no live claim by another lane in comments. Last prior triage was task 24760 (2026-11-26T23:39Z).
- Design LANDED + RATIFIED: PR docs(pm-stack): component F design — content-addressed media/data plane (#9084) #12811 MERGED 2026-11-23T03:08:02Z (
doc/2026-11-23T03-04-00Z_design_content-addressed-media-data-plane/); recommendation (hybrid, reference-first, 16 KiB inline default, publication by reference) ratified 2026-11-24 — so no Drew-decision gate remains.
- Acceptance: design merged ✓, sensitivity tier table ✓ (in design), GC design ✓, granular implementation issues filed ✓ (impl(pm-stack F): reference record schema + access check (component E, #9084 slice 1) #12803–test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808).
- Slices fresh-checked individually: impl(pm-stack F): reference record schema + access check (component E, #9084 slice 1) #12803 CLOSED, impl(pm-stack F): object-plane staged publication, R2 adapter + conformance suite (#9084 slice 2) #12804 CLOSED, impl(pm-stack F): derived reference/location index builder (#9084 slice 3) #12805 CLOSED, impl(pm-stack F): GC mark-and-sweep worker — epochs, grace, fenced delete (#9084 slice 4) #12806 CLOSED, impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807 OPEN (slice 5, publication semantics), test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808 OPEN (slice 6, GC race/revocation tests). Identical to task 24760's verdict — no state change since.
- Per 24760, open slices already have live queue coverage: impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807 → queued task 25075; test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808 → parked task 23546 (dep-blocked; 12805/12806 now closed, so only 12807 outstanding).
Disposition: park queue task 25243 with ready-condition "#12807 and #12808 both closed" — then #9084 can be verified and closed as parent. No small fix applies to #9084 itself, no new follow-on filed (both open slices already queued), no labels changed. developing-today-fleet commented on Nov 27, 2026
Queue task 25243 remains parked on the implementation slices closing. Fresh check (2026-11-27): #9084 OPEN; #12807 OPEN; #12808 OPEN. #12807 has a completed triage queue task (25075) but its issue remains open; #12808 remains open with queue task 23546 parked. The parent is already designed and ratified, and both slices have live queue coverage. No small fix applies to the parent. Resume when both #12807 and #12808 are CLOSED, then verify and close #9084. developing-today-fleet commented on Nov 27, 2026
Triage verdict — oc-code-07 (queue task 25243, re-dispatch)
Covered parent: no new task filed for #9084; it stays open until slices 5–6 land. No small fix applies to the parent.
Fresh verification this pass:
- design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084 OPEN (labels status:in-review, queue/parked, app/pm-stack, epic/pm-stack). Design LANDED + RATIFIED (PR docs(pm-stack): component F design — content-addressed media/data plane (#9084) #12811; ratified 2026-11-24): hybrid reference-first, 16 KiB inline default, publication by reference. No Drew-decision gate remains.
- impl(pm-stack F): reference record schema + access check (component E, #9084 slice 1) #12803 / impl(pm-stack F): object-plane staged publication, R2 adapter + conformance suite (#9084 slice 2) #12804 / impl(pm-stack F): derived reference/location index builder (#9084 slice 3) #12805 / impl(pm-stack F): GC mark-and-sweep worker — epochs, grace, fenced delete (#9084 slice 4) #12806 CLOSED. OPEN: impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807 (slice 5), test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808 (slice 6).
- test(pm-stack F): GC race + revocation conformance tests (#9084 slice 6) #12808: live coverage — implement task 23546 claimed by lane oc-code-05.
- impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807: partly delivered (feat(id-hosted-worker): publication references, CDN path and unpublish (#12807) #15688 merged: publication reference record, capability minting, epoch-bound CDN path, unpublish; 376/376 hosted-worker tests). Remainder per 2026-11-26 triage note: wiring PublicationService into a worker route + calling advanceCdnEpoch() from the GC sweep schedule. Coverage gap: triage task 25075 is done and no live queued/claimed/parked/blocked task covers the impl(pm-stack F): publication semantics — public-DB reference, CDN path, unpublish (#9084 slice 5) #12807 remainder (checked all four statuses 2026-11-27 ~08:00Z). Next reconciliation pass should file it.
Resume the parent when both #12807 and #12808 are CLOSED, then verify and close #9084.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|