Lk dev #21

Merged
likang merged 11 commits from lk_dev into main 2026-09-09 18:52:28 +08:00
Owner
No description provided.
likang added 11 commits 2026-09-09 18:52:18 +08:00
Phase 1 of the decoupling refactor (behavior-preserving move):
- specs.py: vector math, plane/axis helpers, parametric feature specs
- topology.py: diagnostics, planning contracts, TopologyRegistry
- runtime_types.py: compatibility shim re-exporting all public names

No behavior change; all historical import paths keep working.
Phase 2 of the decoupling refactor (behavior-preserving move):
- runtime_base.py: RuntimeExecutionError, FeatureExecutionError, ExtentVector
- session.py: GeometryAdapter protocol + ExecutionSession
- extents.py: end-condition planning (_extent_vectors family)
- pattern_transform.py: translate/mirror/rotate replay parameter algebra
- runtime.py: keeps executors + registry + entry points; re-exports all
  moved names (incl. test-referenced privates) for import stability

No behavior change; verified against baseline (zero new failures).
Phase 3 of the decoupling refactor (behavior-preserving):
- registry.py: atomic_executor decorator, ALL_ATOMIC_IDS with
  fail-fast registration validation, execute_node dispatcher
- executors/: one module per family (extrude, revolve, surfaces,
  loft_sweep, bodies, context, primitives, parametric, holes,
  dressup, patterns) + shared helpers in executors/common
- executors/__init__: explicit aggregation + completeness check
  (registry must cover every declared atomic id at import time)
- runtime.py: slimmed to entry points (analyze_cdsl/rebuild_cdsl)
  plus full historical re-exports incl. test-referenced privates

Adding an atomic operation now touches only one executor module and
its schema contract; the shared registry never changes. Verified
against baseline: zero new failures.
Phase 4 of the decoupling refactor (behavior-preserving):
- profile_schema.json: every operation contract now carries
  runtime_capability {body_mutating, requires_active_body,
  replayable, requires_selector, open_profile_ok} (single source of truth)
- operation_contracts.py: validates and forwards the flags
- capabilities.py: the five data-classification frozensets are now
  derived from the schema at import time; dispatch-logic sets
  (_HOLE_ATOMICS, _PATTERN_ATOMICS, extent constants) stay in code
- test_profile_schema.py: completeness + structural invariants test

Equivalence proven by flag counts (27/13/25/6/2) matching the previous
hand-written sets and by the unchanged test-baseline failure set.
Phase 5 of the decoupling refactor (behavior-preserving move):
- translator/ir.py: SolidWorks plugin JSON to backend-IR conversion (70 syms)
- translator/codegen.py: backend IR to build123d source generation (64 syms)
- translator/runtime_lib.py: frozen generated-script runtime library,
  spliced into generate_build123d_code as *RUNTIME_LIB_LINES
- translator/common.py: helpers shared by both sides
- translator/__init__.py: full historical symbol surface re-exported

Generated-code equivalence verified byte-for-byte against the pre-split
output for a representative IR sample; py_compile clean.
Phase 7 of the decoupling refactor (behavior-preserving move):
- legacy/llm_compiler.py, legacy/llm_engine.py: frozen build_pack path
  (unused by run_cdsl_only), moved with git mv for history
- legacy/exact_rebuild.py: _run_parameterized / _run_exact /
  _apply_geometric_compensations moved out of rebuild.py, including
  the part-specific compensation table
- rebuild.py keeps run_rebuild / run_cdsl_only / compare_with_gold and
  imports the moved functions
- llm_compiler.py / llm_engine.py become compatibility shims

Frozen zone: new capability belongs in executors/ + schema contracts.
The project-specific compensation no longer sits in the main pipeline.
Phase 8: README now maps every module of the split package, documents
the executor registration + schema-contract workflow for new atomic
operations, and restates the schema maintenance rule for executors/.
Phase 6 of the decoupling refactor (behavior-preserving move):
- topology_export.py: body_geometry / surface_geometry / topology_records
  (~290 lines) moved verbatim out of build123d_adapter.py as module-level
  functions; includes the circle_center_mm/radius_mm concentric-circle
  evidence added by the lk_dev integration
- build123d_adapter.py: the three methods are now one-line forwards, so
  kernel construction and topology evidence export live in separate files
  and can evolve independently

No protocol change (GeometryAdapter untouched). Verified by:
- golden comparison: full-corpus analyze (2881 docs) + 12 complete
  rebuilds -- zero field differences vs f79c287
- full test suite: 435 tests, failure set identical to baseline
# Conflicts:
#	backend/app/cad_agent/domain/operation_contract.py
#	backend/engine/cdsl_engine/runtime.py
#	backend/engine/cdsl_engine/runtime_types.py
#	backend/engine/cdsl_engine/semantic_validation.py
likang merged commit adafac9f08 into main 2026-09-09 18:52:28 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: likang/cdsl-cad#21