Repository navigation
fix(cli): baseline warnings on stderr; human_path for the resolved-root notice (#9806) - #9824
Conversation
…h human_path (#9806) Two output-consistency fixes from the #9604 CLI audit: - ripr baseline create and baseline update printed their operator warnings to stdout while every comparable advisory surface (gate, check notices, progress) uses stderr; piping stdout silently dropped exactly the warning the code says must reach the operator. Warnings now ride stderr; the smoke test pins stdout to the write confirmation and stderr to the warning. - ripr check's "resolved workspace root to ..." notice rendered the raw canonicalized path, which on Windows carries an untypable \? verbatim prefix; it now routes through output::path::human_path, the same renderer the adjacent skipped-config warning and ripr init use.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 45 minutes. View limit details
Comment |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm no changed-behavior test shown covers baseline update moving its warning count from stdout to stderr.
- Confirm no direct test shown proves resolved-root notices use human_path and omit Windows verbatim path prefixes such as \?\C:.
- Confirm the changed test directly proves baseline-create warning stderr separation, but this diff does not directly assert baseline-update warning routing or the humanized resolved-root notice.
- Confirm the update warning output was changed to stderr, but no changed test assertion in the patch proves its stream contract.
- Confirm human_path removes platform-specific verbatim prefixes, but the patch contains no Windows-specific assertion for the resolved-root notice.
Refuted
- Rendering the canonicalized workspace root through human_path changes which directory is resolved.; refuted because: The same canonical Path is passed to a display adapter; no assignment, canonicalization, or routing behavior changed.
- The fix should introduce a shared renderer or broader output abstraction to keep both branches consistent.; refuted because: Both changed branches already use direct stderr primitives, and the renderer refactor is explicitly deferred. Adding a new helper here would exceed the smallest complete fix.
- Using human_path is likely to alter the structured or machine-consumed meaning of the resolved-root notice.; refuted because: The changed call occurs inside an existing terminal_safe notice and matches the adjacent warning's established renderer; the diff does not redirect the notice stream or alter root resolution.
Parked follow-ups
- Baseline update's warning-count print was changed to stderr, but the PR's modified smoke assertion exercises only baseline create.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Governing issue or accepted claim: #9806 (CLI output-consistency audit follow-up from #9604; items 1 and 2 of 3)
Acceptance delta (one sentence):
ripr baseline create/updatewarnings can no longer be silently lost by piping stdout, andripr check's resolved-root notice prints a path Windows users can actually type.What changed
Baseline warnings ride stderr.
baseline.rs:78-84(create) andbaseline.rs:187-192(update) printedWarnings: ...to stdout while every comparable advisory surface in the CLI (gate.rs:83, allcheck.rsnotices, progress output) uses stderr — soripr baseline create ... > log.txtdropped exactly the advisory the code comment says must reach the operator. Both now useeprintln!;Wrote/Entries/Migratedconfirmations stay on stdout.Resolved-root notice uses
human_path.check.rs:374-381rendered the rawcanonicalized path — on Windows an untypable\?\C:\...verbatim prefix. It now routes throughoutput::path::human_path, the same renderer the adjacent skipped-closer-config warning (check.rs:391-402) andripr init(init.rs:669) already use.The cli_smoke assertion that pinned warnings on stdout now pins stderr for the warning and stdout for the write confirmation.
Item 3 of #9806 (one shared renderer for every
Wrote ...confirmation across ~15 sites) is a follow-up pass.Validation
cargo test -p ripr --test cli_smoke -- baseline: 10 passed.cargo check -p ripr --libclean; fmt clean. No allow/expect attributes added.Rollback
Revert; output-stream and path-rendering change only, no persisted state.