Skip to content

writ reconcile: the command is renamed, and its renderings go through the sink #774

Closed

Description

@David-Noble-at-work

Epic: #740 — one output convention, every app.
Plan: docs/plans/feature/774-writ-reconcile.md
Related: #762 (the writ lifecycle surface, whose phase 2 this is), #756, #761

writ status is retired and writ reconcile takes its place. This is not a rename followed by a
rendering refactor — it is one piece of work, because the renderings being rewritten live in the package
being renamed.

The settled surface

writ reconcile produces a report. It has no command flags. It takes the globals — --output /
-o, --filter, --jq, --store, --dry-run — and must utilize all of them faithfully. The selector
between fix, diff and summary behaviors is deferred to the reconciliation epic (#772).

What has to happen

The rename. git mv cmd/writ/writ/status cmd/writ/writ/reconcile, status.go → reconcile.go, so
history follows. status.Report → reconcile.Report and the rest of the package surface. No alias — the
old name stops existing. The scenario tests and the plan documents naming writ status follow.

The renderings. 30 stdout call sites route through the sink:

Location Calls
status/report.go → reconcile/report.go 22 fmt.Print*
deploy, decommission, upgrade, secret 4 SerializeGraphs(os.Stdout, …) dry-run dumps
migrate/session.go 1 os.Stdout — classify as narration or result
migrate_cmd.go 1 os.Stdout — FormatMigrationPlan
migrate's own --format retired in favor of -o

The globals, actually consumed. -o must render all eight formats rather than one. --store must be
read. --jq and --filter must reach the pipeline. --dry-run must be honored.

One design question this raises and does not answer

Report is an object of three slices and a struct — shape S4 — so -o list renders four lines with each
section as compact JSON, and -o table renders one row of four cells. Legible for list, useless for
table. Whether that is acceptable, or whether the presenters need a case for a sectioned object, is a
question for after the pipeline is wired. Wiring is not blocked on it: -o json, -o yaml, -o none,
--jq and --filter all become correct immediately.

Metadata

Metadata

Labels

featureDeliverable unit within an epic

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions