Skip to content

Add feature-flagged operation event adapter - #5996

Open
Sean Larkin (TheLarkInn) wants to merge 8 commits into
copilot/reporter-r3c-shadow-parityfrom
copilot/reporter-r5a-operation-adapter
Open

Add feature-flagged operation event adapter#5996
Sean Larkin (TheLarkInn) wants to merge 8 commits into
copilot/reporter-r3c-shadow-parityfrom
copilot/reporter-r5a-operation-adapter

Conversation

@TheLarkInn

Copy link
Copy Markdown
Member

Part of #5978

Stack

Parent: #5992 (copilot/reporter-r3c-shadow-parity)

#5985 -> #5986 -> #5987 -> #5989 -> #5988 -> #5991 -> #5992 -> this PR

R6 #5993 remains a parallel fork from #5989 and is not included here. Keep auto-merge disabled while stack ancestors are open.

Architecture

  • pass the frontend-owned reporter sink, session identity, and operation-stream opt-in to the selected Rush engine without exposing reporter instances or selection state
  • adapt the existing phase-aware OperationGraph.eventSink and OperationExecutionRecord hooks into the existing OperationStreamEmitter; scheduling and operation identity remain project x phase
  • emit registration (including silent metadata), previous/current status transitions, bounded ordered stdout/stderr chunks, authoritative stream close, and final operation outcome
  • retain the existing parser-owned aggregate commandResult hook instead of emitting a competing result path
  • bump the additive reporter protocol minor and update the beta API reviews/changefiles

Flag-off and presentation guarantee

When the reporter opt-in is disabled, the adapter does not expose a raw chunk callback, so OperationChunkTap is not installed. The existing StreamCollator, 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 check
  • rush change --verify --no-fetch

Focused 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

  • no compact spinner/activity/result UI
  • no plaintext/AI/legacy rendering parity ownership
  • no full-log demo fixture or documentation
  • no disabling of the legacy terminal destination
  • no removal of StreamCollator or duplicate-output cutover

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e

@TheLarkInn Sean Larkin (TheLarkInn) left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@TheLarkInn

Copy link
Copy Markdown
Member Author

Combined deep review of current head ac92280377.

  1. HIGH operation stream close and completion are delayed until the entire graph ends. Per-operation consumers retain output and cannot finalize promptly. Emit from each record terminal path, with the graph-end loop only as a backstop.
  2. MEDIUM protocol minor additions are marked required by default. Older same-major peers can accept the handshake and then discard the stream on an unknown event. Make new minor events optional through an explicit required set.
  3. LOW OperationGraph.ts:679-680 duplicates executionRecords.set.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r5a-operation-adapter branch from ac92280 to 11a7f84 Compare August 28, 2026 17:32
@TheLarkInn

Copy link
Copy Markdown
Member Author

Combined review findings fixed at 11a7f8462dd40b1d3c0d83ffafc5f0b748a80394.

  • Operation close and completion now emit exactly once from each terminal record path, after final output and runner cleanup. The graph-end loop is an idempotent backstop for unfinished records.
  • Protocol 1.1 operation terminal events are optional for 1.0 consumers. Unknown optional 1.1 events are skipped while the stream continues.
  • The duplicate execution-record insertion was removed.
  • Sharded mapping and aggregate status ownership remain inherited from Emit shadow Rush lifecycle events #5991 and are absent from the R5A delta.

Validation: reporter 298, rush-lib 782, apps/rush 47; focused operation tests 15; all three builds; API Extractor; rush check; stacked change verification. #5996 is CLEAN and auto-merge remains disabled pending fresh review.

@TheLarkInn

Copy link
Copy Markdown
Member Author

Final combined review of 11a7f8462d found no critical, high, medium, or useful low issues. Per-operation finalization, exactly-once terminal events, runner cleanup ordering, graph backstops, additive minor compatibility, feature-off behavior, cache, and watch paths are review-clean.

@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r5a-operation-adapter branch from 11a7f84 to 2f2cab8 Compare September 3, 2026 17:25
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r5a-operation-adapter branch from 2f2cab8 to f1c8124 Compare September 3, 2026 18:15
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r5a-operation-adapter branch from f1c8124 to 3542fd9 Compare September 3, 2026 18:44
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r5a-operation-adapter branch from 3542fd9 to d1889d3 Compare September 3, 2026 20:01
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r5a-operation-adapter branch 2 times, most recently from 6a493da to 7db76c9 Compare September 3, 2026 20:15
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r5a-operation-adapter branch from 7db76c9 to 3f38e00 Compare September 3, 2026 21:12
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
@TheLarkInn

Copy link
Copy Markdown
Member Author

Deep review of current head f969c43 found no critical, high, or medium actionable issues. Collapsed iterations now register, complete as noOp, close streams, and forward identity and completion through daemon sinks. Merge remains gated by #5992 and maintainer approval.

@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r5a-operation-adapter branch from f969c43 to 0debf23 Compare September 4, 2026 18:49
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