Skip to content

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

Open
TheLarkInn wants to merge 6 commits into
reporter/1-contracts-and-baselinesfrom
reporter/2-bootstrap-and-compat
Open

Reporter overhaul (2/6): bootstrap and cross-version compatibility adapters#5866
TheLarkInn wants to merge 6 commits into
reporter/1-contracts-and-baselinesfrom
reporter/2-bootstrap-and-compat

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

TheLarkInn and others added 6 commits July 15, 2026 04:52
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
@TheLarkInn TheLarkInn force-pushed the reporter/2-bootstrap-and-compat branch from 6a36aae to 2c80ebe 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