Skip to content

feat(metadata): publish a whole app's drafts in one shot (ADR-0033)#1553

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0033-publish-package-drafts
Jun 3, 2026
Merged

feat(metadata): publish a whole app's drafts in one shot (ADR-0033)#1553
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0033-publish-package-drafts

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

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/publish needs the metadata service (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 every sys_metadata draft row bound to the package to active by reusing the per-item publishMetaItem primitive (overridable/lock guards + runtime registry refresh). Per-item failures are collected, not fatal. No metadata-service dependency. Returns { success, publishedCount, failedCount, published, failed }.
  • POST /api/v1/packages/:id/publish-drafts exposes it (distinct from the registry-based /publish), wired in the dispatcher plugin + handlePackages.

Verification

  • Live (showcase): an AI-built app.asset_management (4 drafts: location/asset/asset_list/app) published in one call → { success: true, publishedCount: 4, failedCount: 0 }; asset went from 400 (draft-only) → 200 (active); remaining drafts cleared to [].
  • Unit: orchestration (success / partial-failure-doesn't-abort / empty package) + the dispatcher route (+501 fallback). objectql (498) + runtime (341) suites green.

Companion objectui PR adds the "Publish whole app" button to the package detail.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 3, 2026 2:49am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/m labels Jun 3, 2026
@xuyushun441-sys xuyushun441-sys merged commit e631f1e into main Jun 3, 2026
12 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/adr-0033-publish-package-drafts branch June 3, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants