feat(core): wire worldscript_project_validate Tauri command (Wave 2 PR B) - #426
Conversation
…R B) Strangler proof point per docs/native/CORE-MIGRATION-LEDGER.md's Wave 2 plan: a new src-tauri/src/commands/project_core.rs exposes worldscript_project_validate, delegating to the renderer-neutral worldscript-project crate (parse -> migrate to current schema -> validate) instead of any Tauri-local logic. worldscript-project is added as a path dependency in src-tauri's Cargo.toml, referencing a crate that is itself a member of the separate crates/ Cargo workspace - confirmed this cross-workspace path dependency compiles and links cleanly (cargo check/test/clippy all pass) without requiring the two workspaces to be unified, keeping the Wave 2 PR 1 decision to keep them independent intact. Backend-only: no frontend call site, no changes to services/desktopPlatform.ts or services/fs/projectFsStore.ts / services/storageService.ts's dispatch. This only proves the Tauri <-> Rust Core command boundary compiles and runs correctly; wiring an actual frontend caller is separate, later work. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🤖 CodeAnt AI — Review Status
|
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideWires a new Tauri command into the existing Rust backend that delegates project JSON parse/migrate/validate to the worldscript-project core crate, adds the crate as a path dependency, and exposes the command to the Tauri runtime with structured success/failure results and tests covering main validation paths. Sequence diagram for worldscript_project_validate Tauri command pipelinesequenceDiagram
participant TauriRuntime
participant project_core as worldscript_project_validate
participant CoreCrate as worldscript_project
TauriRuntime->>project_core: worldscript_project_validate(project_json)
project_core->>CoreCrate: parse_envelope(project_json)
alt [parse_envelope Ok]
CoreCrate-->>project_core: envelope
project_core->>CoreCrate: migrate_to_latest(envelope)
alt [migrate_to_latest Ok]
CoreCrate-->>project_core: migrated
project_core->>CoreCrate: validate(migrated.project)
alt [validate Ok]
CoreCrate-->>project_core: ()
project_core-->>TauriRuntime: ProjectValidationResult{ valid: true, schema_version: Some(migrated.schema_version), error: None }
else [validate Err]
CoreCrate-->>project_core: error
project_core-->>TauriRuntime: ProjectValidationResult{ valid: false, schema_version: Some(migrated.schema_version), error: Some(error) }
end
else [migrate_to_latest Err]
CoreCrate-->>project_core: error
project_core-->>TauriRuntime: ProjectValidationResult{ valid: false, schema_version: None, error: Some(error) }
end
else [parse_envelope Err]
CoreCrate-->>project_core: error
project_core-->>TauriRuntime: ProjectValidationResult{ valid: false, schema_version: None, error: Some(error) }
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
This PR successfully implements the Wave 2 PR B milestone by wiring the worldscript_project_validate Tauri command to the worldscript-project Rust Core crate. The implementation follows best practices with proper error handling, comprehensive test coverage (4 tests covering valid schema, migration, corrupt JSON, and validation failures), and adheres to the honest-failure convention established in the codebase.
Key strengths:
- Structured error handling returns results instead of panicking
- Cross-workspace path dependency is correctly configured
- Tests verify parse → migrate → validate pipeline
- Backend-only implementation aligns with stated scope
The code compiles cleanly and is ready for merge based on the test plan verification in the PR description.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe PR adds the local ChangesProject validation command
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR adds a localized project-validation command and its Rust dependency wiring; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Frontend
participant Tauri
participant worldscript_project
Frontend->>Tauri: invoke worldscript_project_validate(project_json)
Tauri->>worldscript_project: parse and migrate project JSON
worldscript_project-->>Tauri: migrated project or failure
Tauri->>worldscript_project: validate migrated project
worldscript_project-->>Tauri: validation result
Tauri-->>Frontend: ProjectValidationResult
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🏁 CodeAnt Quality Gate ResultsCommit: ✅ Overall Status: PASSEDQuality Gate Details
|
CodeAnt correctly flagged that a real Redux-persisted project (using EntityState normalization for characters/worlds) would fail parse_envelope today. This is deliberate, existing scope from PR #409's schema.rs - not a regression introduced here - but that context lived only in schema.rs, not in this command's own docs. Add a pointer so a future reader of project_core.rs alone sees the limitation without having to already know schema.rs's history. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@coderabbitai review |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
User description
Summary
worldscript_project_validate, to the renderer-neutralworldscript-projectRust Core crate (docs/native/CORE-MIGRATION-LEDGER.md).src-tauri/src/commands/project_core.rsruns parse → migrate-to-latest → validate via the crate, returning a structuredProjectValidationResult— neverErr, matchingcommands::task_supervisor's honest-failure convention.worldscript-projectadded as a path dependency insrc-tauri/Cargo.toml, even though it's a member of the separatecrates/Cargo workspace. Confirmed this cross-workspace path dependency compiles/links cleanly (cargo check/test/clippyall pass) without unifying the two workspaces — keeps the original Wave 2 PR 1 decision (crates/stays independent fromsrc-tauri/) intact.Explicitly out of scope
services/desktopPlatform.ts,services/fs/projectFsStore.ts, andservices/storageService.ts's dispatch are untouched. This PR only proves the Tauri ↔ Rust Core command boundary compiles and runs correctly.Test plan
cargo test --libinsrc-tauri/— 23/23 pass (4 new: valid-schema-v2 passes, v1-migrates-then-validates, corrupt-JSON structured failure, duplicate-character-id validation failure)cargo clippy --lib -- -D warnings— cleancargo fmt --check— cleanSummary by Sourcery
Wire project validation from the Tauri command boundary to the worldscript-project core crate.
New Features:
Enhancements:
Build:
Tests:
CodeAnt-AI Description
Expose project validation through the desktop application
What Changed
Impact
✅ Reliable project validation results✅ Automatic validation of older project formats✅ Clearer project data errors💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit
New Features
Tests