Skip to content

Reporter overhaul (2/6): bootstrap and cross-version compatibility adapters - #5866

Merged
Sean Larkin (TheLarkInn) merged 35 commits into
mainfrom
reporter/2-bootstrap-and-compat
Aug 26, 2026
Merged

Reporter overhaul (2/6): bootstrap and cross-version compatibility adapters#5866
Sean Larkin (TheLarkInn) merged 35 commits into
mainfrom
reporter/2-bootstrap-and-compat

Conversation

@TheLarkInn

@TheLarkInn Sean Larkin (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 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

  • Two-stage bootstrap event buffer + handoff file — buffers events emitted before rush-lib loads, with byte caps and a truncation marker, and hands them off for replay.
  • Frontend ReporterHost — constructs the manager and replays the bootstrap handoff in order.
  • Cross-version compatibility adapters — new-frontend/old-engine and old-frontend/new-engine fallbacks, so a version skew degrades gracefully rather than breaking.

Validation

  • rush build --to @rushstack/reporterrush test --only @rushstack/reporter ✅ (adds Bootstrap, ReporterHost, Compatibility suites)
  • All exports @beta.

Scope note

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

Sean Larkin (TheLarkInn) and others added 15 commits July 12, 2026 16:23
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
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the reporter/2-bootstrap-and-compat branch from 6a36aae to 2c80ebe Compare July 15, 2026 04:53
Sean Larkin (TheLarkInn) and others added 9 commits July 16, 2026 15:32
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>
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the reporter/2-bootstrap-and-compat branch from 2c80ebe to 7aa64c9 Compare August 19, 2026 13:44
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>
Comment thread research/feature-list.json Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Base automatically changed from reporter/1-contracts-and-baselines to main August 24, 2026 18:40
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread libraries/reporter/src/bootstrap/BootstrapEventBuffer.ts Outdated
Comment thread libraries/reporter/src/bootstrap/EarlyReporterControls.ts Outdated
Comment thread libraries/reporter/src/utilities/chunkUtf8Text.ts Outdated
Comment thread libraries/reporter/src/bootstrap/BootstrapEventBuffer.ts Outdated
Comment thread libraries/reporter/src/bootstrap/BootstrapHandoff.ts Outdated
Comment thread libraries/reporter/src/frontend/ReporterHost.ts
Comment thread libraries/reporter/src/bootstrap/BootstrapEventBuffer.ts Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0f2ee828-b203-4266-aa2c-d680e52f6fe0
@TheLarkInn
Sean Larkin (TheLarkInn) merged commit b2d4b0e into main Aug 26, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Aug 26, 2026
@TheLarkInn
Sean Larkin (TheLarkInn) deleted the reporter/2-bootstrap-and-compat branch August 26, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants