From c44eb680b2901ee4abf7220cab12fdf2811625cc Mon Sep 17 00:00:00 2001 From: Mathias Bergqvist Date: Wed, 22 Apr 2026 13:35:38 +0200 Subject: [PATCH] feat(exec): surface AttemptRecord slice on Result for session logging --- cmd/supervisor/main.go | 4 +++- internal/exec/result.go | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/supervisor/main.go b/cmd/supervisor/main.go index b5804ef..58d0ac4 100644 --- a/cmd/supervisor/main.go +++ b/cmd/supervisor/main.go @@ -101,7 +101,9 @@ func main() { } attempts := make([]iexec.AttemptRecord, 0, len(chain)) orch := iexec.NewOrchestrator(chain, litellmExec.Run, claudeExec.Run, verifier, models.LlamaSwapURL(), &attempts) - return orch.Run(ctx, req) + result, err := orch.Run(ctx, req) + result.Attempts = attempts // attach orchestration metadata before returning + return result, err } } diff --git a/internal/exec/result.go b/internal/exec/result.go index 8b2f4dc..025f9fb 100644 --- a/internal/exec/result.go +++ b/internal/exec/result.go @@ -14,9 +14,10 @@ type Result struct { Skill string `json:"skill"` // tdd | review | ... FilePath string `json:"file_path"` // absolute path to generated file RunnerOutput string `json:"runner_output"` // raw stdout+stderr from test runner - Verified bool `json:"verified"` // based on exit code, never self-report - ModelUsed string `json:"model_used"` // model name or "self" - Message string `json:"message"` // one sentence summary + Verified bool `json:"verified"` // based on exit code, never self-report + ModelUsed string `json:"model_used"` // model name or "self" + Message string `json:"message"` // one sentence summary + Attempts []AttemptRecord `json:"attempts,omitempty"` // populated by orchestrator, not Claude } var validStatuses = map[string]bool{"pass": true, "fail": true, "error": true}