Skip to content

docs(adr): ADR-0077 — authoring-surface boundary (hook / flow / validation)#2422

Merged
os-zhuang merged 1 commit into
mainfrom
adr/0077-authoring-surface-boundary
Jun 28, 2026
Merged

docs(adr): ADR-0077 — authoring-surface boundary (hook / flow / validation)#2422
os-zhuang merged 1 commit into
mainfrom
adr/0077-authoring-surface-boundary

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

Adds ADR-0077 — names the long-term boundary between hook, flow, and validation rule for an AI-authored platform.

Triggered by the review question "now that flow is this capable, is hook metadata still necessary, and when should each be used?" Answer: yes, hook stays — it uniquely owns the in-transaction write path (rewrite + veto) and the read path (beforeFind/afterFind), neither of which flow can express by construction.

Decisions

  1. Route by intent, not mechanism — reject→validation rule; rewrite/transactional→hook; read interception→hook; after-the-fact multi-step/approval/schedule/webhook→flow; complex hot-path→hook escape hatch.
  2. Tier by audience — validation/flow are business-legible; hook is deliberately not. (after-* side effects go to flow if ops may ever want to change them, else hook.)
  3. Verifiability tier = friction tier — declarative surfaces are os build-provable (lower friction); a hook body is the only non-provable surface → always human-reviewed (ties to ADR-0038 / ADR-0033 draft-gating).
  4. Loud-not-silent — v1 ships two os build lints so the named failure mode becomes a build error instead of a silent runtime no-op.

Code-grounded fact

record-before-* flows cannot rewrite or veto the triggering write: the record_change trigger discards the flow output and swallows its errors by design ("a flow failure must NEVER break the CRUD write that triggered it"); flow CRUD nodes don't thread the transaction, and ADR-0034's ALS ambient-tx doesn't survive setImmediate. The "visual write-time gate" belongs to validation rule (veto) / hook (rewrite), never a before-flow.

Non-goals (explicit)

Do not extend record-change flow to mutate / veto / join-the-transaction — that re-creates Salesforce's order-of-execution swamp and hands the AI more overlapping ways to express one intent.

Scope

Docs-only (one new ADR). The two os build lints and the skill decision-tree updates are recorded as follow-ups, not in this PR.

🤖 Generated with Claude Code

…ation), route by intent, loud-not-silent

Names the hook vs flow vs validation-rule boundary for an AI-authored
platform. Routes by intent not mechanism; tiers surfaces by audience
(validation/flow business-legible, hook deliberately not); sets review
friction by static provability (hook bodies always human-reviewed).

Rules record-before-* flows cannot rewrite or veto the triggering write
(output discarded, errors swallowed by design) and makes that loud via
two new os build lints instead of silent at runtime. Declares extending
record-change flow to mutate/veto/join-the-tx an explicit non-goal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jun 28, 2026 10:39am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/m labels Jun 28, 2026
@os-zhuang os-zhuang merged commit 6268500 into main Jun 28, 2026
14 of 15 checks passed
@os-zhuang os-zhuang deleted the adr/0077-authoring-surface-boundary branch June 28, 2026 10:44
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/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant