Adopt Audita v2 configuration and subprocess contract
This commit is contained in:
@@ -272,8 +272,8 @@ func TestAssembledSplitBundleCommandsUseOneEffectiveFamilyConfiguration(t *testi
|
||||
}, &diff); err != nil {
|
||||
t.Fatalf("compare profiles: %v", err)
|
||||
}
|
||||
if !strings.Contains(diff.String(), "audita.model") || !strings.Contains(diff.String(), "character_items_arannis.profile_id") {
|
||||
t.Fatalf("profile diff = %q, want model and expanded family changes", diff.String())
|
||||
if !strings.Contains(diff.String(), "audita.proposal_profile") || !strings.Contains(diff.String(), "character_items_arannis.profile_id") {
|
||||
t.Fatalf("profile diff = %q, want proposal profile and expanded family changes", diff.String())
|
||||
}
|
||||
|
||||
common := []string{
|
||||
@@ -373,7 +373,7 @@ func TestAssembledSplitBundleProfileSwitchRecordsProvenanceAndLimitsReuse(t *tes
|
||||
if err != nil {
|
||||
t.Fatalf("switch to testing profile: %v", err)
|
||||
}
|
||||
if got, want := testingRuns, []int{0, 0, 0, 1, 1, 1, 1}; !reflect.DeepEqual(got, want) {
|
||||
if got, want := testingRuns, []int{0, 0, 0, 0, 0, 0, 0}; !reflect.DeepEqual(got, want) {
|
||||
t.Fatalf("testing profile runs = %v, want %v", got, want)
|
||||
}
|
||||
assertAssembledProvenance(t, store, testingSummary, "testing", config.EffectivePipelineDigest(testingCfg.Pipeline))
|
||||
|
||||
@@ -229,7 +229,7 @@ seriatim:
|
||||
binary: ` + seriatimBinary + `
|
||||
audita:
|
||||
binary: ` + auditaBinary + `
|
||||
llm_api_key: OPENROUTER_API_KEY
|
||||
credentials: [OPENROUTER_API_KEY]
|
||||
notification:
|
||||
mode: noop
|
||||
`
|
||||
@@ -778,10 +778,18 @@ func TestAuditaAppHelper(t *testing.T) {
|
||||
os.Exit(2)
|
||||
}
|
||||
processArgs := args[start:]
|
||||
if len(processArgs) < 2 || processArgs[0] != "process" {
|
||||
_, _ = os.Stderr.WriteString("expected Audita v2 process invocation\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
for _, arg := range processArgs {
|
||||
if arg == "--report-json" || arg == "--work-dir" || arg == "--debug" || arg == "--reporting=false" {
|
||||
_, _ = os.Stderr.WriteString("retired or unwanted Audita flag\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
|
||||
outputPath := appSeriatimFlagValue(processArgs, "--output")
|
||||
reportPath := appSeriatimFlagValue(processArgs, "--report-json")
|
||||
workDir := appSeriatimFlagValue(processArgs, "--work-dir")
|
||||
if strings.TrimSpace(outputPath) == "" {
|
||||
_, _ = os.Stderr.WriteString("missing --output\n")
|
||||
os.Exit(2)
|
||||
@@ -794,19 +802,9 @@ func TestAuditaAppHelper(t *testing.T) {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("write output: %v\n", err))
|
||||
os.Exit(2)
|
||||
}
|
||||
if strings.TrimSpace(reportPath) != "" {
|
||||
if err := os.MkdirAll(filepath.Dir(reportPath), 0o755); err != nil {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("mkdir report dir: %v\n", err))
|
||||
os.Exit(2)
|
||||
}
|
||||
if err := os.WriteFile(reportPath, []byte(`{"report":true}`), 0o644); err != nil {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("write report: %v\n", err))
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
if strings.TrimSpace(workDir) != "" {
|
||||
if err := os.MkdirAll(workDir, 0o755); err != nil {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("mkdir work dir: %v\n", err))
|
||||
for _, name := range []string{"errors.yml", "recoveries.yml", "report.md"} {
|
||||
if err := os.WriteFile(filepath.Join(filepath.Dir(outputPath), name), []byte("status: completed\n"), 0o644); err != nil {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("write %s: %v\n", name, err))
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,8 +395,8 @@ func TestConfigInspectionOutputsNeverExposeResolvedCredentialValues(t *testing.T
|
||||
t.Fatal(err)
|
||||
}
|
||||
writeInspectionOverlays(t, pipelinePath,
|
||||
"audita:\n model: production\n llm_api_key: NARRATIO_INSPECT_LLM_ONE\n",
|
||||
"audita:\n model: testing\n llm_api_key: NARRATIO_INSPECT_LLM_TWO\nnotarius:\n credentials: [NARRATIO_INSPECT_NOTARIUS_TWO]\n",
|
||||
"audita:\n proposal_profile: production\n credentials: [NARRATIO_INSPECT_LLM_ONE]\n",
|
||||
"audita:\n proposal_profile: testing\n credentials: [NARRATIO_INSPECT_LLM_TWO]\nnotarius:\n credentials: [NARRATIO_INSPECT_NOTARIUS_TWO]\n",
|
||||
)
|
||||
mustWriteTestFile(t, filepath.Join(filepath.Dir(pipelinePath), "overlays", "without-notarius-key.yml"), "notarius:\n credentials: []\n")
|
||||
|
||||
@@ -476,8 +476,8 @@ func TestConfigCommandsInspectMaintainedSplitBundleWithoutRuntimeState(t *testin
|
||||
if err := ConfigDiff(context.Background(), []string{"default", "testing", "--config", pipelinePath, "--campaign-file", campaignPath}, &diff); err != nil {
|
||||
t.Fatalf("ConfigDiff() error = %v", err)
|
||||
}
|
||||
if !strings.Contains(diff.String(), "audita.model") {
|
||||
t.Fatalf("split bundle overlay diff = %q, want model change", diff.String())
|
||||
if !strings.Contains(diff.String(), "audita.proposal_profile") {
|
||||
t.Fatalf("split bundle overlay diff = %q, want proposal profile change", diff.String())
|
||||
}
|
||||
if _, err := os.Stat(workspacePath); !os.IsNotExist(err) {
|
||||
t.Fatalf("inspection created example workspace: %v", err)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -364,8 +364,8 @@ func TestRefinementSemanticChangesRespectDependencyBranches(t *testing.T) {
|
||||
wantRuns [7]int
|
||||
wantExtractStatus manifest.StageStatus
|
||||
}{
|
||||
{name: "polish model", mutate: func(cfg *config.Config) {
|
||||
cfg.Pipeline.Audita.Model = "production"
|
||||
{name: "polish description", mutate: func(cfg *config.Config) {
|
||||
cfg.Pipeline.Audita.TranscriptDescription = "production"
|
||||
}, wantRuns: [7]int{0, 0, 0, 1, 1, 1, 1}, wantExtractStatus: manifest.StatusStale},
|
||||
{name: "normalize schema", mutate: func(cfg *config.Config) {
|
||||
cfg.Pipeline.Normalize = &config.NormalizeConfig{OutputSchema: "seriatim.transcript.v2"}
|
||||
|
||||
Reference in New Issue
Block a user