Skip to content

feat(#1198): run log records each phase's model and the sequant version - #1220

Merged
admarble merged 6 commits into
mainfrom
feature/1198-feat-logs-run-log-records-each-phase-s-model-and-t
Sep 29, 2026
Merged

admarble merged 6 commits into
mainfrom
feature/1198-feat-logs-run-log-records-each-phase-s-model-and-t

Conversation

@admarble

@admarble admarble commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • AC-1: Each run-log PhaseLog now has an optional model (the resolved model from modelUsage) and requestedModel (the pre-resolution role: string, when one was configured). All three createPhaseLogFromTiming call sites in batch-executor.ts fill them in: spec, the main phase loop, and the quality loop.
  • AC-2: The RunLog top level has sequantVersion (from getVersion() in createEmptyRunLog) and driver (resolveRunAgent(config) passed through LogWriterOptions).
  • AC-3: The top-level model in metrics.json is the first phase's resolved model, in config.phases order. It falls back to ANTHROPIC_MODEL ?? "opus" only when no phase reported one.

Runner fix after QA (AC_NOT_MET → fixed)

QA found that all three call sites logged config.phasePolicies[phase].model as requestedModel. resolvePhasePolicies has already replaced that value with the resolved model, so a role:fast policy was logged as requestedModel: "claude-sonnet-5". QA also found that the tests built PhaseLog by hand and never ran the wiring.

  • The sites now read .requestedModel. ExecutionConfig.phasePolicies's inline type gains requestedModel?, which resolvePhasePolicies already set at runtime.
  • New tests in batch-executor.test.ts (#1198: phase log model fields (AC-1)) run runIssueWithLogging and assert what reaches createPhaseLogFromTiming. With a role:fast policy, requestedModel is "role:fast" and model is the dispatched model. With a raw model policy, requestedModel is absent.

Mutation-verified: AC-1 — the main-loop site changed back to ?.model; both new wiring tests failed (2 failed / 102 passed); restored.

Known limitation (QA, recommended action "document")

When the model ladder escalates a phase, the per-phase requestedModel still holds the phase's base role: policy. The escalation's own requested rung is recorded in config.modelEscalation (see ModelEscalationFacts.requestedModel), not on the phase log.

Test plan

  • npx tsc --noEmit: clean
  • npx vitest run src/lib/workflow/batch-executor.test.ts src/lib/workflow/run-log-schema.test.ts src/lib/workflow/log-writer.test.ts src/lib/workflow/run-orchestrator.test.ts src/lib/workflow/run-orchestrator.model-roles.test.ts: 259 passed (runner, after the fix)
  • CHANGELOG [Unreleased] entry

Closes #1198
Refs #1203

🤖 Generated with Claude Code

@admarble admarble changed the title feat(#1198): feat(logs): run log records each phase's model and the sequant version feat(#1198): run log records each phase's model and the sequant version Sep 29, 2026
@admarble
admarble merged commit 7b36d9b into main Sep 29, 2026
7 checks passed
@admarble
admarble deleted the feature/1198-feat-logs-run-log-records-each-phase-s-model-and-t branch September 29, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(logs): run log records each phase's model and the sequant version

1 participant