Integrate negotiated Heft child reporting - #6000
Integrate negotiated Heft child reporting#6000Sean Larkin (TheLarkInn) wants to merge 226 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
Create the authoritative frontend reporter host before version selection, register global reporter controls, and preserve legacy output unless a non-legacy reporter is explicitly selected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
Consume the repository experiment before Rush version selection, keep agent detection out of pre-major defaults, strip frontend-only controls before engine handoff, and preserve legacy verbosity compatibility. 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
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
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
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
|
Independent Findings fixed in 1f910c2
Validation
There are no review threads to resolve. #6000 remains stacked on open #5997 with auto-merge disabled. Merge is blocked until the ancestor chain reaches |
|
Combined deep review of current head
|
Stop reporter control scans at the pass-through separator and add an exactly-once frontend close contract across success, failure, and termination paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
Keep reporter controls out of ts-command-line globals, gate incompatible engines before initialization, and enforce bounded signal and close-error behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
Preserve unsupported custom reporter values until frontend ownership is unambiguous, and narrow emergency legacy stripping to the reporter selection flag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
Probe reporter ownership without requiring a value, then enforce strict reporter parsing only after frontend ownership is established. 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
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
e30aa36 to
7159901
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
Track explicit operation graph iteration identities across lifecycle events and isolate reporter totals, diagnostics, and output spools by watch cycle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6318e80-5da9-4858-a147-817e8692f10e
Preserve published early-failure, late-telemetry and operation-callback corrections; reconcile native lifecycle fields and telemetry references, with real branded parser regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Keep immutable errors intact, capture original pre-execution parser failures without changing legacy rendering, and observe final configured operation silence. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Preserve the published R3C slice and review fixes while incorporating the authoritative server-rebased immediate parent. 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
Retain the exact reviewed R5B slice, including unfiltered canonical full-detail logs and declaration-aware help. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Resolve physical cwd at parser entry so native Windows short names and directory aliases match Git repository paths. Keep real watch cancellation coverage and add symlink/junction regressions without mocking input analysis or watcher behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Native Node 24 and 26 validation showed that generic realpathSync and FileSystem.getRealPath retain 8.3 names. Use the existing native-realpath pattern to resolve the physical directory before configuration discovery. 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
Retain the exact 44-path Heft side slice and APIs while incorporating the qualified post-main core and native Windows watch fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Explicit pipes prevent Git line-ending notices from being mirrored onto the parent test stderr. Real setup failures still throw with the original captured error text. Reproduced the actual Rush production gate with process-local core.autocrlf=true and core.safecrlf=warn: unchanged tests exited with warnings before the fix and passed cleanly after it, without changing CI 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 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 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
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Resolve both expected and actual link locations using native-backed realpath before comparing them. Add a real directory-alias regression that still rejects wrong and missing targets, and run it alongside the unchanged npm and Yarn integration workflows. Reproduced the previous lexical mismatch before the fix; the regression and complete suite pass under an invocation-owned aliased temporary root. No production code, dependency versions, or CI gates changed. 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
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
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Own the complete real watch test promise so Jest afterEach can cancel and join setup, parser execution, and finalization before releasing locks or resetting fixture files and mocks. Forward teardown cancellation only after production abort listeners are installed, and cover successful and failed finalization with deterministic gates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
Retain the published R7 transport and owned watch-fixture changes while inheriting main 130daa8. Resolve squash-ancestry conflicts against the source-equivalent R5B tree and compose the R10 demo checks with the Heft negotiation and Windows fallback checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Untrusted child diagnostics are insufficiently validated, allowing inconsistent metadata and invalid zero-based locations.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
libraries/reporter/src/heft/HeftDescriptorHost.ts — This accepts a known diagnostic code with an arbitrary category and summary/detail template.… View comment |
|
libraries/reporter/src/heft/HeftDescriptorHost.ts — The public diagnostic source contract defines line and column as 1-based, but this validator… View comment |
What changed in this PR
Integrates negotiated structured reporting between Rush and Heft while preserving raw-output fallback and problem-matcher recovery.
Changes:
- Adds bidirectional descriptor negotiation and parent-owned reporter context.
- Streams correlated child output and diagnostics with validation and privacy controls.
- Adds fallback, malformed-stream, watch-cleanup, and demo coverage.
| File | Description |
|---|---|
libraries/rush-lib/src/utilities/Utilities.ts |
Supports custom child environment and stdio. |
libraries/rush-lib/src/pluginFramework/RushSession.ts |
Exposes child reporter session context. |
libraries/rush-lib/src/logic/operations/test/ShellOperationRunner.test.ts |
Tests Heft detection and reporter failures. |
libraries/rush-lib/src/logic/operations/test/OperationGraphEventSink.test.ts |
Minor test formatting cleanup. |
libraries/rush-lib/src/logic/operations/test/HeftChildProcessReporter.test.ts |
Covers negotiation, fallback, and corruption. |
libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts |
Attaches reporter channels to Heft children. |
libraries/rush-lib/src/logic/operations/ReporterOperationEventSink.ts |
Integrates child reporting and problem matchers. |
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts |
Adds structured child output routing. |
libraries/rush-lib/src/logic/operations/OperationEventSink.ts |
Defines child reporter sink contract. |
libraries/rush-lib/src/logic/operations/IOperationRunner.ts |
Extends operation runner context. |
libraries/rush-lib/src/logic/operations/HeftChildProcessReporter.ts |
Implements Rush-side descriptor host. |
libraries/rush-lib/src/index.ts |
Exports the internal reporter interface. |
libraries/rush-lib/src/cli/test/RushCommandLineParserReporterLifecycle.test.ts |
Makes watch-test cancellation cleanup reliable. |
libraries/reporter/src/test/Telemetry.test.ts |
Updates protocol-version expectation. |
libraries/reporter/src/test/Protocol.test.ts |
Tests capabilities, acknowledgements, and context. |
libraries/reporter/src/test/ProblemMatchers.test.ts |
Tests incremental matcher behavior. |
libraries/reporter/src/test/HeftIntegration.test.ts |
Expands protocol and security coverage. |
libraries/reporter/src/test/Goldens.test.ts |
Updates forward-compatibility fixture. |
libraries/reporter/src/test/__snapshots__/Goldens.test.ts.snap |
Updates protocol snapshot. |
libraries/reporter/src/protocol/ReporterProtocol.ts |
Advances protocol minor version. |
libraries/reporter/src/protocol/ReporterHandshake.ts |
Adds capabilities, context, and ACK parsing. |
libraries/reporter/src/matchers/ProblemMatcherRunner.ts |
Adds bounded streaming matching. |
libraries/reporter/src/index.ts |
Exports new reporter APIs. |
libraries/reporter/src/heft/HeftDescriptorHost.ts |
Validates and correlates child events. |
libraries/reporter/src/heft/HeftDescriptor.ts |
Allocates event and acknowledgement descriptors. |
libraries/reporter/src/heft/HeftChildEmitter.ts |
Adds acknowledgement-gated child emission. |
libraries/reporter/src/events/IReporterEventEnvelope.ts |
Adds parent-request correlation. |
common/reviews/api/rush-reporter.api.md |
Updates reporter API report. |
common/reviews/api/rush-lib.api.md |
Updates Rush API report. |
common/changes/@rushstack/rush-reporter/copilot-reporter-r7a-heft-reporting_2026-08-28-08-40.json |
Records reporter minor change. |
common/changes/@rushstack/heft/reporter-windows-pipes_2026-09-07.json |
Records Windows pipe fix. |
common/changes/@rushstack/heft/copilot-reporter-r7a-heft-reporting_2026-08-28-08-40.json |
Records Heft reporting feature. |
common/changes/@microsoft/rush/reporter-heft-review-fixes_2026-09-09.json |
Records stream-validation fixes. |
common/changes/@microsoft/rush/copilot-reporter-r7a-heft-reporting_2026-08-28-08-40.json |
Records Rush integration change. |
apps/rush/src/test/sandbox/reporter-demo/validateHeftOutput.mjs |
Validates demo child reporting. |
apps/rush/src/test/sandbox/reporter-demo/run.mjs |
Adds Heft demo invocation. |
apps/rush/src/test/sandbox/reporter-demo/README.md |
Documents platform behavior. |
apps/rush/src/test/ReporterDemo.test.ts |
Tests demo validation rules. |
apps/rush/src/RushFrontend.ts |
Supplies child reporter context. |
apps/heft/src/pluginFramework/logging/ScopedLogger.ts |
Emits structured diagnostics when available. |
apps/heft/src/pluginFramework/logging/LoggingManager.ts |
Connects loggers to child reporting. |
apps/heft/src/pluginFramework/logging/HeftChildReporter.ts |
Implements frozen Heft wire client. |
apps/heft/src/pluginFramework/logging/HeftChildReporter.test.ts |
Tests negotiation and fallback. |
apps/heft/src/cli/HeftCommandLineParser.ts |
Initializes negotiated child reporting. |
apps/heft/src/cli/HeftActionRunner.ts |
Supports child reporter verbosity. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Require child diagnostic categories and supplied template keys to match the registered definition, preserving optional detail omission and severity overrides. Enforce positive safe integer source coordinates when present. Cover canonical controls and real accepted children that exit zero after sending forged identities or zero coordinates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4747f826-8c83-495d-80df-3d1168662e10

Part of #5980
Stack
Base:
main. Parent #5997 and the rest of the Reporter core have landed.The main-relative diff contains 45 R7 paths: the existing 44-path Heft slice plus its published watch-test cleanup fix. Landed R10 documentation is retained. Parallel R6 #5993 bootstrap work remains excluded.
Merge remains gated on current-head CI and independent approval.
Negotiated Heft reporting
Rush now allocates a pair of private inherited descriptors for operation children: one carries child-to-parent NDJSON events and the other returns the parent hello acknowledgement. The handshake negotiates protocol major, optional capabilities, required features, and parent-owned reporter context (
reporter, log level, color, and terminal width).Compatible Heft versions:
heft-child-events-v1andreporter-context-v1;externalOutputand structured diagnostics without selecting or constructing the parent's reporters;sourceSequence;The Heft-side bootstrap uses a node-only frozen wire client rather than a runtime dependency on
@rushstack/rush-reporter, avoiding a Heft/self-hosting dependency cycle. It activates only when Rush supplies both private descriptors; direct standalone Heft behavior is unchanged.Fallback and problem matchers
Older Heft and opaque external children continue through ordered raw stdout/stderr. Missing or capability-incompatible negotiation falls back without losing output. Unsupported protocol majors or required features produce
RUSH_PROTOCOL_UPDATE_REQUIRED; malformed, oversized, or truncated streams produceRUSH_PROTOCOL_INVALID_CHILD_STREAM.Raw output is published before matcher diagnostics. Matchers consume ANSI-normalized copies keyed independently by operation, child record, and stdout/stderr stream, retain bounded partial lines, cap duplicates, and never mutate, suppress, or reorder the source output. They are disabled only after
heft-child-events-v1is actually accepted, preventing duplicate recovery when structured diagnostics exist.Current landing qualification (September 11, 2026)
Published
c6ed582fff9da05167aafd271e7be9348ea614f6preserves the former R7 head and landedmain@130daa8as its two parents. Production/API and the joined watch-cleanup test are unchanged; only incoming R10 documentation/demo composition changes the old-side tree. Consumer build/types/lint/API and 343 focused Linux tests passed. Existing native evidence is not claimed as a new run. New hosted CI and human approval are still required.Earlier validation (pre-landing snapshot)
rush build --only @rushstack/heft --only @rushstack/rush-reporter --only @microsoft/rush-lib --only @microsoft/rush --verbosenode apps/rush/src/test/sandbox/reporter-demo/run.mjsrush checkrush change --verify --no-fetchCoverage includes new Rush + new Heft, old/capability-less child fallback, unsupported major/required features, unknown optional and required events, malformed/truncated/oversized records, descriptor close and child crash, stdout/stderr interleaving, UTF-8 chunk limits,
sourceSequence, request/session/operation correlation, privacy, matcher recovery and duplicate caps, sharded operations, warning status propagation, and parent context.Non-goals
install-run-rushbootstrap handoff or R6 ownership ([rush reporter][R6A] Add bootstrap handoff and compatibility adapters #5993);