Repository navigation
feat(cli): render Markdown summaries and style progress output - #1927
Conversation
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
| if written != len(styled) { | ||
| return 0, io.ErrShortWrite | ||
| } |
There was a problem hiding this comment.
When the underlying writer performs a partial write (returns written < len(styled) with no error), this method returns 0, io.ErrShortWrite. However, some styled bytes have already been irreversibly flushed to the destination. Returning 0 tells the caller that none of its input was consumed, which can cause duplicated/garbled output if the caller retries with the same buffer.
While current callers (fmt.Fprintf) don't retry on error, this violates the expected io.Writer semantics where n should reflect actual consumption. Consider tracking how many original input bytes map to the successfully written styled portion, or at minimum returning len(data) alongside the error to signal full consumption (since the transformation makes partial recovery impossible anyway).
|
Independent verification on macOS (Go 1.26.10), commit Tests / build
Terminal-safety probes (calling
Non-blocking observations
Overall: the security boundary (untrusted Markdown → terminal) looks sound, and the presentation-only scope is respected. Verified with AI assistance (DeepSeek Harness, deepseek-v4.1-flash); all commands were run locally against the PR tree. |
5570267 to
51f6b35
Compare
Summary
ocr scanproject summaries as terminal Markdown, including headings, emphasis, inline code, lists, and tables.This is a presentation-only PR. It does not include behavioral-analysis workflows, new model calls, prompt changes, or result-schema changes. Review comments keep their existing layout.
--color=alwaysintentionally styles redirected console output for uses such asless -R;--output <file>keeps Markdown delimiters regardless of that flag. Text files retain the existing terminal-control sanitization; JSON preserves the original summary string. Markdown follows CommonMark emphasis rules; punctuation next to closing bold delimiters can affect rendering.Validation
make license-addandmake checkmake test, plus focused race-enabled renderer/security testsmake coverage: 91.6% totalmake buildTERM=dumb. These validate presentation and delivery, not model quality.ocr reviewand a focused follow-up review. The private-CSI finding was fixed and covered by regression tests; suggestions about forced-color pipes and existing text-file control sanitization were checked against the documented contract and baseline behavior.AI Assistance
Prepared with Codex CLI using
gpt-6-astra. Automated pre-commit review usedocrwithgpt-6-astra.