Document and validate preflight readiness

This commit is contained in:
2026-11-27 01:26:07 +00:00
parent a9ab8e59b3
commit 7874ea648b
14 changed files with 143 additions and 35 deletions

View File

@@ -15,7 +15,9 @@ import (
"strings"
"testing"
"gitea.maximumdirect.net/eric/audita/v4/internal/framework/llm"
commandkit "go.maximumdirect.net/commandkit"
pk "go.maximumdirect.net/promptkit"
)
func TestPreflightBindingsAndRunAlias(t *testing.T) {
@@ -181,3 +183,17 @@ func TestPreflightCancellationRetainsPartialProfileDiagnostics(t *testing.T) {
t.Fatalf("status=%d calls=%d cause=%v stderr=%q", result.Status, calls, result.Cause, stderr.String())
}
}
func TestPreflightUsagePreservesUnknownAndCompleteness(t *testing.T) {
report := &pk.SmokeTestReport{Usage: pk.ObservedTokenUsage{
PromptTokens: pk.ObservedTokenCount{Known: true, Complete: false, Value: 4},
CompletionTokens: pk.ObservedTokenCount{Known: true, Complete: true, Value: 0},
TotalTokens: pk.ObservedTokenCount{Known: false, Complete: true},
}}
line := verificationLine(llm.ProfileVerification{ProfileID: "fixture", Status: llm.VerificationSuccess, Report: report})
for _, want := range []string{"prompt=4 (incomplete)", "completion=0 (complete)", "total=unknown (complete)", "reasoning=unknown (incomplete)"} {
if !strings.Contains(line, want) {
t.Fatalf("missing %q in %q", want, line)
}
}
}