Repository navigation
feat(id): libsql HTTP adapter v1 — read-only foreign store (#7577) - #8115
Conversation
Implements the #5806 decision record (B3 under #5672): raw libsql HTTP v2 pipeline client in pkgs/id/src/foreign_libsql.rs — no libsql crate, no SQLite-family dependency (guard test passes unmodified, FUEL_BUDGETS untouched). Structured GrantedQuery pushes the grant predicate into the remote SELECT; writes are unrepresentable and write fragments are refused. Type mapping validates both directions per record item 5 (u64>i64::MAX as 8-byte BE blob, bool as 0/1, NULL distinct from empty, non-UTF8 TEXT rejected, type mismatch is an error). Per-alias circuit breaker, bounded read retries, fatal auth naming the credential reference only. 17 oracle-named tests pass, including a live local-HTTP round trip.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
🤖 Agent note · review disposition (task 14504, lane code-p)
|
|
Follow-up issue #8798 tracks the newly identified half-open circuit-breaker concurrency gap: allow() admits every caller while a recovery probe is in flight. The issue body includes evidence and acceptance criteria. |
Closes #7577. Implements the #5806 decision record (B3 under #5672 Part B) exactly as recorded; no parent decision is re-decided.
What lands
pkgs/id/src/foreign_libsql.rs— a read-only Turso/libsql HTTP adapter v1:id://foreign/libsql/<alias>; the alias resolves only in local operator config to {url, credential reference}. The token is resolved per call (env: references built in; other stores plug in viaCredentialResolver), never stored, logged, or placed in errors — auth errors name the reference only.GrantedQuery(table + granted columns + mandatory grant predicate + optional filter + limit) compiled to a single SELECT. Write shapes cannot be expressed; fragments with write keywords or statement separators are refused.TypeMismatcherrors — never silent coercions. Oversize BLOBs are refused with a named size error, never truncated.Dependencies (per pkgs/id AGENTS.md disclosure)
Three direct deps added to the root
idpackage, all already present inCargo.lockvia iroh/quinn — the lock diff is +3 lines (edges on theidpackage only, no new packages):rustls0.23 (ring/std/tls12),tokio-rustls0.26 (ring/tls12),webpki-roots1. No SQLite-family dependency is added.Tests (oracles named per the testing doctrine)
17 new tests in
foreign_libsql::tests, each citing its oracle (record item or wire format): the five lossy corners (u64 > i64::MAX, f64 precision, non-UTF-8 bytes, NULL vs empty, bool encoding), grant push-down SQL shape, write/missing-grant refusal, auth fatality + reference-only errors, bounded 5xx retry, malformed-response determinism, circuit breaker open/half-open/close, pipeline wire round-trip under contract, and a live pass-through round trip over real HTTP against a local listener playing the sqld endpoint (verifies POST /v2/pipeline, bearer header, grant-pushed SQL). A real Turso-cloud endpoint was not used: no credential is available to the fleet lane; the live test's oracle is the protocol wire format itself.cargo test -p id --lib foreign_libsql— 17 passedcargo test -p id --lib test_the_lock_has_no_sqlite_with_logsync_wired— passes unmodified;FUEL_BUDGETSuntouchedcargo check -p id --lib— clean, no new warnings in the moduleQueue: task 14504, lane code-p. Worktree note: an accidental package-wide
cargo fmtduring development reformatted 7 unrelated files in the task worktree; those changes were discarded before push and are not in this PR.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.