Repository navigation
Add phone profile and state files (P1-04) - #7
Merged
Merged
Conversation
Add the profile module to verone-core. A Profile (phone.toml) holds what the user chose: id, name, engine, Android version, creation time, display, graphics mode and adb port. A State (state.toml) holds what Verone observed, currently the graphics mode of the last successful boot. Both are read and written as TOML. Values are validated, unknown settings are rejected, and a file whose schema number is newer than this build understands is refused with an upgrade hint before the rest of it is interpreted. Files are written through a temporary file so a crash cannot leave a partial one. Phone ids can now be read from and written to files. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What changed
Task P1-04 from
docs/phases/phase-1.md. One new module,crates/verone-core/src/profile.rs:Profile(phone.toml): what the user chose: id, name, engine, Android version, creation time, display size and density, graphics mode, adb port. Defaults match the example in the plan.State(state.toml): what Verone observed, currently the graphics mode of the last successful boot. A phone that has never started has no such file and gets the default state.schemavalue is read first. A newer file is refused with "Upgrade Verone" before the rest is interpreted; schema 0 or a missing schema is refused too.<file>.tmp, which then replaces the target.Also:
PhoneIdgains serde support (storage.rs);CHANGELOG.mdupdated;serdeandtomladded toverone-core(both on the allow-list).Why
create,start,infoand the container spec all read the profile, so its format and rules must be fixed and tested before the engine tasks begin.Acceptance test ("Done when")
Run on the reference laptop (Arch Linux, Rust 1.99.1):
Coverage the plan asked for:
Notes for the reviewer
deny_unknown_fields, so a typo in a hand-editedphone.tomlis reported rather than ignored. The cost is that adding a setting later requires a schema bump or a default; that is intended.Profile::loadrefuses a file whoseiddiffers from its folder name.state.tomlerror says the file is safe to delete, since it records observations only.createin P1-11.🤖 Generated with Claude Code