Prompt::lower takes the language; RunRecord carries the panel; RoundRecord and Decision hold per-language readings (pooled keys retired); decide_panel is Pareto non-regression over decide(); recall splits at UAX #29 word bounds. Integration tests follow in the next commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
221 lines
5.5 KiB
JSON
221 lines
5.5 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"title": "Decision",
|
|
"description": "One closed edit-accept cycle: digests and numbers, no text. Key\n`run:<label>:cycle:<k>`. Only [`cycle`] builds one.\n\n```\nfn f(d: &weksa::run::Decision) -> u32 { d.k() }\n```\n\nEvery field is given, so the literal below fails only on privacy; its twin is\nthe same literal in the unit test `a_decision_literal_compiles_in_the_lib`.\n\n```compile_fail,E0451\nuse weksa::run::{Call, Decision, Verdict};\nfn f() -> Decision {\n Decision {\n k: 1,\n base_round: 1,\n base_rev: 1,\n base_inventory_digest: String::new(),\n edit: Call { prompt: String::new(), items: vec![] },\n edit_answer_digest: None,\n candidate_rev: None,\n candidate_inventory_digest: None,\n candidate_round: None,\n panel: vec![],\n verdict: Verdict::Accepted,\n }\n}\n```",
|
|
"type": "object",
|
|
"properties": {
|
|
"base_inventory_digest": {
|
|
"type": "string"
|
|
},
|
|
"base_rev": {
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0
|
|
},
|
|
"base_round": {
|
|
"description": "The head's establishing round: the base of this cycle.",
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0
|
|
},
|
|
"candidate_inventory_digest": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"candidate_rev": {
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
],
|
|
"format": "uint32",
|
|
"minimum": 0
|
|
},
|
|
"candidate_round": {
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
],
|
|
"format": "uint32",
|
|
"minimum": 0
|
|
},
|
|
"edit": {
|
|
"description": "The edit prompt's digest and the Train keys it held.",
|
|
"$ref": "#/$defs/Call"
|
|
},
|
|
"edit_answer_digest": {
|
|
"description": "16 hex of the editor's answer; `None` when it was unreadable.",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"k": {
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0
|
|
},
|
|
"panel": {
|
|
"description": "One row per panel language, in panel order.",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/PanelReading"
|
|
}
|
|
},
|
|
"verdict": {
|
|
"$ref": "#/$defs/Verdict"
|
|
}
|
|
},
|
|
"required": [
|
|
"k",
|
|
"base_round",
|
|
"base_rev",
|
|
"base_inventory_digest",
|
|
"edit",
|
|
"verdict",
|
|
"panel"
|
|
],
|
|
"$defs": {
|
|
"Call": {
|
|
"description": "One model call: the prompt's digest and the item keys it held.",
|
|
"type": "object",
|
|
"properties": {
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"prompt": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"prompt",
|
|
"items"
|
|
]
|
|
},
|
|
"Metric": {
|
|
"description": "Which metric an edit regressed.",
|
|
"type": "string",
|
|
"enum": [
|
|
"Chrf",
|
|
"Meaning"
|
|
]
|
|
},
|
|
"PanelReading": {
|
|
"description": "One panel language's row of a cycle: the head's Validation reading, the\ncandidate's (none when the edit never reached a round), the language's\nmeasured floor and the threshold derived from it.",
|
|
"type": "object",
|
|
"properties": {
|
|
"base": {
|
|
"$ref": "#/$defs/Reading"
|
|
},
|
|
"candidate": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/$defs/Reading"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"floor": {
|
|
"$ref": "#/$defs/Reading"
|
|
},
|
|
"language": {
|
|
"type": "string"
|
|
},
|
|
"threshold": {
|
|
"type": "number",
|
|
"format": "double"
|
|
}
|
|
},
|
|
"required": [
|
|
"language",
|
|
"base",
|
|
"floor",
|
|
"threshold"
|
|
]
|
|
},
|
|
"Reading": {
|
|
"description": "One validation reading: chrF 0 to 100, meaning 0 to 1, and their composite.",
|
|
"type": "object",
|
|
"properties": {
|
|
"chrf": {
|
|
"type": "number",
|
|
"format": "double"
|
|
},
|
|
"composite": {
|
|
"type": "number",
|
|
"format": "double"
|
|
},
|
|
"meaning": {
|
|
"type": "number",
|
|
"format": "double"
|
|
}
|
|
},
|
|
"required": [
|
|
"chrf",
|
|
"meaning",
|
|
"composite"
|
|
]
|
|
},
|
|
"Verdict": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string",
|
|
"enum": [
|
|
"Accepted"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"Rejected": {
|
|
"$ref": "#/$defs/Why"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"Rejected"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"Why": {
|
|
"description": "Why an edit was rejected.",
|
|
"oneOf": [
|
|
{
|
|
"type": "string",
|
|
"enum": [
|
|
"NoGain"
|
|
]
|
|
},
|
|
{
|
|
"description": "The answer was not an edit draft.",
|
|
"type": "string",
|
|
"const": "EditParse"
|
|
},
|
|
{
|
|
"description": "The draft asked for no change or too many, or the inventory door refused it.",
|
|
"type": "string",
|
|
"const": "EditAdmit"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"Regressed": {
|
|
"$ref": "#/$defs/Metric"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"Regressed"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|