feat(processing): opt-in target-neutral retained executor with typed refusals (M1-C, #7955)
Refs #7955. This is M1 PR C of the CLI retained-mode plan, on top of the controller (#8169) and the product budget (#8176).
What it adds, behind the off-by-default retained-runtime feature:
- A target-neutral retained executor,
processing::element::session_retained. It drives a product's Construction, Affine and Boolean operations through any runtime that implements the#[doc(hidden)]RetainedRuntime/AsyncRetainedExecutortraits. - A hand-written
RetainedProductRefusalwith stable reason codes and typed origins. For example,opening_strategyis checked beforematerial_layer_strategy, andcontract_breach,worker_fault,deadlineandcancelledare distinct. - External runtimes return only
RuntimeFault, so they cannot construct executor errors.RuntimeFault::contractkeeps a healthy worker alive on contract errors. - A minimal
#[doc(hidden)]admission-only entry,admit_product, used by tests. The whole-model driver in the next PR supersedes it. - The executor is lifted from #8148, with the generated contracts, diagnostics and evidence harness dropped.
The native SMLib runtime lives in a separate unpublished crate, rust/retained-native, which is the next PR. ifc-lite-processing gains no dependency on ifc-lite-geometry-runtime, so it stays publishable. cargo package --list is checked for that.
Default path. The executor module is gated on the feature. The only ungated changes are behaviour-identical refactors: Stage::next_kind(), and WorkError made pub inside a private module. There are no new non-test panics.
Tests and CI.
rust/processing/tests/m1_executor.rsis the feature-gated revert-oracle witness. The mutation intests/evidence/m1-c-executor-core/behaviour.oracle.patchmaps the layer refusal to the opening refusal, which the witness catches.- The PR lane now also runs
cargo test -p ifc-lite-processing --features retained-runtimefor the executor unit tests and the witness.
Validation, on the PC fleet worker at f0f393d920: exit 0, source unchanged.
- Workspace clippy
-D warnings, default and with the feature. - Geometry and processing tests, default and with the feature.
- Revert oracle OBSERVED.
- Guards: module-size, refwalk, ci-path-coverage and test-wiring.
- The processing package lists no geometry-runtime.
Two independent reviews against the plan, plus a third on the downstream driver, which produced the contract-fault fixes included here.
This supersedes the executor parts of #8148 (closing it once the stack lands), as #8169 and #8176 did for #8143, #8145 and #8147.
š¤ Generated with Claude Code
Summary by CodeRabbit
-
New Features
- Added retained geometry execution for product admission and supported construction, affine, and Boolean operations.
- Added product admission without numerical execution for supported geometry.
- Added clear refusal categories for unsupported strategies, invalid or incomplete sources, resource limits, cancellation, and runtime failures.
- Added validation to ensure completed operations match their inputs and execution context.
-
Bug Fixes
- Corrected material-layer refusals to report the appropriate category.
- Expanded regression coverage for retained execution and refusal behavior.