hex/ios/TypingConfig/typing-config.schema.json
Ryan Vogel 7603835026 ios: typing config: judge a zone by the words it makes right and wrong, not its taps
The zone rule counted taps: a zone was kept when, on the check half, it gained at least 3 taps net
and lost at most a third of what it gained. Taps overstate a zone's cost and understate its gain:
Hex's next-letter odds and autocorrect repair most letter taps that press a neighbour, while a
space read as a letter runs two words together. Replaced by a rule on words.

- simulate_zones.py also scores each zone on the logged words, using what the log says Hex did
  with each: an untouched word keeps its outcome; a wrong word whose taps all become right is made
  right; a right word with a new slip stays right as often as Hex repaired a word with one slip of
  that kind (letter, space as letter, which also joins the next word, letter as space, other key)
  in that half, leaning toward Hex's own rate on 106 people of two public recordings when the
  person's log has few examples. Prints wordsRight and wordsWrong, --sweep by net words, --repair
  the rates. It can't see context or words deleted and retyped differently (reference, "How a zone
  is scored").
- The rule (limits.json, generated into TypingConfigLimits.swift, limits.py and the schema):
  tuned >= 15 taps in the strip and more words right than wrong; checked >= 10 taps, words right -
  wrong >= 2, wrong <= 34% of right. Removed: zoneMinNetCheckedTaps, zoneMaxLostShare (and
  minNetCheckedTaps, maxLostShare). Added: zoneMinCheckedTaps, zoneMinNetCheckedWords,
  zoneMaxWrongShare, repair, repairPrior.
- Zone evidence gains wordsRight and wordsWrong (TypingConfigFile.Tally, optional; required by the
  schema). check_config.py demands them exactly as simulate_zones.py prints them. The phone's review
  applies the same rule, so a zone with tap-only evidence is now skipped as notEnoughEvidence. No
  config with zones has shipped (the experiment is off by default).
- words.py recognises a run-in deleted and typed again as two words (retyped_as_two), so the word
  rule sees the words a missed space broke.
- SKILL.md, the reference's zone section and worked examples, and docs/typing-configs.md follow.

Verified, on 2b5f2ae8:
- HEXMobileTests: 981 tests, 0 failures (4 skipped), Studio, iPhone 17 Pro sim, iOS 27.2.
- Fresh agents on the six planted-fault fixtures and Ryan's day 1 built configs that pass
  check_config.py with 0 problems.
- 106 public-recording people, tuned on half A by the package's rules, scored by replaying half B
  through the real keys: under the word rule 27 have a config, 4 a zone (all the space bar);
  8 better, 15 unchanged, 4 worse, each worse one by 1-2 words and from aim only; errors 2752 ->
  2576, 185 words made right, 19 wrong. Under the tap rule: 5 zones, 7 / 15 / 5, 2574, 189 / 23.
- The estimate against the engine on 33 zone-only replays: 211 words right and 66 wrong
  estimated, 323 and 111 replayed; every zone the rule would keep improved the replay, and each of
  the three that cost words (13, 16 and 2) is rejected.
2026-11-23 12:47:08 -05:00

518 lines
14 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://hex.anomaly.co/typing-config/0.schema.json",
"title": "Hex typing config, format 0",
"description": "Generated by ios/scripts/build-typing-config.py from ios/TypingConfig/limits.json. Do not edit. Strict: what an agent must write. Hex itself reads leniently (reference/typing-config.md, \"Reading\").",
"type": "object",
"additionalProperties": false,
"required": [
"format",
"version",
"id",
"basedOn",
"madeFrom",
"madeFor",
"note"
],
"properties": {
"format": {
"const": "hex.typing-config"
},
"version": {
"const": 0
},
"id": {
"type": "string",
"pattern": "^cfg-[0-9a-f]{16}$"
},
"basedOn": {
"type": [
"string",
"null"
]
},
"madeFrom": {
"type": "object",
"required": [
"exportId",
"hexVersion",
"hexBuild",
"logDays",
"heldOut"
],
"properties": {
"exportId": {
"type": "string"
},
"hexVersion": {
"type": "string"
},
"hexBuild": {
"type": "string"
},
"logDays": {
"type": "array",
"items": {
"type": "string"
}
},
"heldOut": {
"type": "object",
"required": [
"tunedOn",
"checkedOn"
],
"properties": {
"tunedOn": {
"enum": [
"A",
"B"
]
},
"checkedOn": {
"enum": [
"A",
"B"
]
}
}
}
}
},
"madeFor": {
"type": "object",
"required": [
"device",
"language"
],
"properties": {
"device": {
"type": "string"
},
"language": {
"type": "string"
}
}
},
"note": {
"type": "string",
"maxLength": 280
},
"words": {
"type": "object",
"additionalProperties": false,
"properties": {
"keep": {
"type": "array",
"maxItems": 500,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"word",
"evidence"
],
"properties": {
"word": {
"type": "string",
"minLength": 2,
"maxLength": 32
},
"evidence": {
"type": "object",
"required": [
"times",
"sessions"
],
"properties": {
"times": {
"type": "integer",
"minimum": 0
},
"sessions": {
"type": "integer",
"minimum": 0
}
}
}
}
}
},
"neverCorrectTo": {
"type": "array",
"maxItems": 500,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"word",
"evidence"
],
"properties": {
"word": {
"type": "string",
"minLength": 2,
"maxLength": 32
},
"evidence": {
"type": "object",
"required": [
"takenBack"
],
"properties": {
"takenBack": {
"type": "integer",
"minimum": 0
}
}
}
}
}
},
"fixes": {
"type": "array",
"maxItems": 500,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"typo",
"word",
"mode",
"evidence"
],
"properties": {
"typo": {
"type": "string",
"minLength": 2,
"maxLength": 32
},
"word": {
"type": "string",
"minLength": 2,
"maxLength": 32
},
"mode": {
"enum": [
"apply",
"suggest"
]
},
"evidence": {
"type": "object",
"required": [
"times",
"sessions"
],
"properties": {
"times": {
"type": "integer",
"minimum": 0
},
"sessions": {
"type": "integer",
"minimum": 0
}
}
}
}
}
},
"dictation": {
"type": "array",
"maxItems": 200,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"heard",
"meant",
"evidence"
],
"properties": {
"heard": {
"type": "string",
"minLength": 1,
"maxLength": 96
},
"meant": {
"type": "string",
"minLength": 1,
"maxLength": 96
},
"evidence": {
"type": "object",
"required": [
"times"
],
"properties": {
"times": {
"type": "integer",
"minimum": 0
}
}
}
}
}
}
}
},
"keys": {
"type": "array",
"maxItems": 8,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"context"
],
"properties": {
"context": {
"type": "object",
"additionalProperties": false,
"required": [
"width",
"orientation",
"posture",
"language",
"letters",
"split",
"hexPlacement",
"numberRow",
"keyHeight",
"rowPitch",
"letterWidth",
"hitModel"
],
"properties": {
"width": {
"type": "number"
},
"orientation": {
"enum": [
"portrait",
"landscape"
]
},
"posture": {
"type": "string"
},
"language": {
"type": "string"
},
"letters": {
"type": "string"
},
"split": {
"type": "boolean"
},
"hexPlacement": {
"type": "string"
},
"numberRow": {
"type": "boolean"
},
"keyHeight": {
"type": "number"
},
"rowPitch": {
"type": "number"
},
"letterWidth": {
"type": "number"
},
"hitModel": {
"type": "integer"
}
}
},
"aim": {
"type": "object",
"propertyNames": {
"pattern": "^.$"
},
"additionalProperties": {
"type": "object",
"additionalProperties": false,
"required": [
"offset",
"evidence"
],
"properties": {
"offset": {
"type": "array",
"items": {
"type": "number",
"minimum": -0.3,
"maximum": 0.3
},
"minItems": 2,
"maxItems": 2
},
"evidence": {
"type": "object",
"required": [
"tuned",
"checked"
],
"properties": {
"tuned": {
"type": "object",
"additionalProperties": true,
"required": [
"gained",
"lost"
],
"properties": {
"taps": {
"type": "integer",
"minimum": 0
},
"gained": {
"type": "integer",
"minimum": 0
},
"lost": {
"type": "integer",
"minimum": 0
}
}
},
"checked": {
"type": "object",
"additionalProperties": true,
"required": [
"gained",
"lost"
],
"properties": {
"taps": {
"type": "integer",
"minimum": 0
},
"gained": {
"type": "integer",
"minimum": 0
},
"lost": {
"type": "integer",
"minimum": 0
}
}
}
}
}
}
}
},
"zones": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"key",
"edge",
"move",
"evidence"
],
"properties": {
"key": {
"type": "string"
},
"edge": {
"enum": [
"bottom",
"left",
"right",
"top"
]
},
"move": {
"type": "number",
"minimum": -0.25,
"maximum": 0.25
},
"evidence": {
"type": "object",
"required": [
"tuned",
"checked"
],
"properties": {
"tuned": {
"type": "object",
"additionalProperties": true,
"required": [
"taps",
"gained",
"lost",
"wordsRight",
"wordsWrong"
],
"properties": {
"taps": {
"type": "integer",
"minimum": 0
},
"gained": {
"type": "integer",
"minimum": 0
},
"lost": {
"type": "integer",
"minimum": 0
},
"wordsRight": {
"type": "number",
"minimum": 0
},
"wordsWrong": {
"type": "number",
"minimum": 0
}
}
},
"checked": {
"type": "object",
"additionalProperties": true,
"required": [
"taps",
"gained",
"lost",
"wordsRight",
"wordsWrong"
],
"properties": {
"taps": {
"type": "integer",
"minimum": 0
},
"gained": {
"type": "integer",
"minimum": 0
},
"lost": {
"type": "integer",
"minimum": 0
},
"wordsRight": {
"type": "number",
"minimum": 0
},
"wordsWrong": {
"type": "number",
"minimum": 0
}
}
}
}
}
}
}
}
}
}
}
}
}