Define correction repair response and conversation replay

This commit is contained in:
2026-11-11 04:11:34 +00:00
parent 93a080059d
commit bb81354e21
7 changed files with 282 additions and 2 deletions

View File

@@ -0,0 +1,57 @@
{
"type": "object",
"additionalProperties": false,
"required": [
"proposal_ref",
"action",
"correction"
],
"properties": {
"proposal_ref": {
"type": "integer",
"minimum": 1
},
"action": {
"type": "string",
"enum": [
"revise",
"withdraw"
]
},
"correction": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"id",
"original_text",
"corrected_text",
"confidence"
],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"original_text": {
"type": "string",
"minLength": 1
},
"corrected_text": {
"type": "string"
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
}
},
{
"type": "null"
}
]
}
}
}

View File

@@ -16,9 +16,11 @@ type Key string
const (
CorrectionSetKey Key = "correction_set"
CorrectionRepairKey Key = "correction_repair"
ValidatorDecisionSetKey Key = "validator_decision_set"
AssetRoot = "assets"
correctionSetSchemaID = "audita.correction_set"
correctionRepairSchemaID = "audita.correction_repair"
validatorDecisionSchemaID = "audita.validator_decision_set"
schemaVersionV1 = "v1"
)
@@ -33,6 +35,8 @@ func AssetPath(key Key) (string, bool) {
switch key {
case CorrectionSetKey:
return "correction_set.v1.json", true
case CorrectionRepairKey:
return "correction_repair.v1.json", true
case ValidatorDecisionSetKey:
return "validator_decision_set.v1.json", true
default:
@@ -59,6 +63,7 @@ func (s Schema) DiagnosticsMap() map[string]any {
}
var registry = map[Key]Schema{
CorrectionRepairKey: mustBuildSchemaFromAsset(correctionRepairSchemaID, schemaVersionV1, "audita_correction_repair_v1", "assets/correction_repair.v1.json"),
CorrectionSetKey: mustBuildSchemaFromAsset(
correctionSetSchemaID,
schemaVersionV1,

View File

@@ -10,7 +10,7 @@ import (
)
func TestPromptKitSchemaPathsUseCanonicalAssets(t *testing.T) {
for _, key := range []Key{CorrectionSetKey, ValidatorDecisionSetKey} {
for _, key := range []Key{CorrectionSetKey, CorrectionRepairKey, ValidatorDecisionSetKey} {
path, ok := AssetPath(key)
if !ok {
t.Fatalf("missing path for %q", key)
@@ -81,7 +81,7 @@ func TestRegisteredSchemasLoadReadableEmbeddedJSON(t *testing.T) {
}
func TestSchemaHashesMatchRegisteredJSON(t *testing.T) {
for _, key := range []Key{CorrectionSetKey, ValidatorDecisionSetKey} {
for _, key := range []Key{CorrectionSetKey, CorrectionRepairKey, ValidatorDecisionSetKey} {
schema, ok := Lookup(key)
if !ok {
t.Fatalf("missing schema %q", key)