Remove retired runtime wrappers and persistent cache machinery
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/generic/chunk/units"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/generic/merge/appendorder"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/generic/normalize/noop"
|
||||
jsonoutput "gitea.maximumdirect.net/eric/notarius/internal/modules/generic/output/json"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/seriatim/input/transcript"
|
||||
"go.maximumdirect.net/promptkit"
|
||||
)
|
||||
@@ -36,13 +37,6 @@ func (v observedSpellValidator) Validate(ctx context.Context, req contracts.Type
|
||||
return v.TypedValidator.Validate(ctx, req)
|
||||
}
|
||||
|
||||
type spellPipelineOutput struct{}
|
||||
|
||||
func (spellPipelineOutput) Key() string { return "test/spell-output" }
|
||||
func (spellPipelineOutput) Encode(context.Context, contracts.OutputRequest) (contracts.OutputResult, error) {
|
||||
return contracts.OutputResult{}, nil
|
||||
}
|
||||
|
||||
func TestNativeSpellPipelineAssessesEveryCandidateOnce(t *testing.T) {
|
||||
response := func(name string) string {
|
||||
return fmt.Sprintf(`{"spell_casts":[{"caster":"Aria","spell":%q,"source_refs":[{"start_unit_id":1,"end_unit_id":1}]}]}`, name)
|
||||
@@ -87,8 +81,7 @@ func TestNativeSpellPipelineAssessesEveryCandidateOnce(t *testing.T) {
|
||||
return result, nil
|
||||
}))
|
||||
check(noop.RegisterTyped[dnd.SpellList](registries.Normalizers, dnd.SpellListKind))
|
||||
check(registries.Outputs.RegisterWithSpec(pipeline.ModuleSpec{Key: "test/spell-output", Stage: pipeline.StageOutput, ExecutionClass: contracts.ExecutionClassDeterministic},
|
||||
func() (contracts.OutputEncoder, error) { return spellPipelineOutput{}, nil }))
|
||||
check(jsonoutput.Register(registries.Outputs))
|
||||
catalogValidator, err := spellcatalogvalidator.New(spellcatalogvalidator.Options{})
|
||||
check(err)
|
||||
validators := []contracts.TypedValidator[dnd.SpellList]{
|
||||
@@ -114,7 +107,7 @@ func TestNativeSpellPipelineAssessesEveryCandidateOnce(t *testing.T) {
|
||||
turns := 2
|
||||
profile := pipeline.PipelineProfile{
|
||||
ID: "native-spells", Input: pipeline.Binding(transcript.Key),
|
||||
Chunk: pipeline.Binding(units.Key), Output: pipeline.Binding("test/spell-output"),
|
||||
Chunk: pipeline.Binding(units.Key), Output: pipeline.Binding(jsonoutput.Key),
|
||||
LLMProfile: "profile-spells",
|
||||
Artifacts: map[string]pipeline.ArtifactLaneProfile{"spells": {
|
||||
Extract: pipeline.ModuleBinding{Module: Key, Mode: &test.mode, MaxAdditionalTurns: &turns,
|
||||
@@ -138,7 +131,7 @@ func TestNativeSpellPipelineAssessesEveryCandidateOnce(t *testing.T) {
|
||||
var preparations []promptkit.PreparedRun
|
||||
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
||||
Prepared: prepared, SourceID: "spell-session", SessionID: "spell-session-override", Workers: 1,
|
||||
RawInput: []byte(`{"segments":[{"id":1,"speaker":"Alice","start":0,"end":1,"text":"I cast Cure Wounds."}]}`),
|
||||
RawInput: []byte(`{"metadata":{},"segments":[{"id":1,"speaker":"Alice","start":0,"end":1,"text":"I cast Cure Wounds."}]}`),
|
||||
Execution: contracts.ExecutionOptions{Execution: &promptkit.ExecutionTargetOverride{Model: model},
|
||||
OnPrepared: func(_ context.Context, value promptkit.PreparedRun) { preparations = append(preparations, value) }},
|
||||
})
|
||||
@@ -186,10 +179,10 @@ func TestNativeSpellPipelineAssessesEveryCandidateOnce(t *testing.T) {
|
||||
if test.wantError {
|
||||
return
|
||||
}
|
||||
if output.FallbackCount != test.fallbacks || len(output.NormalizeOutputs) != 1 {
|
||||
if output.FallbackCount != test.fallbacks || len(output.OutputFiles) != 1 {
|
||||
t.Fatalf("outcome = %#v", output)
|
||||
}
|
||||
value, err := spellcodec.New().Decode(output.NormalizeOutputs[0].Artifact.Content)
|
||||
value, err := spellcodec.New().Decode(output.OutputFiles[0].Bytes)
|
||||
check(err)
|
||||
if test.fallbacks > 0 {
|
||||
if value.SpellCasts == nil || len(value.SpellCasts) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user