Adopt Audita v2 configuration and subprocess contract

This commit is contained in:
2026-09-25 15:45:02 +00:00
parent 7e0151ef93
commit 77d9d57937
26 changed files with 522 additions and 1260 deletions

View File

@@ -207,35 +207,18 @@ func buildDefaultAuditaRunner(cfg *config.Config) (audita.Runner, error) {
return &audita.NoopRunner{}, nil
}
report := false
if a.Report != nil {
report = *a.Report
timeout, err := time.ParseDuration(a.Timeout)
if err != nil {
return nil, fmt.Errorf("parse pipeline.audita.timeout %q: %w", a.Timeout, err)
}
llmAPIKey := ""
llmAPIKeyReference := ""
if a.LLMAPIKey != nil {
llmAPIKey = a.LLMAPIKey.Value()
llmAPIKeyReference = a.LLMAPIKey.EnvName()
}
runner, err := audita.NewSubprocessRunnerFromConfigValues(
a.Binary,
a.Timeout,
llmAPIKey,
llmAPIKeyReference,
append([]string(nil), a.Modules...),
a.BaseURL,
a.Model,
a.TranscriptDescription,
a.ConfigPath,
a.OutputSchema,
a.WorkDirRetention,
a.TotalLLMConcurrency,
a.ProposalLLMConcurrency,
a.ValidationModel,
a.ValidationLLMConcurrency,
report,
)
runner, err := audita.NewSubprocessRunner(audita.SubprocessRunnerConfig{
Binary: a.Binary, Timeout: timeout, Credentials: a.Credentials,
Modules: append(a.Modules[:0:0], a.Modules...),
Overlay: a.Overlay, ProposalProfile: a.ProposalProfile,
ValidationProfile: a.ValidationProfile,
TranscriptDescription: a.TranscriptDescription, ConfigPath: a.ConfigPath,
OutputSchema: a.OutputSchema,
})
if err != nil {
return nil, fmt.Errorf("from pipeline.audita: %w", err)
}