Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Thermo-nuclear reviewReviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude
|
|
Follow-up: all 5 thermo review findings above are fixed in the "Address thermo review" commit. Nothing left open. Commands run (E-core wrappers, Rust 1.98.0): |
Summary
Adds a shared, read-only LevelDB reader for Chromium browser storage at
rust/src/browser/leveldb/, with no new crate (user-approved: hand-written LevelDB log/table parser plus a Snappy block decoder). It is infrastructure only: nothing calls it yet, so there is no behavior change. It unblocks the two upstream 0.66.0 items that were deferred for lack of a LevelDB reader: Kimi Chromium local-storageaccess_tokenimport (steipete#3923) and MiniMax browser-storage discovery (steipete#3883).read_entries(dir): scans*.log(write-ahead log) and*.ldb/*.sst(sorted tables, prefix-compressed blocks, none/Snappy compression), resolves each user key to its newest sequence, and drops deleted keys.local_storage::read_local_storage_entries(dir, origin): decodes Chromium Local Storage items (_<origin>\0<format byte><key>, Latin-1 or UTF-16LE text) for one exact origin.local_storage_dir(profile_dir)gives<profile>/Local Storage/leveldb.snappy::decompress(input, max_len): raw Snappy blocks with a caller-set output cap.tracing::debugline (no key or value content is logged).Known limits (documented in the module docs): the MANIFEST is not consulted (a compacted-away table not yet deleted can still be read; newer sequences win), checksums are not verified, blocks with compression types other than none/Snappy are skipped, IndexedDB value decoding is out of scope.
Upstream reference
49e7ff3e) and MiniMax "discover browser session storage" (fix(devin): share Chromium browser session discovery steipete/CodexBar#3883,62cdd065), v0.66.0.ChromiumLocalStorageReader.readEntries(for: origin, in: levelDBDirectory), an external Swift package, so there is no upstream reader source at the tag to copy. Consumer call sites at v0.66.0:Sources/CodexBarCore/BrowserLocalStorageAPI.swift,Sources/CodexBarCore/Providers/Kimi/KimiCookieImporter.swift(localStorageTokens),Sources/CodexBarCore/ChromiumLocalStorageDiscovery.swift.Ported / Deferred
Ported: the reader, Chromium Local Storage decoding, Snappy decoder.
Deferred to follow-up micro PRs (queue items 20 and 21):
localStorageTokens(JWT filter,expcheck, ordering after cookie sources); needs the Kimi region work from Integrate reviewed provider, history, and tray ports #610.BrowserType) and IndexedDB origin-prefix scanning.detection::BrowserProfile.pathpluslocal_storage_diralready covers Local Storage.Validation
Toolchain
cargo +1.98.0, slot-4 target dir, E-core wrappers.cargo +1.98.0 fmt --all: cleancargo +1.98.0 clippy --workspace --all-targets -- -D warnings: passcargo +1.98.0 test -p codexbar leveldb -- --test-threads=4: 24 passed, 0 failedcargo +1.98.0 test -p codexbar browser:: -- --test-threads=4: 39 passed, 0 failedTests cover Snappy literal/copy-1/2/4 elements and malformed streams, log framing across block edges and padding, truncated tails, table prefix compression across blocks, Snappy-compressed blocks, bad footer/handle/compression, newest-sequence resolution across log and table, tombstones, and Local Storage Latin-1/UTF-16 decoding with exact-origin matching. I did not run the full
cargo test -p codexbar(no shared code touched; onlybrowser/mod.rsgained onepub modline).Affected areas
rust/src/browser/)tests.rs, 625).UI proof
Not applicable