2026-11-27 01:15:40 +00:00
|
|
|
package runner
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"gitea.maximumdirect.net/eric/audita/v4/internal/core/chunking"
|
|
|
|
|
"gitea.maximumdirect.net/eric/audita/v4/internal/core/config"
|
|
|
|
|
"gitea.maximumdirect.net/eric/audita/v4/internal/core/schema"
|
|
|
|
|
"gitea.maximumdirect.net/eric/audita/v4/internal/framework/contracts"
|
2026-11-27 01:17:45 +00:00
|
|
|
"gitea.maximumdirect.net/eric/audita/v4/internal/framework/preflight"
|
2026-11-27 01:15:40 +00:00
|
|
|
"gitea.maximumdirect.net/eric/audita/v4/internal/framework/structuredoutput"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type testRunInput struct {
|
|
|
|
|
Config *config.Config
|
|
|
|
|
Transcript *schema.Transcript
|
|
|
|
|
ModuleSpecs []contracts.ModuleRunSpec
|
|
|
|
|
Interactions structuredoutput.InteractionSink
|
|
|
|
|
Evidence *EvidenceSelection
|
|
|
|
|
Progress func(Progress)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func preparedTestInput(input testRunInput) RunInput {
|
|
|
|
|
cfg := chunking.ChunkingConfig{MaxSectionTokens: int(^uint(0) >> 1)}
|
|
|
|
|
if input.Config != nil {
|
|
|
|
|
cfg = chunking.ChunkingConfig{MaxSectionTokens: input.Config.Chunking.MaxSectionTokens, MinSectionTokens: input.Config.Chunking.MinSectionTokens, TargetSections: input.Config.Chunking.TargetSections}
|
|
|
|
|
}
|
|
|
|
|
sections, err := chunking.NewChunker(cfg).ChunkTranscript(input.Transcript)
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
2026-11-27 01:17:45 +00:00
|
|
|
return RunInput{Plan: &preflight.Plan{Sections: sections, Transcript: input.Transcript, Specs: input.ModuleSpecs, Config: input.Config}, Interactions: input.Interactions, Evidence: input.Evidence, Progress: input.Progress}
|
2026-11-27 01:15:40 +00:00
|
|
|
}
|