Repository navigation
Conversation
…, storage-free login steps grabcli-core no longer reads files, paths or the environment and no longer depends on rusqlite. Context loads/saves the session through an Arc<dyn SessionStore> and caches through an Arc<dyn Cache> (wrapped in CacheHandle for TTLs/modes). MemorySessionStore, MemoryCache and NoCache for tests and embedders. Login steps take the pending login as a value and the send budget as an injectable SendBudget; LoginDriver wraps them as a state machine for daemons. WIP: the service crates and the CLI are ported in the next commits.
…printing grabfood exposes context(), menu(), cart_add/cart_remove, quote(), vouchers()/best_voucher(), prepare_order/submit_order/place_order (quote-id match and allow_ordering checked before any request, never retried), orders(), track(), history(); browse functions return Listing. ListOpts' bpaf parser is behind the cli feature. grabmart's Mart::new takes a Context and an injectable Pacer.
…raries session.json via FileSessionStore (0600), login send log and pending login files, config.toml and hydra-key.pem loading, GRAB_NO_CACHE, and the SQLite cache all live in the bin crate now. The food/mart command enums, printing, cart and last-quote files, the tile map and cross-process mart pacing moved here from the library crates. CLI behaviour is unchanged.
…tance) Git-dependency vendoring that copies only the crate directory (crate2nix) can't resolve workspace.package or workspace dependencies.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Library crates (grabcli-core, grabfood, grabmart) now own no storage: no paths, config-file reads, env, printing or rusqlite. They can be embedded in a daemon that keeps the session and cache in its own database.
What's here
SessionStoreandCacheare async (async_trait),Send + Syncand usable asArc<dyn …>.Context::new(config, store, cache)is async and saves every session change (silent refresh, hydra mint, mart login, address) through the store.CacheHandleholds the TTL/mode logic.MemorySessionStore,MemoryCacheandNoCacheare for tests and embedders.SqliteCache(the old cache DB, catalog and images) plus stats/clear/prune. It is the only crate that links rusqlite.&mut Option<PendingLogin>slot with an injectableSendBudget.LoginDriver(start / submit_code / poll / cancel) ends inDone(Session)and writes no files.Cartvalue, quote, vouchers/best_voucher, prepare/submit/place_order, orders, track and history. The order path checks the quote id against a fresh quote and requiresallow_ordering, both before any request, and never retries. The bpaf parser forListOptsis behind theclifeature.Mart::new(ctx)with an injectablePacer. The mart command flows stay in the CLI.grabbin owns config.toml,FileSessionStore(session.json, 0600), the login send-log and pending-login files, the hydra key, GRAB_NO_CACHE, cart and last-quote files, the tracking map and printing. CLI behaviour is unchanged.Tests
cargo test --workspace,cargo clippy --workspace --all-targets -D warnings,nix fmtandnix flake checkall pass. No test hits Grab.