Codebase review fixes + extract apps from oasis-core into independent crates#50
Merged
AndrewAltimit merged 9 commits intomainfrom Mar 6, 2026
Merged
Conversation
Critical fixes:
- Replace mem::zeroed() with MaybeUninit for MT19937 context init (PSP)
- Convert 76 test panic!("expected X") patterns to let-else assertions
Important improvements:
- Add SAFETY comment to VolatileAllocator::alloc() pointer arithmetic
- Fix PSP measure_text() to use proportional bitmap_measure_text()
- Add LRU eviction (2048 cap) to WASM glyph cache to prevent unbounded growth
- Add optional password authentication to FTP server (--password flag)
- Add host pinning to PSP TLS provider for defense-in-depth
- Extract magic numbers to named constants (render colors, snap thresholds)
New features:
- Add Vfs::rename() with implementations for Memory, Real, and GameAsset VFS
- Add FTP RENAME protocol command
- Add MeasureCache for opt-in widget measure result caching
- Add cached_measure() helper for layout performance optimization
All 41 test suites pass, clippy clean, fmt clean.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The WASM build failed because rustls pulled in ring → getrandom 0.2, which requires the "js" feature on wasm32-unknown-unknown. Fix: Set default-features = false for oasis-core at the workspace level, so the WASM backend doesn't inherit tls-rustls. Desktop backends (SDL, app) explicitly opt in to tls-rustls. Also gate the oasis_browser::loader import behind cfg(not(wasm32)) to fix unused import warning. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… pinning Reflects changes from the codebase review branch: VFS rename() trait method in design.md, FTP password authentication and PSP TLS host pinning in security.md, FtpToggle password field in adding-commands.md, and corrected thread safety documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 0 of app extraction: create oasis-app-core containing the App trait, AppAction enum, ContentState, layout calculations, rendering helpers (render_app_chrome, render_content_sdi, draw_content_windowed, hide_app_sdi), and file viewer utilities (list_directory, view_*_file, parent_dir, join_path). oasis-core now depends on and re-exports from oasis-app-core. All existing apps continue to work via re-exports — no behavioral changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 1-2 of app extraction: move Games (2,155 LOC), Paint (1,875), Clock (1,775), Text Editor (1,710), Calculator (1,285), and Media/BrowsingApp (667 LOC) into their own workspace crates. New crates: - oasis-app-games: Snake, Memory Match, Sliding Puzzle - oasis-app-paint: multi-layer canvas with 9 drawing tools - oasis-app-clock: clock, stopwatch, timer, alarms - oasis-app-text-editor: modal editing with undo/redo - oasis-app-calculator: expression parser with history - oasis-app-media: music player + photo viewer (BrowsingApp) All imports updated from crate-internal to workspace crate references. AppRunner dispatch table updated to import from new crates. All 55 test suites pass, clippy clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 3 of app extraction: move the entire tv_guide module (guide.rs, catalog.rs, channel.rs, schedule.rs, test_data.rs) into its own crate. oasis-core re-exports the crate as `apps::tv_guide` for backwards compatibility with oasis-backend-wasm, oasis-app, and other external consumers. Internal references updated to import directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nner.rs Phase 4: Extract RadioApp (338 LOC) into its own crate implementing the App trait, eliminating inline radio handling from runner.rs. Phase 5: Remove dead generic code from runner.rs and runner_sdi.rs now that all apps except TV Guide use the delegate pattern. Removes ~425 lines of unreachable inline rendering, input handling, and unused fields (visual_selected, cached_max_visible). oasis-core: 16,495 LOC (down from ~30,726 originally, 46% reduction) runner.rs + runner_sdi.rs: 1,455 lines (down from 1,889) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The TV Guide crate uses js_sys::Date for WASM timestamps but was missing the conditional js-sys dependency after extraction from oasis-core (which provided it transitively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gemini AI Code ReviewIssues (if any)
Previous Issues (for incremental reviews)(none) Suggestions (if any)
Notes
Generated by Gemini AI (gemini-3.1-pro-preview). Supplementary to human reviews. |
Owner
Author
Review Response Agent (Iteration 1)Status: No changes needed Fixed Issues
Ignored Issues
Deferred to Human
Notes
The agent reviewed feedback but determined no code changes were required. |
The glyph_lru deque only pushed keys on insertion, never promoting them on cache hit. Frequently-used glyphs rendered early would be evicted first once the 2048 limit was reached, causing constant cache thrashing. Fixed by moving accessed keys to the back of the deque on every cache hit. Also includes PSP Cargo.lock update from EBOOT build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gemini AI Incremental ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)
Previous Issues (for incremental reviews)
Suggestions (if any)
Notes
Generated by Gemini AI (gemini-3.1-pro-preview). Supplementary to human reviews. |
Owner
Author
Review Response Agent (Iteration 2)Status: No changes needed Fixed Issues
Ignored Issues
Deferred to Human
Notes
The agent reviewed feedback but determined no code changes were required. |
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.

Summary
Apptrait delegate patternNew crates
oasis-app-coreoasis-app-gamesoasis-app-paintoasis-app-clockoasis-app-text-editoroasis-app-calculatoroasis-app-mediaoasis-app-tv-guideoasis-app-radioTest plan
cargo fmt --all -- --checkpassescargo clippy --workspace -- -D warningspassescargo test --workspacepasses (59 suites, 0 failures)cargo build --workspace --releasesucceedscargo deny checkpasses (advisories, bans, licenses, sources)cargo +nightly psp --release)build-wasm.sh --release)Generated with Claude Code (claude.com/claude-code)