{
  "schemaVersion": 1,
  "slug": "pomodoro-calculator",
  "category": "productivity",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "89db800c3c6b91a61f06f4e0ec72fbeb14a86f148d4b02f5d7ef90d895bf97cc",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/pomodoro-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "T = kw + (k − 1 − ⌊k ÷ e⌋) × b_s + ⌊k ÷ e⌋ × b_l",
    "vars": [
      [
        "T",
        "Total time (min)"
      ],
      [
        "k",
        "Pomodoros"
      ],
      [
        "w",
        "Work interval (min)"
      ],
      [
        "b_s",
        "Short break (min)"
      ],
      [
        "b_l",
        "Long break (min)"
      ],
      [
        "e",
        "Long break every n"
      ]
    ],
    "note": "Finish = start + T ÷ 60 (mod 24); efficiency = kw ÷ T × 100."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const longBreaks = Math.floor((pomodoros-1)/(longBreakEvery || 4)); const shortBreaks = Math.max(0, pomodoros-1-longBreaks); const focusMinutes = pomodoros*workMinutes; const breakMinutes = shortBreaks*shortBreak+longBreaks*longBreak; const totalMinutes = focusMinutes+breakMinutes; const finish = startTime+totalMinutes/60; return { focusMinutes, breakMinutes, totalMinutes, finishTime: ((finish%24)+24)%24, longBreaks, efficiency: totalMinutes > 0 ? focusMinutes/totalMinutes*100 : 0 };",
    "inputs": [
      {
        "name": "pomodoros",
        "type": "number",
        "default": 8,
        "min": 1,
        "max": 40,
        "step": 1,
        "slider": true
      },
      {
        "name": "workMinutes",
        "type": "number",
        "default": 25,
        "min": 5,
        "max": 120,
        "step": 5,
        "slider": true
      },
      {
        "name": "shortBreak",
        "type": "number",
        "default": 5,
        "min": 1,
        "max": 30,
        "step": 1,
        "slider": true
      },
      {
        "name": "longBreak",
        "type": "number",
        "default": 15,
        "min": 5,
        "max": 120,
        "step": 5,
        "slider": true
      },
      {
        "name": "longBreakEvery",
        "type": "number",
        "default": 4,
        "min": 2,
        "max": 12,
        "step": 1,
        "slider": true
      },
      {
        "name": "startTime",
        "type": "number",
        "default": 9,
        "min": 0,
        "max": 23.99,
        "step": 0.25,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "focusMinutes",
        "precision": 0,
        "unit": "min"
      },
      {
        "name": "breakMinutes",
        "precision": 0,
        "unit": "min"
      },
      {
        "name": "totalMinutes",
        "precision": 0,
        "unit": "min"
      },
      {
        "name": "finishTime",
        "precision": 2,
        "unit": "h"
      },
      {
        "name": "longBreaks",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "efficiency",
        "precision": 1,
        "unit": "%"
      }
    ],
    "interpret": null
  }
}
