Skip to content

Expose scoped RushSession reporter producers - #5988

Merged
Sean Larkin (TheLarkInn) merged 2 commits into
copilot/reporter-r2b-frontend-host-controlsfrom
copilot/reporter-r3a-session-sink
Sep 11, 2026
Merged

Expose scoped RushSession reporter producers#5988
Sean Larkin (TheLarkInn) merged 2 commits into
copilot/reporter-r2b-frontend-host-controlsfrom
copilot/reporter-r3a-session-sink

Conversation

@TheLarkInn

Copy link
Copy Markdown
Member

Part of #5976

Stack parent: #5985

Summary

  • accept an optional typed reporter sink/session identity at the frontend-to-engine launch boundary
  • expose source-bound scoped reporters/loggers through RushSession and command-bound reporters to Rush actions
  • give each plugin a RushSession facade whose package/version/plugin source is derived from trusted loader metadata
  • retain legacy terminal/logger APIs and no-sink behavior unchanged
  • keep rush-sdk declaration proxy compatibility for the new beta producer types

Validation

  • rush install
  • rush test --only @rushstack/rush-reporter --only @microsoft/rush-lib --only @rushstack/rush-sdk
  • rush build --to @microsoft/rush-lib --to @rushstack/rush-sdk
  • rush check
  • rush change --verify

Compatibility guarantee

No reporter is created and no structured event is emitted unless the frontend explicitly supplies a sink. Existing RushSession.getLogger(), RushSession.terminalProvider, and visible terminal output remain authoritative and unchanged.

Non-goals

  • lifecycle, diagnostic, telemetry, result, or exit-status emission (R3B)
  • operation stream wiring (R5)
  • reporter selection/configuration or frontend controls (R2)
  • terminal API removal (R9)

@TheLarkInn

Copy link
Copy Markdown
Member Author

Independent R3 review against #5976/RFC phase 3: the slice is correctly limited to the optional frontend-to-engine sink plus trusted Rush/action/plugin producer facades. I found no source-identity spoofing, privacy, no-sink compatibility, error-handling, API, or visible-output defect. Stack-only diff is one commit over #5985; no unresolved review threads are present. Full local stack validation is recorded on child #5992.

@TheLarkInn

Copy link
Copy Markdown
Member Author

Combined deep review of current head eb6ae446f1.

  1. CRITICAL RushFrontend.ts:52-55 passes reporterEventSink, while Rush.launch() reads reporter. The real frontend path produces no structured session or plugin events. Pass reporter: { eventSink, sessionId }.
  2. HIGH RushFrontend.test.ts:58-78 asserts the ignored key through an unsafe cast. Test the typed reporter contract and real launch path.
  3. HIGH RushSession.ts contains empty source metadata guards that continue with invalid path or version data. Fail explicitly with the repository internal error pattern.

@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r3a-session-sink branch from eb6ae44 to 07f17e4 Compare August 28, 2026 16:02
@TheLarkInn

Copy link
Copy Markdown
Member Author

Rebased the single R3A commit onto #5989 head 62d9e7af04ca0ae9d176ba07b745322288f1be72. Fixed the typed frontend-to-engine reporter: { eventSink, sessionId } handoff, added real launchRushFrontendAsync() to Rush.launch() boundary coverage with one preserved session id, removed unsafe sink-key assertions, and confirmed explicit InternalError source guards. Reporter, rush-lib, rush-sdk, and apps/rush tests and builds pass, along with API review, rush check, and stacked change verification.

@TheLarkInn

Copy link
Copy Markdown
Member Author

Final combined review of 07f17e4c7f found no critical, high, medium, or useful low issues. The typed frontend-to-engine contract, session identity, source validation, scoped producer boundary, no-sink compatibility, and launch integration coverage are review-clean.

@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r3a-session-sink branch 2 times, most recently from 9325875 to 39827fa Compare September 3, 2026 18:06
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r3a-session-sink branch 2 times, most recently from 257d502 to 8a9585c Compare September 3, 2026 20:01
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r3a-session-sink branch from 8a9585c to 8a54622 Compare September 3, 2026 20:14
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r3a-session-sink branch from 8a54622 to 007b113 Compare September 3, 2026 20:15
@TheLarkInn

Copy link
Copy Markdown
Member Author

Deep review of current head 007b113 found no critical, high, or medium actionable issues. The typed reporter sink and authoritative session identity remain isolated and backward compatible. Merge remains gated by #5989 and maintainer approval.

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.

Copilot review overview

🟢 Approval recommended

The implementation and tests consistently preserve legacy behavior; only a non-blocking documentation correction remains.

Review tier: Balanced
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity apps/​rush/​src/​IRushFrontendLaunchOptions.ts — The remarks now misdescribe this contract as passing “only the typed producer sink,” but reporter
What changed in this PR

Adds opt-in, source-scoped reporter producers across the Rush frontend, engine, actions, and plugins while preserving legacy output.

Changes:

  • Passes typed reporter sink and session identity into rush-lib.
  • Exposes scoped reporters/loggers with trusted plugin identities.
  • Adds API compatibility, dependency metadata, and focused tests.
File Description
libraries/​rush-sdk/​src/​test/​__snapshots__/​script.test.ts.snap Updates SDK exports snapshot.
libraries/​rush-sdk/​package.json Adds reporter dependency.
libraries/​rush-lib/​src/​pluginFramework/​RushSession.ts Implements scoped reporting and plugin facades.
libraries/​rush-lib/​src/​pluginFramework/​RushSession.test.ts Tests reporting identity and compatibility.
libraries/​rush-lib/​src/​pluginFramework/​PluginManager.ts Supplies source-bound plugin sessions.
libraries/​rush-lib/​src/​pluginFramework/​PluginLoader/​PluginLoaderBase.ts Resolves plugin package versions.
libraries/​rush-lib/​src/​index.ts Exports reporter producer APIs.
libraries/​rush-lib/​src/​cli/​RushCommandLineParser.ts Passes reporting into sessions.
libraries/​rush-lib/​src/​cli/​actions/​BaseRushAction.ts Exposes command-scoped reporters.
libraries/​rush-lib/​src/​api/​Rush.ts Extends the launch boundary.
common/​reviews/​api/​rush-lib.api.md Updates the API report.
common/​config/​subspaces/​default/​pnpm-lock.yaml Updates default dependency state.
common/​config/​subspaces/​build-tests-subspace/​repo-state.json Refreshes generated hashes.
common/​config/​subspaces/​build-tests-subspace/​pnpm-lock.yaml Updates build-test dependency state.
common/​changes/​@microsoft/​rush/​copilot-reporter-r3a-session-sink_2026-08-28-02-38.json Records the patch change.
apps/​rush/​src/​test/​RushFrontend.test.ts Tests the typed launch handoff.
apps/​rush/​src/​RushFrontend.ts Creates and forwards session identity.
apps/​rush/​src/​IRushFrontendLaunchOptions.ts Defines the frontend launch contract.
Files not reviewed (2)
  • common/config/subspaces/build-tests-subspace/pnpm-lock.yaml: Generated file
  • common/config/subspaces/default/pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread apps/rush/src/IRushFrontendLaunchOptions.ts
Retain the exact scoped producer API and WeakMap-backed plugin facades while preserving native-private parser/plugin members and real launch-boundary coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Document both the typed event sink and the frontend-assigned sessionId in the cross-version handoff without changing its shape.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r3a-session-sink branch from 7abfad2 to 47d4f36 Compare September 10, 2026 20:23
@TheLarkInn
Sean Larkin (TheLarkInn) merged commit 89fe41a into main Sep 11, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Sep 11, 2026
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