{
  "openapi": "3.1.1",
  "info": {
    "title": "Favorlane API",
    "version": "1.0.0",
    "summary": "Deterministic tools for people and AI agents.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://favorlane.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "Catalog of all tools",
        "responses": {
          "200": {
            "description": "Tool list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/{id}": {
      "get": {
        "operationId": "getTool",
        "summary": "Definition of one tool",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "favorlane-favour-balance",
                "household-chore-rotator",
                "chore-roulette"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/favorlane-favour-balance/calculate": {
      "post": {
        "operationId": "calculateFavorlaneFavourBalance",
        "summary": "Who helped whom? Time-bank balances and the fewest favours that even them out.",
        "description": "Adds up a list of favours (who helped whom, in hours, points or simply favours) like a time bank: what each person gave and received, the balance between every pair, and the shortest list of favours to return so that everyone is even. Deterministic and exact to two decimals.\n\nMethodology:\n- Each line is one favour: the helper gave and the helped person received the amount (1 when none is given). Amounts are summed in hundredths, so results are exact to two decimals.\n- Balance = given − received. The balances always add up to zero: what some gave more, others received more.\n- To even out, the person who received most above what they gave returns favours to the person who gave most, repeatedly (largest first, ties by name). This needs at most one return favour fewer than there are people with an open balance.\n- Like a time bank, every hour counts the same no matter what kind of help it was.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "favorlane_favour_balance",
        "x-owner-app": "favorlane",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FavorlaneFavourBalanceInput"
              },
              "examples": {
                "example1": {
                  "summary": "Neighbours swapping help",
                  "value": {
                    "exchanges": "Ana -\u003e Ben 2 (carried boxes)\nBen -\u003e Ana 1 (fixed the laptop)\nCleo -\u003e Ana 3 (babysitting)\nAna -\u003e Dev 1.5 (garden)\nDev -\u003e Cleo 1 (marmalade swap)",
                    "unit": "hours"
                  }
                },
                "example2": {
                  "summary": "Simple favour count",
                  "value": {
                    "exchanges": "Mia -\u003e Jon\nMia -\u003e Jon\nJon -\u003e Sam\nSam -\u003e Mia",
                    "unit": "favours"
                  }
                },
                "example3": {
                  "summary": "CSV from a spreadsheet",
                  "value": {
                    "exchanges": "from,to,amount\nKarin,Olaf,4\nOlaf,Pia,2\nPia,Karin,1\nPia,Olaf,2",
                    "unit": "points"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FavorlaneFavourBalanceResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/household-chore-rotator/calculate": {
      "post": {
        "operationId": "calculateHouseholdChoreRotator",
        "summary": "Fair chore rotation by effort and availability, with per-person totals and a calendar.",
        "description": "List your recurring chores (daily, weekly, every two weeks or monthly) with how long they take, and who lives with you and on which days they are available. The rotator builds a calendar for up to 12 weeks that balances everyone's minutes (optionally weighted, e.g. half for a child), rotates who does what, shows per-person totals and exports an .ics calendar file.\n\nMethodology:\n- Occurrences: daily chores happen every day; weekly ones once a week on their day; every-2-weeks ones in weeks 1, 3, 5 …; monthly ones every 4 weeks (13 times a year) so they stay on the same weekday. Weeks are counted from the start date.\n- Weekly-type chores without a fixed day are placed on the weekday with the least planned effort so far (that someone is available on), and keep that day.\n- Occurrences are assigned longest chore first (then by date); each goes to an available person with the lowest score = (minutes already assigned + this chore) ÷ capacity + a rotation term of ¼ × chore minutes × (how often this person already did this chore − the least anyone available did it). Ties go to the person listed first. This keeps everyone's effort proportional to their capacity and rotates the chores.\n- Target share = capacity ÷ sum of capacities. Availability limits can make a perfect balance impossible; the totals table shows the actual shares.\n- The .ics file has one all-day event per chore and day (RFC 5545: CRLF line endings, folded lines, stable UIDs derived from the inputs, DTSTAMP = time of calculation).",
        "tags": [
          "home-travel"
        ],
        "x-mcp-tool": "household_chore_rotator",
        "x-owner-app": "hearth",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HouseholdChoreRotatorInput"
              },
              "examples": {
                "example1": {
                  "summary": "Flat share of three, 4 weeks",
                  "value": {
                    "startDate": "2026-10-19",
                    "weeks": 4,
                    "chores": [
                      {
                        "name": "Dishes",
                        "frequency": "daily",
                        "minutes": 15,
                        "day": "any"
                      },
                      {
                        "name": "Vacuum living room",
                        "frequency": "weekly",
                        "minutes": 30,
                        "day": "sat"
                      },
                      {
                        "name": "Clean bathroom",
                        "frequency": "weekly",
                        "minutes": 45,
                        "day": "any"
                      },
                      {
                        "name": "Take out recycling",
                        "frequency": "biweekly",
                        "minutes": 10,
                        "day": "tue"
                      },
                      {
                        "name": "Defrost freezer",
                        "frequency": "monthly",
                        "minutes": 60,
                        "day": "sun"
                      }
                    ],
                    "people": [
                      {
                        "name": "Ana",
                        "days": ""
                      },
                      {
                        "name": "Ben",
                        "days": "Mon-Fri"
                      },
                      {
                        "name": "Chen",
                        "days": "Wed-Sun"
                      }
                    ]
                  }
                },
                "example2": {
                  "summary": "Family with a child at half capacity, 2 weeks",
                  "value": {
                    "startDate": "2026-11-02",
                    "weeks": 2,
                    "chores": [
                      {
                        "name": "Set the table",
                        "frequency": "daily",
                        "minutes": 5,
                        "day": "any"
                      },
                      {
                        "name": "Laundry",
                        "frequency": "weekly",
                        "minutes": 60,
                        "day": "sat"
                      },
                      {
                        "name": "Water plants",
                        "frequency": "weekly",
                        "minutes": 10,
                        "day": "wed"
                      }
                    ],
                    "people": [
                      {
                        "name": "Parent A",
                        "capacity": 1
                      },
                      {
                        "name": "Parent B",
                        "capacity": 1
                      },
                      {
                        "name": "Kid",
                        "capacity": 0.5,
                        "days": "Sat,Sun"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HouseholdChoreRotatorResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/chore-roulette/calculate": {
      "post": {
        "operationId": "calculateChoreRoulette",
        "summary": "Spin a fair chore rota: random but balanced by effort, with a “not again” rule.",
        "description": "Enter the people (with an optional capacity, e.g. 0.5 for a child) and the chores with effort points. Chore Roulette draws a reproducible random assignment that balances everyone’s total effort, can avoid giving anyone the same chore as last week, and shows each person’s load against their fair share.\n\nMethodology:\n- Each chore occurrence is a task with effort points. A person’s fair share is total effort × their capacity ÷ the sum of capacities.\n- The seeded random generator (sfc32 seeded with SHA-256 of the seed) shuffles the tasks and the people; tasks are then handed out largest first to whoever would end up with the lowest load relative to their capacity (ties go to the seeded order).\n- A local search then moves single tasks and swaps pairs whenever that lowers the sum of squared differences between each person’s effort and their fair share, until nothing improves. Moves never give someone a chore they did last week when the rule is on.\n- Fairness = 100 × (1 − Σ|effort − fair share| ÷ (2 × total effort)): the share of the work that sits with the right person. Spread = highest minus lowest effort per full share of capacity.\n- If everyone did a chore last week, a repeat is unavoidable and is reported. Without a seed, the seed is a hash of the inputs, so the same rota appears on the page, in the API and in MCP; change the seed to re-spin.",
        "tags": [
          "fun"
        ],
        "x-mcp-tool": "chore_roulette",
        "x-owner-app": "hearth",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChoreRouletteInput"
              },
              "examples": {
                "example1": {
                  "summary": "Flat share of three",
                  "value": {
                    "people": [
                      {
                        "name": "Alex"
                      },
                      {
                        "name": "Bea"
                      },
                      {
                        "name": "Chris"
                      }
                    ],
                    "chores": [
                      {
                        "chore": "Bathroom",
                        "effort": 4
                      },
                      {
                        "chore": "Kitchen",
                        "effort": 3
                      },
                      {
                        "chore": "Vacuum",
                        "effort": 3
                      },
                      {
                        "chore": "Bins",
                        "effort": 1
                      },
                      {
                        "chore": "Groceries",
                        "effort": 2
                      },
                      {
                        "chore": "Dishes",
                        "effort": 1,
                        "count": 4
                      }
                    ],
                    "lastWeek": [
                      {
                        "chore": "Bathroom",
                        "person": "Alex"
                      },
                      {
                        "chore": "Kitchen",
                        "person": "Bea"
                      }
                    ],
                    "avoidRepeats": true,
                    "seed": "week-42"
                  }
                },
                "example2": {
                  "summary": "Family with a younger child",
                  "value": {
                    "people": [
                      {
                        "name": "Mum"
                      },
                      {
                        "name": "Dad"
                      },
                      {
                        "name": "Mia",
                        "capacity": 1
                      },
                      {
                        "name": "Leo",
                        "capacity": 0.5
                      }
                    ],
                    "chores": [
                      {
                        "chore": "Cook dinner",
                        "effort": 3,
                        "count": 3
                      },
                      {
                        "chore": "Laundry",
                        "effort": 4
                      },
                      {
                        "chore": "Feed the cat",
                        "effort": 0.5,
                        "count": 7
                      },
                      {
                        "chore": "Tidy living room",
                        "effort": 2
                      },
                      {
                        "chore": "Water plants",
                        "effort": 1
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChoreRouletteResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "Multi-tool workflows",
        "responses": {
          "200": {
            "description": "Workflow list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "FavorlaneFavourBalanceInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "exchanges": {
            "title": "Favours (one per line: helper -\u003e helped amount)",
            "description": "For example “Ana -\u003e Ben 2 (carried boxes)” = Ana helped Ben for 2 hours. Without an amount a line counts 1. CSV with from,to,amount works too.",
            "type": "string",
            "maxLength": 200000,
            "default": "Ana -\u003e Ben 2 (carried boxes)\nBen -\u003e Ana 1 (fixed the laptop)\nCleo -\u003e Ana 3 (babysitting)\nAna -\u003e Dev 1.5 (garden)\nDev -\u003e Cleo 1 (marmalade swap)"
          },
          "unit": {
            "title": "Amounts are",
            "type": "string",
            "enum": [
              "hours",
              "points",
              "favours"
            ],
            "default": "hours"
          }
        },
        "required": []
      },
      "FavorlaneFavourBalanceResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "required": [
              "unit",
              "total",
              "people",
              "pairs",
              "settle"
            ],
            "properties": {
              "unit": {
                "enum": [
                  "hours",
                  "points",
                  "favours"
                ]
              },
              "total": {
                "type": "number"
              },
              "exchanges": {
                "type": "integer"
              },
              "people": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "given": {
                      "type": "number"
                    },
                    "received": {
                      "type": "number"
                    },
                    "net": {
                      "type": "number"
                    }
                  }
                }
              },
              "pairs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "a": {
                      "type": "string"
                    },
                    "b": {
                      "type": "string"
                    },
                    "aToB": {
                      "type": "number"
                    },
                    "bToA": {
                      "type": "number"
                    },
                    "net": {
                      "type": "number"
                    }
                  }
                }
              },
              "settle": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "HouseholdChoreRotatorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "startDate": {
            "title": "Start date",
            "description": "Default: today. Weeks are counted from this day.",
            "type": "string",
            "format": "date"
          },
          "weeks": {
            "title": "Weeks to plan",
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "default": 4
          },
          "chores": {
            "title": "Chores",
            "type": "array",
            "minItems": 1,
            "maxItems": 30,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "title": "Chore",
                  "type": "string",
                  "maxLength": 60
                },
                "frequency": {
                  "title": "How often",
                  "type": "string",
                  "enum": [
                    "daily",
                    "weekly",
                    "biweekly",
                    "monthly"
                  ],
                  "default": "weekly"
                },
                "minutes": {
                  "title": "Effort",
                  "type": "number",
                  "minimum": 1,
                  "maximum": 600,
                  "default": 15,
                  "x-unit": "min"
                },
                "day": {
                  "title": "Day",
                  "type": "string",
                  "enum": [
                    "any",
                    "mon",
                    "tue",
                    "wed",
                    "thu",
                    "fri",
                    "sat",
                    "sun"
                  ],
                  "default": "any"
                }
              },
              "required": [
                "name"
              ]
            }
          },
          "people": {
            "title": "People",
            "description": "Available days like Mon-Fri or Sat,Sun (empty = every day). Capacity: 1 = full share, 0.5 = half share (e.g. a child).",
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "title": "Name",
                  "type": "string",
                  "maxLength": 40
                },
                "days": {
                  "title": "Available days",
                  "type": "string",
                  "maxLength": 60
                },
                "capacity": {
                  "title": "Capacity",
                  "type": "number",
                  "minimum": 0.1,
                  "maximum": 3,
                  "default": 1
                }
              },
              "required": [
                "name"
              ]
            }
          }
        },
        "required": [
          "chores",
          "people"
        ]
      },
      "HouseholdChoreRotatorResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "startDate",
              "endDate",
              "weeks",
              "assignments",
              "totals",
              "unassigned",
              "ics"
            ],
            "properties": {
              "startDate": {
                "type": "string",
                "format": "date"
              },
              "endDate": {
                "type": "string",
                "format": "date"
              },
              "weeks": {
                "type": "integer"
              },
              "assignments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "date",
                    "weekday",
                    "week",
                    "chore",
                    "person",
                    "minutes"
                  ],
                  "properties": {
                    "date": {
                      "type": "string"
                    },
                    "weekday": {
                      "type": "string"
                    },
                    "week": {
                      "type": "integer"
                    },
                    "chore": {
                      "type": "string"
                    },
                    "person": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "minutes": {
                      "type": "number"
                    }
                  }
                }
              },
              "totals": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "person",
                    "capacity",
                    "tasks",
                    "minutes",
                    "sharePercent",
                    "targetSharePercent",
                    "minutesPerWeek"
                  ],
                  "properties": {
                    "person": {
                      "type": "string"
                    },
                    "capacity": {
                      "type": "number"
                    },
                    "tasks": {
                      "type": "integer"
                    },
                    "minutes": {
                      "type": "number"
                    },
                    "sharePercent": {
                      "type": "number"
                    },
                    "targetSharePercent": {
                      "type": "number"
                    },
                    "minutesPerWeek": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                }
              },
              "unassigned": {
                "type": "integer",
                "description": "Occurrences on days when nobody is available."
              },
              "ics": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "filename",
                  "events"
                ],
                "properties": {
                  "filename": {
                    "type": "string"
                  },
                  "events": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "ChoreRouletteInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "people": {
            "title": "People",
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "title": "Name",
                  "type": "string",
                  "maxLength": 40
                },
                "capacity": {
                  "title": "Capacity",
                  "description": "1 = a full share; 0.5 = half a share (e.g. a younger child).",
                  "type": "number",
                  "minimum": 0.1,
                  "maximum": 10,
                  "default": 1
                }
              },
              "required": [
                "name"
              ]
            }
          },
          "chores": {
            "title": "Chores",
            "type": "array",
            "minItems": 1,
            "maxItems": 60,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "chore": {
                  "title": "Chore",
                  "type": "string",
                  "maxLength": 60
                },
                "effort": {
                  "title": "Effort points",
                  "description": "E.g. minutes per week, or 1–5 for how unpleasant it is.",
                  "type": "number",
                  "minimum": 0.1,
                  "maximum": 100,
                  "default": 1
                },
                "count": {
                  "title": "Times per week",
                  "description": "Each occurrence is assigned separately (e.g. dishes ×7 shares out the days).",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 14,
                  "default": 1
                }
              },
              "required": [
                "chore"
              ]
            }
          },
          "lastWeek": {
            "title": "Last week (optional)",
            "description": "Who did which chore last week, for the “not again” rule.",
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "chore": {
                  "title": "Chore",
                  "type": "string",
                  "maxLength": 60
                },
                "person": {
                  "title": "Person",
                  "type": "string",
                  "maxLength": 40
                }
              },
              "required": [
                "chore",
                "person"
              ]
            }
          },
          "avoidRepeats": {
            "title": "Avoid giving anyone the same chore as last week",
            "type": "boolean",
            "default": true
          },
          "seed": {
            "title": "Seed (optional)",
            "description": "Same seed + same inputs = same draw. Leave empty to derive it from the inputs; change it (e.g. to the week number) to re-spin.",
            "type": "string",
            "maxLength": 60
          }
        },
        "required": [
          "people",
          "chores"
        ]
      },
      "ChoreRouletteResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "seed",
              "seedDerived",
              "assignments",
              "loads",
              "totalEffort",
              "spread",
              "fairnessPercent",
              "repeats",
              "unavoidableRepeats"
            ],
            "properties": {
              "seed": {
                "type": "string"
              },
              "seedDerived": {
                "type": "boolean"
              },
              "assignments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "chore",
                    "effort",
                    "person",
                    "repeatOfLastWeek"
                  ],
                  "properties": {
                    "chore": {
                      "type": "string"
                    },
                    "effort": {
                      "type": "number"
                    },
                    "person": {
                      "type": "string"
                    },
                    "repeatOfLastWeek": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "loads": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "person",
                    "capacity",
                    "effort",
                    "target",
                    "share",
                    "chores",
                    "deviation"
                  ],
                  "properties": {
                    "person": {
                      "type": "string"
                    },
                    "capacity": {
                      "type": "number"
                    },
                    "effort": {
                      "type": "number"
                    },
                    "target": {
                      "type": "number"
                    },
                    "share": {
                      "type": "number"
                    },
                    "chores": {
                      "type": "integer"
                    },
                    "deviation": {
                      "type": "number"
                    }
                  }
                }
              },
              "totalEffort": {
                "type": "number"
              },
              "spread": {
                "type": "number",
                "description": "Max − min of effort ÷ capacity, i.e. points per full share (0 = perfectly even)."
              },
              "fairnessPercent": {
                "type": "number",
                "description": "100 × (1 − Σ|effort − fair share| ÷ (2 × total effort)); 100 = everyone exactly at their fair share."
              },
              "repeats": {
                "type": "integer"
              },
              "unavoidableRepeats": {
                "type": "integer"
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}