Align the spell response schema
This commit is contained in:
@@ -334,12 +334,12 @@ independently for extraction and normalization.
|
|||||||
The combat normalizer prepares an external NPC registry before execution or
|
The combat normalizer prepares an external NPC registry before execution or
|
||||||
receives a generated registry at the ordered step handoff, then uses the
|
receives a generated registry at the ordered step handoff, then uses the
|
||||||
immutable view during runtime. It display-normalizes actors,
|
immutable view during runtime. It display-normalizes actors,
|
||||||
rewrites exact canonical-name or alias matches for actors, orders
|
rewrites canonical-name matches for actors, orders and deduplicates source
|
||||||
and deduplicates source references, stable-sorts records by source-document
|
references, stable-sorts records by source-document position, and collapses
|
||||||
position, and collapses only exact duplicate identities with fully valid
|
only exact duplicate identities with fully valid evidence. It deep-clones
|
||||||
evidence. It deep-clones output storage and emits bounded warnings scoped to
|
output storage and emits bounded warnings scoped to merged input indexes. Its
|
||||||
merged input indexes. Its metadata and fingerprints identify the normalization
|
metadata and fingerprints identify the normalization and NPC identity policies.
|
||||||
and NPC identity policies. External bindings may contribute registry
|
External bindings may contribute registry
|
||||||
digest/count metadata; generated identity is retained in framework provenance
|
digest/count metadata; generated identity is retained in framework provenance
|
||||||
and dependency fingerprints. The normalizer is included in the production D&D
|
and dependency fingerprints. The normalizer is included in the production D&D
|
||||||
registrar with the default combat normalization chain.
|
registrar with the default combat normalization chain.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "notarius.dnd.spells.llm",
|
"$id": "notarius.dnd.spells",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": ["spell_casts"],
|
"required": ["spell_casts"],
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ func TestLoadResponseSchemaUsesExtractorOwnedLLMSchema(t *testing.T) {
|
|||||||
if !strings.HasPrefix(schema.SHA256, "sha256:") || !json.Valid(schema.JSONSchema) {
|
if !strings.HasPrefix(schema.SHA256, "sha256:") || !json.Valid(schema.JSONSchema) {
|
||||||
t.Fatalf("schema metadata = %#v, want valid hashed JSON", schema)
|
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()
|
valid := validSpellsResponse()
|
||||||
validJSON, err := json.Marshal(valid)
|
validJSON, err := json.Marshal(valid)
|
||||||
|
|||||||
Reference in New Issue
Block a user