feat(build): package the canonical npm root - #639
Closed
ScriptedAlchemy wants to merge 16 commits into
Closed
Conversation
🦋 Changeset detectedLatest commit: 15e9366 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
commit: |
… root (#640) * feat(runtime): separate the framework state root from the plugin code root Artifact-hosted shells (stdio MCP entry, Flight worker, artifact CLI bin and render worker, standalone hook wrappers) resolve their state root under ~/.agent-bundle/state/<plugin>-<digest> (or $XDG_STATE_HOME/agent-bundle/...) instead of <plugin root>/state, so a read-only install launches and two installs never share state. AGENT_BUNDLE_PLUGIN_ROOT keeps naming the code root; AGENT_BUNDLE_STATE_ROOT overrides the state root. Closes #637 * chore: name #640 in the changeset * fix(state-root): anchor script workers on the artifact, pin dev sessions to <epoch>/state, ignore relative XDG_STATE_HOME Self-review findings: rendered script workers kept the cwd fallback; dev and Workbench MCP sessions would have derived one user-data root per build epoch; a relative XDG_STATE_HOME would have anchored state on the shell's cwd. uninstall --purge-data / doctor coverage of the derived root is #641. * docs: scope --purge-data to legacy state, fix zh plugin.value.root, XDG absolute-path wording
… into feat/555-npm-root
# Conflicts: # docs/entry-conventions.md # website/docs/en/guide/authoring/mcp.mdx # website/docs/en/guide/authoring/package-entries.mdx # website/docs/en/reference/cli.mdx # website/docs/zh/guide/authoring/mcp.mdx # website/docs/zh/guide/authoring/package-entries.mdx # website/docs/zh/reference/cli.mdx
* fix(build): isolate re-bundled runtime entries * chore: add runtime boundary changeset * fix(test): restore release dist after packed fixture * test: preserve ad hoc packed runs * test: isolate runtime rebundle tarball * test: scope rebundle fixture to stdio proof * test: retain release stdio process proof
# Conflicts: # packages/agent-bundle/rslib.config.ts
) * build: compile evidence record module and AB6039 * Persist the compile evidence record beside emitted files (AB6039) * Share the evidence-to-IR lowering between Rslib surfaces and MCP App views * Account for the compile evidence record in root listings and the epoch tamper test * Re-judge recorded externals with the build's policy; keep the record out of the generic JSON check * Judge recorded externals per compilation boundary: views keep none, node bundles load only node bundles
* fix: manage derived state across lifecycle * fix: preserve state roots through keep data * fix: align web data root derivation * fix: keep lifecycle helpers runtime-free
# Conflicts: # packages/agent-bundle/src/build/build.ts # packages/agent-bundle/src/build/emit.ts # packages/agent-bundle/src/build/package-build.ts # packages/agent-bundle/src/build/validate-artifact.ts # packages/agent-bundle/src/install/doctor.ts # packages/agent-bundle/tests/artifact-validator.test.ts # packages/agent-bundle/tests/build-compose.test.ts # packages/agent-bundle/tests/packed-readonly-state-root.test.ts # website/docs/en/guide/concepts/architecture.mdx # website/docs/en/reference/cli.mdx # website/docs/en/reference/targets-artifacts.mdx # website/docs/zh/guide/concepts/architecture.mdx # website/docs/zh/reference/cli.mdx # website/docs/zh/reference/targets-artifacts.mdx
This was referenced Sep 5, 2026
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
binat the manifest-declared artifact executable, remove the obsolete package-relative installer launcher, and make artifact bins directly executabledashboard,web) to the artifact bin after installation in a clean consumerCloses the W2/S4 npm-root step of #555. This PR is stacked on #604 until manifest v2 lands.
Verification
pnpm build && pnpm typecheck && pnpm lint && pnpm test:unitpnpm exec rstest --config rstest.packed.config.ts packages/agent-bundle/tests/packed-web-command.test.tspnpm docs:site:buildDeslop
Deslop: GPT-5.6 Sol, 3 edits (removed a stray blank line, replaced a non-null assertion with explicit narrowing, and flattened package provenance selection).
Self-review
Pending the required Claude Fable review after #604 lands and this branch is rebased onto
main.