Skip to content

feat(lint): warn on seed values outside the declared state machine (#3433 follow-up) - #3471

Merged
os-zhuang merged 1 commit into
mainfrom
claude/seed-fsm-followups-3433
Jul 24, 2026
Merged

feat(lint): warn on seed values outside the declared state machine (#3433 follow-up)#3471
os-zhuang merged 1 commit into
mainfrom
claude/seed-fsm-followups-3433

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

#3433 的三项 follow-up(用户明确要求 1+2+3+4)。

背景

#3433 让种子写入豁免 state_machine 校验。这带来一个"无声后门":FSM 层的"这是不是我认识的态?"检查对种子不再运行。本 PR 把这层以 author-time 形式补回来,并把 marketplace 链路与文档收尾。

改动

① lint 门(task 2)validateSeedStateMachine:纯 (stack) => Finding[] 规则,os validate/os lint 跑。种子记录的 state_machine 字段值若 ∉ 机器声明态集(initialStates ∪ transition 键 ∪ transition 值)→ warning。字段级 select仍在运行时拒非法 option,但自由文本状态字段、或"合法 option 但非 FSM 声明态"会静默漏过——这个门抓它。Advisory(与 #3434 的 replay-safety 门对称)。规则 idseed-value-outside-state-machine`。8 个单测(含 typo 验红);os lint showcase 实测 0 误报。

② marketplace 实测(task 1) — cloud-connection 集成测试:驱动真实 install handler → runInlineSeed → 真 SeedLoaderService,引擎 stub 复现 #3165 的 initialStates 强制。一个种子铺满 pipeline(prospecting→negotiation→closed_won→closed_lost)的模板包 install 后全量入库。已验红(关闭 stub 豁免立即红 3/4 丢行),坐实 #3433 在 marketplace seam 真绿。

③ 文档同步(task 4) — state-machine / validation / seed-data 三处 narrative 补种子豁免说明(种子是既成事实非生命周期事件;其他校验照跑;os lint 抓 typo)。references/ 生成物不动。

#3434(task 3) — mode:'insert' 种子重放翻倍,已被 #3442(组合 externalId)+ #3460(replay-safety 门)修复合并,本 PR 无需改代码。

验证

🤖 Generated with Claude Code

…3433 follow-up)
Follow-ups to the #3433 seed / state-machine exemption:
- lint: `validateSeedStateMachine` — an author-time `os validate` / `os lint`
warning when a seed record's `state_machine`-governed field carries a value the
machine does not declare (initialStates ∪ transition keys ∪ targets). #3433
exempts seeds from the FSM at write time, so this re-adds the "is this even a
known state?" safety net a typo would otherwise slip past. Advisory, symmetric
with the #3434 replay-safety rule. Rule id `seed-value-outside-state-machine`.
- test(cloud-connection): a marketplace-install integration test that drives the
real install handler → runInlineSeed → SeedLoaderService against an engine stub
reproducing the #3165 initialStates guard, proving a template whose seed spans
the whole pipeline (prospecting → closed_won) lands every row on install. Red
without the #3433 exemption (verified).
- docs: note the seed exemption in the state-machine, validation, and seed-data
guides — seeds are established facts, not lifecycle events; every other
validation still runs; `os lint` catches an unknown-state typo before boot.
The remaining #3433 follow-up — #3434 (mode:'insert' seeds duplicate on replay) —
was already closed by #3442 (composite externalId) + #3460 (replay-safety lint),
so it needs no change here.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercelBot commented Jul 24, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
specBuildingBuildingPreview, CommentJul 24, 2026 4:29pm

Request Review

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation tests tooling size/l labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cli, @objectstack/cloud-connection, @objectstack/lint.

19 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/skills-reference.mdx(via packages/cli)
  • content/docs/api/client-sdk.mdx(via @objectstack/cli)
  • content/docs/api/data-flow.mdx(via @objectstack/cli)
  • content/docs/api/environment-routing.mdx(via @objectstack/cli)
  • content/docs/api/error-catalog.mdx(via @objectstack/cli)
  • content/docs/automation/hook-bodies.mdx(via packages/cli)
  • content/docs/deployment/backup-restore.mdx(via @objectstack/cli)
  • content/docs/deployment/cli.mdx(via @objectstack/cli)
  • content/docs/deployment/self-hosting.mdx(via @objectstack/cli)
  • content/docs/getting-started/your-first-project.mdx(via @objectstack/cli)
  • content/docs/kernel/runtime-services/data-service.mdx(via packages/cli)
  • content/docs/kernel/runtime-services/index.mdx(via packages/cli)
  • content/docs/permissions/authentication.mdx(via @objectstack/cli)
  • content/docs/permissions/authorization.mdx(via @objectstack/lint)
  • content/docs/plugins/packages.mdx(via @objectstack/cli)
  • content/docs/protocol/kernel/plugin-spec.mdx(via @objectstack/cli)
  • content/docs/protocol/kernel/realtime-protocol.mdx(via @objectstack/cli)
  • content/docs/releases/implementation-status.mdx(via @objectstack/cli)
  • content/docs/releases/v16.mdx(via @objectstack/cli)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit 95829a0 into mainJul 24, 2026
15 of 16 checks passed
@os-zhuang
os-zhuang deleted the claude/seed-fsm-followups-3433 branch July 24, 2026 16:35
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/lteststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@os-zhuang