Skip to content

Emit shadow Rush lifecycle events - #5991

Open
Sean Larkin (TheLarkInn) wants to merge 1 commit into
copilot/reporter-r3a-session-sinkfrom
copilot/reporter-r3b-shadow-events
Open

Emit shadow Rush lifecycle events#5991
Sean Larkin (TheLarkInn) wants to merge 1 commit into
copilot/reporter-r3a-session-sinkfrom
copilot/reporter-r3b-shadow-events

Conversation

@TheLarkInn

Copy link
Copy Markdown
Member

Part of #5976

Stack parent: #5988

Summary

  • emit root session and command start/completion/result events through the scoped R3A sink boundary
  • adapt phased operation registration/status into stable project x phase identities and emit registered RUSH_OPERATION_FAILED diagnostics without routing raw chunks
  • correlate legacy AlreadyReportedError failures so catch boundaries do not emit duplicate structured diagnostics
  • feed a privacy-gated TelemetrySubscriber projection into existing Rush telemetry while leaving process exit behavior authoritative
  • add the registered RUSH_COMMAND_FAILED diagnostic for representative uncorrelated command failures

Validation

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

No-output guarantee

Legacy terminal rendering and StreamCollator remain the only visible stdout/stderr owners. The shadow sink emits no terminal text, operation chunks are not routed to reporters, and focused tests compare legacy graph output with and without the reporter adapter.

Non-goals

  • reporter selection, defaults, CLI controls, or automatic activation
  • replacing StreamCollator or emitting the R5 raw operation/output stream
  • removing legacy terminal/logger APIs
  • exhaustive parity, watch/retry, and integration matrices reserved for R3C
  • retargeting or merging this child stack before parent branches advance

@TheLarkInn

Copy link
Copy Markdown
Member Author

Independent R3 review against #5976/RFC phase 3: lifecycle/result ordering, phase-aware operation scope, legacy error correlation, telemetry projection, and no-raw-output behavior are correctly isolated while StreamCollator and process exit remain authoritative. The missing exhaustive parity matrix and logical-cancellation derivation are addressed in child #5992 rather than expanding this slice. Stack-only diff is one commit over #5988; no unresolved review threads are present.

@TheLarkInn

Copy link
Copy Markdown
Member Author

Combined deep review of current head e81d5a2508.

  1. HIGH ReporterOperationEventSink.ts:31-59 drops sharded operations that share project and phase identity. Shard failures can disappear from shadow diagnostics and exit derivation. Map every legacy operation name and aggregate shard status.
  2. LOW RushSession.ts:193-198 adds an envelope privacy gate that bypasses the allowlisted non-public diagnostic projection in Harden reporter telemetry privacy projection #5990. After Harden reporter telemetry privacy projection #5990 is hardened, forward all envelopes to the subscriber and keep one authoritative privacy projection.

@TheLarkInn
Sean Larkin (TheLarkInn) force-pushed the copilot/reporter-r3b-shadow-events branch from e81d5a2 to 8255a72 比较 August 28, 2026 16:32
@TheLarkInn

Copy link
Copy Markdown
Member Author

Rebased the single R3B commit onto #5988 head 07f17e4c7f and force-pushed 8255a72716.

Fixed sharded-operation-collapse: pre-shard, every shard, and collator now map to one project x phase identity. Status is aggregated per iteration, a shard failure emits one correlated diagnostic, telemetry retains the aggregate failure, and retry/watch registrations keep the same identity. R3B still exposes no raw chunk callback and legacy output remains authoritative. Also memoized reporter close after resolving the parent rebase.

Validation: build through @microsoft/rush; reporter, rush-lib, and apps/rush tests; API Extractor; rush check; rush change --verify --no-fetch; slice is one commit over 07f17e4c7f.

Low follow-on: keep the outer telemetry privacy gate until #5990 reaches shared main. Then remove it and forward all envelopes to the hardened subscriber.

@TheLarkInn

Copy link
Copy Markdown
Member Author

Four-review rerun on 8255a72716 confirms the sharded-operation fix. One MEDIUM issue remains: a failed watch iteration can permanently latch derived exit failure even after the final iteration and command lifecycle succeed. Derived status can disagree with the authoritative final exit.

Required fix: make final command or session completion, or current-iteration outcomes, establish the recovered success result. Add a fail-then-success watch test.

Dismissible low follow-ons: reset group silent state between watch iterations, and remove the outer telemetry privacy gate after #5990 reaches shared ancestry.

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-r3b-shadow-events branch from 8255a72 to 2f9ac7d 比较 August 28, 2026 17:02
@TheLarkInn

Copy link
Copy Markdown
Member Author

Round two fixed at 2f9ac7d90e.

Derived exit now follows current operation outcomes and authoritative root commandResult, commandCompleted, and sessionCompleted events. A fail-then-success watch sequence now resolves to exit 0, while an active failed iteration still resolves to exit 1. Grouped silence is recomputed after all registrations each iteration, so a group disabled after being active emits no new shadow registration or status.

Validation passed: build through @microsoft/rush; reporter, rush-lib, and apps/rush tests; API Extractor; rush check; rush change --verify --no-fetch; one-commit slice over 07f17e4c7f. The outer telemetry privacy gate remains deferred until #5990 is available in shared ancestry.

@TheLarkInn

Copy link
Copy Markdown
Member Author

Final combined review of 2f9ac7d90e found no critical, high, or medium actionable issue. Sharded aggregation, watch recovery, grouped silence, diagnostics, telemetry status, and derived exit parity are fixed.

One intentional low follow-on remains: remove the outer telemetry privacy gate after #5990 reaches shared ancestry. This head is low-only.

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant