Weksa/schemas/cultnet/weksa.loop_decision.schema.json
Weksa ae8deb1e03 weksa loop cycle: a Train-only editor proposes an inventory edit, a candidate round scores it, a Ladder-stepped noise-floor rule accepts or rejects on Validation
Reading, decide and LADDER_STEP are pure; Decision (weksa.loop_decision) holds
digests and numbers; the latest Accepted decision names the run's head. The
candidate round and its decision are one batch put.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 05:10:47 +00:00

201 lines
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, Reading, Verdict};\nfn f() -> Decision {\n let r = Reading { chrf: 0.0, meaning: 0.0, composite: 0.0 };\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 base: r,\n candidate: None,\n floor: r,\n threshold: 0.0,\n verdict: Verdict::Accepted,\n }\n}\n```",
"type": "object",
"properties": {
"base": {
"$ref": "#/$defs/Reading"
},
"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": {
"anyOf": [
{
"$ref": "#/$defs/Reading"
},
{
"type": "null"
}
]
},
"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"
]
},
"floor": {
"$ref": "#/$defs/Reading"
},
"k": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"threshold": {
"type": "number",
"format": "double"
},
"verdict": {
"$ref": "#/$defs/Verdict"
}
},
"required": [
"k",
"base_round",
"base_rev",
"base_inventory_digest",
"edit",
"base",
"floor",
"threshold",
"verdict"
],
"$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"
]
},
"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"
]
}
]
}
}
}