feat(processing): opt-in target-neutral retained executor with typed refusals (M1-C, #7955)

Merged
LO
1mo ago
+2874-25

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/AsyncRetainedExecutor traits.
  • A hand-written RetainedProductRefusal with stable reason codes and typed origins. For example, opening_strategy is checked before material_layer_strategy, and contract_breach, worker_fault, deadline and cancelled are distinct.
  • External runtimes return only RuntimeFault, so they cannot construct executor errors. RuntimeFault::contract keeps 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.rs is the feature-gated revert-oracle witness. The mutation in tests/evidence/m1-c-executor-core/behaviour.oracle.patch maps 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-runtime for 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.