GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep · Issue #13316 · developing-today/code

Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep #13316

New issue
Copy link
New issue
Copy link
Open
Open
Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep#13316
Copy link
Labels
effort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestpriority/highImportant and time-sensitive

Description

@dezren39
dezren39
opened on Nov 23, 2026
Issue body actions

Phase 2 — shared primary + session sweep + grants (global reads, CAS conflicts, supported auth)

  • Parent issue: Design: fleet kv — namespaced key-value store (local + global), blob offload to content-addressed R2 #10359 (items 2/4/5: central store, sweep survival, five-agent workload).
  • Parent design: reviewed decision record (§1 hybrid central D014, §4 sweep, §5 CAS, §6 five-agent topology D008, §9 auth D011). Stable decision IDs: D003, D004, D005, D006, D007, D008, D011, D014 (D002 reversed/superseded — do not implement row-scopes-only).
  • Prerequisite: design PR docs(fleet): settle namespaced KV storage, sweep and blob design (#10359) #13294 must merge before this phase starts. Depends on: Phase 1 Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314 (local verbs + full-identity overlay + durable outbox); its implementation PR must be merged before Phase 2 implementation begins.
  • Scope: shared Turso primary over the queue-style libSQL HTTP pipeline at configurable FLEET_KV_URL (no hardcoded or fake deployed hostname); proposed migrations/handler paths (no code in this issue): pkgs/fleet/crates/fleet-kv/migrations/ for kv_namespaces, kv_heads, kv_versions, kv_conflicts, idem_receipts, kv_grants, and pipeline handlers beside the existing queue HTTP handlers. Central key derivation per write/read: from the explicitly selected scope — the shared scope_id of the namespace for authorized agents, or the private scope_id of the owning (user, context) — resolved via kv_namespaces + kv_grants; no implicit extra fallback scope exists.
  • Scope: shared Turso primary over the queue-style libSQL HTTP pipeline; central key (scope_id, registry_id, namespace, key) with one shared scope per shared namespace (shared-scope tombstones affect all shared readers; private scopes separate); kv_namespaces with designation-only global_flag; kv_grants with explicit-grant group DBs under fail-closed admission/provisioning policy (no default per-session proliferation; group DBs inline-only — no blob refs, ceiling checked before any group-DB write, blob-needing group writes refuse with blob_requires_shared_primary); --global now serves central (authoritative bypass); local-first reads (ordinary cache ≤ 1 s; miss/expiry refreshes or typed unavailable/stale, --allow-stale opt-in with age; overlay reads immediate offline) with local-override + merged list; durable sweep keyed (owner_user_id, context_id, session_id) via outbox + per-key CAS (≤ 5 attempts, jittered exp backoff capped at 1 s), receipts keyed (authenticated_writer, host_incarnation_UUID, outbox_UUID) + immutable fingerprint; tombstones sweep through CAS; five-agent rule (single-writer-per-key CAS; KV CAS is not a queue lease — no leases/expiry/steal); 15-minute archive checkpoint TARGET (unbounded loss when offline/unarchived; archive carries inline payloads only up to the effective threshold — no Phase 3 upload here). Auth: RP/agent JWT or route-scoped service token to the trusted endpoint; secrets-broker fetch path is not request auth; per-user Turso data-plane tokens refused (data_plane_credential_refused). v1 operational integration ships here: migrations, credential wiring, grant-policy implementation, backup/restore runbook, health probes.

Acceptance

  1. --global get/set round-trips against central; plain get merges local + central with stated origin marks and never silently hides the shadowed row; --global bypasses the 1 s cache.
  2. Sweep: session dirty set merges idempotently (re-run safe; retransmit with same key+fingerprint returns the stored result); two sessions racing one key produce one winner + one typed conflict {expected, actual} with both versions retrievable — never silent last-writer-wins, never Turso Sync last-push-wins; rebase after conflict is a new intent/new id, never silent overwrite. CAS-before-ack order: receipt written atomically with CAS, ack after; crash between CAS and ack replays the recorded result, never a spurious new conflict.
  3. Archive carries inline payloads only (≤ effective threshold) via the archive owner command fleet kv backup (equivalently fleet kv sync --archive mode) plus the 15-minute online-checkpoint-target sweeper; over-threshold local-working bytes are reported protection_unavailable_needs_phase3, never uploaded — no blob upload exists before Phase 3. Over-ceiling bytes addressed to central before Phase 3 land typed pending_needs_phase3 (queued intent, not a row), never silently buffered inline. Crash before ack re-sweeps fully.
  4. Grants: a group DB exists iff a kv_grants row authorizes it; unknown group/namespace refuses fail-closed; with no grant, everything lands on the shared primary. No per-session DB is provisioned by default. Group DBs accept inline bytes only: over-ceiling bytes addressed to a group scope refuse with blob_requires_shared_primary (shared-primary placement required, no auto-move), so no unrestricted write bypasses the ceiling.
  5. Data-plane credential presented to the endpoint is refused with the typed rule, not an incidental signature failure; central access reuses the hosted RP/agent JWT or route-scoped service token path only.
  6. Load probe (REQUIRED, correctness-only fixture — not a latency/perf promise, and no billing claim): five writers × ~1–10 keys/min on a ~10k-key namespace all converge; list polling observes at most the documented 1 s staleness.
  7. Done check from repository root: cargo test --manifest-path pkgs/fleet/Cargo.toml -p fleet-kv central runs the proposed central_* model/property/integration suite with a nonzero test count. It must include the five-agent fixture, scope isolation, clear-versus-sweep, same-ID/different-body refusal, duplicate delivery, archive restore, and expired-cache refusal. Also run cargo test --manifest-path pkgs/fleet/Cargo.toml -p fleet-kv to preserve Phase 1 behavior. A zero-match filter is failure, not evidence.

Oracles

  • Property: CAS linearity — concurrent same-key writers serialize; the central head always equals one writer's full intent, never a blend; losers get typed conflicts. (PBT over concurrent CAS attempts.)
  • Property: sweep idempotence — sweeping the same outbox twice changes central once. (PBT over duplicate deliveries.)
  • Property: tombstone sweep convergence — delete-vs-write races resolve to a retrievable conflict or a tombstoned head, never resurrection-by-replay.
  • Model: central head machine (version, parent_version, writer) against a sequential CAS oracle; sweep as an outbox-draining refinement of it.
{
  "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:22:18Z",
    "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

Activity

Next
  1. dezren39
    added
    kind/featureNew feature or capability request
    priority/normalOrdinary priority (the default)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    on Nov 23, 2026
  2. developing-today commented on Nov 23, 2026

    @developing-today
    developing-todayBot
    on Nov 23, 2026 – with developing.today
    Contributor
    More actions

    CODE-4858

  3. dezren39
    added a parent issue on Nov 23, 2026
    • Design: fleet kv — namespaced key-value store (local + global), blob offload to content-addressed R2 #10359
  4. dezren39
    marked this as blocked on Nov 23, 2026
    • Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314
  5. dezren39
    marked this as blocking on Nov 23, 2026
    • Build: fleet kv phase 3 — authenticated blob offload and reference-safe GC #13318
  6. dezren39 commented on Nov 23, 2026

    @dezren39
    dezren39
    on Nov 23, 2026
    MemberAuthor
    More actions

    Filed by lane any-n under #10359, design task 21123 / parent 20571. Same-pass pilot coverage: repo-health-code-pilot task 21317 (queued); do not implement before design PR #13294 and the phase prerequisites are merged. This run publishes design/build handoffs only.

  7. dezren39
    added a commit that references this issue on Nov 23, 2026

    docs(fleet-kv): delivery update — phase issues, chain, signoff

    ea76fc8
  8. dezren39 commented on Nov 23, 2026

    @dezren39
    dezren39
    on Nov 23, 2026
    MemberAuthor
    More actions

    Triage verdict (task 21317, lane oc-code-02): valid build handoff, not yet implementable.

    • Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep #13316 OPEN, effort/l, kind/feature. Parent Design: fleet kv — namespaced key-value store (local + global), blob offload to content-addressed R2 #10359 items 2/4/5; design record D003/D004/D005/D006/D007/D008/D011/D014 referenced.
    • Prerequisites unmet, verified just now: design PR docs(fleet): settle namespaced KV storage, sweep and blob design (#10359) #13294 OPEN (unmerged); phase-1 Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314 OPEN with no implementation PR merged. Packet explicitly forbids implementation before both merge, and scope excludes unrelated KV phases.
    • No hold label on Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep #13316 (hold check: available). Assignee/authorship are not holds per FDR-0012.
    • No code change in this triage. Returning to queue as fix follow-on; implement phase 2 only after docs(fleet): settle namespaced KV storage, sweep and blob design (#10359) #13294 merge + phase-1 implementation merge, per acceptance criteria in issue body.
  9. dezren39 commented on Nov 23, 2026

    @dezren39
    dezren39
    on Nov 23, 2026
    MemberAuthor
    More actions

    Triage verdict (lane code-g, queue task 21320, 2026-11-23): valid phased build handoff under #10359 with concrete acceptance + oracles. NOT startable now: gate design PR #13294 is OPEN/unmerged, and phase-1 prerequisite #13314 is OPEN. Per the issue's own prerequisite clause, phase-2 implementation must wait for both. Parking the queue task with a ready-condition on #13294 merge; re-validate #13314's implementation PR at resume before any code work. No code changes made.

  10. dezren39
    added a commit that references this issue on Nov 23, 2026

    Merge pull request #13294 from developing-today/lane-any-n/12892-flee…

    50241f4
  11. dezren39 commented on Nov 23, 2026

    @dezren39
    dezren39
    on Nov 23, 2026
    MemberAuthor
    More actions

    Triage refresh (queue task 21320, lane agent-next-22-local, 2026-11-23): valid Phase 2 build handoff; still not startable.

    • Verified design PR docs(fleet): settle namespaced KV storage, sweep and blob design (#10359) #13294 merged at 13:37 UTC.
    • Phase 1 issue Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314 remains OPEN. A search of all PRs referencing Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314 found no Phase 1 implementation PR; Phase 1 is not implemented and merged.
    • Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep #13316 has no human hold label. Its explicit Phase 1 prerequisite remains unmet, so this packet still forbids implementation. No code changes made.
    • Keep the live queue task parked with ready condition: a Phase 1 implementation PR for Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314 is merged. On resume, verify that merge and implement Phase 2 from the merged design in docs(fleet): settle namespaced KV storage, sweep and blob design (#10359) #13294.

    This updates the earlier triage note that said design PR #13294 was open; the design gate has cleared, but Phase 1 has not.

  12. dezren39 commented on Nov 23, 2026

    @dezren39
    dezren39
    on Nov 23, 2026
    MemberAuthor
    More actions

    Related program: #10359. This phase delivers one of the three implementation stages from the accepted fleet-kv design.

  13. dezren39 commented on Nov 23, 2026

    @dezren39
    dezren39
    on Nov 23, 2026
    MemberAuthor
    More actions

    Triage refresh (queue task 21320, lane xaltha, 2026-11-23 ~14:30 UTC): valid Phase 2 build handoff; still not startable.

    • Design PR docs(fleet): settle namespaced KV storage, sweep and blob design (#10359) #13294 MERGED at 13:37 UTC — that gate is now satisfied.
    • Phase 1 Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314 remains OPEN. Its first slice is in flight as PR fleet-kv: add identity-scoped SQLite core #13362 (open, identity-scoped SQLite set/get), which by its own note does NOT complete Phase 1 acceptance (tombstones, outbox, CLI verbs, namespace registry/grants, crash recovery, backup still open).
    • Phase 2 must wait for Phase 1 to be implemented and merged. Not duplicating the in-flight Phase 1 work; recheck after Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314 closes.
  14. 15 remaining items

  15. dezren39
    added 4 commits that reference this issue on Nov 25, 2026

    fleet kv: backup, sync --archive and restore --archive verbs (#13316 …

    062f768

    fleet kv: rebase a conflicted key by a new intent (#13316)

    32867f1

    fleet kv: rebase verb (#13316)

    1d5c206

    fleet kv: five-agent load probe on a 10k-key namespace (#13316 accept…

    fb9e5b2
  16. dezren39 commented on Nov 25, 2026

    @dezren39
    dezren39
    on Nov 25, 2026
    MemberAuthor
    More actions

    Claim-check (lane xaltha, hourly work-loop 2026-11-25 ~14:47 CST): fleet agent next handed #13316 to this lane, but it is already actively in flight by lane 8 — claimed 2026-11-25T19:43Z, slices 1-3 merged in #15214, slices 4-5 merged in #15222/#15228, and slices 6/7/9 (grants, survival archive, rebase + five-agent probe; acceptance 3/4/6) open as PR #15235 (opened 20:36Z today). The shortlist why ("no open PR found") is stale.

    No code touched by xaltha on this issue — duplicating lane 8 would collide. Remaining per lane 8 notes: hosted pipeline route with credential refusal (acceptance 5). Returning this lane to agent next for a different item.

  17. dezren39
    added 2 commits that reference this issue on Nov 25, 2026

    fleet kv: hosted kv door with a statement catalogue (#13316)

    ed095aa

    fleet kv: grants, survival archive, rebase, five-agent probe and host…

    4a3036e
  18. dezren39 commented on Nov 25, 2026

    @dezren39
    dezren39
    on Nov 25, 2026 – with Claude
    MemberAuthor
    More actions

    Progress from lane 8: #15235 merged (slices 6 to 9).

    • Grants (acceptance 4): group databases exist only behind a kv_grants row, take inline bytes only, and refuse fail-closed otherwise.
    • Survival archive (acceptance 3): fleet kv backup / sync --archive checkpoint unswept writes to central kv_archive (migration 2), and fleet kv restore --archive adopts them on a fresh host.
    • Rebase and five-agent probe (acceptance 6): fleet kv rebase clears a lost CAS, and the correctness probe drives five agents over a 10k-key namespace.
    • Hosted kv door: fleet-hosted serves POST /v1/kv/v2/pipeline and forwards only statements in catalog.rs (mirrored as hosted-worker/src/kv-catalog.json, with a drift test). It binds owner and writer to the caller, checks private prefixes and namespace scope, and gates namespace and grant changes on kv-admin. Runbook: book/operations/kv-central.md.

    Verified remotely: the full fleet Rust workspace and the hosted-worker suite (269 pass, typecheck clean).

    Still open on this issue:

    • There is no fleet kv namespace define verb yet. Namespaces are defined through the library or an admin service token.
    • Group databases are not reachable through the hosted door. Granted group writes still need direct libSQL credentials.
    • The door answers 503 kv_primary_not_configured until KV_LIBSQL_URL and KV_LIBSQL_AUTH_TOKEN are set on the deployed Worker.

    Generated by Claude Code

  19. dezren39
    added a commit that references this issue on Nov 25, 2026

    fleet kv: namespace define and list verbs (#13316) (#15260)

    55296d4
  20. dezren39 commented on Nov 25, 2026

    @dezren39
    dezren39
    on Nov 25, 2026 – with Claude
    MemberAuthor
    More actions

    Lane 8: #15260 merged, adding fleet kv namespace define NS (--shared SCOPE | --private) and fleet kv namespace list for operators (admin credential, no local store needed; shared/private changes refused with namespace_scope_change). That closes the namespace-definition gap from the last note. What is left here is deployment wiring (KV_LIBSQL_URL and its token on fleet-hosted) and group databases through the door.


    Generated by Claude Code

  21. developing-today-fleet commented on Nov 27, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 27, 2026 – with developing.today fleet
    Contributor
    More actions

    Triage refresh (queue task 21320, 2026-11-27): the Phase 2 handoff remains valid, but its full acceptance is not yet complete.

    • Gates: design PR docs(fleet): settle namespaced KV storage, sweep and blob design (#10359) #13294 is MERGED; Phase 1 Build: fleet kv phase 1 — local verbs, scoped SQLite and backup #13314 is CLOSED.
    • Implemented slices are merged: fleet kv: central plane, durable sweep and libSQL pipeline client (#13316 slices 1-3) #15214 (central CAS, durable sweep and libSQL pipeline client), fleet kv: sync, host namespace cache and --global verbs (#13316 slice 4) #15222 (sync/cache/global verbs), fleet kv: local-first merged reads with a 1 s central cache (#13316 slice 5) #15228 (local-first merged reads), fleet kv: grants, survival archive, rebase, five-agent probe and hosted door (#13316) #15235 (grants/archive/rebase/five-agent probe/hosted KV door), and fleet kv: namespace define and list verbs (#13316) #15260 (namespace define/list).
    • The latest progress note on Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep #13316 still identifies two concrete gaps: granted group databases are not reachable through the hosted door, and the door returns kv_primary_not_configured until KV_LIBSQL_URL and KV_LIBSQL_AUTH_TOKEN are wired on the deployed Worker. No open PR referencing Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep #13316 was found. I did not perform provider deployment or credential changes.
    • Verdict: no small isolated fix is justified by this triage packet. Keep Build: fleet kv phase 2 — central CAS, shared namespaces and session sweep #13316 OPEN for the remaining implementation/operational work; do not claim full acceptance from the merged slices alone. No code changed.
  22. dezren39
    added a commit that references this issue on Nov 27, 2026

    docs(fleet-book): reference coverage for kv, id and host domains (#15639

    81b72bd
  23. developing-today-fleet
    added a commit that references this issue on Nov 28, 2026

    fleet kv: grant list/revoke operator verbs (#13316)

    f4073d5
  24. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 28, 2026 – with developing.today fleet
    Contributor
    More actions

    Progress — lane oc-code-02 (shortlist slice, #13316)

    PR open: #16384 — fleet kv grant list GROUP / grant revoke GROUP DB NS (branch oc-code-02-13316-central-cas-storage).

    Why this slice: grants::admit/revoke/write/read/place had zero callers outside grants.rs tests — acceptance 4 ("a group DB exists iff a kv_grants row authorizes it; unknown group/namespace refuses fail-closed") was library-only with no operator surface. The new verbs mirror namespace define/list (central admin, kv-admin, no local store): list prints grant rows, unknown/empty groups refuse unknown_group, revoking an ungranted namespace refuses namespace_not_granted.

    Verification: new fail-closed CLI test passes; cargo test -p fleet-kv 180 lib + 3 integration green; central filter 111 green; cargo fmt --check clean. (Clippy unrunnable in this lane: nightly cargo-clippy missing librustc_driver; noted on the PR.)

    Left for follow-ups: CLI grant admit needs a group-membership directory (no source wired yet — admit stays with the kv-admin door grants.upsert); granted group DBs through the hosted door + KV_LIBSQL_URL deployment wiring remain per the 11-27 triage refresh.

  25. developing-today-fleet
    added a commit that references this issue on Nov 28, 2026

    Merge pull request #16384 from developing-today/oc-code-02-13316-cent…

    716cb7f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestpriority/highImportant and time-sensitive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.