docs(automation): hooks-vs-flows 决策指引 — flow 是应用默认面,hook 是系统兜底 - #4272
Merged
Conversation
… default surface, hook the backstop The framing settled while scoping #4271 existed only in an issue thread: flows are the default application surface (structural config that os validate checks; reviews as data; can pause), hooks are the system backstop (in-write mutation, cross-object invariants, read-side events — but a statically opaque body). Land it where authors look: a task→layer table plus the two structural reasons on hooks.mdx, a reverse link from flows.mdx Related. Docs only; empty changeset per repo convention. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147tNF4Snk7Ry1KGt4a5PY4
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…lary check:role-word flags any NEW prose use of the word; rephrasing beats a baseline entry for a sentence that never meant authorization. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147tNF4Snk7Ry1KGt4a5PY4
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.
动机
「flow 是应用逻辑的默认面、hook 是系统兜底」这个分层共识,此前只存在于 #4271 的定题讨论里——作者(尤其 AI 作者)在 hooks / flows 两页文档里读不到任何选层指引,两个面在 record 触发逻辑上完全重叠,选错层的代价(hook body 写集静态全盲 vs flow 结构化 config 有 lint)也没有写在作者会看的地方。
改动
content/docs/automation/hooks.mdx— 紧跟页首概念段新增 Hooks vs flows 一节:beforeFind/afterFind,flow 无读事件)→ hook;update_record.fields受os validate检查:readonly、模板方言、表达式槽),hook body 的写集静态不可见(链接到 hook-bodies 页已有的 accepted-gap 锚点);flow 以数据形态可 diff 可审,hook body 只能按代码审;script节点 +defineStack({ functions })让编排留在受检元数据里。content/docs/automation/flows.mdx— Related 列表加反向链接指到新节。.changeset/hook-vs-flow-path-guidance.md— 空 changeset(docs-only 惯例,不发版)。核实
schedule/timeRelative/暂停语义、script节点两种形态、hook 的读侧事件与 inline 执行(不可暂停);hook-body.zod.ts:134-140的 schema 注释一致,锚点#not-statically-checked-the-write-set已验证存在;os:check代码示例,零 schema 漂移面。关联:#4271(写集 lint 设计 issue)、#4001(母 issue)。
Generated by Claude Code