{
  "openapi": "3.1.1",
  "info": {
    "title": "Mindquarry 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://mindquarry.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": [
                "mindquarry-schulte-table",
                "mindquarry-n-back-sequence",
                "mindquarry-matrix-puzzle",
                "mindquarry-reaction-stats"
              ]
            }
          }
        ],
        "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/mindquarry-schulte-table/calculate": {
      "post": {
        "operationId": "calculateMindquarrySchulteTable",
        "summary": "Printable Schulte tables from 3 × 3 to 9 × 9: shuffled numbers to find in order, as SVG.",
        "description": "Makes Schulte tables — grids of the numbers 1 to N² in random order that you find and point at in ascending order — as printable SVG files in millimetres, plus the number layout of every table. The same seed always gives the same tables, so a group can practise on identical sheets. The tables are the same ones Mindquarry uses in its Schulte exercise.\n\nMethodology:\n- Each table holds the numbers 1 … N² once, shuffled with a Fisher–Yates shuffle driven by a seeded sfc32 generator; table k uses the seed “\u003cseed\u003e|\u003ck\u003e”, so the same seed and size always give the same tables.\n- How to use a table: look at the centre, then find and point at 1, 2, 3 … as quickly as you can without errors; time yourself and compare only with your own earlier times on the same table size.\n- The SVG files use millimetre units (cell size × N wide) and print at true size from a browser or vector editor; black lines and numbers on white.\n\nPractising these tasks makes you better at these tasks; it does not prove that memory, intelligence or everyday life improve.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "mindquarry_schulte_table",
        "x-owner-app": "mindquarry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MindquarrySchulteTableInput"
              },
              "examples": {
                "example1": {
                  "summary": "Three classic 5 × 5 tables",
                  "value": {
                    "size": 5,
                    "count": 3,
                    "seed": "mindquarry"
                  }
                },
                "example2": {
                  "summary": "One small 3 × 3 table for a first try",
                  "value": {
                    "size": 3,
                    "count": 1,
                    "cellMm": 25,
                    "seed": "first"
                  }
                },
                "example3": {
                  "summary": "Four 7 × 7 tables with 14 mm cells",
                  "value": {
                    "size": 7,
                    "count": 4,
                    "cellMm": 14,
                    "seed": "week-48"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MindquarrySchulteTableResult"
                }
              }
            }
          },
          "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/mindquarry-n-back-sequence/calculate": {
      "post": {
        "operationId": "calculateMindquarryNBackSequence",
        "summary": "N-back stimulus lists with an exact number of targets and lures, and a CSV answer key.",
        "description": "Builds the item list for an n-back task: positions on a 3 × 3 grid, digits or shapes, with an exact number of targets (the item equals the one N steps back) and optional lures (equal to the item N−1 or N+1 back, a common source of false alarms). Every item is checked so that no accidental targets or lures sneak in. The result is the answer key as a table and CSV — the same generator Mindquarry uses for its n-back exercise.\n\nMethodology:\n- Targets: round(target share × (items − N)) positions after the first N items are drawn at random; a target copies the item N steps back.\n- Lures: drawn from the remaining positions; a lure copies the item N−1 or N+1 back but never equals the item N back. If no such value is free at a position, the lure moves to the next free position.\n- Every other item (a filler) is drawn from the stimuli that are neither N back nor N±1 back, so the key never contains accidental targets or lures; the counts in the result are recounted from the final list.\n- Randomness comes from a seeded sfc32 generator, so the same inputs always give the same sequence.\n\nPractising these tasks makes you better at these tasks; it does not prove that memory, intelligence or everyday life improve.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "mindquarry_n_back_sequence",
        "x-owner-app": "mindquarry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MindquarryNBackSequenceInput"
              },
              "examples": {
                "example1": {
                  "summary": "2-back, 30 positions, 30 % targets, 10 % lures",
                  "value": {
                    "n": 2,
                    "length": 30,
                    "targetPercent": 30,
                    "lurePercent": 10,
                    "stimuli": "positions"
                  }
                },
                "example2": {
                  "summary": "3-back digits without lures",
                  "value": {
                    "n": 3,
                    "length": 40,
                    "targetPercent": 25,
                    "lurePercent": 0,
                    "stimuli": "digits",
                    "seed": "digits-3"
                  }
                },
                "example3": {
                  "summary": "1-back shapes for a warm-up",
                  "value": {
                    "n": 1,
                    "length": 20,
                    "targetPercent": 30,
                    "lurePercent": 10,
                    "stimuli": "shapes",
                    "seed": "warm-up"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MindquarryNBackSequenceResult"
                }
              }
            }
          },
          "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/mindquarry-matrix-puzzle/calculate": {
      "post": {
        "operationId": "calculateMindquarryMatrixPuzzle",
        "summary": "Generate a 3 × 3 figure-matrix puzzle with 8 options and a checked, unique answer.",
        "description": "Builds a 3 × 3 matrix of figures whose last cell is missing, in the style of progressive-matrix puzzles: shape, number, fill and size follow rules along the rows (constant, step-by-step progression or each value once per row). Eight answer options are generated and the puzzle is only returned when an independent check finds exactly one option that fits every reading of the rules. Returns the puzzle as SVG, the answer, and the rules in plain words. These are practice puzzles, not an intelligence test.\n\nMethodology:\n- Attributes: shape (circle, square, triangle), number (1–3), fill (outline, striped, solid) and size (small, medium, large). Level 1–2 vary one attribute, 3–4 two, 5–7 three, 8–10 all four; “each value once per row” (a Latin square) appears from level 2 (alone) and from level 4.\n- Rules per attribute: the same within each row (rows may differ), a progression by one step from left to right, or each of the three values once per row. Attributes that do not vary are the same in every cell.\n- Uniqueness check: for every attribute, each reading that fits the 8 visible cells — constant, progression with steps −2 … +2 or each value once, read along rows AND along columns — predicts the missing value; all readings must agree. Exactly one of the 8 distinct options may match the prediction; otherwise the puzzle is rebuilt.\n- Wrong options change one (later two) attributes of the right answer, mostly attributes that vary, so they cannot be spotted by ignoring the pattern.\n\nPractice puzzles only: they are not a validated test and give no IQ or ability score. Practising these tasks makes you better at these tasks; it does not prove that memory, intelligence or everyday life improve.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "mindquarry_matrix_puzzle",
        "x-owner-app": "mindquarry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MindquarryMatrixPuzzleInput"
              },
              "examples": {
                "example1": {
                  "summary": "Medium puzzle (level 5)",
                  "value": {
                    "level": 5,
                    "seed": "mindquarry"
                  }
                },
                "example2": {
                  "summary": "Easy puzzle with the answer marked",
                  "value": {
                    "level": 1,
                    "seed": "easy",
                    "showAnswer": true
                  }
                },
                "example3": {
                  "summary": "Hard puzzle (level 10)",
                  "value": {
                    "level": 10,
                    "seed": "hard-1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MindquarryMatrixPuzzleResult"
                }
              }
            }
          },
          "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/mindquarry-reaction-stats/calculate": {
      "post": {
        "operationId": "calculateMindquarryReactionStats",
        "summary": "Mean, median, SD and outlier-trimmed reaction times from a pasted list of milliseconds.",
        "description": "Paste reaction times (from Mindquarry, a lab task, a game or a stopwatch) and get the raw mean, median, standard deviation and percentiles, plus the three common ways to deal with outliers side by side: fixed cut-offs for anticipations and lapses, mean ± k standard deviations, and median ± k scaled median absolute deviations, and a trimmed mean. Every value is flagged with the rule that removed it.\n\nMethodology:\n- Raw statistics use every value: mean, median and percentiles (linear interpolation between order statistics, “type 7”), sample standard deviation (n − 1) and coefficient of variation (SD / mean).\n- Absolute cut-offs first remove anticipations (faster than the lower limit) and lapses (slower than the upper limit). The SD rule, the MAD rule and the trimmed mean all start from the values inside these limits.\n- SD rule: keep values within mean ± k × SD. MAD rule: keep values within median ± k × 1.4826 × MAD (median absolute deviation, scaled to match the SD for normal data); it is not pulled by the outliers it is meant to find (Leys et al. 2013).\n- Trimmed mean: sort, drop floor(n × share) values from each end, average the rest. Reaction-time distributions are right-skewed, so the median and trimmed means are usually more representative than the plain mean (Ratcliff 1993).\n\nDescriptive statistics of your own numbers only; no comparison with population norms and no medical or diagnostic meaning.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "mindquarry_reaction_stats",
        "x-owner-app": "mindquarry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MindquarryReactionStatsInput"
              },
              "examples": {
                "example1": {
                  "summary": "20 simple reaction times with an anticipation and two lapses",
                  "value": {
                    "times": "412 388 455 401 367 1290 395 420 140 433\n398 377 409 441 386 392 415 2405 404 399"
                  }
                },
                "example2": {
                  "summary": "Values in seconds with a decimal comma",
                  "value": {
                    "times": "0,412\n0,388\n0,455\n0,401\n0,367\n0,980\n0,395",
                    "unit": "s",
                    "decimalComma": true
                  }
                },
                "example3": {
                  "summary": "Stricter rules (2 SD, 2.5 MAD, 20 % trimmed)",
                  "value": {
                    "times": "412 388 455 401 367 1290 395 420 140 433\n398 377 409 441 386 392 415 2405 404 399",
                    "sdK": 2,
                    "madK": 2.5,
                    "trimPercent": 20
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MindquarryReactionStatsResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "MindquarrySchulteTableInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "size": {
            "title": "Table size (N × N)",
            "type": "integer",
            "minimum": 3,
            "maximum": 9,
            "default": 5
          },
          "count": {
            "title": "Number of tables",
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "default": 3
          },
          "cellMm": {
            "title": "Cell size",
            "description": "20 mm cells make a 5 × 5 table 10 cm wide.",
            "type": "number",
            "minimum": 8,
            "maximum": 40,
            "default": 20,
            "x-unit": "mm"
          },
          "seed": {
            "title": "Seed (same seed = same tables)",
            "type": "string",
            "maxLength": 64,
            "default": "mindquarry"
          },
          "showTitle": {
            "title": "Print a title above each table",
            "type": "boolean",
            "default": true
          }
        },
        "required": []
      },
      "MindquarrySchulteTableResult": {
        "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": [
              "size",
              "count",
              "seed",
              "widthMm",
              "tables"
            ],
            "properties": {
              "size": {
                "type": "integer"
              },
              "count": {
                "type": "integer"
              },
              "seed": {
                "type": "string"
              },
              "widthMm": {
                "type": "number"
              },
              "tables": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "n",
                    "seed",
                    "rows",
                    "svg"
                  ],
                  "properties": {
                    "n": {
                      "type": "integer"
                    },
                    "seed": {
                      "type": "string"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "integer"
                        }
                      }
                    },
                    "svg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "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"
              }
            }
          }
        }
      },
      "MindquarryNBackSequenceInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "n": {
            "title": "N (steps back)",
            "type": "integer",
            "minimum": 1,
            "maximum": 9,
            "default": 2
          },
          "length": {
            "title": "Number of items",
            "type": "integer",
            "minimum": 5,
            "maximum": 500,
            "default": 30
          },
          "targetPercent": {
            "title": "Targets",
            "description": "Share of the items after the first N that are targets.",
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "default": 30,
            "x-unit": "%"
          },
          "lurePercent": {
            "title": "Lures",
            "description": "Items equal to the one N−1 or N+1 back (but not N back). With N = 1 only N+1 lures exist.",
            "type": "number",
            "minimum": 0,
            "maximum": 30,
            "default": 10,
            "x-unit": "%"
          },
          "stimuli": {
            "title": "Stimuli",
            "type": "string",
            "enum": [
              "positions",
              "digits",
              "shapes"
            ],
            "default": "positions"
          },
          "seed": {
            "title": "Seed (same seed = same sequence)",
            "type": "string",
            "maxLength": 64,
            "default": "mindquarry"
          }
        },
        "required": []
      },
      "MindquarryNBackSequenceResult": {
        "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": [
              "n",
              "length",
              "stimuli",
              "seed",
              "scorable",
              "targets",
              "lures",
              "items",
              "csv"
            ],
            "properties": {
              "n": {
                "type": "integer"
              },
              "length": {
                "type": "integer"
              },
              "stimuli": {
                "enum": [
                  "positions",
                  "digits",
                  "shapes"
                ]
              },
              "seed": {
                "type": "string"
              },
              "scorable": {
                "type": "integer"
              },
              "targets": {
                "type": "integer"
              },
              "lures": {
                "type": "integer"
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "index",
                    "value",
                    "stimulus",
                    "target",
                    "lure"
                  ],
                  "properties": {
                    "index": {
                      "type": "integer"
                    },
                    "value": {
                      "type": "integer"
                    },
                    "stimulus": {
                      "type": "string"
                    },
                    "target": {
                      "type": "boolean"
                    },
                    "lure": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "csv": {
                "type": "string"
              }
            }
          },
          "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"
              }
            }
          }
        }
      },
      "MindquarryMatrixPuzzleInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "level": {
            "title": "Difficulty (1–10)",
            "description": "Higher levels vary more attributes at once and use the “each value once per row” rule.",
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "default": 5
          },
          "seed": {
            "title": "Seed (same seed = same puzzle)",
            "type": "string",
            "maxLength": 64,
            "default": "mindquarry"
          },
          "showAnswer": {
            "title": "Mark the answer in the picture",
            "type": "boolean",
            "default": false
          }
        },
        "required": []
      },
      "MindquarryMatrixPuzzleResult": {
        "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": [
              "level",
              "seed",
              "cells",
              "options",
              "answer",
              "rules",
              "verified",
              "svg"
            ],
            "properties": {
              "level": {
                "type": "integer"
              },
              "seed": {
                "type": "string"
              },
              "cells": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Descriptions of the 8 visible cells, row by row."
              },
              "options": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "n",
                    "description",
                    "shape",
                    "count",
                    "fill",
                    "size"
                  ],
                  "properties": {
                    "n": {
                      "type": "integer"
                    },
                    "description": {
                      "type": "string"
                    },
                    "shape": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "fill": {
                      "type": "string"
                    },
                    "size": {
                      "type": "string"
                    }
                  }
                }
              },
              "answer": {
                "type": "integer",
                "description": "Number (1–8) of the correct option."
              },
              "rules": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "verified": {
                "type": "boolean"
              },
              "svg": {
                "type": "string"
              }
            }
          },
          "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"
              }
            }
          }
        }
      },
      "MindquarryReactionStatsInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "times": {
            "title": "Reaction times",
            "description": "One value per line or separated by spaces, commas, tabs or semicolons.",
            "type": "string",
            "maxLength": 400000,
            "default": "412 388 455 401 367 1290 395 420 140 433\n398 377 409 441 386 392 415 2405 404 399"
          },
          "unit": {
            "title": "Unit of the values",
            "type": "string",
            "enum": [
              "ms",
              "s"
            ],
            "default": "ms"
          },
          "decimalComma": {
            "title": "Values use a decimal comma (0,412)",
            "type": "boolean",
            "default": false
          },
          "minMs": {
            "title": "Faster than this is an anticipation",
            "type": "number",
            "minimum": 0,
            "maximum": 2000,
            "default": 150,
            "x-unit": "ms"
          },
          "maxMs": {
            "title": "Slower than this is a lapse",
            "type": "number",
            "minimum": 100,
            "maximum": 60000,
            "default": 3000,
            "x-unit": "ms"
          },
          "sdK": {
            "title": "SD rule: mean ± k × SD, k =",
            "type": "number",
            "minimum": 1,
            "maximum": 5,
            "default": 2.5
          },
          "madK": {
            "title": "MAD rule: median ± k × MAD, k =",
            "type": "number",
            "minimum": 1,
            "maximum": 5,
            "default": 3
          },
          "trimPercent": {
            "title": "Trimmed mean: cut from each end",
            "type": "number",
            "minimum": 0,
            "maximum": 45,
            "default": 10,
            "x-unit": "%"
          }
        },
        "required": []
      },
      "MindquarryReactionStatsResult": {
        "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": [
              "n",
              "skipped",
              "raw",
              "absolute",
              "sdRule",
              "madRule",
              "trimmedMean",
              "values"
            ],
            "properties": {
              "n": {
                "type": "integer"
              },
              "skipped": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "raw": {
                "type": "object"
              },
              "absolute": {
                "type": "object"
              },
              "sdRule": {
                "type": "object"
              },
              "madRule": {
                "type": "object"
              },
              "trimmedMean": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "values": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "index",
                    "ms",
                    "flags"
                  ],
                  "properties": {
                    "index": {
                      "type": "integer"
                    },
                    "ms": {
                      "type": "number"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}