Repository navigation
fix(cloud-connection): install-local seeds a composed bundle's package datasets on install, reseed, upgrade and restart - #34403
Conversation
…stall-local seed door (red on main) Claude-Session: https://claude.ai/code/session_01FEkQ5pHNFS9mn8hS13iGyL Co-Authored-By: Claude <noreply@anthropic.com>
…y install-local seed door Claude-Session: https://claude.ai/code/session_01FEkQ5pHNFS9mn8hS13iGyL Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pHNFS9mn8hS13iGyL Co-Authored-By: Claude <noreply@anthropic.com>
…le seed pin Claude-Session: https://claude.ai/code/session_01FEkQ5pHNFS9mn8hS13iGyL Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 7 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 9987d45bd56cc1c121ac2ca6cad0daf075ea0344 && git checkout 9987d45bd56cc1c121ac2ca6cad0daf075ea0344
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 80cdbd4e0fe293696ab2ada350b5b348ff4ed172 543a53e54b37c0a6729a4234159511e3a6dea0dc && git checkout -B drift-repro 80cdbd4e0fe293696ab2ada350b5b348ff4ed172 && git merge --no-ff 543a53e54b37c0a6729a4234159511e3a6dea0dc
node scripts/docs-audit/affected-docs.mjs --json 80cdbd4e0fe293696ab2ada350b5b348ff4ed172
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pHNFS9mn8hS13iGyL Request: review · PR #34403 · area o1-B · Fixes #34336 · head
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi 席位核对 · ACCEPT (L1, first read) · Head-sha: f54ec13 · 2026-11-16T13:49ZL1 thread L1-a for area o1-B, on the final head declared in 6918245890. I read card #34336, the scope note 6917833544, dev report 6917684209, and the full diff against merge base
Should (not blocking)
Landing: not Tier H. After the merge-only delta (if it comes) is read, area o1-B lands it. |
…try when the resolver refuses its body Claude-Session: https://claude.ai/code/session_01FEkQ5pHNFS9mn8hS13iGyL Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pHNFS9mn8hS13iGyL Request: review · PR #34403 · area o1-B · Fixes #34336 · head
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi 席位核对 · ACCEPT (L1, delta) · Head-sha: 543a53e · 2026-11-16T15:36ZThis is L1 thread L1-a for area o1-B, reading the final head declared in 6920968387. It is a delta read against my ACCEPT 6918284604 at
Landing: not Tier H, and no L2 is owed. Area o1-B lands it once |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pHNFS9mn8hS13iGyL Verdict: ACCEPT at 2026-11-16T15:37Z, and the landing rides this stroke. ACCEPT → PR #34403 comment 6921006456.
State: ready plus auto-merge through the merge queue. On MERGED, |
Requested by Leehom · project thread
Fixes #34336
Clause-②: no
Metadata-protocol: none
维护者速读
packages[])每个子包里的 seed 数据都能读到。data,托管租户装上后 订单与回款、项目交付 等模块一条演示数据都没有。packages/cloud-connection/src/marketplace-install-local-plugin.ts的seedDatasetsOf与applySideEffects第 2 步;marketplace-install-local-composed-bundle-seeds.test.ts。pnpm --filter @objectstack/cloud-connection exec vitest run src/marketplace-install-local-composed-bundle-seeds.test.ts,预期 9/9 通过。What changes
Every seed door of
MarketplaceInstallLocalPluginread the top-leveldataonly. A composed bundle (dist/objectstack.jsonwithpackages[], ADR-0130 D4) has no top-leveldata, so all of them answered as if the package had no sample data.They now share one reader,
seedDatasetsOf(body), which isresolveStackCollection(body, 'data')from@objectstack/corefiltered to datasets that name an object and carry records. It reads the top-leveldatawhen the body has one. Otherwise it reads every package body'sdata, in the artifact's package order (dependency order, the order the packages register in).POST install-local(applySideEffectsstep 2 + 3)seeded: skipped / no-datasets, nothing sharedseed-datasetsPOST …/reseed-sample-data400 RESEED_SKIPPED no-datasetsapplySideEffectswithseedNow: false)maybeHealSampleData)POST …/purge-sample-data400 NOTHING_TO_PURGEGET …/sample-datacount: 0withSampleDatafalseThe unmanaged copy (
installMode: 'unmanaged') is unchanged: its import refuses a multi-package artifact by name, and its doors read the seed receipt, not the body.A malformed
packagesgets the resolver's ADR-0112 refusal, the same one themanifestservice raises on those bytes.applySideEffectsreports it inseeded(seed-datasets-unread: …) and does not throw, as its contract says. The listing answerswithSampleData: falsefor that entry and logs it atwarn. The heal logs it and skips.Tests
New file
packages/cloud-connection/src/marketplace-install-local-composed-bundle-seeds.test.ts, 9 cases. The composed fixture lists the order module before the core module it depends on, so package order is not array order:[core, o2c], andseed-datasetsgets the same list;[core, o2c];seed-datasetsis refilled and the heal seeds[core, o2c];dataunchanged; a composed artifact that still carries a flattened top-leveldatareads it once, not again per package; a composed artifact with no datasets still answersno-datasets.Red on the base plugin source, green on the fix (HEAD f54ec13)
Red leg:
marketplace-install-local-plugin.tsrestored from719b6b537(base), the new test run, then restored withgit checkout HEAD --and the blob hash checked against HEAD.Green leg:
Tests 9 passed (9).Package:
pnpm --filter @objectstack/cloud-connection typecheck(bothtsc --noEmitprograms) andvitest run:Test Files 84 passed (84),Tests 1236 passed (1236).Acceptance notes
sys_seed_landed_keyalready keeps a deleted row from coming back. Measured on this door, for a flat bundle as well as a composed one:sys_organizationrow is inserted;runInlineSeedbuildsSeedLoaderServicewith nolandedKeysoption, so this door neither reads nor writessys_seed_landed_key. On this door a row a tenant deleted comes back on reinstall or reseed (create-onlyignoredefault).So ask 2 would be new behaviour, not a fix. After this PR a composed upgrade does what a flat upgrade does: a package the upgrade adds gets its rows in the upgrading organization. The question is open on the card.
applySideEffectsstep 1 readstranslationsfrom the top level only. Measured on a scratch run: a composed bundle with a package-bodytranslationsanswerstranslationsLoaded: 0, and the same translations on a flat bundle answer1. The ADR-0120 D5e global-unique gate (evaluateGlobalUniqueGate) also readsmanifest.objectsfrom the top level only. That one is read from the code, not measured. Both are reported to the seat.appDefaultSeedLocale) still reads the composed artifact's top-leveli18n, the same asAppPlugin.resolveSeedLocaledoes for a boot bundle. That is unchanged.Verification
Local gates (HEAD f54ec13)
node scripts/pm/dispatch-gates.mjs --commands: 71 families derived. All 71 were run. Reconciliation with--ranand recorded exit codes:71 derived famil(ies) accounted for — 70 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).check:type-check-debt(0 raw tsc error(s) total),check:durability-log-level,check:startup-registry-verdict,check:test-source-alias,check:nul-bytes,check:route-envelope.pnpm check:dual-build-cjs-loads: exit 3, PREREQUISITE NOT MET (it needs a full workspace build). NOT MEASURED locally; CI runs it.git merge-treeagainst the one open PR that touchesmarketplace-install-local-plugin.ts(fix(cloud-connection)!: install-local parses manifest.namespace through its declaration #34316,claude/area-A5-33922) produced no conflict.Fix round 2 (head
543a53e54b)origin/main(9e67ea6cf4, no conflicts; none of the 17 incoming commits touchespackages/cloud-connection).POST …/purge-sample-data) and the sample-data count (GET …/sample-data) now read a ledger entry's seed datasets throughledgerSeedDatasets. A body the resolver refuses (a malformedpackages, ADR-0112INVALID_ARTIFACT_PACKAGES) now gets the unreadable-entry answer the reseed already gives (500MARKETPLACE_STORAGE_FAILED, naming the ledger file and quoting the refusal) instead of a throw into the route's error path. No row is matched or deleted.LocalManifestSource.fileNameOfnames the file by the existingsafeFilenamerule.marketplace-install-local-composed-bundle-seeds.test.ts, red onf54ec13b(2 failed, thrown refusal), green at head (11/11).check:dual-build-cjs-loadsnot measured (exit 3, needs a full build; CI runs it).543a53e54b: 35 success, 16 skipped, 0 failure. Dev report 6920915310 on marketplace install-local: a composed bundle's seed datasets (packages[i] data) are never loaded on install, reseed or upgrade, so a hosted tenant gets no demo data for a new module #34336.Generated by Claude Code