Skip to content

feat(core): add versioned artifact metadata - #1903

Draft
ScriptedAlchemy wants to merge 11 commits into
mainfrom
codex/rsdoctor-rstack-artifact-contract
Draft

feat(core): add versioned artifact metadata#1903
ScriptedAlchemy wants to merge 11 commits into
mainfrom
codex/rsdoctor-rstack-artifact-contract

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an optional versioned top-level metadata field 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 existing data and clientRoutes shapes; the agent-cli reader remains compatible with legacy artifacts and forwards unknown metadata keys.

The in-process Agent CLI returns RSDOCTOR_SECTION_UNAVAILABLE when 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/pageNumber aliases are honored, and nested side-effect, chunk, and asset output respects the requested page size.

The branch is refreshed on current main and preserves the merged watch-mode report-compression path in multi-compiler writes.

Verification

  • Full @rsdoctor/core suite: 292 passed
  • Focused metadata, multi-compiler, watch-compression, and sharding tests: 23 passed
  • Agent CLI tests: 45 passed
  • Core build passed
  • Repository lint and dependency-version checks passed

Related Links

Copilot AI lite review requested due to automatic review settings August 12, 2026 23:34
@pkg-pr-new

pkg-pr-new Bot commented Aug 12, 2026

Copy link
Copy Markdown
@rsdoctor/agent-cli

npm i https://pkg.pr.new/@rsdoctor/agent-cli@1903

@rsdoctor/cli

npm i https://pkg.pr.new/@rsdoctor/cli@1903

@rsdoctor/client

npm i https://pkg.pr.new/@rsdoctor/client@1903

@rsdoctor/core

npm i https://pkg.pr.new/@rsdoctor/core@1903

@rsdoctor/shared

npm i https://pkg.pr.new/@rsdoctor/shared@1903

commit: 368c5d7

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploying rsdoctor-v1 with  Cloudflare Pages  Cloudflare Pages

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

View logs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/core/src/sdk/sdk/index.ts Outdated
Comment thread packages/core/src/sdk/multiple/primary.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/core SDK 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
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploying rsdoctor with  Cloudflare Pages  Cloudflare Pages

Latest commit: 368c5d7
Status: ✅  Deploy successful!
Preview URL: https://838681f9.rsdoctor.pages.dev
Branch Preview URL: https://codex-rsdoctor-rstack-artifa.rsdoctor.pages.dev

View logs

@ScriptedAlchemy

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/agent-cli/src/executor.ts
Comment thread packages/core/src/sdk/sdk/index.ts Outdated
@ScriptedAlchemy

Copy link
Copy Markdown
Contributor Author

@codex review

ScriptedAlchemy added a commit to rstackjs/context that referenced this pull request Aug 15, 2026
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>
ScriptedAlchemy added a commit to rstackjs/context that referenced this pull request Aug 15, 2026
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

# Conflicts:
#	packages/core/src/sdk/multiple/primary.ts
#	packages/core/tests/rspack-plugin/plugin.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants