Commit Graph

2 Commits

Author SHA1 Message Date
rob 7256b54719 Address shop-packet review (consistency, determinism, validation, jigs)
- One active CutPlan: the BOM window holds self._plan; Cut List, Shopping,
  Instructions, and Cut Layout all render from it (no more "shopping says 3 sticks
  while the optimized layout uses 2"). _set_plan/_refresh_all keep them in sync.
- Unplaced/oversize parts now appear in the Shopping list ("Won't fit standard
  stock — source/cut specially"), not just a layout warning.
- Process-stable shuffle ordering via hashlib (built-in hash() is salted per run).
- Kerf-gap validation: placement_fits/validate now reject pieces closer than a
  kerf (not just overlap beyond a kerf).
- Manual edits: drop checks stock-type compatibility (no 2x4 onto a plywood
  sheet); waste regions + score recompute after every move/rotate/lock; rotation
  respects allow_plywood_rotation/grain and validate flags illegal rotation.
- Jig specificity: holes/mortises grouped by face + position + size (not just
  cutter size), so a registration template is only suggested when the position
  actually repeats.

125 tests pass; verified offscreen that Shopping tracks the optimized plan and
unplaced parts surface. Phase 1 noted as partial in SHOP_PACKET_PLAN.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 15:11:02 -03:00
rob ee00ec7ce5 Phase 3: jig suggestions (rule-based detection + AI explanation)
jigs.py: detect repeated operations deterministically and propose shop aids with
COMPUTED dimensions — stop block (repeated identical crosscuts, e.g. 10× a length),
drilling template (repeated hole diameters), mortise template (repeated mortises),
rip-fence setting (repeated panel widths). Jigs are shop aids kept SEPARATE from
the project BOM (no silent material adds). explain_prompt() lets the AI describe
build/use without changing any dimension.

BOM window gains a Jigs tab: deterministic suggestions + "Explain jigs (AI)"
(background claude) + Print.

116 tests pass (10× crosscut -> stop block, below-threshold -> none, repeated
holes/mortises -> templates).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 14:41:58 -03:00