Skip to content

Agents and scripts: Installed Slicers describes its exact parameters and reply (#13306) - #13340

Merged
bherbruck merged 5 commits into
tangency-labs:mainfrom
LouisBunt:slicers-schemas-13306
Nov 9, 2026
Merged

bherbruck merged 5 commits into
tangency-labs:mainfrom
LouisBunt:slicers-schemas-13306

Conversation

@LouisBunt

@LouisBunt LouisBunt commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Change

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.
  • 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.
  • 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.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

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.

Run configuration

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.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Medium

Possibly related issues

  • 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: Passed 6

Check name Status Explanation
Title check Passed 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 Passed 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 Passed 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 Passed 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 Passed 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 Passed 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
Recent review info

Run configuration

Commits

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.

@theironchef

Copy link
Copy Markdown
Contributor

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.
  • cargo test -p solidcraft-mcp: 114 passed.
  • cargo clippy -p solidcraft-engine --lib -- -D warnings: clean.

The conflict with #13341 in crates/engine/src/cmd/file.rs is only the use crate::schema::... import lines at the top; keep both.

…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>
@bherbruck
bherbruck force-pushed the slicers-schemas-13306 branch from 8bc8c35 to 976a613 Compare November 8, 2026 18:29
@bherbruck bherbruck added approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green labels Nov 8, 2026
@bherbruck
bherbruck added this pull request to the merge queue Nov 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 8, 2026
Made with Claude Opus 5.5 in Claude Code (Ultra plan, default effort, fast mode off, Ultracode off).
Made with Claude Opus 5.5 in Claude Code (Ultra plan, default effort, fast mode off, Ultracode off).
@bherbruck
bherbruck added this pull request to the merge queue Nov 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 9, 2026
Made with Claude Opus 5.5 in Claude Code (Ultra plan, default effort, fast mode off, Ultracode off).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installed Slicers: input and output schemas (part of #2829)

3 participants