fix: publish playground source with its Published switch - #696
Merged
davidmckayv merged 4 commits intoOct 2, 2026
Merged
Conversation
Harbor404
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
October 1, 2026 13:49
…blish-source # Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
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.
What this changes
Fixes #693.
The generic Published switch used to call
ComponentStore.publishfor every component kind. For a sandboxed component that promoted only the governance row, so Bots were offered a component whosepublished_htmlwas still null.This change makes the generic component store refuse to write a sandboxed publication itself. The publication route catches that signal and delegates to
sandboxedStore, which now publishes or withdraws the source row, published description, argument schema, revision, and governance row in one PostgreSQL transaction. Missing playground source, empty HTML, or an empty description is answered with409and changes nothing. Re-publishing an unchanged draft is idempotent and records one audit event; unpublish withdraws both rows together.Where it runs
sandboxed_componentsandcomponentsrows remain the state.sandboxed_components.publishandunpublishrun the two writes insidedatabase.transaction, locking both rows withSELECT ... FOR UPDATE. The unchanged-publish branch is a no-op. No check-then-write outside a transaction is introduced.Boundary and audit
requireAdmin; no client-supplied source or actor is trusted.Changelog
Added an
Unreleasedentry because playground publication behavior changes.Proof
TEST_DATABASE_URL=... bun test server/tests/component-publication.test.ts server/tests/sandboxed-routes.test.ts server/tests/sandboxed-save-fields.test.ts server/tests/sandboxed-components.integration.test.ts server/tests/component-store.integration.test.ts server/tests/sandboxed-publication.integration.test.ts/api/sandboxed/published.bun run typecheck— server, app, and worker pass.bun run lint— 983 files, no fixes.bun run format:check— 968 files, no fixes.bun testwas also run. Component/publication tests passed; the remaining local-only failures were in separate bot fixtures that require their own CI-installed dependencies (Mastra/LangGraph were rechecked after installation and pass), plusagent-computer/tests/identity.test.ts, whose child process fails on this workspace's percent-encoded Chinese path rather than on the change.