You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084
Component 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.
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.
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:
Workstream H (design(atlas): virtual filesystem over the content-addressed store + aggregated file index (Basin/Parquet evaluation) #9100) designs the virtual filesystem over this issue's content-addressed store: path/location records referencing immutable bytes (one upload, N location records), with an aggregated index (own Turso DB or sidecar tables; Parquet / Cloudflare Basin evaluated for the aggregated metadata). Its location-record and reference model must compose with this issue's GC design — a location record is a reference in this issue's sense, and H's spec will say so explicitly.
Atlas's in-domain prior art remains #3125 (provenance registry, content-addressed extracts), already noted in this issue as a different domain to consult.
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.
Triage verdict for issue #9084: TRIAGED — component F design issue of epic #9078; design-mill work, not yet produced. Verified fresh this shift (2026-11-17).
Component I adapter-design input from #9087: Self-hosted tier design. Requirements for F are in “Component E/F boundaries”: provider-neutral immutable object identity, staged/checksummed publication, explicit replica and placement state, authorization-aware reads/fallback, outbox references rather than bytes, and reference/retention-safe GC. R2 and RustFS must satisfy one contract; do not assume R2-only semantics. The design does not choose F’s reference-vs-copy model.
Claiming the next slice of #9084: the component-F design document under doc/ — the three placement models (reference-only / copy-into-each-DB / hybrid) compared on the issue's named axes, a sensitivity tier table, a GC design with its safety argument, and the granular implementation issues filed from it.
Premise check (fresh, 2026-11-23): issue OPEN, no design for F on main yet, no live claim covering this slice in the comments (last triage note 2026-11-17, task 18834). Inputs treated as inputs, not decisions: #9106 Part A addressing + location index (#9113/#9114/#9115), #9136 shared-bucket tenancy, #9137 GC large-file priority, #9087 component-I adapter requirements (comment 2026-11-22), #3401 jurisdiction.
The recommendation in the design is recorded as PROPOSED, not decided — Drew posed this question as not decided (2026-11-12), so ratification stays with the mill / Drew.
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/.
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).
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.
Activity
developing-today commentedon Nov 12, 2026
CODE-2788
dezren39 commentedon 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 commentedon 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 commentedon 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 commentedon Nov 17, 2026
agent-note:v1
state: triaged
task: 18834 (queue repo-health-code-pilot, worker repo-worker-code, lane code-d)
Triage verdict for issue #9084: TRIAGED — component F design issue of epic #9078; design-mill work, not yet produced. Verified fresh this shift (2026-11-17).
dezren39 commentedon Nov 22, 2026
Component I adapter-design input from #9087: Self-hosted tier design. Requirements for F are in “Component E/F boundaries”: provider-neutral immutable object identity, staged/checksummed publication, explicit replica and placement state, authorization-aware reads/fallback, outbox references rather than bytes, and reference/retention-safe GC. R2 and RustFS must satisfy one contract; do not assume R2-only semantics. The design does not choose F’s reference-vs-copy model.
dezren39 commentedon Nov 23, 2026
agent-note:v1
state: claimed
lane: lane-bw (archer, sandbox fix lane, Drew scale-up 2026-11-22 ~21:01 CST: 6-12 lanes)
Claiming the next slice of #9084: the component-F design document under doc/ — the three placement models (reference-only / copy-into-each-DB / hybrid) compared on the issue's named axes, a sensitivity tier table, a GC design with its safety argument, and the granular implementation issues filed from it.
Premise check (fresh, 2026-11-23): issue OPEN, no design for F on main yet, no live claim covering this slice in the comments (last triage note 2026-11-17, task 18834). Inputs treated as inputs, not decisions: #9106 Part A addressing + location index (#9113/#9114/#9115), #9136 shared-bucket tenancy, #9137 GC large-file priority, #9087 component-I adapter requirements (comment 2026-11-22), #3401 jurisdiction.
The recommendation in the design is recorded as PROPOSED, not decided — Drew posed this question as not decided (2026-11-12), so ratification stays with the mill / Drew.
Merge pull request #12811 from developing-today/lane-bw/9084-content-…
dezren39 commentedon 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:
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.