Skip to content

test: run repeated CLI formatting capacity pairings in process - #14279

Merged
morluto merged 1 commit into
mainfrom
test/trim-cli-formatting-capacity
Nov 24, 2026
Merged

morluto merged 1 commit into
mainfrom
test/trim-cli-formatting-capacity

Conversation

@morluto

@morluto morluto commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

tests/acceptance/cliFormattingCapacity.test.ts ran 11 presentations × success/failure. That is 22 fresh CLI processes with an encoder loader hook, plus a SIGPIPE case. It was 67.7 s of module time in main CI run 45303778758 and among the slowest acceptance files. Most of the pairings repeat the same recovery in createCliResultOutput. This keeps one real process per distinct behaviour and checks every pairing in process.

Real-process cases kept (11 + SIGPIPE)

Each kept case covers a distinct encoder boundary, presentation owner or outcome:

Kept case Distinct behaviour
default TOON × success, default TOON × failure encodeLines boundary, both outcomes, real failure envelope from a missing target
human TOON × success terminal (isTTY) presentation
full TOON × failure full-output envelope through encodeLines
TOON token count × success encode boundary via the token-count presentation
TOON token window × failure encode boundary via the token window, failure path
YAML × failure, full YAML × success yaml.stringify boundary; parsed recovery document, with and without the envelope
Markdown × success, full Markdown × failure REA's Markdown renderer; ## ok / ## error.code / ## meta headings
Markdown token window × success Markdown token window
SIGPIPE (unchanged) reader closes before formatting recovery

The kept cases keep every assertion: the exact stderr marker that proves which encoder entry failed, resource_constraint, --format json, formatted_characters, no [truncated: and no UNKNOWN, target_unavailable on failure, and YAML/Markdown envelope parsing.

Pairings moved in process

They moved to tests/boundary/cli/formattingRecovery.test.ts, under "CLI formatting capacity recovery for each presentation". That table covers all 22 pairings by calling createCliResultOutput with the same parsed CLI arguments. A success value fails at encoding. A completed target_unavailable failure's details exceed a runtime string. Each pairing asserts:

  • resource_constraint, retryable: false, resource: memory
  • reported_limits.format and formatted_characters: null
  • original_failure on failure
  • the text facts the acceptance test checks
  • the full envelope (meta.duration present only with --full-output)
  • parsed YAML (error, ok: false, meta.command)
  • full-Markdown headings
Removed real-process pairing Covering test
human TOON × failure formattingRecovery › "human TOON returns a typed formatting constraint after failure"
full TOON × success › "full TOON … after success"
TOON token count × failure › "TOON token count … after failure"
TOON token window × success › "TOON token window … after success"
full TOON token window × success / failure › "full TOON token window … after success" / "… after failure"
YAML × success › "YAML … after success"
full YAML × failure › "full YAML … after failure"
Markdown × failure › "Markdown … after failure"
full Markdown × success › "full Markdown … after success"
Markdown token window × failure › "Markdown token window … after failure"

The encoder boundaries those pairings reached are still exercised in a real process by the kept cases above. No capacity limit, refusal reason or recovery assertion was dropped.

Mutation checks

Both mutations were applied to src/cli/cliResultOutput.ts, then restored.

  1. Recovery drops the full-output envelope when a token window is set (options.fullOutput && !options.tokenWindow). The in-process cases "full TOON token window … after success" and "… after failure" fail. Both pairings were removed from the real-process matrix.
  2. Recovery omits original_failure for YAML. "YAML … after failure" and "full YAML … after failure" fail. The second was removed from the real-process matrix.

Timing

Before After
Real CLI processes 23 12
cliFormattingCapacity module time, CI 67.7 s (main run 45303778758, 12-shard full run) 16.1 s (this PR's run 45327921989, one selected shard)
formattingRecovery module time, CI — 1.3 s (34 cases, 0.1 s of test bodies)
cliFormattingCapacity, local 11.8 s 7.4 s
In-process table, local none about 0.1 s for 22 cases

The PR run is less contended than a 12-shard main run, so the CI before and after figures are not strictly like for like. Estimated saving under main-CI contention: about 11 processes × 2.9 s ≈ 32 s of module time. This is an estimate.

Validation

  • vitest run on both files passes (46 tests). Built tests ran against a CI-built runtime.
  • oxfmt and oxlint pass on both files.
  • A scoped tsc over both files reported no errors.
  • verify:architecture-guards passes.
  • CI run 45327921989 is green.

The acceptance matrix started 22 CLI processes for 11 presentations and two
outcomes, most of which repeat the same recovery. Keep one real process per
encoder boundary (encodeLines, encode, YAML stringify, Markdown), presentation
owner (terminal, full envelope, token count and window) and outcome, plus the
SIGPIPE case. Check every presentation and outcome pairing in process through
createCliResultOutput, including the full-envelope, YAML and Markdown facts.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-24T04:39:43.635697Z
We couldn’t complete this review. Comment @codex review to try again.
9037904 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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.

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no blocking issue was found.

Summary

Moves repeated formatting-capacity checks into the process running the tests, reducing real CLI processes from 23 to 12.

  • Formatting capacity tests keep distinct CLI runs and reuse the other pairings.

Reviews (2) · Last reviewed commit: "test: run repeated CLI formatting capaci..." · Reviewed by Greptile

@morluto
morluto merged commit 3cb7ca9 into main Nov 24, 2026
3 checks passed
@morluto
morluto deleted the test/trim-cli-formatting-capacity branch November 24, 2026 04:42
vincentkoc added a commit that referenced this pull request Nov 24, 2026
…-20261124

* origin/main: (3854 commits)
  fix(ci): retry recorded crash dependency acquisition without stale index cache (#14076)
  chore(deps): bump rcssmin from 1.2.2 to 1.3.0 in /website (#14229)
  chore(deps): bump markdownify from 1.2.3 to 1.2.4 in /website (#14227)
  ci: compare frozen selections with observed test failures (#14301)
  ci: record affected-test predictions above the live cutoff (#14300)
  ci: wait for static checks before broad PR test shards (#14299)
  ci: validate workflow anchors with actionlint 1.7.12 (#14298)
  ci: measure portable runner time for recorded selection predictions (#14304)
  test(pe): distinguish unsupported DOS input from truncated input (#14302)
  test(go): check build information in a one-directory PE32 fixture (#14303)
  fix(tests): damage Deno PE resource framing the loader-equivalent reader reads
  test(go): expect loader-equivalent PE header facts in the MZ diagnostics (#14293)
  perf(resources): refuse non-ASAR Pickle prefixes without building errors
  perf(artifacts): reuse the streamed XML plist verdict when classifying
  perf(artifacts): decide the FAT header once per classified stream
  test: run repeated CLI formatting capacity pairings in process (#14279)
  fix(limits)!: make the IL2CPP pointer index adjustable and require owned refusal limits (#14243)
  fix(artifacts): report S-record data after the final count (#14260)
  feat(artifacts): report declared DDS, GLB, KTX and KTX2 headers and regions (#14248)
  fix(pe)!: share one loader-equivalent PE header owner across static readers (#14253)
  ...
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.

1 participant