feat(runtime)!: 动作参数默认严格,opt-in 开关删除(#3438 D2 翻转,17.0 车次) - #4213
Merged
Conversation
… is gone (#3438) ADR-0104 D2 landed warn-first behind OS_ACTION_PARAMS_STRICT_ENABLED. The 2026-07-30 addendum decided that window closes in 17.0 rather than 18.0, so this executes it: - actionParamsStrict() becomes laxActionParams(): enforcement is the default and OS_ALLOW_LAX_ACTION_PARAMS=1 is the only knob — spelled OS_ALLOW_* per PD #9 and ADR-0110 D6, which this change also removes the sole cited exception from. The opt-in name never reached `latest` (RC-only), so it is deleted outright rather than deprecated for a release. - The escape-hatch path still warns once per action, so opting out tolerates the drift instead of hiding it again. - Dogfood duals are inverted: the DEFAULT path is now what the gate proves, and the hatch — the branch nobody sets — is what gets a test so it cannot rot unnoticed. Also corrects three docs the flip falsifies, plus two the earlier #3681 media work had already left self-contradictory in the v17 notes (the section said hard rejection arrives only via OS_DATA_VALUE_SHAPE_STRICT_ENABLED two paragraphs before saying media enforces per verified deployment; the upgrade checklist prescribed the env var as the way to get there, which would opt in every value class including the ones with no migration behind them). Verified: runtime 951, spec 7147, dogfood 425 (+3 skipped) all green; the D2 contract dogfood passes with the inverted duals; all ten spec artifact gates pass. Swept examples and packages for callers posting param bags — the todo MCP e2e invokes only param-less actions, showcase tests call handlers directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zgA8CQMJeJbFEjnbib1Uv
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…efault-flip-vbly5z # Conflicts: # content/docs/releases/v17.mdx
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 113 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
marked this pull request as ready for review
July 30, 2026 16:30
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.
执行 ADR-0104 2026-07-30 附录的 D2 决定(#4199 已合并)
三件实现工作的第 1 件,也是唯一有硬截止的一件:
changeset pre exit之前。一旦OS_ACTION_PARAMS_STRICT_ENABLED随 GA 上了latest,「直接删除、不背弃用债」的窗口就永久关闭,此后必须走readEnvWithDeprecation兼容一版。代码变更
违规参数包(缺
required、越出options、multiple/reference形状错、未声明键)在 handler 运行前被拒:REST400 VALIDATION_FAILED,MCP 抛错。逃生阀路径仍然每个 action 告警一次——设了它是「容忍漂移」,不是「让漂移重新隐形」。变量名按 PD #9 与 ADR-0110 D6 采用
OS_ALLOW_*(opt-out)形态。顺带:D6 原文把OS_ACTION_PARAMS_STRICT_ENABLED举为"可容忍的 opt-in 例外",本次删除后该规则再无例外可指,已在 ADR-0110 就地更新。Dogfood 对偶翻转
原来「默认宽松」是每个调用方都会走的路径、而「严格」要设变量才能到达;现在反过来。测试也随之反过来:默认路径成为被证明的那条,而逃生阀——那条没人会设的分支——拿到专门用例,否则它正是会悄悄腐烂的东西。
顺带修掉两处 v17 发版说明的自相矛盾(#3681 遗留)
不是本任务范围,但我的新章节交叉引用了它,就变成了我的问题:
OS_DATA_VALUE_SHAPE_STRICT_ENABLED时才到来」,后一段说「媒体值形态只在本部署验证过自己的迁移后才强制」——feat(objectql)!: 媒体值形态 strict 按部署生效 —— #3438 中标记真正覆盖的那一半 #3681 之后只有后者是真的。已重写,并说清两个开关分立在标记两侧:OS_ALLOW_LAX_MEDIA_VALUES往回退,OS_DATA_VALUE_SHAPE_STRICT_ENABLED往前推到全部值类(含尚无迁移背书的引用/结构化 JSON,D1 非媒体类型的按部署扫描门禁 + D2 动作参数 17.0 默认严格 —— 证据来源与载体已定于 ADR-0104 2026-07-30 附录(修订版) #3438 第 2 项)。OS_DATA_VALUE_SHAPE_STRICT_ENABLED」——那会一次性把没有证据支撑的类别也打开。已改为「跑迁移即可,别碰那个变量」,并新增 Actions 一条。验证
@objectstack/runtime@objectstack/spec风险面排查:扫了
examples/与packages/所有投递 param 包的调用点。todo 的 MCP e2e 只调用无params声明的动作(complete_task/clone_task;声明了参数的defer_task是 modal-only 且未被调用),showcase 测试直接调 handler 绕过 dispatch。完整 dogfood 跑真实 HTTP 全绿,是这条结论最强的证据。Console 侧(objectui)从声明构造参数包,且 dispatch 自注入的
recordId/objectName在ACTION_PARAM_BUILTIN_KEYS白名单内——R3 里唯一会造成误伤的那半早已关闭,所以现在被拒的确实是写错的。关联
#3438 剩余两项(
os migrate value-shapes扫描门禁 + 新库创建时记账)不在本 PR,仍在 issue 跟踪。🤖 Generated with Claude Code
https://claude.ai/code/session_016zgA8CQMJeJbFEjnbib1Uv
Generated by Claude Code