Skip to content

fix(inspect): finish Workbench and documentation audits - #649

Merged
ScriptedAlchemy merged 11 commits into
mainfrom
audit/inspection-workbench-docs
Sep 5, 2026
Merged

fix(inspect): finish Workbench and documentation audits#649
ScriptedAlchemy merged 11 commits into
mainfrom
audit/inspection-workbench-docs

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • render actual lowered Rspack configurations from inspection.origin.bundlerConfigs in inspect --bundler
  • compile TypeDoc from built declarations while preserving Twoslash source checking and docs link/anchor gates
  • content-hash Workbench production assets, apply immutable caching while keeping index.html no-store, target Chrome 120, and serve extensionless notices as text/plain

Refs #566 and #572.

Measurement

pnpm docs:site:build improved from 102.42s to 91.48s in same-worktree single runs (10.7%); CI now builds declarations before docs.

Validation

  • pnpm build
  • pnpm typecheck, pnpm lint, pnpm test:unit (concurrent after build)
  • pnpm test:packed
  • pnpm docs:site:build

Review hygiene

  • Deslop: Cursor Grok 4.6 High Fast, 7 edits removing restating comments and reusing errorMessage.
  • Self-review: Claude Fable 5.1 Thinking High. Fixed stale distPath.root docs, generated DTS tsconfig lowering parity/cleanup, AB7001 guidance, and release-note accuracy. The patch bump is retained per the audit delivery requirement despite the inspection JSON shape change. Two follow-up reviews found no remaining merge risk.

`agent-bundle inspect --bundler` rendered the composed Rslib/Rsbuild author
config — the framework profile with the `tools` hatch merged over it — not
what the compiler receives. Each entry's `config` is now the lowered Rspack
configuration from `inspection.origin.bundlerConfigs`, produced by the
build's own lowering step and stopped where the build would start compiling.

- rslib.ts: extract `lowerEntries` (create instance, compose every entry,
  `inspectProductionConfig`, `assertExecutableConfig`) and share it between
  `buildRslibSurfaces` and the new `inspectRslibEntries`; generalize
  `inspectProductionConfig` (NODE_ENV restore) to any `inspectConfig` owner.
- mcp-apps.ts: extract `lowerViews` (Rsbuild instance, compile-time plugins,
  production inspection, `assertResolvedViewConfig`) and share it between
  `compileMcpApps` and the new `inspectMcpAppsConfig`.
- inspect-bundler.ts: plan every Rslib output (scripts, routed CLI bins, MCP
  entries and flight workers, hook wrappers, package bin/lib) and lower each
  run through the shared step; render configs JSON-safe (`[function <name>]`,
  `[object <Class>]`, `[regexp /src/]`) with the artifact root folded to
  `<output>` and the synthesized dts tsconfig to `<generated-dts-tsconfig>`
  so the output is deterministic per project.
- api.ts: `AB7001` for a refused bundler inspection carries the lowering's
  refusal message.
- Tests: inspect-bundler.test.ts asserts the lowered shape (resolved aliases,
  externals, framework plugins, output.path tokens, determinism, refusal);
  cli.test.ts asserts the CLI JSON and human output against the same shape.
- Docs: entry-conventions, diagnostics (AB7001), framework-mode, READMEs, and
  the en/zh CLI reference, package-entries, and distribution pages.
Ship hashed JS/CSS/assets so the foreground can cache them for a year, while index.html and other unhashed files stay no-store. Contributor HMR keeps stable unhashed names.
The prebuilt Workbench tree ships THIRD_PARTY_NOTICES and
src/mcp/APP-RENDERER-LICENSE without an extension, so the asset source fell
through to application/octet-stream and browsers downloaded them instead of
rendering. Extensionless files whose basename is a conventional notice name
(LICENSE, NOTICE, COPYING, and -/_ prefixed variants) are now typed
text/plain; charset=utf-8. Other extensionless files keep the binary
fallback and asset path containment is unchanged.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89df366

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Sep 5, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@649
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@649
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@649
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@649

commit: 89df366

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.

1 participant