45 lines
2.2 KiB
JSON
45 lines
2.2 KiB
JSON
{
|
||
"$comment": "规则合同(专题-09 §4.1)。active 规则必须配齐四类样例,由 load.py 强制,不在 schema 内表达。",
|
||
"type": "object",
|
||
"required": ["id", "name", "layer", "carrier_scope", "trigger", "default_disposition", "fix_hint", "samples", "version", "status", "evidence"],
|
||
"properties": {
|
||
"id": {"type": "string", "minLength": 2},
|
||
"name": {"type": "string", "minLength": 2},
|
||
"layer": {"type": "string", "enum": ["mechanical", "lexical", "structural", "density", "semantic"]},
|
||
"carrier_scope": {"type": "string", "enum": ["narration", "dialogue", "monologue", "in_text_carrier", "all"]},
|
||
"trigger": {
|
||
"type": "object",
|
||
"required": ["type"],
|
||
"properties": {
|
||
"type": {"type": "string", "enum": ["regex", "handler", "density", "model_judgment"]},
|
||
"pattern": {"type": "string"},
|
||
"criteria": {"type": "string"},
|
||
"handler": {"type": "string", "enum": ["short_sentence_run", "repeated_sentence_start", "camera_action_list", "uniform_paragraph_length"]},
|
||
"max_chars": {"type": "integer", "minimum": 1},
|
||
"min_run": {"type": "integer", "minimum": 2},
|
||
"window_chars": {"type": "integer", "minimum": 50},
|
||
"min_hits": {"type": "integer", "minimum": 2},
|
||
"tolerance": {"type": "integer", "minimum": 1, "maximum": 50}
|
||
}
|
||
},
|
||
"carve_out": {"type": "array", "items": {"type": "string"}},
|
||
"default_disposition": {"type": "string", "enum": ["blocking", "candidate", "advisory"]},
|
||
"function_check": {"type": "array", "items": {"type": "string"}},
|
||
"fix_hint": {"type": "string", "minLength": 2},
|
||
"samples": {
|
||
"type": "object",
|
||
"required": ["sf", "snf", "boundary", "regression"],
|
||
"properties": {
|
||
"sf": {"type": "array", "items": {"type": "string"}},
|
||
"snf": {"type": "array", "items": {"type": "string"}},
|
||
"boundary": {"type": "array", "items": {"type": "string"}},
|
||
"regression": {"type": "array", "items": {"type": "string"}}
|
||
}
|
||
},
|
||
"version": {"type": "integer"},
|
||
"status": {"type": "string", "enum": ["candidate", "active", "deprecated"]},
|
||
"evidence": {"type": "string", "minLength": 2},
|
||
"case_card_ids": {"type": "array", "items": {"type": "string", "minLength": 2}}
|
||
}
|
||
}
|