fix(seed): complete Dataset->Seed rename + load published seed rows (locally verified)#1620
Merged
Merged
Conversation
The diagnostic added in the prior fix revealed the exact shape: a direct
protocol.getMetaItem() call returns a WRAPPER `{ type, name, item, lock,
editable, deletable, resettable }` — the seed body (object/records) is under
`.item`, not top-level and not `.metadata`/`.body` (the HTTP endpoint unwraps
it, which is why a manual GET showed the body directly and misled the first
guess). Add `.item` to the extraction chain so the published seed body is
actually read → its rows load on publish.
This completes the magic-moment loop: AI builds → publishes → sample seed rows
load into the object.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Locally verified together (106 spec + 163 runtime tests green) BEFORE deploying.
Prior split attempts failed because the rename never landed on main (auto-merge
raced ahead of the rename commit) and the seed-apply hook was patched blind
through the slow deploy loop.
1. Finish the lost Dataset->Seed rename:
- data/dataset.zod.ts -> data/seed.zod.ts (+ dataset.test.ts -> seed.test.ts)
- DatasetSchema->SeedSchema (canonical), Dataset->Seed, DatasetInput->SeedInput,
DatasetMode->SeedMode, DatasetImportMode->SeedImportMode,
DatasetLoadResult(Schema)->SeedLoadResult(Schema), defineDataset->defineSeed
- SeedLoaderRequest field datasets->seeds (+ all constructors/readers/tests)
- callers: 3 examples, plugin-org-scoping, runtime seed-loader + app-plugin,
spec stack/manifest/package-artifact/metadata-collection/solution-blueprint
Frees the dataset name for the ADR-0021 analytics layer. NOT renamed (other
concepts): env-artifact datasets bucket, seed-datasets service key, manifest
data, RAGFlow datasets.
2. Fix publish-drafts seed-apply so published seed rows actually load:
protocol.getMetaItem (direct) returns a WRAPPER {type,name,item,...} - the
seed body is under .item (the HTTP endpoint unwraps it, which misled earlier
guesses). Read .item; try active-org then env-wide; never report success while
loading 0 rows. New integration test (http-dispatcher.test.ts) exercises the
real SeedLoaderService end-to-end and pins this.
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.
本地已验证(106 spec + 163 runtime 测试全绿)后才提交
之前分两次做都失败:改名那条 commit 因 auto-merge 抢跑没落到 main(#1611 只合了"seed 类型 + SeedSchema 别名"),seed-apply 钩子又被我在慢部署循环里盲改。这次按新纪律(AGENTS.md)本地跑通再提。
1. 补完丢失的 Dataset->Seed 改名
2. 修 publish-drafts seed-apply,让已发布 seed 真正落数据
诊断(staging seedApplied 报错)显示:protocol.getMetaItem 直连返回的是 wrapper
{type,name,item,...},seed body 在 .item 下(HTTP 端点会解包,误导了之前的猜测)。修复:读 .item;先 active-org 再 env-wide 回退;读不到时返回 success:false 而非"成功 0 行"。新增集成测试 http-dispatcher.test.ts 跑真实 SeedLoaderService 端到端锁定。
说明
main 当前 seed-apply 是坏的(#1618 传 seeds 但 schema 字段是 datasets)——本 PR 把字段统一为 seeds 后即一致。seed 是新功能,未影响线上。