You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agents and scripts: Installed Slicers describes its exact parameters and reply (#13306) - #13340
Agents and scripts drive SolidCraft through named commands. The MCP tool describe_command and engine.describe give a command's exact parameters and reply, but only for commands with schemas. This PR gives them to Installed Slicers (file.slicers). With the parameter check at warn or strict, a key sent to it is now reported or refused. Fixes#13306, part of #2829.
The contract SlicersParams and the reply types SlicersResult and SlicerInfo are in a new module, schema/slicers.rs (tests in slicers_tests.rs), so this PR does not touch the files of the other cmd/file.rs conversions. The handler builds its reply from SlicersResult, which serializes to the same JSON as before: each slicer has id, name, program and icon, the last two null when missing. file.slicers leaves schema/unconverted.txt.
No parameters: the handler reads no key, so SlicersParams is empty. A call with any key is reported in warn and refused in strict; a call without one runs as before.
Test helpers:mesh_convert, CHOSEN_PROGRAMS and MadeUp in the engine tests become pub(crate). The new reply test fakes the slicer list, so it takes the same lock as the send tests that fake it, or the two would race. Nothing else in those files changes.
What changes for callers: nothing for a call that works today, apart from a call with a key, in warn/strict mode.
Changes a default: no
Tests
New tests in crates/engine/src/schema/slicers_tests.rs: the schema and the key check agree, the type reads no key as the handler reads none, strict runs a call without keys and refuses one with a key, the check names an unknown key, an entry serializes with null for what is missing, and the replies (the real list and a faked one with and without program and icon, in warn) match the output schema.
Validation
On Linux:
cargo fmt --check: pass.
cargo clippy -p solidcraft-engine --all-targets -- -D warnings: clean except clippy::manual_range_contains in a file this PR does not touch (crates/doc/src/project.rs:591), which Rust 1.97 also flags on main.
Not run: the full workspace suite, the param-audit recorder, web-offline-test and the wasm and UI builds.
Made with Claude Sonnet 5.5 (medium effort, fast mode off) through the Claude API, with Claude Opus 5.5 as advisor.
Summary by CodeRabbit
New Features
Slicer listings now return a consistent structured response with each slicer’s name and ID, plus program and icon details when available.
The command accepts no parameters. Unknown parameters can generate warnings or be rejected in strict mode, while warning-mode responses still include detected slicers.
Responses follow a defined format, and invalid results are reported as command errors.
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Note
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
file.slicers now has typed parameter and result schemas. Its handler serializes detected slicers through the typed result. Tests cover parameter checks, output conformance, and serialization.
Changes: file.slicers schema
Layer / File(s)
Summary
Define and apply the slicers contract crates/engine/src/schema/slicers.rs, crates/engine/src/schema/mod.rs, crates/engine/src/cmd/file.rs, crates/engine/src/schema/unconverted.txt
The command declares typed parameter and output schemas. The handler serializes slicer entries through SlicersResult. The command is removed from the unconverted list.
Validate the contract and replies crates/engine/src/schema/slicers_tests.rs, crates/engine/src/tests/mesh_convert.rs
Tests cover parameter checks, output-schema conformance, and serialized results. Shared test items are crate-visible.
tangency-labs/solidcraft#2829 — The RFC describes typed command schemas and parameter checks. This change applies that contract to file.slicers.
Suggested reviewers:0xlillith, jyviko
Merge Risk: Minimal · previous review f8986
The typed contract preserves the described reply behavior; no merge-blocking issue was identified.
Security architecture risk: Minimal · up to f8986
The command retains its existing reachability and returned information. The new contract adds parameter validation and schema discovery without adding execution privileges, sensitive fields, or a new access path.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The changed execution surface remains the existing caller-visible inventory of slicers on the engine host. Comparing registration and returned values against the base does not show expanded host, tenant, asset or execution authority.
Trust Boundaries and Controls
observed — Caller-supplied keys reach the existing checked-dispatch wrapper before the handler. Strict enforces the empty key contract; Warn and Off intentionally permit execution. The handler reads no parameter, so an unexpected key does not select a program, path or downstream operation.
Pre-merge checks: 6
Check name
Status
Explanation
Title check
The title names the main change: Installed Slicers (file.slicers) now has its exact parameters and reply described, which is the core of this PR. It matches the changeset, which adds typed `SlicersP…
Description check
The description follows the repository template in its main parts. The Change section explains what the tool does, who uses it, the problem, and the resulting behavior, and it links the issue (#13306,…
Linked Issues check
Directly linked issue [#13306] (part of #2829) has three coding requirements. The whole-PR diff from merge base 53ce0e4 to head f8986c8 meets all three.
(1) Typed input contract. `SLICERS_CONTRACT: T…
Out of Scope Changes check
The whole-PR diff from merge base 53ce0e4 to head f8986c8 contains only changes that serve [#13306].
- cmd/file.rs: the slicers schema import, SLICERS_CONTRACT, the checked! registration with…
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Existing Defaults Unchanged
The usual file.slicers call keeps the same reply. Parameter checking remains Off by default. Warn and Strict modes change behavior only for calls with unknown keys.
Full details: Title check
Explanation
The title names the main change: Installed Slicers (file.slicers) now has its exact parameters and reply described, which is the core of this PR. It matches the changeset, which adds typed SlicersParams, SlicersResult, and SlicerInfo schemas, and removes file.slicers from unconverted.txt. The title is one concise sentence. It names the feature but not the warn/strict parameter-check behavior, which is a detail and not required.
Full details: Description check
Explanation
The description follows the repository template in its main parts. The Change section explains what the tool does, who uses it, the problem, and the resulting behavior, and it links the issue (#13306, part of #2829). It includes the required 'Changes a default: no' line. The Validation section lists commands run, results, and what was not run. The description does not include a title-style line at the top, which the template comment describes. The Screenshots section is absent. For this change, the template allows omission when there is no useful observable behavior. The Integration status section is absent. The template asks for upstream commit and PR status before handoff, and the description does not record it. The rest of the description is substantive and specific.
Full details: Linked Issues check
Explanation
Directly linked issue [#13306] (part of #2829) has three coding requirements. The whole-PR diff from merge base 53ce0e4 to head f8986c8 meets all three.
(1) Typed input contract. SLICERS_CONTRACT: TypedContract<SlicersParams> is added in cmd/file.rs. SlicersParams {} in schema/slicers.rs derives JsonSchema with #[schemars(deny_unknown_fields)]. The handler slicers(_: &mut Session, _: &Value) reads no parameter, so the empty contract matches it. The command is registered as crate::checked!("file.slicers", slicers) with .contract(&SLICERS_CONTRACT).
(2) Output schema. .output(output_schema_for::<SlicersResult>) is set. SlicersResult and SlicerInfo derive JsonSchema.
(3) Removal from schema/unconverted.txt. The diff removes the line file.slicers and no other line.
Behaviour is kept. The handler still calls crate::slicers::detect(). SlicerInfo takes id, name, program (d.command.first().cloned()) and icon (path string). program and icon are Option<String> without skip_serializing_if, so a missing value serializes as null, as before. param_warnings uses skip_serializing_if = "Vec::is_empty", so a normal reply has only the slicers key.
Automated tests in schema/slicers_tests.rs (six tests) cover schema and key-check agreement, key-less and keyed calls in strict mode, the unknown-key warning, null serialization, and reply conformance to the output schema. Residual uncertainty: the helpers crate::schema::tests::{assert_keys, assert_strict_keeps_todays_errors, conforms}, crate::slicers::{IconSource, Slicer, TEST_DETECTED}, and Session::default are not in this diff. Their existence relies on base code, which I did not inspect. I did not compile or run the tests. Author-reported pass results do not set this verdict.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff from merge base 53ce0e4 to head f8986c8 contains only changes that serve [#13306].
cmd/file.rs: the slicers schema import, SLICERS_CONTRACT, the checked! registration with .contract and .output for file.slicers, and the slicers handler body. No other command changes.
schema/slicers.rs and schema/slicers_tests.rs: the new contract and reply types, and their tests.
schema/mod.rs: pub mod slicers;, which makes the new module reachable.
schema/unconverted.txt: removes the converted file.slicers line.
tests/mesh_convert.rs: CHOSEN_PROGRAMS and MadeUp become pub(crate). The reply test in slicers_tests.rs uses them to take the same lock as the send tests. This is test-only visibility.
The PR objectives mention a merge conflict with #13341 and CI history. These are not code changes in this diff and add no scope. No file outside the listed set appears in the whole-PR diff.
Full details: Docstring Coverage
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 5 files.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 4abf5ac and f8986c8.
Files selected for processing: 3
crates/engine/src/cmd/file.rs
crates/engine/src/schema/mod.rs
crates/engine/src/schema/unconverted.txt
Files with no reviewable changes: 1
crates/engine/src/schema/unconverted.txt
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Tested this merged onto current main on its own, since it conflicts with #13341 (Windows, MSVC, --profile ci). No new failures:
cargo test -p solidcraft-engine --lib -- schema align mesh slicer insert hostile param_check: 680 passed, 3 failed. inserting_variable_fillet_control_preserves_parameters_at_existing_positions and dragging_a_mirrored_part_meshes_its_copies_once fail the same way on main. The third, an_insert_after_a_mirror_keeps_its_meshes_through_a_drag, is flaky under load: with this PR it passed 3 out of 3 runs alone and in its mirror_placed module.
…and reply (tangency-labs#13306)
file.slicers now publishes typed input and output schemas. It takes no
parameters, so a call with a key is reported in warn and refused in strict,
and a call without one runs as before. The reply is built from a typed
value and serializes to the same JSON as before: each slicer has id, name,
program and icon, the last two null when missing. Its line leaves
unconverted.txt.
Two test helpers in tests/mesh_convert.rs become crate-visible so the new
reply test takes turns with the send tests that fake the slicer list.
Made with Claude Sonnet 5.5 (medium effort, fast mode off) through the Claude API, with Claude Opus 5.5 as advisor.
Co-Authored-By: Claude Sonnet 5.5 <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
approved-for-ciReviewed: run the full PR CI (build, tests, goldens, Clippy)ready to mergereviewed, every ask addressed; merge once CI is green
3 participants
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.
Change
Agents and scripts drive SolidCraft through named commands. The MCP tool
describe_commandandengine.describegive a command's exact parameters and reply, but only for commands with schemas. This PR gives them to Installed Slicers (file.slicers). With the parameter check at warn or strict, a key sent to it is now reported or refused. Fixes #13306, part of #2829.The contract
SlicersParamsand the reply typesSlicersResultandSlicerInfoare in a new module,schema/slicers.rs(tests inslicers_tests.rs), so this PR does not touch the files of the othercmd/file.rsconversions. The handler builds its reply fromSlicersResult, which serializes to the same JSON as before: each slicer hasid,name,programandicon, the last twonullwhen missing.file.slicersleavesschema/unconverted.txt.No parameters: the handler reads no key, so
SlicersParamsis empty. A call with any key is reported in warn and refused in strict; a call without one runs as before.Test helpers:
mesh_convert,CHOSEN_PROGRAMSandMadeUpin the engine tests becomepub(crate). The new reply test fakes the slicer list, so it takes the same lock as the send tests that fake it, or the two would race. Nothing else in those files changes.What changes for callers: nothing for a call that works today, apart from a call with a key, in warn/strict mode.
Changes a default: no
Tests
New tests in
crates/engine/src/schema/slicers_tests.rs: the schema and the key check agree, the type reads no key as the handler reads none, strict runs a call without keys and refuses one with a key, the check names an unknown key, an entry serializes withnullfor what is missing, and the replies (the real list and a faked one with and without program and icon, in warn) match the output schema.Validation
On Linux:
cargo fmt --check: pass.cargo clippy -p solidcraft-engine --all-targets -- -D warnings: clean exceptclippy::manual_range_containsin a file this PR does not touch (crates/doc/src/project.rs:591), which Rust 1.97 also flags on main.cargo test -p solidcraft-engine --lib -- schema:: hostile: 508 passed;schema::slicers: 6 passed;mesh_convert slicers file::: 124 passed, 3 ignored. Rerun after rebasing on main,schema:: cmd::file mesh_convert: 564 passed, 0 failed, 3 ignored.cargo xtask lists,mesh-decisions,layers,assets,icons,i18n --check,skills,ui-containers,licences --check,features: pass.web-offline-testand the wasm and UI builds.Made with Claude Sonnet 5.5 (medium effort, fast mode off) through the Claude API, with Claude Opus 5.5 as advisor.
Summary by CodeRabbit