Skip to content

TTY-aware output under the git porcelain rule (Closes #33) - #53

Merged
cursor[bot] merged 3 commits into
mainfrom
kimi/issue-33-tty-output
Jul 19, 2026
Merged

cursor[bot] merged 3 commits into
mainfrom
kimi/issue-33-tty-output

Conversation

@0xLeif

@0xLeif 0xLeif commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Closes #33.

Summary

TTY-aware output under the git porcelain rule (design decision 5, minimal chrome): human output may be pretty, machine output is a frozen contract.

  • New TTY.swift: isatty detection, NO_COLOR-aware Style (bold/red/green, identity when disabled), column-aligning table(header:rows:)
  • keys: aligned bold-header table on a TTY; byte-stable TSV when piped (verified byte-for-byte); new --quiet prints key names only
  • JSON: pretty on TTY, compact single-line when piped (gh rule) via CLIOutput.encodeJSON for --json payloads and JSONCoding.encodeAuto for dump (keeps the injected dependency — the DI demo stays honest)
  • Flag symmetry: watch --json is now an alias for --jsonl
  • README: new "Output modes (human and agent)" section + --generate-completion-script bash|zsh|fish documentation

Machine shapes stay additive-only; only whitespace and (TTY-only) ANSI adapt. Error-path coloring is deliberately out of scope here: the error contract PR (#50) owns the fail path when it lands.

Verification (local, worktree)

  • swift build clean; 44 tests (4 new: table alignment, style identity off-TTY, compact JSON off-TTY for both encoders), 0 failures
  • smoke.sh green incl. new assertions: piped keys is TSV with zero ANSI, keys --quiet, watch --json alias, all JSON greps moved to the compact contract
  • specsync check --force 7/7 files 100%, specsync change check 20 active valid, fledge lanes run verify green
  • Manual: piped keys byte-dumped (TSV, no ESC), piped dump single-line, TTY paths inspected

SpecSync

  • CHG-0021 accepted (feature; REQ-aps-cli-019 with requirement evidence; deltas for both spec modules)
  • Evidence rebound for shared accepted changes via audited reopen (actor 0xLeif)

Merge note

Overlaps #50 (CLIOutput/Aps error paths) and #51 (README agent section) textually but not semantically; whichever merges second gets the usual rebase + rebind pass, which I will happily run.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review (agent:cursor) — tested locally

Verdict: Approve after SpecSync renumber (post-#50).

Tested

  • fledge lanes run verify: pass (41 tests + smoke)
  • CI: all green
  • Piped aps keys emits stable TSV; keys --quiet prints names only; piped --json is compact single-line

Required before merge

Merge order

Safe soon after #50. Orthogonal enough to #54/#55, but rebase for SpecSync evidence churn.

0xLeif added 3 commits July 19, 2026 12:59
- new TTY.swift: isatty detection, NO_COLOR-aware Style, aligned table
- keys: aligned bold-header table on TTY, byte-stable TSV when piped,
  --quiet for names only
- JSON pretty on TTY, compact when piped (gh rule) via CLIOutput.encodeJSON
  and JSONCoding.encodeAuto (dump keeps the injected dependency)
- watch --json aliases --jsonl
- README documents output modes and --generate-completion-script
- tests (4 new) + smoke (piped-plain, alias, quiet, compact greps);
  specs in lockstep
- SpecSync CHG-0021 accepted; evidence rebound for shared changes
  (audited reopens, actor 0xLeif)
FileHandle.fileDescriptor is unavailable on Windows; use MSVCRT
_isatty/_fileno via ucrt there.
Piped JSON is now compact (gh rule); the PowerShell smoke greps still
expected the pretty form.
@cursor
cursor Bot force-pushed the kimi/issue-33-tty-output branch from 6601523 to ea7599b Compare July 19, 2026 12:59
@cursor
cursor Bot merged commit ea7599b into main Jul 19, 2026
3 of 4 checks passed
@cursor
cursor Bot deleted the kimi/issue-33-tty-output branch July 19, 2026 12:59
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Landed on main via rebase (CHG-0022) after #50. Closing as merged by hand: ea7599b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TTY-aware output under the git porcelain rule

1 participant