Reporter overhaul (4/6): opt-in reporters, selection, StreamCollator replacement#5868
Open
TheLarkInn wants to merge 22 commits into
Open
Reporter overhaul (4/6): opt-in reporters, selection, StreamCollator replacement#5868TheLarkInn wants to merge 22 commits into
TheLarkInn wants to merge 22 commits into
Conversation
This was referenced Jul 15, 2026
Resolve the reporter and log level from controls for @rushstack/reporter (#5858). - Add the built-in reporter names and log levels with validation guards - Add agent and CI detection, including COPILOT_CLI and configured agent environment variables and the active-value semantics - Parse the --output control into reporter, target, and params - Add resolveReporterSelection: the primary reporter runs from explicit CLI through RUSH_REPORTER, agent, CI, and TTY down to generic non-TTY plaintext, and always pairs with the file reporter - Resolve the log level independently, mapping --quiet, --verbose, and --debug aliases and rejecting contradictions - Keep command-specific --json distinct from the json reporter and fail explicit unsupported reporter or log-level requests - Cover precedence, aliases, contradictions, outputs, and detection with tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Add per-reporter log-level filtering for @rushstack/reporter (#5858). - Classify each event to a minimum log level and add shouldRenderAtLogLevel and filterEventsForLogLevel so each reporter applies quiet, normal, verbose, or debug filtering independently - Keep diagnostic severity separate from the reporter log level: severity sets the minimum level while the reporter's configured level gates rendering - Default the full-detail file reporter to debug - Cover ranking, classification, per-level rendering, monotonicity, and the severity separation with tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Resolve the automatic reporter plan by environment for @rushstack/reporter (#5858). - Add planAutomaticReporters, which pairs ai with file for an agent, detailed plaintext with file for CI, default with file for an interactive TTY, and concise plaintext with file otherwise - Give machine reporters (ai, json) exclusive stdout and route human progress to stderr, with emergency diagnostics always on stderr - Add describeReporterPlan to record the selection reason and reporters in the detailed log - Cover the full matrix, machine stdout ownership, and the plan description with tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Add the concise default reporter for @rushstack/reporter (#5858). - Add interactive rendering helpers: a spinner, color resolution honoring NO_COLOR and FORCE_COLOR, width-aware active projects with +N more, and a three-row live region renderer that truncates before coloring - Add DefaultInteractiveReporter, which paints the live region at no more than 10 Hz, reacts to terminal width, hides and restores the cursor, leaves at most three stable lines on success, appends a bounded diagnostic block and log path on failure, and appends one summary per completed watch cycle - Cover rendering helpers and reporter behavior with an injected terminal and clock Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Add the plaintext reporter for @rushstack/reporter (#5858). - Add PlaintextReporter, an append-only reporter that never moves the cursor and disables color by default - Emit the start line, meaningful operation state changes, diagnostics, and the final result - Add a compact 30-second heartbeat for long non-TTY and CI sessions - Retain StreamCollator-like operation grouping in the detailed CI variant by grouping each operation's output under a header - Add stable concise and detailed plaintext snapshot tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Add the machine reporters for @rushstack/reporter (#5858). - Add JsonReporter, which emits the complete versioned NDJSON event stream on exclusive stdout and replaces an oversized record with a valid marker - Add AiReporter, a bounded projection that emits a status record and a final record with the result, scope, error codes and categories, structured remediation, aggregate counts, log reference, and artifact completeness - Cap the AI record at 64 KiB and 20 detailed diagnostics, represent warnings by count when failures exist, and exclude raw output and stacks - Keep the absolute log path in AI output while telemetry continues to exclude it - Add stdout-purity tests for both reporters and a telemetry path cross-check Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Add the full-detail file reporter for @rushstack/reporter (#5858). - Add FileReporter, which writes a debug NDJSON invocation log to <commonTempFolder>/rush-logs/<UTC timestamp>-<pid>-<action>.log with owner-only permissions and redacts fields classified as secret - Maintain a latest.log pointer for both successful and failed commands - Buffer events until the first flush and fall back to the OS temp folder - Delete logs older than 14 days and cap retention at 20 sessions - Treat failure at both paths as nonfatal, emitting an emergency warning and marking the artifact unavailable - Cover writing, permissions, redaction, retention, fallback, and failure with tests against real temp directories Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Add the legacy reporter for @rushstack/reporter (#5858). - Add LegacyReporter, which reproduces the current Rush output: the start line, the parallelism line, StreamCollator-style operation headers with grouped output, and a success or failure summary with durations - Add isLegacyEmergencyFallbackRequested and confirm RUSH_REPORTER=legacy selects the legacy reporter as an emergency fallback - Validate the reporter against the frozen legacy output snapshots Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Add the uncollated operation event stream for @rushstack/reporter (#5858). - Add OperationStreamEmitter so the scheduler emits operation registration, status transitions, raw output chunks, and the aggregate command result - Emit output chunks immediately in call order and never collate them, so the concise reporter derives activity without buffering while the detailed and file reporters own grouping - Add iterateExternalOutput and regroupOperationOutput so problem matchers consume the uncollated stream and reporters reconstruct StreamCollator-parity grouping - Cover emission, chunking, uncollated ordering, and reporter parity with tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Recover diagnostics from raw external output for @rushstack/reporter (#5858). - Preserve raw stdout and stderr as ordered chunks and run matchers over an ANSI-normalized copy so the raw evidence and process status are never modified - Add a tool- and version-scoped problem matcher registry gated on default enablement, routing older Heft versions through the version predicate - Add runProblemMatchers, which reassembles lines split across chunks, links recovered diagnostics to the operation and source location, preserves unmatched text, and caps duplicate diagnostics - Cover ANSI stripping, scoping, recovery, split chunks, the duplicate cap, and a representative corpus with tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Bridge the legacy sentinel error pattern for @rushstack/reporter (#5858). - Deprecate AlreadyReportedError so new usage is prohibited now that structured diagnostics and RushError are available - Add LegacyErrorBridge, which observes emitted diagnostics, correlates legacy sentinels with them, and suppresses duplicate rendering of failures that are already represented - Document the bridge removal criteria for a later major - Cover sentinel detection, suppression, correlation, and the removal criteria with tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
73b545b to
9a7365d
Compare
beb5166 to
291cbc2
Compare
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.
📚 Reporter Overhaul PR stack (merge bottom-up)
mainEach PR's diff is scoped to its phase; review independently, merge from #5865 upward.
👉 This is PR 4 of 6.
Phase 4 — Opt-in reporters (RFC §8.1)
Adds the actual reporters plus selection/config, and replaces StreamCollator only on the new reporter path.
What's included
--reporter/RUSH_REPORTER/agent/CI/TTY), independent per-reporter log levels, and the automatic environment matrix.defaultinteractive (3-row live region),plaintext/non-TTY,json, boundedai, full-detailfile(owner-only perms, retention, OS-temp fallback), andlegacy(selectable + emergency fallback).AlreadyReportedErrorusage; correlate legacy sentinels with emitted diagnostics.Validation
rush build --to @rushstack/reporter✅rush test --only @rushstack/reporter✅ (adds ReporterSelection, LogLevelFilter, AutomaticReporterMatrix, the reporter suites, OperationStreamEmitter, ProblemMatchers, LegacyErrorBridge)@beta.Scope note
Standalone package; not yet wired into the live CLI. Independently releasable/revertible per RFC §8.1.