Add feature-flagged operation event adapter - #5996
Add feature-flagged operation event adapter#5996Sean Larkin (TheLarkInn) wants to merge 9 commits into
Conversation
Sean Larkin (TheLarkInn)
left a comment
There was a problem hiding this comment.
Independent R5A review completed against #5978 and RFC phase 4.
Fixed in ac92280:
- collapsed sharded implementation records now feed one project x phase identity without losing shard output/failure state;
- raw stdout/stderr is tapped before newline normalization, including CR and unterminated chunks;
- cache-path terminal output now reaches the semantic stream;
- scheduling/pre-execution hook failures cannot leave registered operations without close/completion events.
Validation: focused OperationGraphEventSink suite (12/12), plus the inherited full reporter/rush-lib/apps-rush matrix on #5997 (304/773/28). No unresolved review threads. Auto-merge remains disabled because #5992 and earlier ancestors are open.
|
Combined deep review of current head
|
ac92280 to
11a7f84
Compare
|
Combined review findings fixed at
Validation: reporter 298, rush-lib 782, apps/rush 47; focused operation tests 15; all three builds; API Extractor; |
|
Final combined review of |
11a7f84 to
2f2cab8
Compare
2f2cab8 to
f1c8124
Compare
f1c8124 to
3542fd9
Compare
3542fd9 to
d1889d3
Compare
6a493da to
7db76c9
Compare
7db76c9 to
3f38e00
Compare
f969c43 to
0debf23
Compare
0debf23 to
e38163f
Compare
f741114 to
3cbffdf
Compare
3cbffdf to
3af8aab
Compare
Preserve operation stream/callback corrections and the owning forwarding consumer; reconcile native record/graph fields without changing scheduling or public contracts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
3af8aab to
da51dfb
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The primary reporter currently suppresses unscoped external output in addition to operation-scoped chunks.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
apps/rush/src/RushReporterHost.ts — This filters every externalOutput event from the primary reporter, not just the operation chunks… |
What changed in this PR
Adds a feature-flagged adapter that publishes phase-aware operation streams while retaining legacy terminal presentation.
Changes:
- Emits raw operation output, lifecycle transitions, stream closure, and completion events.
- Adds protocol 1.1 event contracts and compatibility handling.
- Forwards operation events through Rush frontend and daemon integrations.
| File | Description |
|---|---|
libraries/rush-lib/src/pluginFramework/RushSession.ts |
Gates operation-stream emitters. |
libraries/rush-lib/src/logic/operations/test/OperationGraphEventSink.test.ts |
Tests ordering, output, and outcomes. |
libraries/rush-lib/src/logic/operations/ReporterOperationEventSink.ts |
Adapts graph events to reporter events. |
libraries/rush-lib/src/logic/operations/OperationGraph.ts |
Registers and finalizes operation records. |
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts |
Taps output and emits finalization. |
libraries/rush-lib/src/logic/operations/OperationEventSink.ts |
Extends operation sink callbacks. |
libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts |
Taps cache-related output. |
libraries/rush-daemon/src/test/PhasedRequestEventMultiplexer.test.ts |
Tests event forwarding. |
libraries/rush-daemon/src/PhasedRequestEventMultiplexer.ts |
Multiplexes completion and identity. |
libraries/reporter/src/test/Telemetry.test.ts |
Updates protocol expectation. |
libraries/reporter/src/test/ReporterHost.test.ts |
Tests minor-version replay. |
libraries/reporter/src/test/Protocol.test.ts |
Tests protocol 1.1 policy. |
libraries/reporter/src/test/OperationStreamEmitter.test.ts |
Tests new stream events. |
libraries/reporter/src/test/Manager.test.ts |
Tests required flags. |
libraries/reporter/src/test/LogLevelFilter.test.ts |
Tests new event levels. |
libraries/reporter/src/test/IReporterEventEnvelope.test.ts |
Updates event-type coverage. |
libraries/reporter/src/test/HeftIntegration.test.ts |
Tests optional-event compatibility. |
libraries/reporter/src/test/__snapshots__/Goldens.test.ts.snap |
Updates protocol golden. |
libraries/reporter/src/scheduler/OperationStreamEmitter.ts |
Emits enriched operation streams. |
libraries/reporter/src/protocol/ReporterProtocol.ts |
Bumps protocol minor version. |
libraries/reporter/src/lifecycle/LifecycleEvents.ts |
Defines new payload contracts. |
libraries/reporter/src/index.ts |
Exports new payload types. |
libraries/reporter/src/frontend/ReporterHost.ts |
Supports configurable protocol compatibility. |
libraries/reporter/src/events/ReporterEventType.ts |
Adds optional 1.1 event types. |
libraries/reporter/src/events/IReporterEventEnvelope.ts |
Clarifies required-event semantics. |
libraries/reporter/src/config/LogLevelFilter.ts |
Classifies new events. |
libraries/reporter/src/bootstrap/BootstrapEventBuffer.ts |
Applies centralized required policy. |
common/reviews/api/rush-reporter.api.md |
Updates reporter API review. |
common/reviews/api/rush-lib.api.md |
Updates Rush library API review. |
common/changes/@rushstack/rush-reporter/copilot-reporter-r5a-operation-adapter_2026-08-28-06-35.json |
Records reporter change. |
common/changes/@rushstack/rush-daemon/reporter-operation-forwarding_2026-09-07.json |
Records daemon change. |
common/changes/@microsoft/rush/copilot-reporter-r5a-operation-adapter_2026-08-28-06-35.json |
Records Rush change. |
apps/rush/src/test/RushReporterHost.test.ts |
Tests deferred primary presentation. |
apps/rush/src/test/RushFrontend.test.ts |
Tests frontend stream flag. |
apps/rush/src/RushReporterHost.ts |
Defers operation presentation. |
apps/rush/src/RushFrontend.ts |
Passes operation-stream opt-in. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Address #5996 comment 3981270424 by deferring only operation-scoped external chunks. Cover real adapter stdout/stderr and command-scoped output in JSON and detailed plaintext without duplicating collated operation output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Preserve the R5A post-configuration registration helper and NoOp/finalization paths instead of adding a duplicate ancestor callback. Combine terminal test imports without weakening raw output coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Combine command-aware controls with R5A's scoped deferral rule while preserving final configured registration, lifetime completion, and all owning regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Preserve the existing slice and current parent histories; only capture successful fixture setup diagnostics, without changing production behavior, warning policy, or watch assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Preserve the existing slice and parent histories while carrying the validated test-helper correction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
The newly landed parent tree is byte-identical to the already integrated parent. Preserve the entire reviewed slice tree and both parent histories while correcting ancestry after the protected stack-prefix squash landing. For R3C, exclude the 300 lines of duplicated old graph tests introduced by automatic merge; the final source, test, dependency and API trees are exactly unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10

Part of #5978
Stack
Parent: #5992 (
copilot/reporter-r3c-shadow-parity)R6 #5993 remains a parallel fork from #5989 and is not included here. Keep auto-merge disabled while stack ancestors are open.
Architecture
OperationGraph.eventSinkandOperationExecutionRecordhooks into the existingOperationStreamEmitter; scheduling and operation identity remain project x phasecommandResulthook instead of emitting a competing result pathFlag-off and presentation guarantee
When the reporter opt-in is disabled, the adapter does not expose a raw chunk callback, so
OperationChunkTapis not installed. The existingStreamCollator, problem-matcher, stdout, and stderr pipeline remains byte-identical and authoritative.When opted in, raw events flow to the manager, full-log file reporter, and explicit output sinks. The primary terminal reporter temporarily filters operation registration/status/output/close/completion events, so this slice cannot duplicate or suppress operation output while legacy collation still owns presentation.
Validation
rush test --only @rushstack/rush-reporter --only @microsoft/rush-lib --only @microsoft/rush --verbose(6 operations; reporter 295 tests, rush-lib 766 tests, apps/rush 19 tests)rush build --to @rushstack/rush-reporter --to @microsoft/rush-lib --to @microsoft/rush --verbose(8 operations)rush checkrush change --verify --no-fetchFocused coverage includes event ordering, stdout/stderr separation, 64 KiB chunk boundaries, no duplicated/lost chunks, previous/current status and outcome mapping, phase-aware identity, repeated watch iteration identity, silent operations, no-sink behavior, disabled-tap behavior, and byte-identical flag-off output.
R5B non-goals
StreamCollatoror duplicate-output cutover