refactor: replace OpsProducer pipeline with assembler registry#309
Merged
Conversation
- Remove AssemblerMeta.resolve_params in favor of Step.get_assembler_kwargs() - Replace step.assembler_name/assembler_params with ASSEMBLER_NAME ClassVar and real typed attributes on each Step subclass - Add MachineDefaults dataclass wired through the pipeline - Thread Step through pipeline instead of separate assembler_name/params - Add AssemblerRegistry with _register_laser_assemblers fallback for workers - Make task_mgr a required parameter on AddonManager, passed at construction so _build_and_update_manifest always finds shared_state - Remove set_task_manager method (redundant with constructor parameter) - Remove _ensure_assemblers_registered conftest fixture (assembler registry fallback handles it) - Step.from_dict dispatches via step_registry; workers get addon manifest through shared_state automatically - Remove _STEP_TYPE_TO_ASSEMBLER hack from compute_workpiece_artifact - Add to_dict/from_dict roundtrip and get_assembler_kwargs tests for all step subclasses - Clean up pipeline test args indices (args[7] -> args[5]) - Remove addon imports from core pipeline tests
- Add orchestration ClassVars to Step base (IS_VECTOR, SPLIT_CONTOURS, SET_POWER, NORMALIZE_WINDINGS, ALWAYS_WRAP, SECTION_TYPE) and override on each Step subclass - replaces AssemblerMeta fields - Delete AssemblerMeta class entirely; AssemblerRegistry becomes a plain name -> Callable map with no param_keys filtering - Add set_step_property() helper to StepComponentSettingsWidget base for undoable step attribute writes via ChangePropertyCommand - Migrate contour, frame, shrinkwrap, wavefront, and raster widgets to read/write step attributes directly instead of opsproducer_dict - Add override_threshold, threshold to ContourStep and dither_algorithm to EngraveStep (previously only on producers) - Fix Step.from_dict to delegate to step_class.from_dict(data) so subclass attributes are deserialized correctly - Remove _register_laser_assemblers() hardcoded fallback from registry (consistent with ProducerRegistry/StepRegistry pattern) - Simplify all assembler registration calls (no AssemblerMeta wrapper) - ShrinkWrapStep imports prepare_surface directly from rayforge.image - Fix UnboundLocalError from local logger shadowing module-level logger
- Delete all producer files: OpsProducer, ProducerRegistry, PlaceholderProducer, and all 6 laser producer implementations (contour, frame, shrinkwrap, raster, wavefront, material_test_grid) - Remove register_producers hook spec, registration table entry, and all implementations (laser_worker, sketcher) - Move CutSide/CutOrder enums to rayforge/core/cut_side.py - Migrate material test widget + command to step attributes (no more opsproducer_dict or producer parameters) - Widget frontend passes 4 args (editor, title, page, step) — no more producer arg - Base class makes component parameter optional with default None - Add missing_step_types property to Doc (replaces missing_producer_types) - Clean up all remaining OpsProducer/opsproducer_dict/producer_registry references across tests, scripts, and hooks
Re-implement bidirectional raster scan X-offset calibration feature from main in the new assembler/step architecture (producers were deleted in this branch): - EngraveStep: add bidir_x_offset_mm attribute with serialization - MaterialTestStep: add offset_range attribute, pass min/max_offset to assembler, add SPEED_VS_OFFSET grid mode support - material_test_helpers: add SPEED_VS_OFFSET to GridMode enum, pass min/max_offset to draw_preview - material_test_cmd: add offset_range to _PARAM_KEYS for preview sync - raster_widget: read bidir_x_offset_mm from self.step (not producer) - material_test_grid_widget: read offset_range from self.step, fix offset handlers to use tuple signature of _update_range_param - workpiece_stage: read bidir_x_offset_mm from step.to_dict() via setdefault instead of deleted opsproducer_dict - Add BidirScanOffsetTransformer and tests from main (unchanged) - Update tests for new architecture (no opsproducer_dict references)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Replaces the old OpsProducer-based pipeline with a new assembler registry architecture driven by Step subclasses.
Key changes
Tests