Align the spell response schema

This commit is contained in:
2026-07-23 03:57:55 +00:00
parent 4b0b166143
commit 250c5c22b8
3 changed files with 14 additions and 7 deletions

View File

@@ -334,12 +334,12 @@ independently for extraction and normalization.
The combat normalizer prepares an external NPC registry before execution or
receives a generated registry at the ordered step handoff, then uses the
immutable view during runtime. It display-normalizes actors,
rewrites exact canonical-name or alias matches for actors, orders
and deduplicates source references, stable-sorts records by source-document
position, and collapses only exact duplicate identities with fully valid
evidence. It deep-clones output storage and emits bounded warnings scoped to
merged input indexes. Its metadata and fingerprints identify the normalization
and NPC identity policies. External bindings may contribute registry
rewrites canonical-name matches for actors, orders and deduplicates source
references, stable-sorts records by source-document position, and collapses
only exact duplicate identities with fully valid evidence. It deep-clones
output storage and emits bounded warnings scoped to merged input indexes. Its
metadata and fingerprints identify the normalization and NPC identity policies.
External bindings may contribute registry
digest/count metadata; generated identity is retained in framework provenance
and dependency fingerprints. The normalizer is included in the production D&D
registrar with the default combat normalization chain.

View File

@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "notarius.dnd.spells.llm",
"$id": "notarius.dnd.spells",
"type": "object",
"additionalProperties": false,
"required": ["spell_casts"],

View File

@@ -20,6 +20,13 @@ func TestLoadResponseSchemaUsesExtractorOwnedLLMSchema(t *testing.T) {
if !strings.HasPrefix(schema.SHA256, "sha256:") || !json.Valid(schema.JSONSchema) {
t.Fatalf("schema metadata = %#v, want valid hashed JSON", schema)
}
var schemaDocument map[string]any
if err := json.Unmarshal(schema.JSONSchema, &schemaDocument); err != nil {
t.Fatalf("Unmarshal(schema.JSONSchema) error = %v, want nil", err)
}
if schemaDocument["$id"] != ResponseSchemaID {
t.Fatalf("schema $id = %#v, want %q", schemaDocument["$id"], ResponseSchemaID)
}
valid := validSpellsResponse()
validJSON, err := json.Marshal(valid)