Migrate CLI execution and terminal reports

This commit is contained in:
2026-11-18 19:04:15 +00:00
parent e7a8b0db04
commit 77f168c660
7 changed files with 66 additions and 66 deletions

View File

@@ -24,7 +24,7 @@ func TestCollectorProjectsOnlyTerminalAggregates(t *testing.T) {
}
collector.Observe(promptkit.ExecutionEvent{
Kind: promptkit.ExecutionFinished, RunID: "run-1", PromptID: "prompt-1",
PromptVersion: "1", ProfileID: "profile-1", BackendID: "backend-1", Model: "model-1",
ProfileID: "profile-1", BackendID: "backend-1", Model: "model-1",
Outcome: promptkit.ExecutionOutcomeError, Failure: promptkit.ExecutionFailureProviderStatus,
StatusCode: 503, RetriesExhausted: true, Attempts: 3, TransientRetries: 2, RepairCalls: 1,
Duration: 1500 * time.Millisecond, CapacityWait: 20 * time.Millisecond,
@@ -54,7 +54,7 @@ func TestCollectorProjectsOnlyTerminalAggregates(t *testing.T) {
if err := json.Unmarshal(encoded, &fields); err != nil {
t.Fatal(err)
}
for _, key := range []string{"run_id", "prompt_id", "prompt_version", "profile_id", "backend_id", "model", "outcome", "failure", "status_code", "retries_exhausted", "attempts", "transient_retries", "repair_calls", "duration_ms", "capacity_wait_ms", "generation_duration_ms", "retry_delay_ms", "usage"} {
for _, key := range []string{"run_id", "prompt_id", "profile_id", "backend_id", "model", "outcome", "failure", "status_code", "retries_exhausted", "attempts", "transient_retries", "repair_calls", "duration_ms", "capacity_wait_ms", "generation_duration_ms", "retry_delay_ms", "usage"} {
if _, ok := fields[key]; !ok {
t.Fatalf("report missing %q: %s", key, encoded)
}
@@ -65,7 +65,7 @@ func TestCollectorProjectsOnlyTerminalAggregates(t *testing.T) {
t.Fatalf("incomplete token count %q: %#v", key, item)
}
}
for _, forbidden := range []string{"session_id", "headers", "endpoint", "api_key", "error", "output", "input"} {
for _, forbidden := range []string{"prompt_version", "session_id", "headers", "endpoint", "api_key", "error", "output", "input"} {
if _, present := fields[forbidden]; present {
t.Fatalf("report exposed %q: %s", forbidden, encoded)
}