Repository navigation
Open
Labels
effort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)
Description
Phase 3 — blob offload only (threshold, streaming upload, capabilities, GC)
- Parent issue: Design: fleet kv — namespaced key-value store (local + global), blob offload to content-addressed R2 #10359 (threshold/blob question; reference pattern from design(pm-stack): content-addressed media/data plane — R2 dedup, reference-based access, GC when the last reference drops #9084).
- Parent design: reviewed decision record (§8 threshold D009, §9 upload/read D011, §10 dedup/reference D010/D012). Stable decision IDs: D009, D010, D011, D012, D015 (envelope versions
kv:raw-v1/kv:ref-v1; D013 reversed/superseded — no lists/tables in this phase). - Prerequisite: design PR docs(fleet): settle namespaced KV storage, sweep and blob design (#10359) #13294 must merge before this phase starts. Depends on: Phase 2 Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep #13316 (shared primary + CAS sweep + supported auth); its implementation PR must be merged before Phase 3 implementation begins. Phase 1 is Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314.
- Scope (blob-only): per-namespace threshold knob (default 256 KiB, subordinate to the shared partition policy — may only narrow, never widen past the partition ceiling/16 KiB conservative start);
--force-blobone-directional override (forces blob at/below ceiling; no force-inline above ceiling); staged → verified → published upload through the trusted endpoint (streaming length + recomputed BLAKE3-256 over exact bytes in ≤ 64 KiB chunks, ≤ 1 MiB resident; multipart completion is not publication — publication is the CAS + ref-registration transaction);KvBlobRefV1rows (profile raw-blake3-256, digest,bytes_len,partition {jurisdiction, tier}, opaque adapter locator,state=published); hash-never-bearer reads via short-lived (5 min) object+operation-scoped capabilities minted from live reference state; component-F mark-and-sweep GC per(jurisdiction, tier)over the full root set (published rows, retained versions, conflict-proposed refs, unexpired archive/snapshot refs, dedup pins) sharing the central per-partition serialization point; the effective-threshold formulaeffective = min(namespaceKnob, partitionCeiling)resolves the nominal-vs-effective gap (256 KiB knob nominal, 16 KiB partition start effective where component E governs); the proposedpartition_fencestable (no code in this issue) lives on the SHARED primary and orders publish-CAS against the delete-fence sequence in one transaction serialization — group DBs never fence; cross-partition references refused (partition_mismatch). No lists/tables, no manifests: any future shape arrives as a new envelope version under D015.
Acceptance
- At/below effective threshold: inline
kv:raw-v1row; above:kv:ref-v1row after staged→verified→published; promotion is a new version with identical read semantics;--force-blobforces blob treatment at/below ceiling; any attempt to place bytes inline above the ceiling refuses with a typed error. - Arbitrary-byte streaming: a value well above any threshold (test: ≥ 64 MiB random bytes — larger than the streaming buffer, with resident working set asserted ≤ 1 MiB, not larger than machine memory) pushes and pulls with bounded resident memory, and the pulled bytes hash to the identical BLAKE3-256 digest recomputed streaming on receipt.
- Central never accepts an unpublished blob reference; staged/verified-but-un-CASed objects are invisible to reads and reaped by staging TTL under the staging pin; crash after publish-CAS leaves a retained ref root retired only by grace/GC; a "published"-marked object without its CAS is an orphan under grace/GC, never staging-TTL-reaped.
- Read without a live authorized reference mints no capability; hash presentation alone serves nothing; capabilities expire at 5 min and are object+operation-scoped.
- GC sweep: unreferenced content per partition passes candidate → grace → re-verify → fenced delete + audit over the full root set (published rows, retained versions, conflict-proposed refs, unexpired archive/snapshot refs, dedup pins); a reference created during grace clears candidacy via the shared serialization point; cross-partition resolution refuses.
- The blob row's
(jurisdiction, tier)is identified from the authenticated scope's placement policy, never from the sessionpartitionId; a placement-policy lookup failure refuses the upload (no default partition). - Done check from repository root:
cargo test --manifest-path pkgs/fleet/Cargo.toml -p fleet-kv blobruns the proposedblob_*property/model/integration suite with a nonzero test count. It must include threshold boundary cases, binary 64 MiB streaming with the documented buffer budget, corruption refusal, reference-authorized capability expiry, retained-history pins, and reference-create/delete-fence interleavings. Also runcargo test --manifest-path pkgs/fleet/Cargo.toml -p fleet-kvto preserve Phases 1–2. A zero-match filter is failure, not evidence. Reuse the existing component-F endpoint/GC conformance tests rather than creating a parallel object-plane protocol.
Oracles
- Property: threshold placement — a value's placement (inline vs reference) is a pure function of (effective threshold,
--force-blob), and reads are placement-indifferent. (PBT over sizes ±1 byte around the threshold; override only ever moves toward blob.) - Property: publish-before-reference — no execution reaches a readable reference row without a prior publish-CAS (CAS + ref-registration transaction) for the same digest. (Trace property over upload/CAS interleavings.)
- Property: streaming hash integrity — pulled bytes always re-hash to the row digest; any mismatch refuses rather than serving. (PBT over sizes, chunk splits, truncation/corruption injection.)
- Property: GC safety — a delete event implies (no live reference at re-verify) AND (grace elapsed) AND (fence epoch recorded). (PBT over reference/GC interleavings; derived index drift may only delay, never cause, delete.)
- Model: blob lifecycle state machine (staged → verified → published → candidate → deleted) against the reference-row oracle; cross-partition attempts as typed refusals.
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-23T13:23:04Z",
"session_id": "ses_e5df79277fdffep9u8FJIv4AqN",
"lane": null,
"host": "amd",
"worktree": "/home/user/.local/share/opencode/worktree/7c7733/lane-any-n-12892-fleet-kv-design",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/user/.local/share/opencode/worktree/7c7733/lane-any-n-12892-fleet-kv-design",
"repo": "developing-today/code",
"branch": "lane-any-n/12892-fleet-kv-design",
"sha": "5ac3ddcec60017b05b655b8fe665b06c61369ec3"
},
"auth_subject": "oc-code-06",
"stamped_by": "fleet 0.1.0 (native)"
}
}Related program: #10359
Metadata
Metadata
Assignees
Labels
effort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)
Activity
developing-today commentedon Nov 23, 2026
CODE-4859
dezren39 commentedon Nov 23, 2026
Filed by lane any-n under #10359, design task 21123 / parent 20571. Same-pass pilot coverage: repo-health-code-pilot task 21318 (queued); do not implement before design PR #13294 and the phase prerequisites are merged. This run publishes design/build handoffs only.
dezren39 commentedon Nov 23, 2026
Triage — Lane XI, 2026-11-23 (queue task 21318). Verdict: valid build handoff, correctly scoped; implementation blocked on its named prerequisites. No small fix applies; returned to the queue as dep-blocked.
Premise validated first-hand:
doc/2026-11-23T12-45-00Z_design_fleet_kv/…at5ac3ddcec600) and the issue's scope traces to its decisions D009–D012/D015 as stated.Prerequisites, checked 2026-11-23T13:2xZ:
So there is nothing to implement in this pass and nothing to fix in the issue text — the handoff is accurate as written. Queue task 21318 is dep-blocked on #13316 (with PR #13294's merge as the co-gate) and will re-surface when the phase-2 implementation lands; the phase-3 build then starts from this issue's acceptance criteria and oracles as written.
docs(fleet-kv): delivery update — phase issues, chain, signoff
Merge pull request #13294 from developing-today/lane-any-n/12892-flee…
dezren39 commentedon Nov 23, 2026
Related program: #10359. This phase delivers one of the three implementation stages from the accepted fleet-kv design.