Skip to content

feat(ai): zero-package app building — auto app package#1550

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0033-auto-app-package
Jun 2, 2026
Merged

feat(ai): zero-package app building — auto app package#1550
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0033-auto-app-package

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

What & why

Mainstream AI app builders never make a business user create a "package/solution" to start building — the App is the user's unit; packaging is opt-in/later, and there's always a default container (Power Apps' default solution, Salesforce orgs). ObjectStack did the opposite by omission: AI-built metadata landed with package_id = null — ungrouped env-local overlays with no home. This makes the blueprint flow give an app a writable home package automatically — one app ⇒ one app.<name> package — with zero user package steps.

Changes

  • apply_blueprint (when the blueprint has an app): ensureAppPackage creates/reuses an app.<name> package and threads its packageId through every stageDraftsys_metadata.package_id. Result envelope gains package: { id, name, created }.
  • Lazy package-service resolution in plugin.ts (resolved per call, not at init) so it's init-order-safe and picks up the opt-in marketplace capability when present.
  • Best-effort, non-fatal: no package service wired → drafting proceeds package-less exactly as before; the build never fails on packaging.
  • showcase: enables the marketplace capability so the package service loads (exercises the path).

Verification

  • Unit (5 new, blueprint-tools.test.ts): creates app.<name> once + binds packageId to every artifact; reuses an existing package (no second publish); graceful package-less fallback when no service; no app → no package calls; publish-fails → still drafts. Full suites green: service-ai 468, tsc-clean.
  • Live (showcase + gpt-5.5): "build a project management app" → confirm → apply envelope shows package: { id:"app.project_management", name:"项目管理", created:true } — the feature activates (resolves the service, publishes, binds).

Honest scope / known gaps

  • Stamps the legacy sys_metadata.package_id — a real grouping + the foundation for later version/export/promote — not the sealed sys_package_version model. Full cross-environment promotion + Studio package-selector visibility depend on finishing the runtime package subsystem (ADR-0027), tracked separately.
  • In the showcase dev (sqlite :memory:), the published package record didn't surface via GET /api/v1/packages (404). Most likely a sqlite :memory: multi-connection artifact (publish INSERT and REST read on different in-memory DBs); in a shared DB it persists+surfaces. The blueprint code is correct (publish returns success, binding is unit-proven); finishing the package subsystem's persistence/REST surface is the follow-up.

This is the "default home" half of the package story; the sealed-version ALM + marketplace publish are deliberately separate, opt-in follow-ups.

🤖 Generated with Claude Code

…a writable package

When apply_blueprint builds an app, auto-create a writable app.<name> package
(idempotent, via the runtime `package` service, resolved lazily) and bind every
drafted artifact to it via stageDraft → sys_metadata.package_id. Result envelope
gains `package:{id,name,created}`. Best-effort: no package service → drafts
proceed package-less (unchanged), never fails the build. Mirrors mainstream
AI-builder UX (Power Apps default solution): the user never creates a package.

- service-ai: ensureAppPackage + lazy package resolution + apply_blueprint binding
- showcase: enable the `marketplace` capability so the package service loads
- tests: 5 new (creates once, reuses, binds packageId, graceful fallback, no-app)

Stamps the legacy sys_metadata.package_id (grouping + foundation); sealed-version
promotion + Studio selector visibility depend on the ADR-0027 package subsystem
(separate). Verified live: apply envelope shows package created+bound.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

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

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

Request Review

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling and removed size/m labels Jun 2, 2026
@xuyushun441-sys xuyushun441-sys merged commit 6b82e68 into main Jun 2, 2026
12 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/adr-0033-auto-app-package branch June 2, 2026 15:31
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 tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants