T-1197: Show variant agent and warn on consolidation mismatch in orbit finalize#158
Conversation
Plan the enhancement to `orbit finalize` so it (a) shows the agent
(alias, type, model) used for the variant being finalized in the
confirmation preamble, and (b) warns when --variant disagrees with
the most recent chosen_variant_id recorded in consolidation-log.json.
The mismatch warning is informational: the user can still proceed via
the existing y/N prompt or --force. A missing or unreadable
consolidation log is treated as "no verification possible" and skipped
silently, since consolidation is optional.
Adds specs/finalize-show-verify/{smolspec.md,tasks.md,decision_log.md}
with 5 implementation tasks (distributed test coverage plus a
lint/test gate). No code changes in this commit.
Generate a chronological catalog of all feature specs under specs/, with status (Done/In Progress/Planned/No Tasks) derived from each spec's tasks.md, plus per-spec file listings linking to the underlying documents. Excludes specs/bugfixes/ (tracked separately) and the empty specs/gear-mode and specs/general placeholder directories. Includes the new finalize-show-verify entry from the previous commit on this branch.
…n orbit finalize Render the variant's agent alias, agent type, and model in the finalize preamble, falling back to "Agent: unknown" when no fields are populated. Build the parenthetical conditionally so missing fields produce a clean string with no empty parens, dangling commas, or stray "model: " labels. Read consolidation-log.json (when present) and warn before the confirmation prompt when the requested --variant differs from the most recent consolidation entry's chosen_variant_id. The lookup runs before the --force gate so the warning is visible in CI output. Missing log, parse failure, or empty Entries are treated as "no verification" and emit nothing. Tests cover all/partial/no agent fields, mismatch firing, matching entries producing no warning, missing/corrupt/empty logs, and the --force path.
…rify Three-level explanation (beginner / intermediate / expert) of the cmd/orbit/finalize.go changes plus a Completeness Assessment table mapping each numbered requirement in smolspec.md to the code that satisfies it. Generated as part of pre-push-review validation; all nine requirements explained cleanly with no gaps.
Code Review — T-1197: Show variant agent and warn on consolidation mismatch in orbit finalizeOverviewThis PR adds two informational improvements to
The change is purely additive, contained to Code Quality
// finalize.go:35
fmt.Printf("%s\n", formatVariantAgentInfo(targetVariant))This can be simplified to
Nil safety — Test CoverageGood: Every smolspec requirement has a corresponding test case, including the One gap — multi-entry log: There is no test case with two log entries where the first mismatches but the second matches (or vice versa). The requirement is "most recent entry only", but the test suite only uses single-entry logs. Adding a case like: "only most recent entry is checked": {
setupLog: func(t *testing.T, repoRoot, specName string) {
writeConsolidationLog(t, repoRoot, specName, []consolidation.LogEntry{
mismatchEntry, // older entry: ChosenVariantID=2
matchingEntry, // newer entry: ChosenVariantID=1
})
},
args: []string{"--variant", "1"},
wantWarning: false, // should not warn — most recent matches
},…would pin the "last element wins" invariant explicitly. Test duplication: Panic safety in t.Cleanup(func() { os.Stdout = originalStdout })Architecture / DesignAcknowledged design debt — Warning on stdout vs stderr: The implementation notes justify this (preamble consistency, CI log visibility). Reasonable for now, but worth flagging: if a CI consumer ever tries to parse No breaking changes: The rebase path ( Specs / Documentation
Summary
Suggestions (none blocking):
|
Summary
orbit finalizeconfirmation preamble, with graceful fallback when fields are missing.--variantdisagrees with the most recentchosen_variant_idinconsolidation-log.json; warning fires before the--forcegate so it's visible in CI output.specs/finalize-show-verify/(smolspec, tasks, decision log) and a top-levelspecs/OVERVIEW.mdcatalog of all feature specs.Test plan
--forcepathmake testpassesmake lintpasses