feat(runtime,cli): surface seed / marketplace-heal outcomes in the boot summary (#3430)#3444
Merged
Merged
Conversation
…ot summary (#3430) `os dev` forwards a default `warn` log level and the serve boot-quiet window swallows stdout, so the seed pipeline's `logger.info` result lines are invisible: a marketplace package rehydrating onto a fresh DB with 0 rows, a fresh-DB self-heal, and row-level seed failures all had zero terminal signal. Extend the #3415 Seeds banner line to a per-source summary. The `seed-summary` kernel service is now a list; AppPlugin (config apps) and the marketplace rehydrate/heal path each record a labelled entry through a shared `recordSeedOutcome` writer, and the ready banner prints one combined line that ignores the log level, e.g.: Seeds: showcase 162 rows · hotcrm(marketplace) 157 ok / 5 errors ⚠ Fresh-DB heals are marked `(healed on fresh db)`; a marketplace package that installed with seed datasets but landed 0 rows, and any run that dropped records, escalate to a yellow ⚠ line instead of passing silently. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBziZWgaMBBFdqrrYHwqxc
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 3 package(s): 30 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
marked this pull request as ready for review
July 24, 2026 15:06
This was referenced Jul 24, 2026
os-zhuang
added a commit
that referenced
this pull request
Jul 25, 2026
…source, not just the first (#3453) (#3478) In multi-tenant mode a new org replays the kernel's `seed-datasets` list on the `sys_organization` insert, so that list must hold the union of every seed source (every config app + every marketplace package). Two framework traps — the same pair #3444 fixed for seed-summary — shrank it to just the first source: - the standard PluginContext has no `.kernel` handle, so `(ctx as any).kernel?.getService('seed-datasets')` always read undefined and each source clobbered the list with only its own datasets; and - `registerService` throws on a duplicate name, so the second source's re-register was swallowed and its datasets (and, for a config app, its replayer) were silently lost. `seed-datasets` is now a single shared array, registered once and mutated in place by every source via a new `mergeSeedDatasets` helper that reads through the context's own resolver first. AppPlugin's per-org replayer reads that live list at invoke time — not a captured snapshot — and is itself registered once and reused by later config apps, so a new org replays the full union. Seam-level unit tests only (accumulation across app + marketplace sources; the replayer reads the live union); true multi-tenant e2e needs the enterprise `@objectstack/organizations` plugin, which lives in the cloud repo. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
背景 / Why
Closes #3430.
os dev转发给 serve 的默认 log-level 是 warn,而种子链路最关键的结果行全是logger.info,再加上 serve 的 boot-quiet 窗口会吞掉 stdout。后果:默认 dev 环境下,「marketplace 包装了但 0 行」「换库自愈(heal)」「行级 seed 失败」这类状态在启动输出里完全不可见——只能靠直接查库确认。#3415 已经把 config app(AppPlugin)的 seed 结果提为 boot 摘要行;本 PR 把它扩展到 marketplace 的 rehydrate/heal 路径,并改成按来源的摘要。
What changed
seed-summarykernel 服务改为「按来源」的列表。 新增@objectstack/runtime的共享写入器recordSeedOutcome(ctx, outcome)——一个契约,两端都用,避免 producer 各写各的 shape。registerService对重复名会抛错,故写入器只在首次注册、之后原地 mutate 同一引用(getService返回的是同一数组)。AppPlugin(config apps) 现在通过
recordSeedOutcome记录一条带标签的条目(source = appId),取代原先跨 app 累加的单聚合对象。MarketplaceInstallLocalPlugin 的 rehydrate/heal 路径 现在也记录一条
marketplace: true的条目:heal 落库成功 →healed;声明了 seed 数据却 0 行落库 →emptyInstall(⚠ 升级)。经守卫式动态 import 解析,旧 runtime / mock 缺失该 helper 时安全跳过,不影响 heal 主流程。CLI ready banner 读取该列表并打印一行合并的
Seeds:,不受 log-level 影响:fresh-DB 自愈标注
(healed on fresh db);errored > 0或「装了包但 0 行」升级为黄色⚠行,不再静默。对应 issue 的四点要求:①两端各自汇总 inserted/updated/skipped/errored;②errored>0 或空装显眼标记;③heal 明确标注;④在 kernel:ready 后于 ready banner 处输出一次,不依赖
--log-level info。Tests
packages/runtime/src/seed-summary.test.ts(新增)——锁定 mutate-in-place + 合并语义,尤其是「第二个来源不触发 duplicate-register 抛错」这条关键路径。packages/cli/src/utils/format.seed-summary.test.ts——改为按来源断言:clean / rejected / marketplace-healed / empty-install / 多来源合并 / 静默。packages/cloud-connection/src/marketplace-install-local-heal.test.ts——断言 heal 成功记录healed:true、无行落库记录emptyInstall:true。全部通过:runtime 592、cli 632、cloud-connection 63(三个 package 的完整 suite);受影响 package 依赖闭包
build绿(含tsc)。已加 changeset。References
🤖 Generated with Claude Code
Generated by Claude Code