feat: Marketplace Package Lifecycle — 6 protocol specifications#773
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…tion, upgrade migration protocols Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ction Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…for marketplace protocols Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add package artifact format specification for marketplace
feat: Marketplace Package Lifecycle — 6 protocol specifications
Feb 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements the complete package distribution protocol for ObjectStack's marketplace, filling 6 critical protocol gaps that were blocking the end-to-end package lifecycle (git dev → build → marketplace → install/upgrade/uninstall). The implementation is comprehensive, well-tested, and properly documented.
Changes:
- P0 Distribution Pipeline: Added package artifact format specification (
package-artifact.zod.ts) defining.tgzinternal structure with checksums and digital signatures; added platform version compatibility viaManifestSchema.enginefield for semver requirements; integrated artifact storage and distribution intomarketplace.zod.tswithArtifactReferenceSchemaandArtifactDownloadResponseSchema - P1 Upgrade Scenarios: Added upgrade migration context (
UpgradeContextSchema) for version-awareonUpgradehooks; implemented dependency resolution protocol (dependency-resolution.zod.ts) with conflict detection and topological ordering; added namespace collision detection withNamespaceRegistryEntrySchemaandNamespaceConflictErrorSchema - Comprehensive Testing: Added 60 new tests across 4 test files providing thorough coverage of all new schemas and edge cases; all new fields are
.optional()for backward compatibility
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/spec/src/kernel/package-artifact.zod.ts |
New file defining package artifact format with checksums, signatures, and metadata categories |
packages/spec/src/kernel/package-artifact.test.ts |
New file with 17 test cases covering artifact validation scenarios |
packages/spec/src/kernel/dependency-resolution.zod.ts |
New file defining dependency resolution protocol with conflict detection and install ordering |
packages/spec/src/kernel/dependency-resolution.test.ts |
New file with 15 test cases covering resolution scenarios |
packages/spec/src/kernel/plugin.zod.ts |
Added UpgradeContextSchema for version migration context |
packages/spec/src/kernel/plugin.test.ts |
Added 3 test cases for upgrade context validation |
packages/spec/src/kernel/package-registry.zod.ts |
Added upgrade history, namespace registry, conflict detection, and dependency resolution integration |
packages/spec/src/kernel/package-registry.test.ts |
Added 7 test cases for new registry features |
packages/spec/src/kernel/manifest.zod.ts |
Added engine field for platform compatibility requirements |
packages/spec/src/kernel/manifest.test.ts |
Added 4 test cases for engine field validation |
packages/spec/src/cloud/marketplace.zod.ts |
Added artifact reference and download response schemas |
packages/spec/src/cloud/marketplace.test.ts |
Added 3 test cases for artifact distribution |
packages/spec/src/kernel/index.ts |
Registered exports for new protocol files |
content/docs/references/kernel/package-artifact.mdx |
New documentation file for package artifact protocol |
content/docs/references/kernel/dependency-resolution.mdx |
New documentation file for dependency resolution protocol |
content/docs/references/kernel/package-registry.mdx |
Updated with namespace registry and upgrade history documentation |
content/docs/references/kernel/manifest.mdx |
Updated with engine field documentation |
content/docs/references/cloud/marketplace.mdx |
Updated with artifact reference documentation |
content/docs/references/kernel/meta.json |
Added new protocol files to navigation |
docs/ENTERPRISE_ASSESSMENT.md |
Updated with comprehensive protocol implementation details |
ROADMAP.md |
Marked 5 protocol tasks as completed |
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.
The package distribution pipeline (
git dev → build → marketplace → install/upgrade/uninstall) had 6 protocol gaps blocking end-to-end operation. This PR adds the missing schemas across P0 (blocking distribution) and P1 (blocking upgrades).P0 — Distribution Pipeline
package-artifact.zod.ts) — Defines.tgzinternal structure:PackageArtifactSchema,ArtifactChecksumSchema(file→SHA256 map),ArtifactSignatureSchema(RSA/ECDSA),MetadataCategoryEnum,ArtifactFileEntrySchemaManifestSchema.enginefield for semver range requirements (e.g.>=3.0.0),InstallPackageRequestSchema.platformVersionfor install-time verificationmarketplace.zod.ts) —ArtifactReferenceSchema(URL + SHA256 + size),ArtifactDownloadResponseSchema(pre-signed URLs), artifact refs linked into listing versions and install requestsP1 — Upgrade Scenarios
plugin.zod.ts) —UpgradeContextSchemawithpreviousVersion/newVersion/isMajorUpgrade/previousMetadata;InstalledPackageSchema.upgradeHistorytracking migration outcomesdependency-resolution.zod.ts) —ResolvedDependencySchema(satisfied/needs_install/needs_upgrade/conflict),DependencyResolutionResultSchemawith topological install ordering and circular dependency detection; linked toInstallPackageResponseSchemapackage-registry.zod.ts) —NamespaceRegistryEntrySchema,NamespaceConflictErrorSchema,InstalledPackageSchema.registeredNamespacesAll new fields are
.optional()for backward compatibility. 60 new tests (6056 total). Docs,ROADMAP.md, andENTERPRISE_ASSESSMENT.mdupdated.Original prompt
This section details on the original issue you should resolve
<issue_title>Marketplace Package Lifecycle: 必须开发的协议清单</issue_title>
<issue_description>
背景
基于 Git-based 开发模式,ObjectStack 的包分发链路为:
经过与 Salesforce Packages 和 Power Apps Solutions 的深度对比分析,当前协议层(
manifest.zod.ts、package-registry.zod.ts、marketplace.zod.ts)已经覆盖了包定义、命名空间、依赖声明、生命周期钩子、市场发布流程等核心能力。但仍有 6 项关键缺失 阻塞整条链路的完整运行。以下按优先级分为 P0(阻塞链路)和 P1(阻塞升级场景)两组。
P0 — 阻塞整条链路(必须先完成)
任务 1: 包构建产物规范 (Package Artifact Format Spec)
问题:
marketplace-publishing.md提到os plugin build产生.tgz,但没有定义产物内部结构的 Schema。市场无法校验、存储、分发一个没有标准格式的产物。具体任务:
packages/spec/src/kernel/下创建package-artifact.zod.tsPackageArtifactSchema,规范.tgz内部结构:ArtifactChecksumSchema:文件路径 → SHA256 映射ArtifactSignatureSchema:签名算法、公钥引用、签名值package-artifact.test.tsstack.zod.ts的导出中注册影响文件: 新建
packages/spec/src/kernel/package-artifact.zod.ts任务 2: 平台版本兼容性声明 (Platform Version Compatibility)
问题: 当前
ManifestSchema缺少平台最低版本要求字段。用户安装包时,系统无法判断"这个包能不能在当前版本的平台上运行"。具体任务:
ManifestSchema(manifest.zod.ts)中增加字段:package-registry.zod.ts的InstallPackageRequestSchema中增加兼容性校验逻辑的字段说明manifest.test.ts增加新字段的测试用例content/docs/references/kernel/manifest.mdx影响文件: 修改
packages/spec/src/kernel/manifest.zod.ts任务 3: 产物存储与分发协议 (Artifact Storage & Distribution)
问题: 用户点击"安装"时,系统需要知道去哪里下载包产物。当前
MarketplaceListingSchema没有定义产物的下载地址和完整性校验。具体任务:
marketplace.zod.ts中增加ArtifactReferenceSchema:MarketplaceListingSchema的 version 记录中关联ArtifactReferenceSchemaInstallPackageRequestSchema中增加artifactUrl或artifactRef字段ArtifactDownloadResponseSchema(用于 REST API)影响文件: 修改
packages/spec/src/cloud/marketplace.zod.tsP1 — 阻塞升级场景(安装跑通后必须完成)
任务 4: 升级版本迁移上下文 (Upgrade Migration Context)
问题:
PluginLifecycleSchema中onUpgrade钩子存在,但缺少版本上下文参数。开发者无法在升级钩子中编写"从 v1 到 v2 需要做什么迁移"的逻辑。具体任务:
plugin.zod.ts中定义UpgradeContextSchema:PluginLifecycleSchema中onUpgrade的签名描述,明确接收UpgradeContextpackage-registry.zod.ts的升级流程中增加版本迁移记录:影响文件: 修改
packages/spec/src/kernel/plugin.zod.ts,package-registry.zod.ts任务 5: 运行时依赖解析协议 (Dependency Resolution Protocol)
问题:
ManifestSchema声明了dependencies,但缺少运行时依赖解析的结果 Schema。当安装 A 需要 B@^2.0,但已安装的 B 是 1.x 时,系统需要标准化的方式表达冲突和解决方案。具体任务:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.