feat(metadata): publish a whole app's drafts in one shot (ADR-0033)#1553
Merged
Conversation
Add protocol.publishPackageDrafts (loops the per-item publishMetaItem primitive over a package's sys_metadata draft rows — no metadata-service dependency) and POST /api/v1/packages/:id/publish-drafts. Per-item failures are collected, not fatal. Verified live: an AI-built app's 4 drafts published in one call, all promoted to active and drafts cleared. Unit tests for the orchestration (success/partial-failure/empty) + the dispatcher route (+501 fallback). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Context
After an AI builds an app, its metadata is drafted (bound to an app package). Publishing meant doing it one item at a time — the package-level
POST /packages/:id/publishneeds themetadataservice (503 when absent, e.g. the showcase) and reads the in-memory registry, not the drafts. This adds a true "publish whole app" action. (Builds on #1552, which added the draft list +promoteDraft-reuse path.)Change
protocol.publishPackageDrafts({ packageId, organizationId?, actor? })— promotes everysys_metadatadraft row bound to the package to active by reusing the per-itempublishMetaItemprimitive (overridable/lock guards + runtime registry refresh). Per-item failures are collected, not fatal. Nometadata-service dependency. Returns{ success, publishedCount, failedCount, published, failed }.POST /api/v1/packages/:id/publish-draftsexposes it (distinct from the registry-based/publish), wired in the dispatcher plugin +handlePackages.Verification
app.asset_management(4 drafts: location/asset/asset_list/app) published in one call →{ success: true, publishedCount: 4, failedCount: 0 };assetwent from 400 (draft-only) → 200 (active); remaining drafts cleared to[].Companion objectui PR adds the "Publish whole app" button to the package detail.
🤖 Generated with Claude Code