Skip to content

Commit 6d4b487

Browse files
TheLarkInnCopilot
andauthored
Reporter overhaul (1/6): contracts and baselines (@rushstack/rush-reporter package) (#5865)
* Add Rush reporter overhaul RFC Document the reviewed reporter architecture, structured event protocol, compatibility model, rollout plan, and supporting codebase research for issue #5858. Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ba539363-ff7b-44c9-b4f6-e49ef7fc6c92 * Add @rushstack/reporter public beta package scaffold Introduce the @rushstack/reporter package skeleton that will hold the canonical event protocol, reporter manager, and built-in reporters described in the Rush reporter overhaul RFC (#5858). - Scaffold libraries/reporter with rig-based Heft build config - Mark exported contracts as public beta via API Extractor (@beta) - Declare no dependency on rush-lib - Register the package in rush.json and update the pnpm lockfile - Track reporter-overhaul feature-list progress Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add rush change file for @rushstack/reporter Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add canonical reporter event envelope and core event type union Define the presentation-free event contract for @rushstack/reporter as described in the Rush reporter overhaul RFC (#5858). - Add IReporterProtocolVersion, ReporterPrivacyClassification, and the immutable IReporterEventEnvelope with source and scope - Add the closed ReporterEventType union and REPORTER_EVENT_TYPES list - Add ReporterJsonValue to type JSON-serializable payloads - Document sequence as authoritative ordering and timestamp as informational, and preserve child producer order via sourceSequence - Add a golden envelope schema test covering snapshot, JSON round-trip, the closed union, and Error payload handling Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add rush change file for reporter event envelope Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add scoped producer API for reporter events Introduce the presentation-free producer contract for @rushstack/reporter (#5858). - Add IReporterEventSink.emit, which accepts an envelope input that omits the sink-assigned eventId, sequence, and timestamp - Add IScopedReporter with emitMessage, emitDiagnostic, and emitExtension, none of which expose reporter instances, destinations, or thresholds - Add namespaced extension event names with an isReporterExtensionEventName validator so producer events cannot collide with the closed core set - Add a minimal IRushDiagnostic contract, expanded by the structured diagnostics feature - Cover the sink omit contract, scoped emit ids, emit-only surface, and extension name validation with tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add rush change file for scoped producer API Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add structured diagnostics with code registry and field privacy Complete the structured diagnostics contract for @rushstack/reporter (#5858). - Expand IRushDiagnostic with category, remediation, source, classified parameters, cause chaining, and related artifacts - Add RushDiagnosticCategory, IRushRemediationAction, IRushDiagnosticSource, and IClassifiedDiagnosticValue - Add a central, never-reused RUSH_<DOMAIN>_<NAME> code registry with English templates keyed by resource key and a stable internal-error code - Add computeEnvelopePrivacyFloor and getPrivacyClassificationRank so the envelope classification is the least-sensitive floor while field-level classification stays authoritative - Add createRushDiagnostic and RushError so emission returns a diagnostic id that propagated failures reference - Add registry, privacy, factory, and RushError tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add rush change file for structured diagnostics Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add NDJSON wire protocol with handshake and size limits Add the cross-process wire protocol for @rushstack/reporter (#5858). - Add REPORTER_PROTOCOL_VERSION, REPORTER_PROTOCOL_LIMITS (1 MiB bootstrap and record, 64 KiB external chunk), and isReporterProtocolCompatible - Add an NDJSON encoder and a streaming decoder that enforce the record limit - Add hello/helloAck negotiation that accepts the capability intersection, tolerates additive minor versions, and rejects only unknown required features or unsupported majors - Emit an update-global-Rush diagnostic (RUSH_PROTOCOL_UPDATE_REQUIRED) on rejection - Cover encode/decode framing, size limits, and negotiation with tests Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add rush change file for NDJSON wire protocol Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add ReporterManager lifecycle, ordering, and fan-out Add the reporter fan-out engine for @rushstack/reporter (#5858). - Add the IReporter interface and IReporterContext - Add ReporterManager, the authoritative in-process sink: it assigns one monotonic session sequence, eventId, and timestamp, rehomes foreign child envelopes while preserving sourceSequence, and delivers events to each reporter through an independent ordered queue - Enforce exclusive destination ownership and add ReporterMultiplexer for explicit sharing - Flush on normal, error, and signal completion with 10s and 2s timeouts - Coalesce replaceable status events under pressure while never dropping lifecycle, diagnostic, result, artifact, or external-output events - Disable optional reporters on runtime failure with an emergency diagnostic and make required-reporter and initialization failures fatal - Cover ordering, destinations, failure handling, coalescing, and flush/close Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add rush change file for ReporterManager Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add protocol, compatibility, and legacy output goldens Freeze baselines for @rushstack/reporter (#5858). - Add golden schema tests that freeze the serialized event envelope, diagnostic, and hello/helloAck wire forms and assert NDJSON round-trips - Add compatibility goldens for negotiation across supported majors and minors, including additive-minor tolerance and forward-compatible field retention - Freeze representative legacy success and failure output as the parity baseline for the future legacy reporter - Wire all goldens into the existing jest test runner Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add rush change file for reporter goldens Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Add @rushstack/reporter to the repository README package list Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 * Address reporter contract review feedback Assistant-model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 90cfc9a4-cbde-48e6-a771-86ad7abf948c * Realign @rushstack/rush-reporter contracts with design review decisions - Rename @rushstack/reporter to @rushstack/rush-reporter - Add messageEmitted core event type; message text privacy defaults to local-sensitive - Type-level diagnostic codes (template literals, as const satisfies registry, derived RushDiagnosticCodes/RushDiagnosticTemplateKey unions) with per-domain template modules and a non-regex runtime validator - Forward-compatible RushDiagnosticCategory (KnownCategory | (string & {})) - IRushDiagnosticSource becomes a kind-tagged discriminated union - Event identity documented as (sessionId, eventId); manager derives the envelope required flag from event type; required-reporter failure writes its emergency diagnostic once - Governed REPORTER_KNOWN_CAPABILITIES registry; template-literal extension event names; two-tier (contract vs tuning) constant policy; full beta license docblock - Spec gains a design realignments addendum; goldens and API report regenerated Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Fix the README package badge for the @rushstack/rush-reporter rename The repo-toolbox readme --verify check failed in CI because the npm badge URL still pointed at the old @rushstack/reporter name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Address reporter contract review follow-up Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ea5daa0b-7839-42f0-9d63-4ca84c7d2b5c * Preserve NDJSON records across decode errors Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ea5daa0b-7839-42f0-9d63-4ca84c7d2b5c * Avoid Error cause target conflicts Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ea5daa0b-7839-42f0-9d63-4ca84c7d2b5c --------- Co-authored-by: Sean Larkin <TheLarkInn@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ba539363-ff7b-44c9-b4f6-e49ef7fc6c92 Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3 Copilot-Session: 90cfc9a4-cbde-48e6-a771-86ad7abf948c Copilot-Session: ea5daa0b-7839-42f0-9d63-4ca84c7d2b5c
1 parent e61404a commit 6d4b487

72 files changed

Lines changed: 7385 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ These GitHub repositories provide supplementary resources for Rush Stack:
9696
| [/libraries/package-deps-hash](./libraries/package-deps-hash/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fpackage-deps-hash.svg)](https://badge.fury.io/js/%40rushstack%2Fpackage-deps-hash) | [changelog](./libraries/package-deps-hash/CHANGELOG.md) | [@rushstack/package-deps-hash](https://www.npmjs.com/package/@rushstack/package-deps-hash) |
9797
| [/libraries/package-extractor](./libraries/package-extractor/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fpackage-extractor.svg)](https://badge.fury.io/js/%40rushstack%2Fpackage-extractor) | [changelog](./libraries/package-extractor/CHANGELOG.md) | [@rushstack/package-extractor](https://www.npmjs.com/package/@rushstack/package-extractor) |
9898
| [/libraries/problem-matcher](./libraries/problem-matcher/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Fproblem-matcher.svg)](https://badge.fury.io/js/%40rushstack%2Fproblem-matcher) | [changelog](./libraries/problem-matcher/CHANGELOG.md) | [@rushstack/problem-matcher](https://www.npmjs.com/package/@rushstack/problem-matcher) |
99+
| [/libraries/reporter](./libraries/reporter/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Frush-reporter.svg)](https://badge.fury.io/js/%40rushstack%2Frush-reporter) | [changelog](./libraries/reporter/CHANGELOG.md) | [@rushstack/rush-reporter](https://www.npmjs.com/package/@rushstack/rush-reporter) |
99100
| [/libraries/rig-package](./libraries/rig-package/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Frig-package.svg)](https://badge.fury.io/js/%40rushstack%2Frig-package) | [changelog](./libraries/rig-package/CHANGELOG.md) | [@rushstack/rig-package](https://www.npmjs.com/package/@rushstack/rig-package) |
100101
| [/libraries/rush-daemon](./libraries/rush-daemon/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Frush-daemon.svg)](https://badge.fury.io/js/%40rushstack%2Frush-daemon) | [changelog](./libraries/rush-daemon/CHANGELOG.md) | [@rushstack/rush-daemon](https://www.npmjs.com/package/@rushstack/rush-daemon) |
101102
| [/libraries/rush-daemon-protocol](./libraries/rush-daemon-protocol/) | [![npm version](https://badge.fury.io/js/%40rushstack%2Frush-daemon-protocol.svg)](https://badge.fury.io/js/%40rushstack%2Frush-daemon-protocol) | [changelog](./libraries/rush-daemon-protocol/CHANGELOG.md) | [@rushstack/rush-daemon-protocol](https://www.npmjs.com/package/@rushstack/rush-daemon-protocol) |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-reporter",
5+
"comment": "Initial public beta scaffold of the @rushstack/rush-reporter package",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-reporter",
10+
"email": "TheLarkInn@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-reporter",
5+
"comment": "Add the canonical reporter event envelope, closed core event type union, privacy classification, and JSON payload types",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-reporter",
10+
"email": "TheLarkInn@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-reporter",
5+
"comment": "Add the scoped producer API (IReporterEventSink, IScopedReporter) and namespaced extension event names",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-reporter",
10+
"email": "TheLarkInn@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-reporter",
5+
"comment": "Add structured diagnostics: category, remediation, and source types, a central RUSH_<DOMAIN>_<NAME> code registry with English templates, field privacy floor helpers, createRushDiagnostic, and RushError",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-reporter",
10+
"email": "TheLarkInn@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-reporter",
5+
"comment": "Add the NDJSON wire protocol: protocol version and byte limits, an NDJSON encoder and streaming decoder, and hello/helloAck capability negotiation with an update-global-Rush diagnostic",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-reporter",
10+
"email": "TheLarkInn@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-reporter",
5+
"comment": "Add ReporterManager and IReporter: monotonic session ordering, per-reporter queues, exclusive destination ownership with a multiplexer, timed flush/close, status coalescing, and optional/required failure handling",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-reporter",
10+
"email": "TheLarkInn@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-reporter",
5+
"comment": "Add protocol, compatibility, and legacy output golden tests (test-only baselines)",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-reporter",
10+
"email": "TheLarkInn@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-reporter",
5+
"comment": "Apply design-review realignments to the reporter contracts: rename the package to @rushstack/rush-reporter; add the messageEmitted core event type with a fail-safe local-sensitive default for message text; enforce diagnostic codes and template keys at the type level with per-domain template modules; make diagnostic categories forward-compatible; make diagnostic sources a kind-tagged discriminated union; scope event identity to (sessionId, eventId); derive the envelope required flag from the event type in ReporterManager; govern handshake capabilities with a registry; and document the two-tier constant policy and full beta license.",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-reporter",
10+
"email": "TheLarkInn@users.noreply.github.com"
11+
}

common/config/subspaces/default/pnpm-lock.yaml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)