Reporter overhaul (2/6): bootstrap and cross-version compatibility adapters - #5866
Merged
Merged
Conversation
Document the reviewed reporter architecture, structured event protocol, compatibility model, rollout plan, and supporting codebase research for issue #5858. Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ba539363-ff7b-44c9-b4f6-e49ef7fc6c92
Introduce the @rushstack/reporter package skeleton that will hold the canonical event protocol, reporter manager, and built-in reporters described in the Rush reporter overhaul RFC (#5858). - Scaffold libraries/reporter with rig-based Heft build config - Mark exported contracts as public beta via API Extractor (@beta) - Declare no dependency on rush-lib - Register the package in rush.json and update the pnpm lockfile - Track reporter-overhaul feature-list progress 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
Define the presentation-free event contract for @rushstack/reporter as described in the Rush reporter overhaul RFC (#5858). - Add IReporterProtocolVersion, ReporterPrivacyClassification, and the immutable IReporterEventEnvelope with source and scope - Add the closed ReporterEventType union and REPORTER_EVENT_TYPES list - Add ReporterJsonValue to type JSON-serializable payloads - Document sequence as authoritative ordering and timestamp as informational, and preserve child producer order via sourceSequence - Add a golden envelope schema test covering snapshot, JSON round-trip, the closed union, and Error payload handling 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
Introduce the presentation-free producer contract for @rushstack/reporter (#5858). - Add IReporterEventSink.emit, which accepts an envelope input that omits the sink-assigned eventId, sequence, and timestamp - Add IScopedReporter with emitMessage, emitDiagnostic, and emitExtension, none of which expose reporter instances, destinations, or thresholds - Add namespaced extension event names with an isReporterExtensionEventName validator so producer events cannot collide with the closed core set - Add a minimal IRushDiagnostic contract, expanded by the structured diagnostics feature - Cover the sink omit contract, scoped emit ids, emit-only surface, and extension name validation 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
Complete the structured diagnostics contract for @rushstack/reporter (#5858). - Expand IRushDiagnostic with category, remediation, source, classified parameters, cause chaining, and related artifacts - Add RushDiagnosticCategory, IRushRemediationAction, IRushDiagnosticSource, and IClassifiedDiagnosticValue - Add a central, never-reused RUSH_<DOMAIN>_<NAME> code registry with English templates keyed by resource key and a stable internal-error code - Add computeEnvelopePrivacyFloor and getPrivacyClassificationRank so the envelope classification is the least-sensitive floor while field-level classification stays authoritative - Add createRushDiagnostic and RushError so emission returns a diagnostic id that propagated failures reference - Add registry, privacy, factory, and RushError 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 cross-process wire protocol for @rushstack/reporter (#5858). - Add REPORTER_PROTOCOL_VERSION, REPORTER_PROTOCOL_LIMITS (1 MiB bootstrap and record, 64 KiB external chunk), and isReporterProtocolCompatible - Add an NDJSON encoder and a streaming decoder that enforce the record limit - Add hello/helloAck negotiation that accepts the capability intersection, tolerates additive minor versions, and rejects only unknown required features or unsupported majors - Emit an update-global-Rush diagnostic (RUSH_PROTOCOL_UPDATE_REQUIRED) on rejection - Cover encode/decode framing, size limits, and negotiation 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 reporter fan-out engine for @rushstack/reporter (#5858). - Add the IReporter interface and IReporterContext - Add ReporterManager, the authoritative in-process sink: it assigns one monotonic session sequence, eventId, and timestamp, rehomes foreign child envelopes while preserving sourceSequence, and delivers events to each reporter through an independent ordered queue - Enforce exclusive destination ownership and add ReporterMultiplexer for explicit sharing - Flush on normal, error, and signal completion with 10s and 2s timeouts - Coalesce replaceable status events under pressure while never dropping lifecycle, diagnostic, result, artifact, or external-output events - Disable optional reporters on runtime failure with an emergency diagnostic and make required-reporter and initialization failures fatal - Cover ordering, destinations, failure handling, coalescing, and flush/close 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
Freeze baselines for @rushstack/reporter (#5858). - Add golden schema tests that freeze the serialized event envelope, diagnostic, and hello/helloAck wire forms and assert NDJSON round-trips - Add compatibility goldens for negotiation across supported majors and minors, including additive-minor tolerance and forward-compatible field retention - Freeze representative legacy success and failure output as the parity baseline for the future legacy reporter - Wire all goldens into the existing jest test runner 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
This was referenced Jul 15, 2026
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
Sean Larkin (TheLarkInn)
force-pushed
the
reporter/2-bootstrap-and-compat
branch
from
July 15, 2026 04:53
6a36aae to
2c80ebe
Compare
Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 90cfc9a4-cbde-48e6-a771-86ad7abf948c
- Rename @rushstack/reporter to @rushstack/rush-reporter
- Add messageEmitted core event type; message text privacy defaults to
local-sensitive
- Type-level diagnostic codes (template literals, as const satisfies
registry, derived RushDiagnosticCodes/RushDiagnosticTemplateKey unions)
with per-domain template modules and a non-regex runtime validator
- Forward-compatible RushDiagnosticCategory (KnownCategory | (string & {}))
- IRushDiagnosticSource becomes a kind-tagged discriminated union
- Event identity documented as (sessionId, eventId); manager derives the
envelope required flag from event type; required-reporter failure writes
its emergency diagnostic once
- Governed REPORTER_KNOWN_CAPABILITIES registry; template-literal extension
event names; two-tier (contract vs tuning) constant policy; full beta
license docblock
- Spec gains a design realignments addendum; goldens and API report
regenerated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add the self-contained bootstrap machinery for @rushstack/reporter (#5858). install-run-rush must stay zero-dependency and embed a frozen copy of this encoder rather than import the package at runtime, so the source of truth lives here. - Add a frozen protocol-major constant, buffer and chunk limits, and the private handoff environment variable name - Add BootstrapEventBuffer, a bounded 1 MiB encoder that preserves required and diagnostic events on overflow, splits raw external output into 64 KiB chunks, and appends a bufferTruncated extension event describing any loss - Add handoff helpers that write, read, and delete the temporary NDJSON file - Add parseEarlyReporterControls for the prelude - Cover parsing, encoding, overflow, failure, chunking, and handoff 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 frontend reporter host for @rushstack/reporter (#5858). - Add ReporterHost, which owns the authoritative ReporterManager the frontend creates before version selection - Replay the bootstrap handoff file into the manager and delete it, skipping direct invocations and tolerating a missing or corrupt file - Expose a typed IReporterEventSink to the selected rush-lib so the engine can emit events but cannot own reporter selection - Clean abandoned handoff files older than the retention window - Share the handoff file-name pattern between the writer and the cleaner - Cover replay, direct invocation, missing-file tolerance, the sink, and cleanup 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 frontend and engine version mismatches for @rushstack/reporter (#5858). - Add resolveReporterCompatibility, which classifies structured, new-frontend-old-engine, old-frontend-new-engine, and legacy pairings and keeps legacy rendering as the sole visible output - Add createEngineSink and LegacyFallbackSink so a new engine paired with an old frontend emits safely and renders legacy output - Add OldEngineOutputAdapter, which bridges an old engine's raw stdout and stderr into structured externalOutput events without changing the visible legacy output - Cover both mismatch directions 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
…missions The handoff file's first line is a header carrying a one-time nonce; the bootstrap process publishes the nonce through a private environment variable and the frontend rejects a file whose header does not match. The file is created with owner-only permissions (0o600) where supported. Aligns 2/6 with the post-review contract realignments from 1/6 (sink inputs no longer carry 'required'). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sean Larkin (TheLarkInn)
force-pushed
the
reporter/2-bootstrap-and-compat
branch
from
August 19, 2026 13:44
2c80ebe to
7aa64c9
Compare
The repo-toolbox readme --verify check failed in CI because the npm badge URL still pointed at the old @rushstack/reporter name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ea5daa0b-7839-42f0-9d63-4ca84c7d2b5c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ea5daa0b-7839-42f0-9d63-4ca84c7d2b5c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ea5daa0b-7839-42f0-9d63-4ca84c7d2b5c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mo Jazayeri (mojaza)
approved these changes
Aug 22, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0f2ee828-b203-4266-aa2c-d680e52f6fe0
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0f2ee828-b203-4266-aa2c-d680e52f6fe0
Contributor
There was a problem hiding this comment.
Pull request overview
Adds standalone bootstrap capture, handoff replay, and cross-version compatibility infrastructure to @rushstack/rush-reporter, without wiring it into the live CLI.
Changes:
- Adds bounded bootstrap buffering, handoff files, early controls, and
ReporterHost. - Adds legacy compatibility sinks and output adapters.
- Adds tests, public API declarations, change files, and CI checkout adjustment.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/ci.yml |
Fetches complete Git history. |
research/progress.txt |
Records phase progress and scope. |
libraries/reporter/src/utilities/chunkUtf8Text.ts |
Adds UTF-8-safe chunking. |
libraries/reporter/src/test/ReporterHost.test.ts |
Tests replay and cleanup. |
libraries/reporter/src/test/Compatibility.test.ts |
Tests compatibility adapters. |
libraries/reporter/src/test/Bootstrap.test.ts |
Tests bootstrap behavior. |
libraries/reporter/src/index.ts |
Exports new APIs. |
libraries/reporter/src/frontend/ReporterHost.ts |
Hosts manager and replays handoffs. |
libraries/reporter/src/compat/ReporterCompatibility.ts |
Resolves frontend/engine compatibility. |
libraries/reporter/src/compat/OldEngineOutputAdapter.ts |
Bridges legacy raw output. |
libraries/reporter/src/compat/LegacyFallbackSink.ts |
Adds discard fallback sink. |
libraries/reporter/src/bootstrap/EarlyReporterControls.ts |
Parses early reporting controls. |
libraries/reporter/src/bootstrap/BootstrapProtocol.ts |
Defines bootstrap constants. |
libraries/reporter/src/bootstrap/BootstrapHandoff.ts |
Reads, writes, and deletes handoffs. |
libraries/reporter/src/bootstrap/BootstrapEventBuffer.ts |
Buffers and serializes startup events. |
common/reviews/api/rush-reporter.api.md |
Updates the API report. |
common/changes/@rushstack/rush-reporter/docs-rush-reporter-overhaul-spec_2026-07-15-00-11-21.json |
Documents compatibility APIs. |
common/changes/@rushstack/rush-reporter/docs-rush-reporter-overhaul-spec_2026-07-15-00-05-25.json |
Documents ReporterHost. |
common/changes/@rushstack/rush-reporter/docs-rush-reporter-overhaul-spec_2026-07-15-00-00-05.json |
Documents bootstrap machinery. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0f2ee828-b203-4266-aa2c-d680e52f6fe0
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 2 of 6.
Phase 2 — Bootstrap and compatibility adapters (RFC §8.1)
Adds startup-time event capture and cross-version fallback, while legacy rendering remains the sole visible output (no user-facing change).
What's included
rush-libloads, with byte caps and a truncation marker, and hands them off for replay.ReporterHost— constructs the manager and replays the bootstrap handoff in order.Validation
rush build --to @rushstack/reporter✅rush test --only @rushstack/reporter✅ (adds Bootstrap, ReporterHost, Compatibility suites)@beta.Scope note
Standalone package; not yet wired into the live CLI. Independently releasable/revertible per RFC §8.1.