Repository navigation
refactor(storage): retire low-value persistence paths - #1178
Conversation
Use canonical Context for Server Session hydration and keep CLI recovery explicitly local. Remove DB CSL, cloud Session checkpoints, skill-selection projection, metadata Sandbox CRUD and Marketplace metrics with their schema and wiring. Classify deletion-fence activation rejection as 404 using the existing typed owner.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of 6dad5ea against d0511d5.
Verdict: no blocking regression found; recommend approval for the explicitly fresh-database/product-cut scope. This is a COMMENT review because the authenticated account is also the PR author, not a formal self-approval.
Design and ownership
- Server continuation stays with the existing owner-scoped Context coordinator. The handler validates/materializes canonical state before activation; it does not introduce a replacement checkpoint table, reconciliation state machine, or local-filesystem fallback.
- CLI file CSL/local recovery and Run checkpoint custody are separate, justified responsibilities and remain wired. Removing the unused database CSL backend does not remove those implementations.
- The skill-selection projection removal follows through contracts, writer/transaction, runtime wiring, schema, deletion inventory and feature-only tests. Actual selection, activation, tool results, quality tracking and observer dispatch remain. Selected-skill telemetry still has CLI consumers, so deleting that state merely because the SQL writer disappeared would be incorrect.
- Sandbox metadata CRUD and Marketplace metrics/ranked search are intentional public product cuts, not behavior-preserving refactoring. Their router/service/schema paths are removed together; ordinary versioning and skill registry/install remain.
- The activation fix reuses the typed lifecycle fence and preserves lock order/cancellation-safe connection ownership. The added pending/completed-deletion tests exercise both existing activation APIs rather than adding a second lifecycle implementation.
Complexity and tests
The aggregate +960/-6920 is not the basis for approval. Counting file categories and inline Rust cfg(test) sections gives implementation/config +260/-3163, tests +628/-3531, docs +60/-39, and remaining build/scripts/fixtures +12/-186. The new behavior tests check public routing, real next-provider skill results, owner isolation, missing/corrupt canonical state and deterministic fence ordering. The two whole-HTTP resume/delete races do not exhaustively establish every materialization/delete interleaving; the PR correctly does not claim that.
Independent verification in this review
- SDK typecheck passed; complete SDK suite: 503 passed, 13 skipped. The focused client suite separately passed 86 tests.
- Schema inventory: 47 passed; CI parallelism contracts: 17 passed; cleanup-pressure wrapper: 5 passed.
- Fresh-database harness contracts: 13 passed in a selected rerun. The complete 15-test invocation had two environment errors because Unix sockets were prohibited; these are not product failures or successful tests. An elevated attempt could not start due to environment setup. No local Rust compiler/server/MatrixOne journey was run here.
- Read actual exact-head CI logs, not only green badges: online integration 298/298 (including ordinary SQL budget, selected/missing skill SQL capture, and the stream/context/restore journey); online services 478/478 (including activation_rechecks_pending_and_completed_delete_after_owner_read); frozen fresh-Astra consumer 7/7. The regression harness log records 18/18 cases with deepseek-v4.1-flash. These are independently inspected CI executions, not local runs performed by this review.
- Exact-head check list had no failed or pending checks at review time. git diff --check passed and the review checkout is unchanged.
Comment resolution
There were no pre-existing PR conversation comments or inline review threads, and #1177 had no comments, at both initial and final reads. Therefore there is no outstanding GitHub review thread to mark resolved. Private/off-platform review discussions are not evidence I can certify from this PR.
Non-blocking cleanup
The two audit_cloud_sync skill documents under .agent/skills and .claude/skills still instruct readers to inspect session_checkpoints and HybridRestoreService and reconcile local/cloud checkpoints. Refresh those operational instructions to the canonical Context + explicit CLI-local boundaries so future audits do not follow retired paths.
Scope limits: no upgrade/mixed-version or historical-data cleanup guarantee, no measured engine write-amplification/capacity claim, and no exhaustive race-instrumentation claim. None is required by the stated fresh-system scope.
Capability assessment: Updated: Server Session hydration requires canonical Context; metadata Sandbox and Marketplace metrics APIs are retired. CLI local recovery, execution isolation and active skill behavior remain supported. References: docs/reference/capabilities.md, docs/design/data-and-storage.md, docs/design/skills-and-tools.md.
Summary
Remove five persistence paths with no production writer, redundant ownership, or little current product value. Fresh schema inventory drops from 136 to 131 tables, removing 61 columns and 14 non-primary index definitions. Server resume now validates canonical Context before activation instead of hydrating an obsolete checkpoint projection first.
conversation_logsession_checkpointsskill_selection_eventsinfra_sandbox_metadataskill_metricsA real resume/delete QA race also exposed a shared Session-service classification error: durable deletion admission returned 500. The existing typed fence state now returns 404 in both activation paths, without changing SQL or locking order. Missing post-commit Session reads also return 404. The SDK resume return type now matches hydration rather than inventing Session header fields.
Related issue
Closes #1177. Related to #1124; this does not resolve its remaining wide-row/index/write-amplification scope.
Change type
User and compatibility impact
Intentional product cuts:
/sandboxCRUD,/data-versioning/sandbox/{name}/checkpoint,/marketplace/quality-report,/marketplace/stats/{skill_name}and/marketplace/searchreturn 404. Skill registry/install/personal evaluation, runtime skill-quality feedback, ordinary data versioning and real execution isolation remain.Full and continuation Session resume require owner-scoped canonical Context. Missing state returns 404 without activation; corrupt/foreign state fails closed. Cloud checkpoint-only fallback is removed. SDK
resumeSessionreturns canonical hydration, with optional omitted fields represented accurately.Fresh databases only: no schema version bump, migration, backfill, compatibility read, physical old-table cleanup or mixed-version deployment support is introduced. Existing tables and historical rows are untouched; retired Session tables are removed from the deletion catalog. Historical retention/deletion transitions are outside this change. In particular, old skill-selection rows can contain queries. This PR performs no deployment or existing-database operation.
Architecture and complexity delta
Verification
astra-core,astra-turn-core,astra-services,astra-cliandastra-runtime(cargo nextest run --locked --libwith history/CSL/restore/lifecycle/versioning/provider/post-loop filters, two test threads).allow_skills; original outcome/observer assertions and inference counts remain.npm run typecheckandnpm test -- src/__tests__/client.test.ts: 86 passed, including a server-shaped hydration response with omittedpermission_mode.cargo test --locked -p astra-runtime --features moi-compat-tests --test moi_fresh_astra -- --include-ignored --test-threads=1: seven passed. Linux/amd64 historical executables were not run on this macOS ARM host; no external-client compatibility claim is made for the removed APIs.--locked --all-targets --features astra-runtime/e2e-hooks -- -D warnings), final runtime delta clippy,cargo fmt --all -- --checkandgit diff --checkpassed. Schema inventory 47; fresh-database harness 13 passed/two existing opt-in skips; unchanged CI/probe tests 17/5 and the public zero-measurement rejection control are reused.gpt-6.1-terrawithmaxproduced the design and final overall review; all material findings are resolved. Final reviewed dirty-diff SHA-256:ed7e789e0576b0bfd5c487af9dfbfd126666f7d193a9c52922626f1898186fd3. Validation: macOS ARM, Rust 1.97.0, Node 24.10.0, localhost MatrixOne and scripted providers with per-process synthetic keys. No live provider or production database was used.CI is pending; this PR does not wait for or claim CI results.
SQL implications: a completed selected-skill loop removes the old four statements plus BEGIN/COMMIT (source-derived); no-selected-skill turns already skipped that hook. Full Server hydration removes legacy reads and the checkpoint aggregate subquery. Removed feature costs are not ordinary-chat savings. No measured engine write-amplification or 1000-session capacity claim is made.
Final checklist