Skip to content

fix(seed): complete Dataset->Seed rename + load published seed rows (locally verified)#1620

Merged
xuyushun441-sys merged 2 commits into
mainfrom
fix/seed-readback-item-shape
Jun 6, 2026
Merged

fix(seed): complete Dataset->Seed rename + load published seed rows (locally verified)#1620
xuyushun441-sys merged 2 commits into
mainfrom
fix/seed-readback-item-shape

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

本地已验证(106 spec + 163 runtime 测试全绿)后才提交

之前分两次做都失败:改名那条 commit 因 auto-merge 抢跑没落到 main(#1611 只合了"seed 类型 + SeedSchema 别名"),seed-apply 钩子又被我在慢部署循环里盲改。这次按新纪律(AGENTS.md)本地跑通再提。

1. 补完丢失的 Dataset->Seed 改名

  • 文件 data/dataset.zod.ts -> data/seed.zod.ts(+ 测试同改名)
  • DatasetSchema->SeedSchema(规范名)、Dataset->Seed、DatasetInput->SeedInput、DatasetMode->SeedMode、DatasetImportMode->SeedImportMode、DatasetLoadResult(Schema)->SeedLoadResult(Schema)、defineDataset->defineSeed
  • SeedLoaderRequest 字段 datasets->seeds(含全部构造/读取/测试)
  • 调用方:3 个 example、plugin-org-scoping、runtime seed-loader + app-plugin、spec stack/manifest/package-artifact/metadata-collection/solution-blueprint
  • 把 dataset 名让给 ADR-0021 分析层。不改(不同概念):env-artifact 的 datasets 桶、seed-datasets 服务键、manifest data、RAGFlow datasets。

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 是新功能,未影响线上。

os-zhuang and others added 2 commits June 6, 2026 22:49
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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 6, 2026 3:10pm

Request Review

@xuyushun441-sys xuyushun441-sys merged commit 594002d into main Jun 6, 2026
12 checks passed
@xuyushun441-sys xuyushun441-sys deleted the fix/seed-readback-item-shape branch June 6, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants