[rush reporter][R1B] Generate install-run-rush bootstrap protocol - #5986
Conversation
b52b54e to
1b4252c
Compare
|
Combined deep review of current head No critical, high, or medium actionable findings. No useful low follow-ons. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The generator must detect inline dynamic imports before its zero-dependency guarantee is reliable.
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 |
|---|---|
libraries/reporter/scripts/generateBootstrapProtocol.js — The import guard only matches statements whose first token is import, so an inline dynamic import… |
What changed in this PR
Generates and embeds a zero-dependency reporter bootstrap protocol for install-run-rush, with deterministic synchronization checks.
Changes:
- Adds the generated bootstrap encoder and protocol constant.
- Integrates generation checks into builds and tests.
- Updates bootstrap buffering and change records.
| File | Description |
|---|---|
libraries/rush-lib/src/scripts/install-run-rush.ts |
Embeds and validates the bootstrap protocol. |
libraries/rush-lib/src/scripts/generated/BootstrapProtocol.ts |
Provides the generated protocol artifact. |
libraries/reporter/src/test/Bootstrap.test.ts |
Tests deterministic envelope encoding. |
libraries/reporter/src/bootstrap/BootstrapProtocol.ts |
Defines the generated protocol source region. |
libraries/reporter/src/bootstrap/BootstrapEventBuffer.ts |
Uses the shared encoder. |
libraries/reporter/scripts/generateBootstrapProtocol.js |
Generates and verifies the artifact; its import guard misses inline dynamic imports, allowing unintended runtime dependencies. |
libraries/reporter/package.json |
Adds generation and validation commands. |
libraries/reporter/config/heft.json |
Adds build-time synchronization validation. |
common/changes/@rushstack/rush-reporter/copilot-reporter-bootstrap-generation_2026-08-28-01-58.json |
Records the reporter change. |
common/changes/@microsoft/rush/copilot-reporter-bootstrap-generation_2026-08-28-01-58.json |
Records the Rush change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Deep review of current head 4a97962 found no critical, high, or medium actionable issues. Fixed the inline dynamic import guard, generated-artifact cache ownership, require-rooted module edge coverage, and undefined payload envelope handling. Reporter and rush-lib builds and tests, stale-artifact rejection, frozen install, generation checks, and repository policy gates pass. Low follow-ons are non-blocking: the duplicate reporter-side artifact check has a weaker cache ownership contract, and the rush-lib task uses a repository-relative sibling path. The rush-lib artifact-owner check remains authoritative. |
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
4a97962 to
b2949c7
Compare

Summary
Stack
This is the R1B child of #5985. Auto-merge stays disabled while #5985 is open. After #5985 merges, retarget this PR to main, verify its slice and full CI, then merge it before #5987.
Generation and boundary guarantees
libraries/reporter/scripts/generateBootstrapProtocol.js extracts only the marked protocol region, parses it with TypeScript, verifies its major matches REPORTER_PROTOCOL_VERSION.major, rejects module-loading edges, and writes the committed artifact. Check mode compares the artifact deterministically after normalizing checkout line endings.
The rush-lib build owns validation of the committed generated artifact. The reporter build also validates source changes early. The generated module contains only the frozen major, envelope DTO types, and JSON encoder. The built install-run-rush.js contains the encoder and contains no @rushstack/rush-reporter runtime reference.
Validation
Non-goals
This slice does not implement the bootstrap handoff prelude, reporter selection, or the Rush 6 default change. Those remain separate workstreams.
Part of #5974