schema_version: "wall_module_v0.1"

units:
  length: "in"   # internal canonical unit
  display: "ft-in"

module:
  id: "WM-EX-001"
  type: "wall_panel"
  nominal_thickness_in: 5.5            # 2x6 actual
  width_in: 48                         # user-selectable: 24..96 recommended
  height_in: 120                       # user-selectable: >= 96 recommended
  stud_spacing_oc_in: 24
  framing_lumber: "2x6"
  plates:
    top_plate_count: 2                 # typical double top
    bottom_plate_count: 1
  sheathing:
    side: "A"                          # sheathing on one face, A or B
    material: "OSB"
    thickness_in: 0.4375               # 7/16
    sourcing_policy:
      preferred_sheet_width_in: 48
      preferred_sheet_heights_in: [96, 108, 120]  # 8', 9', 10'
      rule:
        # described in English below; compiler implements deterministically
        strategy: "single_sheet_if_possible_else_96_plus_rip"

openings:
  # zero or more
  - id: "W1"
    type: "window"
    centered_in_module: false          # user controls placement if not centered
    rough_opening:
      width_in: 36
      height_in: 48
    sill_height_from_bottom_in: 36
    x_from_left_in: 6                  # left edge of RO from left plate
    header:
      type: "flush_built"
      members: 2
      lumber: "2x12"
      bias_to_face: "A"                # "A" face per your requirement
      fastener_schedule: "nail-laminate-default"
    framing_rules:
      trimmers_each_side: 1            # jack studs each side
      king_studs_each_side: 1
      cripple_above_header: "auto_to_top_plate"
      cripple_below_sill: "auto_to_bottom_plate"

  - id: "D1"
    type: "door"
    centered_in_module: true           # door centered for single door modules
    allowed_module_widths_in: [48]     # enforce unless double door
    rough_opening:
      width_in: 36
      height_in: 80
    x_from_left_in: null               # null means compiler centers it
    header:
      type: "flush_built"
      members: 2
      lumber: "2x12"
      bias_to_face: "A"
      fastener_schedule: "nail-laminate-default"
    framing_rules:
      trimmers_each_side: 1
      king_studs_each_side: 1
      cripple_above_header: "auto_to_top_plate"
      threshold_detail: "bottom_plate_removed_under_RO"  # common door framing
      spacers: "auto_if_needed"

manufacturing:
  cut_optimization:
    allow_splices: false               # framing members are full-length unless constrained
    waste_priority: "medium"
  naming:
    face_A_definition: "sheathing_face"
  tolerances:
    framing_length_in: 0.0625          # +/- 1/16 typical cut tolerance target
  outputs:
    generate:
      - "framing_elevation_face_A"
      - "framing_elevation_face_B"
      - "osb_cut_plan"
      - "cut_list"
      - "bom"
      - "assembly_notes"

