Skip to content

refactor: split oasis-core monolith into 12 crates - #10

Merged
AndrewAltimit merged 12 commits into
mainfrom
refactor/split-oasis-core
Feb 13, 2026
Merged

refactor: split oasis-core monolith into 12 crates#10
AndrewAltimit merged 12 commits into
mainfrom
refactor/split-oasis-core

Conversation

@AndrewAltimit

Copy link
Copy Markdown
Owner

Summary

  • Split oasis-core (57K LOC monolith) into 12 independent crates with zero downstream import changes
  • All existing crate::* paths continue to work through re-exports in oasis-core
  • Enables parallel compilation and lets consumers depend on only what they need

Extracted crates

Crate LOC Description
oasis-types 2,811 Foundation types, backend traits, error, input, color, shadow
oasis-vfs 1,330 Virtual file system (Memory, Real, GameAsset)
oasis-platform 663 Platform service traits (Power, Time, USB, Network, OSK)
oasis-sdi 1,336 Scene Display Interface registry
oasis-net 1,729 TCP networking, TLS, remote terminal
oasis-audio 1,655 Audio manager, playlist, MP3/ID3
oasis-ui 4,642 20+ widgets, DrawContext, Theme
oasis-wm 2,677 Window manager
oasis-skin 4,632 8 skins, TOML loader, theme derivation
oasis-terminal 2,737 Command interpreter, builtins
oasis-browser 23,838 HTML/CSS/Gemini engine + 4 benchmarks
oasis-core 9,444 Integration hub (apps, dashboard, agent, plugin, etc.)

Test plan

  • cargo build --workspace compiles (desktop)
  • cargo build --workspace --release compiles
  • cargo test --workspace -- all 1,756 tests pass
  • cargo clippy --workspace -- -D warnings -- clean
  • cargo fmt --all -- --check -- clean
  • PSP EBOOT compiles (cargo +nightly psp --release)
  • PPSSPP headless test -- boots, renders frames, clean shutdown
  • PPSSPP GUI interactive -- verified working

Generated with Claude Code

AI Agent Bot and others added 12 commits February 13, 2026 04:09
Extract core types and traits into a new `oasis-types` crate:
- error.rs (OasisError, Result)
- input.rs (InputEvent, Button, Trigger)
- backend.rs (Color, TextureId, DrawCommand, SdiBackend, InputBackend,
  NetworkBackend, AudioBackend, NetworkStream, AudioTrackId)
- config.rs (OasisConfig)
- color.rs (lerp_color, darken, lighten, with_alpha)
- shadow.rs (Shadow, ShadowLayer)
- pbp.rs (PBP parser)
- tls.rs (TlsProvider trait)

oasis-core re-exports all modules so downstream crate::* paths are unchanged.
Removes Theme::from_skin_theme() (callers use skin.to_ui_theme() directly).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move VFS trait, MemoryVfs, RealVfs, GameAssetVfs, and vfs bench into
standalone `oasis-vfs` crate. oasis-core re-exports via
`pub use oasis_vfs as vfs;` so all downstream `crate::vfs::*` paths
continue to work unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move platform service traits (PowerService, TimeService, UsbService,
OskService, NetworkService), DesktopPlatform impl, and 27 tests into
standalone `oasis-platform` crate. oasis-core re-exports via
`pub use oasis_platform as platform;`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move SDI scene graph (SdiRegistry, SdiObject, helpers) and sdi_registry
bench into standalone `oasis-sdi` crate. oasis-core re-exports via
`pub use oasis_sdi as sdi;`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move TCP networking, RemoteListener/Client, StdNetworkBackend, hosts
config, and TLS (rustls) impl into standalone `oasis-net` crate.
The `tls-rustls` feature propagates: oasis-core forwards to oasis-net.
oasis-core re-exports via `pub use oasis_net as net;`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move audio subsystem (playlist management, playback state, AudioManager,
NullAudioBackend) into standalone oasis-audio crate. Re-exported from
oasis-core as `pub use oasis_audio as audio` for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move UI widget toolkit (20 widgets, DrawContext, Theme, animation, layout)
into standalone oasis-ui crate with local MockBackend for tests. Re-exported
from oasis-core as `pub use oasis_ui as ui` for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move window manager (window configs, hit testing, drag/resize, focus)
into standalone oasis-wm crate. Re-exported from oasis-core as
`pub use oasis_wm as wm` for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move skin system (TOML skins, builtin skins, effects, corrupted modifiers,
active theme, legacy theme constants) into standalone oasis-skin crate.
Re-exported from oasis-core for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move interpreter, commands, audio_commands, network_commands, and
skin_commands into a new oasis-terminal crate. Agent and plugin
commands remain in oasis-core because they depend on oasis-core
modules (agent, plugin). The oasis-core terminal module re-exports
everything from oasis-terminal via glob import.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the entire browser subsystem (HTML/CSS parser, Gemini protocol,
layout engine, paint layer, resource loader, navigation, reader mode)
and 4 criterion benchmarks into a new oasis-browser crate. This is
the largest extraction at ~23.8K LOC. oasis-core re-exports via
`pub use oasis_browser as browser;`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Gemini AI Code Review

Issues

(none)

Previous Issues

(none)

Suggestions

  • crates/oasis-core/src/lib.rs:34 - Optional: Standardize pub use oasis_skin::legacy_theme as theme;
    • The theme module is re-exported from oasis_skin::legacy_theme, but ActiveTheme and other skin-related types are also re-exported. Consider a more uniform re-export structure for themes to distinguish between the static legacy theme and the dynamic skin-driven theme.

Notes

  • The refactor successfully decomposes the oasis-core monolith into 12 crates while maintaining backward compatibility through re-exports in the original oasis-core crate.
  • Dependency isolation is correctly handled: foundational types (colors, errors, backend traits) are moved to oasis-types, which has zero internal dependencies.
  • Feature flags for TLS are correctly propagated from oasis-core to oasis-net.
  • Similarity indexes for renamed files are high (96-100%), indicating that the logic remains intact and only imports were adjusted.
  • Cargo.toml workspace members and dependency paths are correctly updated to reflect the new directory structure.

Reaction


Generated by Gemini AI (gemini-3-flash-preview). Supplementary to human reviews.

@AndrewAltimit

Copy link
Copy Markdown
Owner Author

Review Response Agent (Iteration 1)

Status: No changes needed

Fixed Issues

  • (none)

Ignored Issues

  • Gemini suggestion (crates/oasis-core/src/lib.rs:35): Standardize legacy_theme re-export naming. This is a cosmetic suggestion, not a bug. The current pub use oasis_skin::legacy_theme as theme; correctly maintains backward compatibility for downstream consumers that import oasis_core::theme. No change needed.

Deferred to Human

  • (none)

Notes

  • Gemini found zero issues (only one optional suggestion about re-export naming).
  • Codex CLI failed to produce a review (error during execution), so no Codex feedback to address.
  • Workspace compiles cleanly with cargo check --workspace - no errors or warnings.

The agent reviewed feedback but determined no code changes were required.

@AndrewAltimit
AndrewAltimit merged commit c28eb9f into main Feb 13, 2026
7 checks passed
@AndrewAltimit
AndrewAltimit deleted the refactor/split-oasis-core branch February 13, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant