Repository navigation
fix(cli): os plugin publish decodes the compiled manifest once - #28075
Conversation
readCompiledPluginManifest now answers the document it decoded beside the parsed manifest, and os plugin publish uploads that document as plugin_manifest instead of decoding the archive entry a second time behind a non-null lookup by the CLI's own spelling of the filename. The upload is unchanged: the artifact's manifest, key for key, without the defaults the ManifestSchema parse stamps. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cxECYe6ksiqRSsT4Rm
📓 Docs Drift CheckThis PR changes 2 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 51 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin bba7ff03d24bbb7edb7d83cf658c599d55d32463 && git checkout bba7ff03d24bbb7edb7d83cf658c599d55d32463
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2e955dde6c058e629a439714695667184f5cb783 263039c193a9c9986fe2913e5f589af7ddecbba1 && git checkout -B drift-repro 2e955dde6c058e629a439714695667184f5cb783 && git merge --no-ff 263039c193a9c9986fe2913e5f589af7ddecbba1
node scripts/docs-audit/affected-docs.mjs --json 2e955dde6c058e629a439714695667184f5cb783
|
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Contract-review-claim: The lane seat writes the |
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Contract reviewServed-tier: Owed on the declaration face alone ( ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Seat ACCEPT · PR #28075 · head
|
Requested by Elon · project thread
domain:server#3 · os-elon-musk · session_016WV4cxECYe6ksiqRSsT4Rm
Fixes #27914
维护者速读
os plugin publish只解码一次插件包里的编译清单;readCompiledPluginManifest在解析结果旁一并交回解码出的原始文档,发布直接上传它。packages/runtime/src/compiled-plugin-manifest.ts的返回类型与publish.ts的一行替换。pnpm --filter @objectstack/cli exec vitest run test/plugin-publish-manifest-entry.test.ts(在 main 上红:TypeError)。What changes
readCompiledPluginManifest(@objectstack/runtime): theokarm ofCompiledPluginManifestReadgainsdocument, the manifest entry as decoded before theManifestSchemaparse. Nothing else in the result moves.os plugin publish(@objectstack/cli):plugin_manifestisread.document. The secondJSON.parseand the non-nullarchiveFiles.find(f => f.path === MANIFEST_FILENAME)!are gone.patchon both packages.Why
The publish door decoded the same entry twice and found it the second time by the CLI's own spelling of the filename, so it held only while
MANIFEST_FILENAME(CLI) andCOMPILED_PLUGIN_MANIFEST_FILE(runtime) spelled the same string (contract review 6514352615 on PR #27910). The verbatim upload stays verbatim: the parsed value stampsscopeanddefaultDatasource, which would no longer match the signed bytes.Verification
Pins first, measured against
main's source (runtime rebuilt from it):mainand here:plugin-publish.test.tsnow also checksJSON.stringify(plugin_manifest)equals the archive entry's decoded document, key for key and in order.main, green here:plugin-publish-manifest-entry.test.tsmocks the CLI'sMANIFEST_FILENAMEto a different spelling. Onmain:TypeError: Cannot read properties of undefined (reading 'data')at the second lookup. Here: publish posts both requests and uploads the entry's document. Reached without a product change.compiled-plugin-manifest.test.ts(new):documentcarries no stamped default and matches the entry key for key; red onmain(nodocument).@objectstack/clifull suite: 535 files passed, 1 skipped (6663 tests passed, 9 skipped). Runtime:compiled-plugin-manifest+installed-plugin-loadersuites, 61 passed.tsc --noEmitclean on both packages.dispatch-gates --commands: 61 families derived, 60 run with exit 0, 1 NOT MEASURED (check:dual-build-cjs-loads, exit 3, prerequisite).--ranreconcile: 0 UNRUN.pnpm lint: exit 0.Out of scope, noted only: the integrity preflight's
exemptlist inpublish.tsis still spelled with the CLI'sMANIFEST_FILENAME, so the same two-spelling dependency remains there (the drift pin uses a manifest with nointegritymap for that reason).Skills-docs: none.
grep -rn "readCompiledPluginManifest\|CompiledPluginManifestRead\|plugin_manifest"overskills/,content/docs/,docs/(.md/.mdx): 0 hits.docs/qa/platform-checklist/areas/cli.jsonnamesreadCompiledPluginManifestand says the uploadedplugin_manifeststays the artifact's own manifest, which still holds.Clause-②: yes (widening: the
okarm of@objectstack/runtime's exportedCompiledPluginManifestReadgainsdocument; every existing key keeps its value)Metadata-protocol: none
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: n/a, not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cxECYe6ksiqRSsT4Rm