Repository navigation
refactor: route command output through explicit writers - #123
Merged
Merged
Conversation
entelecheia
marked this pull request as ready for review
November 9, 2026 22:29
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94
Final T4 after #120, #121 and #122. Command/module text follows the supplied writer instead of bypassing it through process stdout.
RunContext.Outresolves throughOutput()with the previous stdout default when nil. CLI contexts passcmd.OutOrStdout(); console logs and apply-recording warnings use the error writer. Metadata/audit stderr warnings remain separate. Explicit tenant writers (including discard) retain priority.Module and CLI bare stdout prints are gone. Shared UI helpers cover styled status rows and plain text/tables; names-only lists and raw id/groups/quota payloads keep their bytes. Production glyph literals are centralized in UI, including unstyled constants where a description enters JSON. Tenant uses the leaf UI constants; low-level backup previews use ASCII
->rather than adding an exec-to-UI dependency. Fleet shares the JSON encoder with its existing HTML-escaping mode and uses the same exit-code constant.Verification
fmt.Print*in module/CLI production code and no production glyph literal outside UI. Explicit-writer, nil fallback, stdout-leak, warning separation, raw-payload and table tests cover the routing.11455ae, with failing ambientufwandsshdfirst on PATH. Twenty managed renderers/constants are byte-identical to main. Config/profiles/fingerprints, fleet remote commands, sudoers and schedule sources are untouched. Six-profile module tests assert actual Check/RunAll outcome order and unchanged managed directories/files/backups.11455aeafter the host became healthy: failing UFW first on PATH, race tests for CLI/module/UI/tenant/exec passed (14.5s/65.6s/1.4s/2.6s/2.2s),go vet ./internal/...clean, specs 21/0 errors. The author's earlier admission deferral is superseded by this exact-head reviewer evidence.Reviewed text diffs
All six profiles have before/after captures under
internal/module/testdata/output-t4/and full CLI captures underinternal/cli/testdata/output-t4/(plus exit/stderr results). With colors disabled, the common change is one additional space after the status marker:When colors are enabled, RunAll uses the existing styled UI markers. Raw payload/table spacing and command words remain unchanged. Rollback symlink previews use
->; machine-facing Storage and Cloudflared arrows retain their existing bytes through unstyled constants. The fixture seeds a chosen Docker log driver so the pre-existing daemon-updates map iteration does not make captures nondeterministic; output is never sorted to hide module ordering.Release notes
Text status rows use the common marker spacing/style, and rollback symlink previews use an ASCII separator. Commands embedded with a custom output writer now capture their module text consistently. JSON/Prometheus, managed file content and fleet/schedule commands are unchanged. No new reload, restart or operator action is introduced.