{
  "title": "The Carnitas Algorithm",
  "author": "Ana Lopez",
  "location": "Pleasanton, Texas",
  "version": "1.0.0",
  "date": "2026-07-18",
  "description": "Deterministic procedure for transforming pork shoulder into carnitas via controlled lard-bath thermodynamics",
  "constants": {
    "target_temp_f": 195,
    "target_temp_c": 90.5,
    "simmer_range_f": [185, 205],
    "crisp_range_f": [325, 375],
    "thermal_mass_coefficient": 1.8,
    "conduction_rate_per_kg": 2.4,
    "default_ramp_duration_min": 15,
    "crisp_phase_duration_min": 30,
    "rest_phase_duration_min": 12,
    "yield_retention": 0.72,
    "render_rate_g_per_min_per_kg_at_350F": 0.8
  },
  "formulas": {
    "total_simmer_minutes": "(195 - T_initial_F) × 1.8 + mass_kg × 2.4",
    "lard_requirement_kg": "mass_kg × fat_ratio (0.35–0.65)",
    "final_yield_kg": "mass_kg × 0.72",
    "fat_loss_kg": "mass_kg × 0.28"
  },
  "stages": [
    {
      "name": "Alpha",
      "phase": "Submersion",
      "duration_min": 90,
      "temperature_f": [185, 205],
      "process": "Collagen hydrolysis initiation, moisture retention"
    },
    {
      "name": "Beta",
      "phase": "The Ramp",
      "duration_min": 15,
      "temperature_f": [205, 350],
      "process": "Controlled ascent preventing case-hardening"
    },
    {
      "name": "Gamma",
      "phase": "Crisping",
      "duration_min": 30,
      "temperature_f": [350, 375],
      "process": "Surface dehydration, Maillard cascade activation"
    },
    {
      "name": "Delta",
      "phase": "The Rest",
      "duration_min": 12,
      "temperature_f": "ambient",
      "process": "Protein matrix equilibration, juice redistribution"
    }
  ],
  "failure_modes": [
    {"code": "E-01", "symptom": "Rubbery texture", "cause": "Insufficient Alpha stage time", "correction": "+30 min simmer"},
    {"code": "E-02", "symptom": "Dry interior", "cause": "Ramp rate >15°F/min", "correction": "Extend ramp to 25 min"},
    {"code": "E-03", "symptom": "Uneven crisp", "cause": "Fat level below meat surface", "correction": "Add lard to cover"},
    {"code": "E-04", "symptom": "Burnt exterior", "cause": "Gamma >375°F", "correction": "Reduce to 340°F, monitor"}
  ],
  "sources": {
    "offal": "https://4ort.xyz/entity/Q157484",
    "lard": "https://4ort.xyz/entity/Q72827",
    "simmering": "https://4ort.xyz/entity/Q240164",
    "collagen_denaturation_threshold": "USDA Food Safety Database",
    "maillard_window": "Journal of Agricultural and Food Chemistry"
  },
  "integration": {
    "feeds_into": "comida-calculator.html",
    "fed_by": "lard-render.html",
    "outputs_protein_mass_for": "feast_planning_engine"
  }
}
