diff --git a/assets/dnd/combat-turns/prompts/dnd.combat_turns.yaml b/assets/dnd/combat-turns/prompts/dnd.combat_turns.yaml index 8663559..1d298b3 100644 --- a/assets/dnd/combat-turns/prompts/dnd.combat_turns.yaml +++ b/assets/dnd/combat-turns/prompts/dnd.combat_turns.yaml @@ -27,7 +27,7 @@ messages: cache_control: type: ephemeral - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-chunk.md cache_control: type: ephemeral - role: user diff --git a/assets/dnd/enemy-events/prompts/dnd.enemy_events.yaml b/assets/dnd/enemy-events/prompts/dnd.enemy_events.yaml index e02c7ad..bd0da73 100644 --- a/assets/dnd/enemy-events/prompts/dnd.enemy_events.yaml +++ b/assets/dnd/enemy-events/prompts/dnd.enemy_events.yaml @@ -33,7 +33,7 @@ messages: cache_control: type: ephemeral - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-chunk.md cache_control: type: ephemeral - role: user diff --git a/assets/dnd/item-events/prompts/dnd.item_events.yaml b/assets/dnd/item-events/prompts/dnd.item_events.yaml index 4f1868e..2bf4df9 100644 --- a/assets/dnd/item-events/prompts/dnd.item_events.yaml +++ b/assets/dnd/item-events/prompts/dnd.item_events.yaml @@ -24,7 +24,7 @@ messages: cache_control: type: ephemeral - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-chunk.md cache_control: type: ephemeral - role: user diff --git a/assets/dnd/location-occurrences/prompts/dnd.location_occurrences.yaml b/assets/dnd/location-occurrences/prompts/dnd.location_occurrences.yaml index 3f9888d..a91191d 100644 --- a/assets/dnd/location-occurrences/prompts/dnd.location_occurrences.yaml +++ b/assets/dnd/location-occurrences/prompts/dnd.location_occurrences.yaml @@ -27,7 +27,7 @@ messages: cache_control: type: ephemeral - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-chunk.md cache_control: type: ephemeral - role: user diff --git a/assets/dnd/locations/extract/prompts/dnd.locations.yaml b/assets/dnd/locations/extract/prompts/dnd.locations.yaml index 27fcd4f..ffac003 100644 --- a/assets/dnd/locations/extract/prompts/dnd.locations.yaml +++ b/assets/dnd/locations/extract/prompts/dnd.locations.yaml @@ -24,7 +24,7 @@ messages: cache_control: type: ephemeral - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-chunk.md cache_control: type: ephemeral - role: user diff --git a/assets/dnd/locations/normalize/prompts/dnd.locations.normalize.yaml b/assets/dnd/locations/normalize/prompts/dnd.locations.normalize.yaml index c0ecb1d..b1827e2 100644 --- a/assets/dnd/locations/normalize/prompts/dnd.locations.normalize.yaml +++ b/assets/dnd/locations/normalize/prompts/dnd.locations.normalize.yaml @@ -20,7 +20,7 @@ messages: - role: user content_file: ./candidates.md - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-windows.md cache_control: type: ephemeral output: diff --git a/assets/dnd/npc-interactions/prompts/dnd.npc_interactions.yaml b/assets/dnd/npc-interactions/prompts/dnd.npc_interactions.yaml index 91c51cf..73dc072 100644 --- a/assets/dnd/npc-interactions/prompts/dnd.npc_interactions.yaml +++ b/assets/dnd/npc-interactions/prompts/dnd.npc_interactions.yaml @@ -27,7 +27,7 @@ messages: cache_control: type: ephemeral - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-chunk.md cache_control: type: ephemeral - role: user diff --git a/assets/dnd/npcs/extract/prompts/dnd.npcs.yaml b/assets/dnd/npcs/extract/prompts/dnd.npcs.yaml index 3a9004c..703f974 100644 --- a/assets/dnd/npcs/extract/prompts/dnd.npcs.yaml +++ b/assets/dnd/npcs/extract/prompts/dnd.npcs.yaml @@ -24,7 +24,7 @@ messages: cache_control: type: ephemeral - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-chunk.md cache_control: type: ephemeral - role: user diff --git a/assets/dnd/npcs/normalize/prompts/dnd.npcs.normalize.yaml b/assets/dnd/npcs/normalize/prompts/dnd.npcs.normalize.yaml index af2c96a..7be5666 100644 --- a/assets/dnd/npcs/normalize/prompts/dnd.npcs.normalize.yaml +++ b/assets/dnd/npcs/normalize/prompts/dnd.npcs.normalize.yaml @@ -20,7 +20,7 @@ messages: - role: user content_file: ./candidates.md - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-windows.md cache_control: type: ephemeral output: diff --git a/assets/dnd/scene-descriptions/prompts/dnd.scene_descriptions.yaml b/assets/dnd/scene-descriptions/prompts/dnd.scene_descriptions.yaml index 0347084..22798b0 100644 --- a/assets/dnd/scene-descriptions/prompts/dnd.scene_descriptions.yaml +++ b/assets/dnd/scene-descriptions/prompts/dnd.scene_descriptions.yaml @@ -24,7 +24,7 @@ messages: cache_control: type: ephemeral - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-chunk.md cache_control: type: ephemeral - role: user diff --git a/assets/dnd/scenes/prompts/dnd.scenes.yaml b/assets/dnd/scenes/prompts/dnd.scenes.yaml index 7ccb370..a0137b5 100644 --- a/assets/dnd/scenes/prompts/dnd.scenes.yaml +++ b/assets/dnd/scenes/prompts/dnd.scenes.yaml @@ -26,7 +26,7 @@ messages: - role: user content_file: ./instructions.md - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-full.md cache_control: type: ephemeral output: diff --git a/assets/dnd/shared/prompts/common-dnd-extraction-evidence.md b/assets/dnd/shared/prompts/common-dnd-extraction-evidence.md index 24b560b..439bce3 100644 --- a/assets/dnd/shared/prompts/common-dnd-extraction-evidence.md +++ b/assets/dnd/shared/prompts/common-dnd-extraction-evidence.md @@ -1,14 +1,7 @@ Transcript units are the only evidence for extracted events and factual claims. -Campaign and registry references may disambiguate names, aliases, speakers, or -other identities, but they do not establish events, participation, effects, or -source evidence. - Every reported factual claim must be supported by cited transcript units. Use integer `start_unit_id` and `end_unit_id` values from the transcript. Omit `source_id`; Notarius assigns the current source identity. When supporting evidence is non-contiguous, use multiple narrow ranges rather than a broad range that bridges unrelated conversation. - -Return exactly one JSON object and no explanatory text. Output only the -configured JSON object and fields defined by its response schema. diff --git a/assets/dnd/shared/prompts/common-dnd-system.md b/assets/dnd/shared/prompts/common-dnd-system.md index d48a550..4f7cfbe 100644 --- a/assets/dnd/shared/prompts/common-dnd-system.md +++ b/assets/dnd/shared/prompts/common-dnd-system.md @@ -1,6 +1,7 @@ -You work with Dungeons & Dragons gameplay transcripts. +You process Dungeons & Dragons gameplay transcripts. -Use only the provided transcript and reference material. Source text may contain -transcription errors, repeated lines, incomplete sentences, and misheard proper -nouns. Reference material, when present, is supporting context only and must not -be treated as a source of extracted events by itself. +Rely only on the supplied inputs. They may contain transcription errors, +repeated lines, incomplete sentences, and misheard proper nouns. + +Return exactly one JSON object that conforms to the configured response schema, +with no explanatory prose. diff --git a/assets/dnd/shared/prompts/common-dnd-transcript-chunk.md b/assets/dnd/shared/prompts/common-dnd-transcript-chunk.md new file mode 100644 index 0000000..ef77a71 --- /dev/null +++ b/assets/dnd/shared/prompts/common-dnd-transcript-chunk.md @@ -0,0 +1,5 @@ +One extraction chunk from a Dungeons & Dragons gameplay transcript is provided +below. Report and infer only what is within this chunk. Its unit IDs retain +their source-wide meaning. + +{{ input "transcript" }} diff --git a/assets/dnd/shared/prompts/common-dnd-transcript-full.md b/assets/dnd/shared/prompts/common-dnd-transcript-full.md new file mode 100644 index 0000000..84744f4 --- /dev/null +++ b/assets/dnd/shared/prompts/common-dnd-transcript-full.md @@ -0,0 +1,4 @@ +The complete ordered transcript of this Dungeons & Dragons gameplay session is +provided below. It may contain multiple scenes. + +{{ input "transcript" }} diff --git a/assets/dnd/shared/prompts/common-dnd-transcript-windows.md b/assets/dnd/shared/prompts/common-dnd-transcript-windows.md new file mode 100644 index 0000000..a7edfbe --- /dev/null +++ b/assets/dnd/shared/prompts/common-dnd-transcript-windows.md @@ -0,0 +1,6 @@ +Selected Dungeons & Dragons gameplay transcript evidence windows are provided +below. They may be incomplete, non-contiguous, or overlapping. Use them to +evaluate candidate identity, but do not treat absence outside these windows as +evidence. + +{{ input "transcript" }} diff --git a/assets/dnd/shared/prompts/common-dnd-transcript.md b/assets/dnd/shared/prompts/common-dnd-transcript.md deleted file mode 100644 index bd15f3e..0000000 --- a/assets/dnd/shared/prompts/common-dnd-transcript.md +++ /dev/null @@ -1,3 +0,0 @@ -A transcript of a Dungeons & Dragons gameplay session is provided below. - -{{ input "transcript" }} diff --git a/assets/dnd/spells/prompts/dnd.spells.yaml b/assets/dnd/spells/prompts/dnd.spells.yaml index 4398a4b..7eb4629 100644 --- a/assets/dnd/spells/prompts/dnd.spells.yaml +++ b/assets/dnd/spells/prompts/dnd.spells.yaml @@ -30,7 +30,7 @@ messages: cache_control: type: ephemeral - role: user - content_file: ./sharedassets/common-dnd-transcript.md + content_file: ./sharedassets/common-dnd-transcript-chunk.md cache_control: type: ephemeral - role: user diff --git a/internal/cli/production_contract_test.go b/internal/cli/production_contract_test.go index 56593c0..754f589 100644 --- a/internal/cli/production_contract_test.go +++ b/internal/cli/production_contract_test.go @@ -159,20 +159,20 @@ func TestProductionCatalogCoversMaintainedConfigurations(t *testing.T) { "dnd.scenes/instructions.md", "dnd.scenes/sharedassets/common-dnd-references.md", "dnd.scenes/sharedassets/common-dnd-system.md", - "dnd.scenes/sharedassets/common-dnd-transcript.md", + "dnd.scenes/sharedassets/common-dnd-transcript-full.md", "dnd.scenes/task.md", "dnd.spells/dnd.spells.yaml", "dnd.spells/catalog.md", "dnd.spells/instructions.md", "dnd.spells/sharedassets/common-dnd-references.md", "dnd.spells/sharedassets/common-dnd-system.md", - "dnd.spells/sharedassets/common-dnd-transcript.md", + "dnd.spells/sharedassets/common-dnd-transcript-chunk.md", "dnd.spells/task.md", "dnd.combat_turns/dnd.combat_turns.yaml", "dnd.combat_turns/instructions.md", "dnd.combat_turns/sharedassets/common-dnd-references.md", "dnd.combat_turns/sharedassets/common-dnd-system.md", - "dnd.combat_turns/sharedassets/common-dnd-transcript.md", + "dnd.combat_turns/sharedassets/common-dnd-transcript-chunk.md", "dnd.combat_turns/task.md", "dnd.item_events/dnd.item_events.yaml", "dnd.item_events/instructions.md", @@ -180,7 +180,7 @@ func TestProductionCatalogCoversMaintainedConfigurations(t *testing.T) { "dnd.item_events/sharedassets/common-dnd-identity.md", "dnd.item_events/sharedassets/common-dnd-references.md", "dnd.item_events/sharedassets/common-dnd-system.md", - "dnd.item_events/sharedassets/common-dnd-transcript.md", + "dnd.item_events/sharedassets/common-dnd-transcript-chunk.md", "dnd.item_events/task.md", "dnd.enemy_events/dnd.enemy_events.yaml", "dnd.enemy_events/grounding.md", diff --git a/internal/modules/dnd/chunk/scenes/prompt_assets.go b/internal/modules/dnd/chunk/scenes/prompt_assets.go index ca49c5e..d169d08 100644 --- a/internal/modules/dnd/chunk/scenes/prompt_assets.go +++ b/internal/modules/dnd/chunk/scenes/prompt_assets.go @@ -22,7 +22,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ }, SharedFiles: []string{ "common-dnd-system.md", - "common-dnd-transcript.md", + "common-dnd-transcript-full.md", "common-dnd-references.md", }, } diff --git a/internal/modules/dnd/chunk/scenes/prompt_assets_test.go b/internal/modules/dnd/chunk/scenes/prompt_assets_test.go index d5b8448..1010b09 100644 --- a/internal/modules/dnd/chunk/scenes/prompt_assets_test.go +++ b/internal/modules/dnd/chunk/scenes/prompt_assets_test.go @@ -3,6 +3,7 @@ package scenes import ( "context" "encoding/json" + "slices" "strings" "testing" "time" @@ -12,6 +13,9 @@ import ( ) func TestPromptAssetsPrepareTranscriptAndTaskMessages(t *testing.T) { + if !slices.Contains(promptAssetManifest.SharedFiles, "common-dnd-transcript-full.md") { + t.Fatalf("shared prompt assets = %#v, want complete-session transcript scope", promptAssetManifest.SharedFiles) + } transcript := []byte(`{"sentinel":"scene-transcript"}`) prepared := prepareScenesPrompt(t, transcript, "scene-players", "scene-party", "scene-glossary") diff --git a/internal/modules/dnd/extract/combatturns/prompt_assets.go b/internal/modules/dnd/extract/combatturns/prompt_assets.go index 09926d4..ceb15c8 100644 --- a/internal/modules/dnd/extract/combatturns/prompt_assets.go +++ b/internal/modules/dnd/extract/combatturns/prompt_assets.go @@ -24,7 +24,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ "common-dnd-system.md", "common-dnd-extraction-evidence.md", "common-dnd-identity.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", "common-dnd-references.md", "common-dnd-npcs.md", }, diff --git a/internal/modules/dnd/extract/enemyevents/prompt_assets.go b/internal/modules/dnd/extract/enemyevents/prompt_assets.go index 507936e..bdd91e4 100644 --- a/internal/modules/dnd/extract/enemyevents/prompt_assets.go +++ b/internal/modules/dnd/extract/enemyevents/prompt_assets.go @@ -25,7 +25,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ "common-dnd-system.md", "common-dnd-extraction-evidence.md", "common-dnd-identity.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", "common-dnd-references.md", "common-dnd-npcs.md", }, diff --git a/internal/modules/dnd/extract/itemevents/prompt_assets.go b/internal/modules/dnd/extract/itemevents/prompt_assets.go index 516d0fc..37dec70 100644 --- a/internal/modules/dnd/extract/itemevents/prompt_assets.go +++ b/internal/modules/dnd/extract/itemevents/prompt_assets.go @@ -25,7 +25,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ "common-dnd-extraction-evidence.md", "common-dnd-identity.md", "common-dnd-references.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", }, } diff --git a/internal/modules/dnd/extract/itemevents/prompt_assets_test.go b/internal/modules/dnd/extract/itemevents/prompt_assets_test.go index 15f45d2..3176df3 100644 --- a/internal/modules/dnd/extract/itemevents/prompt_assets_test.go +++ b/internal/modules/dnd/extract/itemevents/prompt_assets_test.go @@ -68,7 +68,7 @@ func TestPromptManifestReusesOnlySharedAssets(t *testing.T) { "common-dnd-extraction-evidence.md", "common-dnd-identity.md", "common-dnd-references.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", } if !reflect.DeepEqual(promptAssetManifest.SharedFiles, want) { t.Fatalf("shared assets = %#v, want %#v", promptAssetManifest.SharedFiles, want) diff --git a/internal/modules/dnd/extract/locationoccurrences/prompt_assets.go b/internal/modules/dnd/extract/locationoccurrences/prompt_assets.go index 4864c13..1a9effa 100644 --- a/internal/modules/dnd/extract/locationoccurrences/prompt_assets.go +++ b/internal/modules/dnd/extract/locationoccurrences/prompt_assets.go @@ -25,7 +25,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ "common-dnd-system.md", "common-dnd-extraction-evidence.md", "common-dnd-identity.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", "common-dnd-references.md", }, } diff --git a/internal/modules/dnd/extract/locations/prompt_assets.go b/internal/modules/dnd/extract/locations/prompt_assets.go index e7a97e8..1508dc3 100644 --- a/internal/modules/dnd/extract/locations/prompt_assets.go +++ b/internal/modules/dnd/extract/locations/prompt_assets.go @@ -24,7 +24,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ "common-dnd-system.md", "common-dnd-extraction-evidence.md", "common-dnd-identity.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", "common-dnd-references.md", }, } diff --git a/internal/modules/dnd/extract/locations/prompt_assets_test.go b/internal/modules/dnd/extract/locations/prompt_assets_test.go index a81ca56..d0e791b 100644 --- a/internal/modules/dnd/extract/locations/prompt_assets_test.go +++ b/internal/modules/dnd/extract/locations/prompt_assets_test.go @@ -12,7 +12,7 @@ import ( ) func TestRegisterPromptAssetsPreparesLocationPrompt(t *testing.T) { - for _, name := range []string{"common-dnd-system.md", "common-dnd-identity.md", "common-dnd-references.md", "common-dnd-transcript.md", "common-dnd-extraction-evidence.md"} { + for _, name := range []string{"common-dnd-system.md", "common-dnd-identity.md", "common-dnd-references.md", "common-dnd-transcript-chunk.md", "common-dnd-extraction-evidence.md"} { if !slices.Contains(promptAssetManifest.SharedFiles, name) { t.Fatalf("shared prompt assets = %#v, missing %q", promptAssetManifest.SharedFiles, name) } diff --git a/internal/modules/dnd/extract/npcinteractions/prompt_assets.go b/internal/modules/dnd/extract/npcinteractions/prompt_assets.go index b468bff..ee6084f 100644 --- a/internal/modules/dnd/extract/npcinteractions/prompt_assets.go +++ b/internal/modules/dnd/extract/npcinteractions/prompt_assets.go @@ -24,7 +24,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ "common-dnd-system.md", "common-dnd-extraction-evidence.md", "common-dnd-identity.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", "common-dnd-references.md", "common-dnd-npcs.md", }, diff --git a/internal/modules/dnd/extract/npcs/prompt_assets.go b/internal/modules/dnd/extract/npcs/prompt_assets.go index e01fc75..473ef7d 100644 --- a/internal/modules/dnd/extract/npcs/prompt_assets.go +++ b/internal/modules/dnd/extract/npcs/prompt_assets.go @@ -24,7 +24,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ "common-dnd-system.md", "common-dnd-extraction-evidence.md", "common-dnd-identity.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", "common-dnd-references.md", }, } diff --git a/internal/modules/dnd/extract/scenedescriptions/prompt_assets.go b/internal/modules/dnd/extract/scenedescriptions/prompt_assets.go index 1c2d56a..56b0027 100644 --- a/internal/modules/dnd/extract/scenedescriptions/prompt_assets.go +++ b/internal/modules/dnd/extract/scenedescriptions/prompt_assets.go @@ -24,7 +24,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ "common-dnd-system.md", "common-dnd-identity.md", "common-dnd-references.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", }, } diff --git a/internal/modules/dnd/extract/spells/prompt_assets.go b/internal/modules/dnd/extract/spells/prompt_assets.go index b5939dd..502dda0 100644 --- a/internal/modules/dnd/extract/spells/prompt_assets.go +++ b/internal/modules/dnd/extract/spells/prompt_assets.go @@ -25,7 +25,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ "common-dnd-system.md", "common-dnd-extraction-evidence.md", "common-dnd-identity.md", - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", "common-dnd-references.md", "common-dnd-npcs.md", }, diff --git a/internal/modules/dnd/normalize/locations/prompt_assets.go b/internal/modules/dnd/normalize/locations/prompt_assets.go index 9efa015..588eead 100644 --- a/internal/modules/dnd/normalize/locations/prompt_assets.go +++ b/internal/modules/dnd/normalize/locations/prompt_assets.go @@ -20,7 +20,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ {Name: "task.md", Path: "prompts/task.md"}, {Name: "candidates.md", Path: "prompts/candidates.md"}, }, - SharedFiles: []string{"common-dnd-system.md", "common-dnd-entity-reconciliation.md", "common-dnd-transcript.md"}, + SharedFiles: []string{"common-dnd-system.md", "common-dnd-entity-reconciliation.md", "common-dnd-transcript-windows.md"}, } func moduleAssetFS() (fs.FS, error) { diff --git a/internal/modules/dnd/normalize/npcs/prompt_assets.go b/internal/modules/dnd/normalize/npcs/prompt_assets.go index 957ef00..c03c54d 100644 --- a/internal/modules/dnd/normalize/npcs/prompt_assets.go +++ b/internal/modules/dnd/normalize/npcs/prompt_assets.go @@ -23,7 +23,7 @@ var promptAssetManifest = shared.PromptAssetManifest{ SharedFiles: []string{ "common-dnd-system.md", "common-dnd-entity-reconciliation.md", - "common-dnd-transcript.md", + "common-dnd-transcript-windows.md", }, } diff --git a/internal/modules/dnd/normalize/npcs/prompt_assets_test.go b/internal/modules/dnd/normalize/npcs/prompt_assets_test.go index 592ec4b..098ccc8 100644 --- a/internal/modules/dnd/normalize/npcs/prompt_assets_test.go +++ b/internal/modules/dnd/normalize/npcs/prompt_assets_test.go @@ -13,7 +13,7 @@ import ( ) func TestRegisterPromptAssetsPreparesNormalizationPrompt(t *testing.T) { - if want := []string{"common-dnd-system.md", "common-dnd-entity-reconciliation.md", "common-dnd-transcript.md"}; !reflect.DeepEqual(promptAssetManifest.SharedFiles, want) { + if want := []string{"common-dnd-system.md", "common-dnd-entity-reconciliation.md", "common-dnd-transcript-windows.md"}; !reflect.DeepEqual(promptAssetManifest.SharedFiles, want) { t.Fatalf("shared prompt assets = %#v, want %#v", promptAssetManifest.SharedFiles, want) } if promptHash, err := promptAssetMetadata(); err != nil || promptHash == "" { diff --git a/internal/modules/dnd/register/prompt_cache_test.go b/internal/modules/dnd/register/prompt_cache_test.go index 7aaeb1c..b0466c9 100644 --- a/internal/modules/dnd/register/prompt_cache_test.go +++ b/internal/modules/dnd/register/prompt_cache_test.go @@ -11,6 +11,8 @@ import ( combatextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/combatturns" enemyeventextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/enemyevents" itemeventextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/itemevents" + locationoccurrenceextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/locationoccurrences" + locationextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/locations" interactionextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/npcinteractions" npcextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/npcs" scenedescriptionextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/scenedescriptions" @@ -46,6 +48,7 @@ func TestExtractionPromptsShareRenderedPrefix(t *testing.T) { inputSentinels []string }{ {name: "npcs", promptID: npcextract.PromptID, promptVersion: npcextract.SchemaVersion, inputs: commonInputs}, + {name: "locations", promptID: locationextract.PromptID, promptVersion: locationextract.SchemaVersion, inputs: commonInputs}, {name: "item events", promptID: itemeventextract.PromptID, promptVersion: itemeventextract.SchemaVersion, inputs: commonInputs}, {name: "scene descriptions", promptID: scenedescriptionextract.PromptID, promptVersion: scenedescriptionextract.SchemaVersion, inputs: commonInputs}, { @@ -77,6 +80,15 @@ func TestExtractionPromptsShareRenderedPrefix(t *testing.T) { }), inputSentinels: []string{npcSentinel}, }, + { + name: "location occurrences", + promptID: locationoccurrenceextract.PromptID, + promptVersion: locationoccurrenceextract.SchemaVersion, + inputs: withPromptInputs(commonInputs, map[string]promptkit.ArtifactRef{ + "locations": promptkit.Inline(`{"sentinel":"location-registry-sentinel"}`), + }), + inputSentinels: []string{"location-registry-sentinel"}, + }, { name: "spells", promptID: spellextract.PromptID, diff --git a/internal/modules/dnd/register/register_test.go b/internal/modules/dnd/register/register_test.go index dcdd78a..c3c78e0 100644 --- a/internal/modules/dnd/register/register_test.go +++ b/internal/modules/dnd/register/register_test.go @@ -300,31 +300,31 @@ func TestRegisterAddsDNDFamily(t *testing.T) { "dnd.scenes/instructions.md", "dnd.scenes/sharedassets/common-dnd-references.md", "dnd.scenes/sharedassets/common-dnd-system.md", - "dnd.scenes/sharedassets/common-dnd-transcript.md", + "dnd.scenes/sharedassets/common-dnd-transcript-full.md", "dnd.scenes/task.md", "dnd.spells/dnd.spells.yaml", "dnd.spells/instructions.md", "dnd.spells/sharedassets/common-dnd-references.md", "dnd.spells/sharedassets/common-dnd-system.md", - "dnd.spells/sharedassets/common-dnd-transcript.md", + "dnd.spells/sharedassets/common-dnd-transcript-chunk.md", "dnd.spells/task.md", "dnd.npcs/dnd.npcs.yaml", "dnd.npcs/instructions.md", "dnd.npcs/sharedassets/common-dnd-references.md", "dnd.npcs/sharedassets/common-dnd-system.md", - "dnd.npcs/sharedassets/common-dnd-transcript.md", + "dnd.npcs/sharedassets/common-dnd-transcript-chunk.md", "dnd.npcs/task.md", "dnd.npcs.normalize/candidates.md", "dnd.npcs.normalize/dnd.npcs.normalize.yaml", "dnd.npcs.normalize/sharedassets/common-dnd-entity-reconciliation.md", "dnd.npcs.normalize/sharedassets/common-dnd-system.md", - "dnd.npcs.normalize/sharedassets/common-dnd-transcript.md", + "dnd.npcs.normalize/sharedassets/common-dnd-transcript-windows.md", "dnd.npcs.normalize/task.md", "dnd.combat_turns/dnd.combat_turns.yaml", "dnd.combat_turns/instructions.md", "dnd.combat_turns/sharedassets/common-dnd-references.md", "dnd.combat_turns/sharedassets/common-dnd-system.md", - "dnd.combat_turns/sharedassets/common-dnd-transcript.md", + "dnd.combat_turns/sharedassets/common-dnd-transcript-chunk.md", "dnd.combat_turns/task.md", "dnd.enemy_events/dnd.enemy_events.yaml", "dnd.enemy_events/grounding.md", @@ -336,7 +336,7 @@ func TestRegisterAddsDNDFamily(t *testing.T) { "dnd.item_events/sharedassets/common-dnd-identity.md", "dnd.item_events/sharedassets/common-dnd-references.md", "dnd.item_events/sharedassets/common-dnd-system.md", - "dnd.item_events/sharedassets/common-dnd-transcript.md", + "dnd.item_events/sharedassets/common-dnd-transcript-chunk.md", "dnd.item_events/task.md", "dnd.npc_interactions/dnd.npc_interactions.yaml", "dnd.npc_interactions/instructions.md", @@ -347,7 +347,7 @@ func TestRegisterAddsDNDFamily(t *testing.T) { "dnd.scene_descriptions/sharedassets/common-dnd-identity.md", "dnd.scene_descriptions/sharedassets/common-dnd-references.md", "dnd.scene_descriptions/sharedassets/common-dnd-system.md", - "dnd.scene_descriptions/sharedassets/common-dnd-transcript.md", + "dnd.scene_descriptions/sharedassets/common-dnd-transcript-chunk.md", "dnd.scene_descriptions/task.md", }) assertAssetNamesContain(t, assets.SchemaFS, []string{ diff --git a/internal/modules/dnd/shared/assets.go b/internal/modules/dnd/shared/assets.go index 184f507..7c5099e 100644 --- a/internal/modules/dnd/shared/assets.go +++ b/internal/modules/dnd/shared/assets.go @@ -23,7 +23,9 @@ var sharedPromptPaths = map[string]string{ "common-dnd-system.md": "prompts/common-dnd-system.md", "common-dnd-extraction-evidence.md": "prompts/common-dnd-extraction-evidence.md", "common-dnd-identity.md": "prompts/common-dnd-identity.md", - "common-dnd-transcript.md": "prompts/common-dnd-transcript.md", + "common-dnd-transcript-full.md": "prompts/common-dnd-transcript-full.md", + "common-dnd-transcript-chunk.md": "prompts/common-dnd-transcript-chunk.md", + "common-dnd-transcript-windows.md": "prompts/common-dnd-transcript-windows.md", "common-dnd-references.md": "prompts/common-dnd-references.md", "common-dnd-npcs.md": "prompts/common-dnd-npcs.md", "common-dnd-entity-reconciliation.md": "prompts/common-dnd-entity-reconciliation.md", diff --git a/internal/modules/dnd/shared/assets_test.go b/internal/modules/dnd/shared/assets_test.go index b162c89..9c8673e 100644 --- a/internal/modules/dnd/shared/assets_test.go +++ b/internal/modules/dnd/shared/assets_test.go @@ -20,7 +20,9 @@ func TestPromptAssetManifestPromptFS(t *testing.T) { }, SharedFiles: []string{ "common-dnd-system.md", - "common-dnd-transcript.md", + "common-dnd-transcript-full.md", + "common-dnd-transcript-chunk.md", + "common-dnd-transcript-windows.md", }, } @@ -47,7 +49,9 @@ func TestPromptAssetManifestPromptFS(t *testing.T) { } for _, path := range []string{ "assets/prompts/dnd.test/sharedassets/common-dnd-system.md", - "assets/prompts/dnd.test/sharedassets/common-dnd-transcript.md", + "assets/prompts/dnd.test/sharedassets/common-dnd-transcript-full.md", + "assets/prompts/dnd.test/sharedassets/common-dnd-transcript-chunk.md", + "assets/prompts/dnd.test/sharedassets/common-dnd-transcript-windows.md", } { content, err := fs.ReadFile(fsys, path) if err != nil { @@ -148,7 +152,7 @@ func TestPromptAssetManifestHashMatchesManifestParts(t *testing.T) { {Name: "task.md", Path: "assets/prompts/task.md"}, }, SharedFiles: []string{ - "common-dnd-transcript.md", + "common-dnd-transcript-chunk.md", "common-dnd-system.md", }, } @@ -164,7 +168,7 @@ func TestPromptAssetManifestHashMatchesManifestParts(t *testing.T) { want, err := llm.HashAssets([]llm.AssetHashPart{ {FS: moduleFS, Path: "assets/prompts/dnd.test.yaml"}, {FS: moduleFS, Path: "assets/prompts/task.md"}, - {FS: sharedFS, Path: "prompts/common-dnd-transcript.md"}, + {FS: sharedFS, Path: "prompts/common-dnd-transcript-chunk.md"}, {FS: sharedFS, Path: "prompts/common-dnd-system.md"}, }) if err != nil { @@ -176,7 +180,7 @@ func TestPromptAssetManifestHashMatchesManifestParts(t *testing.T) { withUnused, err := llm.HashAssets([]llm.AssetHashPart{ {FS: moduleFS, Path: "assets/prompts/dnd.test.yaml"}, {FS: moduleFS, Path: "assets/prompts/task.md"}, - {FS: sharedFS, Path: "prompts/common-dnd-transcript.md"}, + {FS: sharedFS, Path: "prompts/common-dnd-transcript-chunk.md"}, {FS: sharedFS, Path: "prompts/common-dnd-system.md"}, {FS: sharedFS, Path: "prompts/common-dnd-npcs.md"}, })