Skip to content

Reporter overhaul (3/6): shadow structured emission#5867

Open
TheLarkInn wants to merge 8 commits into
reporter/2-bootstrap-and-compatfrom
reporter/3-shadow-emission
Open

Reporter overhaul (3/6): shadow structured emission#5867
TheLarkInn wants to merge 8 commits into
reporter/2-bootstrap-and-compatfrom
reporter/3-shadow-emission

Conversation

@TheLarkInn

@TheLarkInn TheLarkInn commented Jul 15, 2026

Copy link
Copy Markdown
Member

📚 Reporter Overhaul PR stack (merge bottom-up)

# PR Phase Base
1 #5865 Contracts & baselines (package) main
2 #5866 Bootstrap & compatibility #5865
3 #5867 Shadow structured emission #5866
4 #5868 Opt-in reporters #5867
5 #5869 Heft protocol track #5868
6 #5870 Perf budgets & default flip #5869

Each PR's diff is scoped to its phase; review independently, merge from #5865 upward.

👉 This is PR 3 of 6.

Phase 3 — Shadow structured emission (RFC §8.1)

First-party lifecycle and diagnostic events are emitted without changing visible output, and telemetry/exit-code parity is validated.

What's included

  • RushSession event sink + scoped producers exposed to actions and plugins (plugins cannot inspect modes/destinations/thresholds).
  • Shadow lifecycle emission — structured lifecycle + diagnostic events run alongside the legacy renderer with no output change.
  • Telemetry projection subscriber — allowlist + beforeLog adapter.
  • Reporter-independent exit codes — command success/exit semantics preserved regardless of the active reporter.

Validation

  • rush build --to @rushstack/reporterrush test --only @rushstack/reporter ✅ (adds Session, Lifecycle, Telemetry, ExitStatus suites)
  • All exports @beta.

Scope note

Standalone package; not yet wired into the live CLI. Independently releasable/revertible per RFC §8.1.

TheLarkInn and others added 8 commits July 15, 2026 04:52
Expose the producer-facing reporting surface for @rushstack/reporter (#5858).

- Add createScopedReporter and RushSessionReporting so RushSession can create
  scoped reporters and loggers bound to a command, operation, project, and phase
- Add IScopedLogger, a presentation-free logger with no terminal handle
- Pass the sink to actions through IReporterExecutionContext while exposing only
  emit methods, so plugins cannot inspect modes, destinations, or thresholds
- Add the Rush plugin API version, manifest field, a support check, and a
  structured migration diagnostic for incompatible plugins
- Cover scoped emission, the privacy floor, the emit-only surface, logging, the
  session facade, and plugin compatibility 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 first-party lifecycle emission for @rushstack/reporter (#5858).

- Add typed lifecycle payloads and a LifecycleEmitter that actions, the
  scheduler, and plugins use to publish session, command, and operation events
  plus structured diagnostics
- Mark every lifecycle, result, and diagnostic event required, and keep the
  emitter output-neutral so legacy rendering stays the sole visible output
- Add deriveExitCodeFromEvents and summarizeShadowResult to validate exit-code
  and result parity against the frozen baselines
- Cover emission, scope merging, output neutrality, and 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
Add the telemetry subscriber for @rushstack/reporter (#5858).

- Add TelemetrySubscriber, which consumes canonical events before reporter
  filtering and produces an allowlisted aggregate at command completion
- Keep only allowlisted values: command and result, timing, operation status
  counts, diagnostic codes and categories, reporter mode, and protocol and
  producer versions
- Exclude messages, paths, raw output, command arguments, remediation
  parameters, stacks, and local-sensitive and secret values by construction
- Add createTelemetryReporter to wire the subscriber into the manager
- Preserve the legacy beforeLog hook through createBeforeLogAdapter
- Add allowlist schema and leakage 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
Preserve command success and exit-code semantics for @rushstack/reporter (#5858).

- Add resolveExitStatus and resolveExitStatusFromEvents, which return 0 for
  success including warning-only success, 1 for failure and logical
  cancellation, and the conventional signal-derived status for OS signals
- Take only failure, cancellation, and signal state as inputs, so the reporter
  mode and diagnostic categories can never select the exit code
- Add separateJsonControls so the command-specific --json flag stays distinct
  from the json reporter and keeps its own schema
- Cover success, failure, cancellation, signal precedence, category
  independence, and JSON-control 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
@TheLarkInn TheLarkInn force-pushed the reporter/2-bootstrap-and-compat branch from 6a36aae to 2c80ebe Compare July 15, 2026 04:53
@TheLarkInn TheLarkInn force-pushed the reporter/3-shadow-emission branch from 73b545b to 9a7365d Compare July 15, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant