GeezerVison is showing github.com — atlas(#6666 slice 3): persistent embedded replicas for internal/public (libsql local-copy, design 5.5) · Issue #11213 · developing-today/code
atlas(#6666 slice 3): persistent embedded replicas for internal/public (libsql local-copy, design 5.5) #11213DescriptionParent
Follow-on from #6666 (atlas shard consumer), its slice 3: persistent embedded replicas for internal/public. Split out by queue task 20005 (2026-11-17) when slice 1 (serve-mode ShardedBackend wiring + re-discovery) landed separately: slice 3 is a distinct dependency + verification effort, not a remainder that should block slice 1.
What design 5.5 requires
From doc/2026-11-04T21-27-34Z_design_atlas_scaler_revision section 5.5: embedded replicas are libSQL's local-copy mode — the laptop holds persistent local replicas of all internal core scan stores + public stores, syncing page/WAL deltas in the background within the recorded sync budget. secret stores are NEVER replicated off their home node (a replica is a copy; copies defeat the tier's physical separation). Staging-tier replicas: none.
Current state (verified 2026-11-17, task 20005)
- The workspace has NO
libsql crate dependency anywhere. Shard transports are a hand-rolled HTTPS pipeline (atlas-core/src/turso.rs) for hosted shards and rusqlite local files (atlas-core/src/shards/local.rs, whose header names it "the seam for embedded replicas (design 5.5) later").
- Slice 1 (serve wiring + periodic re-discovery with atomic snapshot swap) makes a replica directory immediately consumable: a synced replica home can be served via the
dir: spec and stays fresh through re-discovery.
Scope for this issue
- Decide and record the integration shape: add the
libsql crate as the embedded-replica transport for internal/public scan shards (builder with remote URL + auth token, local path, background sync), behind the existing ShardTransport seam in shards/local.rs — or record a different shape with reasons if the crate's sync model does not fit the pipeline contract.
- Enforce the tier rule in code: replica creation refuses the secret tier, mirroring the discovery ceiling's fail-closed posture.
- Wire replica homes into discovery (a spec or config naming replica-backed shards) so serve mode (slice 1) can consume them.
- Verify live: initial sync of one internal + one public shard on the laptop, a promoted row appearing after a background sync without restart, and the sync-budget figures from design 5.5 re-checked against the Turso counters.
Acceptance
- Internal/public shard replicas persist on the laptop and serve reads locally through the existing transport seam.
- Secret-tier replica attempts fail closed with a named error.
- Live verification recorded on this issue (initial sync size/time, delta sync after a promotion, budget check).
- The standalone and hosted serve paths are regression-tested unchanged.
Activitydeveloping-today commented on Nov 17, 2026 dezren39 commented on Nov 18, 2026 agent-note:v1
state: parked
task: 20734 (repo-health-code-pilot, lane oc-code-06)
Picked up task 20734 and freshly revalidated: #11213 and parent #6666 are OPEN; #11213 is assigned to Drew (dezren39), no matching PR is open, and issue effort is labeled L while the packet calls for a new dependency, replica transport, tier enforcement, and live sync verification. No files or branch changed.
Parked naming the existing Drew assignment and scope mismatch. Resume after reassignment/unassignment or an explicit owner handoff plus a realistic staged budget. Resume brief: first reconcile task boundaries/timebox with the issue’s L effort and live-verification acceptance; then implement internal/public replicas behind the shard transport seam, fail closed for secret tier, run targeted tests, and record live sync/budget evidence. Do not infer that slice 1 alone completes this slice. dezren39 commented on Nov 18, 2026 agent-note:v1
state: blocked-escalated
task: 20734 (repo-health-code-pilot, lane oc-code-07)
Picked up task 20734 fresh (lane oc-code-07) and revalidated against current GitHub state: #11213 is OPEN, assigned to Drew (dezren39), labeled effort/l (multi-day); no matching PR exists (PR search for 11213 returns none); parent #6666 slice 1 landed via merged PR #11216 and no superseding PR or branch owns slice 3. No files or branch changed.
My read: this task cannot be worked by a queue lane in its current shape. The packet classifies it as a 45-minute small_fix, but the acceptance criteria (new libsql dependency, embedded-replica transport behind the ShardTransport seam, secret-tier fail-closed enforcement, live laptop sync evidence) plus the issue effort/l label describe multi-day staged work, and the issue is assigned to Drew. This is also park churn: five prior lane cycles (09:12Z through 11:56Z) each claimed and parked on this exact mismatch, requeueing the task unchanged. Escalating rather than parking a sixth time.
Decision required (Drew): either unassign/hand off #11213 to the fleet with a realistic staged budget (and a re-scoped packet reflecting effort/l), or keep it for yourself. Packet defect to record either way: kind small_fix / timebox 45 min contradicts effort/l and the live-verification acceptance criteria.
Resume condition: reassignment away from Drew, or an explicit owner handoff plus a re-scoped staged packet. Do not infer that slice 1 alone completes this slice. dezren39 commented on Nov 22, 2026 agent-note:v1
state: blocked
task: 20734 (repo-health-code-pilot, lane oc-code-01)
Picked up task 20734 and freshly revalidated: #11213 is OPEN and unassigned; a fresh PR search for 11213 returned none. Current issue labels include status/blocked, queue/blocked, work/assigned, and user/escalated, but no effort label. No matching PR or superseding branch was found.
Blocked as packet_defect, not an ownership gate: the task packet calls this a 45-minute small_fix, while acceptance covers a new libSQL dependency, persistent internal/public replica transport, secret-tier fail-closed behavior, discovery/serve integration, regression tests, and live sync/budget measurements. The prior owner-escalation rationale is stale against current GitHub state. Removed the stale user/escalated label; retained blocked/work lifecycle labels. No files or branches changed.
Resume brief: split the acceptance into bounded, independently verifiable slices and update the packet kind/budget/acceptance before requeue. Do not wait for an ownership handoff. dezren39 commented on Nov 23, 2026 agent-note:v1
state: scope item 1 DONE (decision recorded); remainder staged below
task: shortlist via fleet agent next (archer, Lane DU, picked up through parent #5755)
worker: Muse lane DU
Scope item 1 is decided and recorded: PR #12868 merged (bf322f9a4e) — doc/2026-11-23T04-10-00Z_decision_atlas_embedded_replica_integration/. It changes the shape this issue's scope item 1 floated, on fresh evidence:
- The core shards are TursoDB-type (design §6); Turso's Rust reference (read 2026-11-22) says match the crate to the engine — default candidate is the
turso crate (pull-only), not libsql. libsql only if a spike proves replication against a TursoDB-type primary.
- Reads never open a syncing replica file from a second process (vendor corruption warning), so the replica transport is a new
PipelineTransport impl in the sync-owning process — not rusqlite over a dir: of replica files. The dir: assumption in this issue's "current state" section is superseded (quiesced-read fallback recorded in the decision doc).
- Secret-tier refusal stays fail-closed and pre-network, as scoped.
Staged remainder (each stage is a lane-sized packet; this replaces the 45-minute small-fix packet three lanes parked as a defect):
- Spike (gates the crate):
turso-crate pull from one real internal shard on the laptop; initial sync size/time vs the §5.5 budget (~5 GB ≈ 21% of the monthly 24 GB sync allowance); promoted row visible after pull, no restart; optional libsql attempt recorded either way; re-confirm the second-process warning in the chosen crate's primary docs.
- Transport: replica
PipelineTransport impl + secret-tier named-error refusal + fixture tests; standalone/hosted regression tests unchanged.
- Discovery wiring: replica endpoints in serve config, consumed by atlas shard consumer: serve-mode (fleet serve search role) and #5668 snapshot-id integration (follow-up of #5755 slice 1) #6666 slice 1's re-discovery.
- Live verification: this issue's acceptance record (initial sync, delta after promotion, budget counters).
Next slice = stage 1. This issue stays open until stage 4. dezren39 commented on Nov 24, 2026 Triage (oc-code-01, queue task 21694, 2026-11-24): verified fresh. Issue is still open; no libsql dependency exists in the workspace per the 2026-11-17 check, so slice 3 is unstarted and remains effort/l. Verdict: keep open, not closable. Blocked on the queue/status labels; a scoped implementation packet should be routed only once a dependency decision (add the libsql crate for embedded replicas) is recorded here. No follow-on packet filed in this triage, to avoid a duplicate of the existing blocked state. Tracking: #14158. developing-today-fleet commented on Nov 27, 2026 Stage-1 spike evidence (queue task 25392, 2026-11-27)
Full record: doc/2026-11-26T23-45-00Z_atlas_replica_spike/stage-1-turso-pull-spike.md. Scratch scaffold only — no repo code, credentials, or production state changed.
Crate gate — PASS. turso =0.8.4 (current max stable) with sync feature; primary docs confirm the engine-match rule (turso crate for Turso-engine primaries), pull-only operation (pull() with no push(), first-run bootstrap), and stats() network counters for the §5.5 budget check. The do-not-open-while-syncing corruption warning is re-confirmed in the primary embedded-replicas doc (stated generally; the turso-sync page does not repeat it verbatim — single-owner-by-construction stays the posture).
Live pull — attempted, gate NOT met. Three pulls of the real atlas shard with the existing fresh cached read-only token: bootstrap deterministically stalls at exactly 7,278,391,296 bytes, then error reading response body. Control turso db shell query works (20 tables), so the primary is healthy — this is the large sync body failing over this route. Reads-after-pull and promotion-visibility checks could not run against an incomplete replica (nothing read from it).
Budget flag for stage 2: the partial sync alone (≥7.28 GB) already exceeds the §5.5 ≈5 GB initial-sync estimate — a completed sync would take ≥30% of the 24 GB monthly allowance. §5.5 needs a re-measurement before transport lands.
Unmet, explicitly: completed initial sync (retry from the laptop network); promoted-row visibility (needs a staged write or a natural promotion bracketed by two pulls); libsql-against-TursoDB live attempt (optional, timebox). developing-today-fleet commented on Nov 27, 2026 Triage (queue task 24656, lane any-n): revalidated that #11213 remains open and effort/l. The Stage-1 spike (task 25392; evidence: doc/2026-11-26T23-45-00Z_atlas_replica_spike/stage-1-turso-pull-spike.md) selected the Turso Rust crate for the TursoDB-type primary, but initial sync repeatedly stalls at 7,278,391,296 bytes. A completed initial sync, promoted-row visibility check, and completed-sync budget measurement remain unmet; no transport was implemented.\n\nDisposition: keep this issue open and blocked. Next work should retry on the laptop network or diagnose the sync-body failure, then complete the sync/budget and staged-promotion gates before transport implementation. The prior 45-minute small-fix framing is not appropriate for this effort/l work.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|