Skip to content

docs(skills): seed replace deletes nothing; minimal preset still mounts job and queue - #31461

Merged
os-zhuang merged 2 commits into
mainfrom
claude/project-thread-9vaorb
Nov 8, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/project-thread-9vaorb

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #31379

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:平台技能 Seed Data 一行不再把种子模式 replace 标成「数据丢失」,改为「从不删除、会重复」;PLATFORM_ALWAYS_ON_CAPABILITIES 的注释补全 --preset minimal 下仍会挂载 job/queue/email 的情形。
  • 为什么改:实测加载器的 replace 只做插入,一行都不删;旧文案吓退本该可用的场景,却漏说真正的风险(重复行)。注释原说 minimal「完全退出」,与 resolveServedCapabilities 实际行为不符。
  • 风险与回滚:仅教学文字与代码注释,无行为变化;回滚即 revert 本 PR。
  • 先看:skills/objectstack-platform/SKILL.md(Seed Data 段两行)、packages/spec/src/kernel/platform-capabilities.ts(L347-351 注释)。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs,预期平台 SKILL.md 仍为 5994 tokens(上限 6011),退出码 0。
  • 需要你做的:审阅并批准(技能面属 Tier H,需维护者落地)。

What changes

  • skills/objectstack-platform/SKILL.md § Seed Data: replace ⚠️ data loss becomes replace ⚠️ never deletes, duplicates. Every SeedMode member stays named (the seed-modes liveness binding). The growth is paid in the same paragraph ("rows that already exist —" becomes "existing rows:"), on the same two lines.
  • packages/spec/src/kernel/platform-capabilities.ts TSDoc on PLATFORM_ALWAYS_ON_CAPABILITIES: --preset minimal opts out of the slate, but resolveServedCapabilities (packages/core/src/capability-composition.ts) still mounts job and queue first when email, approvals or auth is present (NEEDS_JOB_AND_QUEUE), and mounts email whenever auth is. Comment only.
  • .changeset/31379-seed-replace-minimal-preset-text.md: '@objectstack/skills': patch. No @objectstack/spec entry: the Check Changeset job requires a changeset, not one per moved package, and the spec edit is a comment.

The SeedMode comment in packages/spec/src/data/seed.zod.ts and skills/objectstack-data/references/seeds.md were already right and are unchanged.

Tests

The loader measurement that decided which text was wrong, on 0c4f621e's parent 4941c40b:

Seed loader replace over existing rows (throwaway probe, not committed)

The real SeedLoaderService over an in-memory engine double holding two rows, gold (matched by the dataset's externalId: 'name') and legacy (not in the dataset). Dataset: mode: 'replace', records gold and silver.

multiPass=false before=2 after=4 deleteCalls=0 updateCalls=0 totalInserted=2
  rows: pre-1:gold:1, pre-2:legacy:9, gen-1:gold:2, gen-2:silver:3
multiPass=true  before=4 after=6 deleteCalls=0 updateCalls=0 totalInserted=2
  rows: + gen-3:gold:2, gen-4:silver:3

replace deleted nothing (the row outside the dataset survives), left the matched row as it was, and inserted every record again on each load. Code: writeRecord's case 'replace' only calls engine.insert, and decideWriteAction groups replace with insert.

  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/kernel/platform-capabilities.test.ts: 35/35 passed.
  • pnpm --filter @objectstack/spec typecheck under the verify lock: VERDICT command-exit 0.

Acceptance notes

  • skills/** readings, origin/main 4941c40b vs head: skills/objectstack-platform/SKILL.md 411 → 411 lines, 23994 → 23993 bytes, 5994 → 5994 tokens (ceiling 6011); all SKILL.md files 4553 → 4553 lines; bundle total 237077 → 237077 tokens.
  • The order's file surface names skills/objectstack-platform/references/seeds.md, which does not exist; the seeds reference is skills/objectstack-data/references/seeds.md, already correct and untouched.

Verification

Derived gates: 93 derived, 92 exit 0, 1 NOT MEASURED

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 0c4f621e: 93 commands; 92 exit 0. pnpm check:dual-build-cjs-loads exit 3 (PREREQUISITE NOT MET: needs every package's dist; left to CI). --ran reconciliation: 93 accounted, 92 run, 1 NOT-MEASURED, 0 UNRUN.

After merging origin/main (head ded443ab, no incoming change to a touched file), re-run: check-skills-token-ratchet, check:skill-identifier-liveness, check:skill-links, check-changeset-no-major, check-empty-changeset, spec check:docs, check:nul-bytes, all exit 0.


Generated by Claude Code

…ts job/queue

The platform skill's Seed Data line marked seed mode `replace` as data
loss. The loader's replace path only inserts (writeRecord and
decideWriteAction), so it deletes nothing and duplicates rows a caller
did not clear. The PLATFORM_ALWAYS_ON_CAPABILITIES comment now names
what resolveServedCapabilities still mounts under --preset minimal.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jT9oVmjxA38pKor1tX
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️ 1 changed file(s) yielded no anchor (packages/spec/src/kernel/platform-capabilities.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/src/kernel/platform-capabilities.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 171 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 1ff99441d8c5155f14b602181337d43e41ec9b6a → packageMentionDocs.

Copy link
Copy Markdown
Collaborator

Contract-review-claim: session_01QsR2jV5sBSzCYNEDgpYLJw · head ded443a · 2026-11-08T09:17:48Z


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

director#1 · zhuangjianguo · session_01QsR2jV5sBSzCYNEDgpYLJw

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ded443ab2d66f32760d07d779534b6a36ca0c25c
Local-runs: none. Read-only: git show / git grep on origin/main and on this head.
Scope: .changeset/31379-seed-replace-minimal-preset-text.md, packages/spec/src/kernel/platform-capabilities.ts (L345–351 TSDoc), skills/objectstack-platform/SKILL.md (L366–368); read on origin/main: packages/metadata-protocol/src/seed-loader.ts (writeRecord L3255–3320, decideWriteAction L3331–3365), packages/core/src/capability-composition.ts (NEEDS_JOB_AND_QUEUE L86, resolveServedCapabilities L115–140), packages/spec/src/data/seed.zod.ts (SeedMode L24–28, .describe L208–218), skills/objectstack-data/references/seeds.md (### Import modes L56, rows L64 and L163), platform-capabilities.ts L380–392, platform SKILL.md L296 / L333 / L338; the branch's two commits; card #31379, claim 6719361651, report 6719703020, the docs-drift bot comment 6719702150.

① Contract against the card

② Which seed text was wrong

  • The loader on main: writeRecord case 'replace' calls engine.insert only (comment: "just insert (caller should have cleared the table)"); decideWriteAction returns { action: 'insert' } for 'insert', 'replace' and default. No engine.delete anywhere in the write path. The dev's probe (2→4 rows, 4→6 under multiPass, 0 delete, 0 update) is what that code does.
  • So the platform SKILL.md's "⚠️ data loss" was the wrong text, and SeedMode L27 ("deleting nothing: for a cache table the caller cleared"), .describe L214 ("replace does the same and deletes nothing") and seeds.md L64 / L163 ("It never deletes: duplicates otherwise") were right. The new wording "⚠️ never deletes, duplicates" states the same two facts in the same order as seeds.md L163, and the #import-modes anchor resolves to ### Import modes (L56), whose replace row carries the full sentence. Beside that link the skill line teaches the replay effect: the warning now names the real risk (duplicate rows on a table nobody cleared) rather than one the loader cannot cause. Clear enough; no change needed.
  • All five SeedMode members stay on the line (ignore upsert insert update replace), so the seed-modes binding holds (liveness exit 0 after the main merge, per the report). Line count 411→411, bytes 23994→23993, tokens 5994→5994 against 6011: the growth is paid in the same paragraph ("rows that already exist —" → "existing rows:"). ✓

③ The TSDoc against the composition code

  • resolveServedCapabilities: email is pushed when auth is declared BEFORE the preset is read (L126), the slate is skipped only when preset === 'minimal' (L130), and job then queue are unshifted when any of NEEDS_JOB_AND_QUEUE (email, approvals, auth) is present, preset or not (L135–138). The new comment — "opts out of the slate, though not of all of it: … still mounts job and queue first when email, approvals or auth is present, and mounts email whenever auth is" — reads that code right, including "first" (front of the mount order). It matches what the platform SKILL.md already teaches at L296 and L333 since docs(skills): name ignore as the seed mode default and the minimal-preset job/queue exception; correct three capability comments #31377, and the module's own JSDoc at L100–110. hostDefaults also survive minimal, but they are the host's additions, not the slate's, so the sentence about the slate is complete as written. ✓
  • L386–387 of the same file ("unless the preset is minimal") stays true for the package token it describes, which is not in NEEDS_JOB_AND_QUEUE. ✓

④ Tier, deviations, CI

  • Tier H: skills/objectstack-platform/SKILL.md is under skills/**. This record is the at-tier review, not the approval; landing is the maintainer's hand or an authorized approval. packages/spec TSDoc is ungoverned.
  • Deviations as reported: built at the default tier under the maintainer's no-Fable rule; the first commit 0c4f621 was made with core.hooksPath overridden and both hook bodies were then run by hand green, the merge commit and push ran the hooks; check:dual-build-cjs-loads exit 3 is the usual prerequisite miss, left to CI. Recorded, none a finding. The commit carries the model-free trailers.
  • Docs drift bot: no anchor for platform-capabilities.ts; a comment-only edit documents nothing new. No page owes a change.
  • Serial: none claimed on the surface; mergeable: true, merge-base = current main. CI at this head when read: 12 success, 8 skipped, 21 in progress, 0 failures; the seat's post-merge re-runs (token ratchet, liveness, links, changeset gates, spec check:docs) exit 0.

⑤ Findings

  • Must-fix: none.
  • Should-fix: none.

Implemented-by: claude/project-thread-9vaorb
Reviewed-by: session_01QsR2jV5sBSzCYNEDgpYLJw

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · zhuangjianguo · session_01QsR2jT34CXs5fCn3BDirZw

维护者速读

  • 改了什么:平台技能「Seed Data」一节原来把种子模式 replace 标成「⚠️ 数据丢失」,改为「⚠️ 不删任何行,会重复插入」;platform-capabilities.ts 的注释补全:--preset minimal 并非全部关掉,有 email / approvals / auth 时仍会挂上 job 和 queue,有 auth 时仍会挂上 email。
  • 为什么改:两段文字说法相反,必须先实测。开发实跑了真实的种子加载器:replace 只插入,删除 0 次、更新 0 次,表从 2 行变 4 行。所以「数据丢失」是错的,seed.zod.ts 和数据技能的 seeds.md 本来就对,没动(platform: two lines still misstate the minimal preset and seed replace mode (platform-capabilities.ts L348 TSDoc; platform SKILL.md Seed Data "replace ⚠️ data loss") #31379)。
  • 风险与回滚:只改一段技能文字和一段代码注释,零运行时变化,行数和 token 数都不变。回滚就是 revert 本 PR。
  • 先看:skills/objectstack-platform/SKILL.md 第 366 行附近那一句;platform-capabilities.ts 第 348 行附近的注释。
  • 两分钟验证:node scripts/check-skill-identifier-liveness.mjs 应退出 0(seed-modes 绑定仍点名全部五种模式);pnpm check:pm-skill-ratchet 应退出 0。
  • 需要你做的:审阅后批准本 PR(Approve review),批准后由席位落地。
  • 席位意见:ACCEPT。契约复核 PASS(记录 6719726174,Head ded443ab,无 must-fix / should-fix),复核方另读了加载器代码,确认 replace 只插入。

席位核对

Head-sha: ded443ab2d66f32760d07d779534b6a36ca0c25c

  1. Shape: draft, base main, body carries Fixes #31379, '@objectstack/skills': patch changeset. 3 files, +16/−3. Governed: skills/** (Tier H).
  2. Premise measured: the dev ran the real SeedLoaderService at 4941c40b. With replace over a table holding a matched row and a row outside the dataset, rows went 2→4 (multiPass false) and 4→6 (true), with 0 delete and 0 update calls. That matches seed.zod.ts L27/L214 ("inserts every record with no match… deletes nothing"). The seat read the diff: the SKILL.md line is the one wrong text, every SeedMode member stays named, and 411/411 lines and 5994/5994 tokens hold.
  3. Gates: contract review at CONTRACT_REVIEW_TIER: PASS, record 6719726174 on this head. Dev gates: 93 derived, 92 exit 0, check:dual-build-cjs-loads exit 3 (CI-only, green in CI), --ran 0 UNRUN. Check-runs on this head: 55 success, 9 skipped, 0 failure, 0 running.
  4. Accepted deviations:
    • Built at TIER_DEFAULT under the standing no-Fable rule.
    • The first commit was made with core.hooksPath overridden; both hook bodies were then run by hand, green. The seat has told the dev not to repeat this.
    • The seat's order named a seeds.md path that does not exist (the file is skills/objectstack-data/references/seeds.md, correct and untouched).
  5. Out of scope / Skills-docs: none filed. Metadata-protocol: none, so no Skills-docs: line is owed.
  6. Landing: Tier H. pm:awaiting-merge + reviewers os-zhuang, hotlong; the PR stays draft until an authorized approval or a maintainer enqueue.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 8, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 8, 2026 14:36
@os-zhuang
os-zhuang enabled auto-merge November 8, 2026 14:36
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit d53131b Nov 8, 2026
70 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-9vaorb branch November 8, 2026 15:18
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

3 participants