feat(ai): zero-package app building — auto app package#1550
Merged
Conversation
…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>
|
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.
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 ⇒ oneapp.<name>package — with zero user package steps.Changes
apply_blueprint(when the blueprint has anapp):ensureAppPackagecreates/reuses anapp.<name>package and threads itspackageIdthrough everystageDraft→sys_metadata.package_id. Result envelope gainspackage: { id, name, created }.package-service resolution inplugin.ts(resolved per call, not at init) so it's init-order-safe and picks up the opt-inmarketplacecapability when present.packageservice wired → drafting proceeds package-less exactly as before; the build never fails on packaging.marketplacecapability so the package service loads (exercises the path).Verification
blueprint-tools.test.ts): createsapp.<name>once + bindspackageIdto 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.package: { id:"app.project_management", name:"项目管理", created:true }— the feature activates (resolves the service, publishes, binds).Honest scope / known gaps
sys_metadata.package_id— a real grouping + the foundation for later version/export/promote — not the sealedsys_package_versionmodel. Full cross-environment promotion + Studio package-selector visibility depend on finishing the runtime package subsystem (ADR-0027), tracked separately.sqlite :memory:), the published package record didn't surface viaGET /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