feat(core): add versioned artifact metadata - #1903
Conversation
@rsdoctor/agent-cli
@rsdoctor/cli
@rsdoctor/client
@rsdoctor/core
@rsdoctor/shared
commit: |
Deploying rsdoctor-v1 with
|
| Latest commit: |
368c5d7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ca69c44f.rsdoctor-v1.pages.dev |
| Branch Preview URL: | https://codex-rsdoctor-rstack-artifa.rsdoctor-v1.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a832812a08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR introduces a schema-versioned, optional top-level metadata field for Rsdoctor artifacts (both normal manifests and brief JSON artifacts) so downstream consumers can reliably bind reports to build/compiler identity and distinguish “collected but empty” sections from omitted data, while keeping legacy artifact shapes compatible.
Changes:
- Added shared artifact metadata types (schema v1) and surfaced
metadata?: ...on manifest and brief artifact envelopes. - Implemented metadata emission in
@rsdoctor/coreSDK writers (brief JSON + normal manifest/sharding/cloud manifest), including per-section collection/omission reasons and optional build identity. - Added rspack plugin plumbing to attach per-compiler compilation identity, plus tests validating metadata presence and multi-compiler identity behavior; updated agent-cli datasource typing/docs/tests to accept and preserve metadata.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/shared/src/types/sdk/instance.ts | Adds optional SDK hook for attaching artifact build identity; minor type formatting cleanup. |
| packages/shared/src/types/manifest.ts | Defines schema v1 artifact metadata/types and adds optional metadata to manifest and brief artifact envelopes. |
| packages/core/src/sdk/sdk/index.ts | Emits schema v1 metadata in brief JSON artifacts and normal manifests (including cloud/sharded manifest metadata). |
| packages/core/src/sdk/sdk/core.ts | Stores and exposes artifact build identity on the SDK core for metadata emission. |
| packages/core/src/sdk/multiple/primary.ts | Extends metadata for multi-compiler manifests by producing a per-compiler identity list. |
| packages/core/src/rspack-plugin/plugin.ts | Captures compilation hash/target/environment and forwards to SDK metadata via setArtifactBuildIdentity. |
| packages/core/tests/sdk/sdk/core/brief-json-output.test.ts | Adds assertions that brief and normal outputs include v1 metadata without breaking existing envelopes/sharding. |
| packages/core/tests/rspack-plugin/plugin.test.ts | Adds multi-compiler test ensuring independently matchable per-compiler identities are emitted. |
| packages/agent-cli/src/commands/datasource.ts | Updates datasource typings to accept optional metadata and preserve unknown metadata keys. |
| packages/agent-cli/tests/rsdoctor-cli.test.ts | Adds test ensuring legacy and v1 artifacts parse equivalently for report data while preserving metadata when present. |
| packages/agent-cli/README.md | Documents artifact compatibility and semantics of collected vs omitted sections. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…-artifact-contract # Conflicts: # packages/core/tests/rspack-plugin/plugin.test.ts
Deploying rsdoctor with
|
| Latest commit: |
368c5d7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://838681f9.rsdoctor.pages.dev |
| Branch Preview URL: | https://codex-rsdoctor-rstack-artifa.rsdoctor.pages.dev |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d6ba7ee25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
The pkg.pr.new override never propagated to consumers, so downstream installs resolved the published 0.1.1 whose omitted-section semantics this package cannot ship against. Declaring the commit-pinned canary of web-infra-dev/rsdoctor#1903 directly makes every install resolve the build the tests certify. Swap for a release version once the PR ships. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Revert the URL dependency from c01fd3b: published previews must carry ordinary semver dependencies because blockExoticSubdeps consumers reject URL-resolved subdependencies (rstack-cli context-plugin-boundary design, "Preview dependency policy" — adopting it broke rstack-cli installs with ERR_PNPM_EXOTIC_SUBDEP). Local validation still resolves the pinned canary of web-infra-dev/rsdoctor#1903, now commit-addressed instead of floating on the PR ref; consumers on 0.1.1 fall back to the existing zero-shape degraded reporting for omitted sections. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-artifact-contract
…-artifact-contract # Conflicts: # packages/core/src/sdk/multiple/primary.ts # packages/core/tests/rspack-plugin/plugin.test.ts
Summary
Add an optional versioned top-level
metadatafield to normal and brief Rsdoctor artifacts so consumers can bind reports to compiler builds and distinguish collected-empty sections from omitted data. New writers emit producer, output-mode, build/compiler, per-compiler compilation hash, target/environment, and section-state metadata while preserving the existingdataandclientRoutesshapes; the agent-cli reader remains compatible with legacy artifacts and forwards unknown metadata keys.The in-process Agent CLI returns
RSDOCTOR_SECTION_UNAVAILABLEwhen required metadata marks a section omitted, while collected-empty and legacy artifacts keep their compatible behavior. Catalog analysis output is bounded: empty tree-shaking bailout rows are removed,limit/pageNumberaliases are honored, and nested side-effect, chunk, and asset output respects the requested page size.The branch is refreshed on current
mainand preserves the merged watch-mode report-compression path in multi-compiler writes.Verification
@rsdoctor/coresuite: 292 passedRelated Links