Repository navigation
Closed
Labels
effort/lLarge: multi-day or open-ended; expect staged check-insLarge: multi-day or open-ended; expect staged check-insepic/atlasEpic: atlas - all issues of this effort carry itEpic: atlas - all issues of this effort carry itepic/atlas-programReprioritization program epic (2026-11-12)Reprioritization program epic (2026-11-12)kind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)Ordinary priority (the default)source/humanFiled directly by a humanFiled directly by a human
Milestone
Description
Implementation of §4 of the Scaler-era data architecture revision (design doc PR #5667, doc/2026-11-04T21-27-34Z_design_atlas_scaler_revision/).
Scope:
atlas_stagev1 schema DDL (items,chunks_raw,notes,kv,_schema_version) + one provisioning tool that creates a staging DB per work unit (queue task / session / epic / notes batch) and applies the schema.- Registry (internal core tier): unit id → staging DB, owner, sensitivity level, state (open/closing/merged), schema version. (Design §6 proposes the registry be born as a TursoDB
--tursodbpilot DB once the account toggle is enabled — sequencing note, not a blocker for the libSQL version.) - Aggregator (
fleet serverole, laptop): on unit close, embed new chunks with the resident Snowflake model, promote survivors into core in bounded batches (≤500 rows/txn), write the merge manifest (unit id, rows in/promoted, content hash), bump the core snapshot id per batch (consumed by the §3 result cache), branch the staging DB as archive, deregister. Partial periodic promotion for long-lived units (epics). - Core stores per design: exactly three physical sensitivity levels (public / internal-default / secret — separate DBs + credentials); within a level, scan stores per corpus + one content store per level; reclassification = verified mechanical row move (counts + hash) with a manifest log entry.
- Session-close extraction hook as the canonical staging producer (sessions write staging only; core never sees session-rate writes).
Acceptance: an end-to-end demo unit (one session) flows staging → close → promotion → searchable in core with correct ceiling behavior per level; a reclassification move round-trips counts/hashes; promotion never holds a core writer > seconds (batch bound enforced); core DDL only via maintenance path. PBT/MBT per the testing doctrine (schema-version invariants, manifest hash oracle).
Design: #5667 §4 (+ §5 sizing, §6 pilot). Parent context: hatch-personal#21.
Acceptance criteria
-
atlas_stagev1 schema DDL exists (items,chunks_raw,notes,kv,_schema_version) and one provisioning tool creates a per-unit staging DB and applies it. - Internal registry records unit id -> staging DB, owner, sensitivity level, state (open/closing/merged), and schema version, and is the lookup the aggregator uses.
- Aggregator promotion on unit close embeds new chunks, promotes survivors into core in bounded batches (<=500 rows/txn), writes a merge manifest (unit id, rows in/promoted, content hash), and bumps the core snapshot id per batch.
- Long-lived units (epics) get partial periodic promotion; closed units are branched as archive and deregistered.
- Behaviour matches design PR docs: Scaler-era Atlas/Turso data architecture revision #5667 section 4; deviations are recorded on this issue.
Metadata
Metadata
Assignees
Labels
effort/lLarge: multi-day or open-ended; expect staged check-insLarge: multi-day or open-ended; expect staged check-insepic/atlasEpic: atlas - all issues of this effort carry itEpic: atlas - all issues of this effort carry itepic/atlas-programReprioritization program epic (2026-11-12)Reprioritization program epic (2026-11-12)kind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)Ordinary priority (the default)source/humanFiled directly by a humanFiled directly by a human
Activity
dezren39 commentedon Nov 4, 2026
Intake review
Intake by fleet monitor (repo-fleet-monitor), 2026-11-04 run.
dezren39 commentedon Nov 4, 2026
Drew approvals recorded (2026-11-04 ~17:10 CST):
db create --tursodb, so no dashboard toggle was needed. Two empty Turso-type pilot DBs now exist in groupgreat-star-lord, labeled as pilots, no data migrated:pilot-tursodb-registry(staging registry pilot, per §4/§6 of the revision doc, PR docs: Scaler-era Atlas/Turso data architecture revision #5667)pilot-tursodb-embedcache(shared embedding-cache pilot — see also the confirmation on atlas-search service: query-embedding + snapshot result caching, --no-cache/--wait/--expand/--raw flags #5668)Engine note for this issue's staging design: production atlas is confirmed libSQL (sqld) by three independent signals (
turso db showType=SQLite + libsql:// URL + sqlite_version() 3.47.0, vs Type=Turso + turso:// + 3.50.4 on the pilots). TursoDB exists in this org only for DBs created with--tursodb.dezren39 commentedon Nov 5, 2026
Core-tier shard restore — executed 2026-11-04 (per Drew's stop-and-redirect ruling, 18:24 CST)
The in-flight index rewrite was stopped (precondition verified here: laptop
atlas-index-rewrite.serviceinactive; hosted shadow frozen at 28,760 across two reads ~5 min apart) and the corpus was restored into fresh shards. Productionatlaswas only ever read — untouched.Engine + creation route (Drew ruling 18:28 CST: all new DBs are TursoDB)
CreateDatabaseV3Body.use_tursodb) and verified empirically:POST https://api.turso.tech/v3/organizations/{org-UUID}/databaseswith{"name": ..., "group_id": ..., "use_tursodb": true}. The path org must be the org UUID — the slug returns "organization not found".atlas-tursodb-probe, created via the API route):turso db showType=Turso,sqlite_version()= 3.50.4 (libSQL = 3.47.0),F32_BLOB(768)accepted,vector_distance_cosscan top-10 identical to production on the same 200 real chunks.vec F32_BLOB(768), fan-out + merge. Nolibsql_vector_idx(TursoDB rejects the syntax; scan-over-shards is the design regardless). TursoDB's metric set for future corpora: cosine, dot product, L2, Jaccard — this corpus is cosine by design (source index metadata).chunks_fts. Keyword search stays on the libSQL monolith until the consumer work decides the FTS answer (see atlas core consumer wiring: fleet atlas-search fan-out over the TursoDB shard core (tier ceilings, merge, --expand hydration) #5755).Shard map (tier → topic → shards; sessions atomic; ≤4,800 chunks/shard per §5.2)
Source: hosted
atlas, 107,639 chunks = 107,639 vectors (all 3,072 B; 0 missing/orphan). Sensitivity → tier: secret-bearing → secret; personal + local-only → internal (default); public = none in this corpus.Plus per-level content stores (§4.2):
atlas-core-internal-content(sessions 18,235; messages 70,987) andatlas-core-secret-content(sessions 90; messages 564). (The content message load needed one idempotent resume: the first pass dropped at 84% on a transport disconnect —RemoteDisconnectedescaping the HTTP client's retry filter — and a targeted second pass inserted only the missing ids to the exact counts above. Scan-shard loads were unaffected.) Every scan shard carries chunks + vec with DDL identical to source, plus anatlas_manifestself-description. Secret chunks exist only in the two secret DBs.Verification (all independent of the loader's own counts)
Corrections to the restore packet's premises (verified, second-sourced)
Leftovers
atlas-tursodb-probe(200 test chunks from the gate) kept as a test artifact — cleanup is Drew's call, along with the nine spike DBs (untouched).developing-today commentedon Nov 5, 2026
🤖 Agent note · handed off
74 remaining items
dezren39 commentedon Nov 17, 2026
🤖 Agent note · picked up (resume)
dezren39 commentedon Nov 17, 2026
🤖 Agent note · parked
dezren39 commentedon Nov 17, 2026
🤖 Agent note · parked (acceptance gap identified)
MERGEABLE/CLEAN, only check CodeRabbitSUCCESS; no GitHub Actions runs on the branch; no review decision, no merge SHA. Diff ispkgs/atlas-search/crates/atlas-core/src/stage.rs(+207/−3) andpkgs/atlas-search/schema/stage_registry_v1.sql(+11).cd pkgs/atlas-search && cargo test -p atlas-core): all suites pass — 137 lib tests plus the integration suites, 0 failures.merge_manifestsand movesstaging_units.statetomergedin one transaction, andmerge_manifest()reads the record back — but it implements no archive branch and no deregistration; the unit stays instaging_unitsand the staging DB is not branched. Design §4.1 is explicit: manifest, then branch the staging DB as archive, then drop it from the active registry.promoted unit is no longer returned as an active registry entry while its manifest persists), or (b) get owner disposition that a retainedmergedregistry row plus an intact staging DB satisfies "archived/deregistered" for this slice. Parked ~20 minutes pending that.atlas: archive staging DB and close out active state on promotion (#5669
dezren39 commentedon Nov 17, 2026
Slice 2 (merge manifest + promotion close-out) is on PR #11317 at 753d700. Parked while CodeRabbit runs.
dezren39 commentedon Nov 17, 2026
agent-note:v1
kind: done
task: 19870 (repo-worker-code, openchamber-scheduled-lane any-o)
outcome: pr_opened — PR #11317 carries the merge manifest and the promotion close-out (archive via VACUUM INTO to .archive, unit moved to merged and out of active states). Head 753d700. cargo test -p atlas-core passes (138 unit + integration suites). Not merged; left for owner review.
follow-up (minor, not blocking): branch_staging_db_as_archive docs say the previous archive is replaced only after the new snapshot is written, but the code removes the old archive before writing. Doc and code need reconciling in a follow-up.