Skip to content

docs(adr): ADR-0076 OQ#9 裁决 — catch-all 洗白、步骤①吸收完成 (#2462) - #3576

Merged
os-zhuang merged 1 commit into
mainfrom
docs/adr-0076-step1-verdict
Jul 27, 2026
Merged

docs(adr): ADR-0076 OQ#9 裁决 — catch-all 洗白、步骤①吸收完成 (#2462)#3576
os-zhuang merged 1 commit into
mainfrom
docs/adr-0076-step1-verdict

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

裁决(防止将来执行者按旧文本行动)

ADR D11/OQ#9 原文写"until the catch-all is retired by step ③"——步骤③ 用相反的刀法达成了目标:18 个域体全部搬出、dispatch() 缩成关卡序 + first-match 注册表、if 链域分支清零。

病根从来不是 catch-all 本身,而是它委托进的那个不可枚举的上帝 if 链("declared≠mounted≠implemented" 的 v16 缝 bug 类就藏在那里)。委托进"关卡+注册表"薄管线是合理终态:路由表可枚举(DomainHandlerRegistry.list())、每条有 owner 模块与接缝测试、cloud fallback 织物(/share-links per-env 主面、/notifications 唯一 owner)走同一管线并被 conformance 41 断言 + dogfood 351 端到端锁定。

步骤①("删死分支")被吸收:已无分支可删,只有有主的注册表条目。cloud 侧验证:objectos-runtime 240 测试(含 kernel-resolver 策略)对拆解后 dispatcher 原样通过。

可选 polish(adapter 枚举注册表挂显式路由)需把关卡序 middleware 化——成本大于收益,有意不排期(conformance + route-parity 门在位)。

纯 docs(skip-changeset)。关联 #2462

🤖 Generated with Claude Code

…ep (1) absorbed (#2462)

Step (3) decomposed the dispatcher the other way around: 18 domain
bodies moved out, dispatch() shrank to gates + a first-match registry,
and the if-chain reached zero domain branches. The disease was never
the catch-all — it was the unenumerable god if-chain it delegated
into. Delegating into a thin gates+registry pipeline is the terminal
shape; "kill the dead callable branches" is absorbed (no branches
left, only owned registry entries). The adapter-enumerates-registry
polish is deliberately not scheduled.

Cloud-side verification: objectos-runtime 240 tests (incl. the
kernel-resolver strategy) pass unchanged against the decomposed
dispatcher.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 27, 2026 7:29am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/xs labels Jul 27, 2026
@os-zhuang os-zhuang added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Jul 27, 2026
@os-zhuang
os-zhuang merged commit 8e5def1 into main Jul 27, 2026
17 of 18 checks passed
@os-zhuang
os-zhuang deleted the docs/adr-0076-step1-verdict branch July 27, 2026 07:37
os-zhuang added a commit that referenced this pull request Jul 27, 2026
…re splitting into per-prefix mounts (#3608) (#3637)

The first place anyone (human or agent) tempted to "fix" the catch-all
looks is this line, not the issue tracker. Anchor the #3576 verdict and
the #2852 RLS-leak failure mode here; reopen conditions stay archived
on #3608 (closing as deliberately-unscheduled).

Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
os-zhuang added a commit that referenced this pull request Jul 30, 2026
…oes not own, and unbreak the #4116 ledger (#4117) (#4133)

Two things, and the second is urgent.

## The fix (#4117)

`app.all(`${prefix}/auth/*`)` claimed a whole namespace and was TERMINAL: it
returned the auth service's response unconditionally, including better-auth's 404
for a path it does not implement, and the legacy `handleAuth` bridge's own
`handled: false` 404. That is #4088's shape. #4116's scan found it; the manual
greps that preceded that scan had not.

A 404 from better-auth, or `handled: false` from the dispatcher, now means "not
this mount's path" and the handler yields. The predicate is the dispatcher's OWN
`handled` flag wherever one exists — an explicit ownership answer beats inferring
one from a status; only the better-auth hand-off lacks such a flag, and there the
404 is the signal, exactly as in #4092.

What this buys here is narrower than #4092 and the code says so: it does NOT make
a later-registered Hono route reachable, because the `${prefix}/*` dispatcher
catch-all below is deliberately terminal (ADR-0076 OQ#9, #3576/#3608) and would
swallow one either way. It means an unowned `/auth/*` path now reaches that gated
`dispatch()` instead of dead-ending in a 404 built one mount earlier, so a domain
handler registered for it becomes reachable — which is this adapter's actual
extension mechanism. The first draft of the tests asserted the #4092 outcome and
failed, which is how the distinction got established rather than assumed.

## Unbreaking main

#4122 shipped the ledger declaring TWO ratcheted mounts here. Between its base
(974c6d4) and its merge, #4087/#4112 landed and DELETED the `/storage/*` bridge —
so the squash produced a main where the ledger declares a mount that no longer
exists, and `check:wildcard-fallthrough` fails on main with "DECLARED but not
found". That is my merge race, and this commit removes the entry.

Worth recording why the guard behaved well here: the stale-entry arm is what
caught it, immediately, on the first run against the new main. And #4112 reached
the same verdict about that wildcard independently, from the other direction —
"the wildcard was wider than the two routes it served". Two independent reads
landing on one defect is the argument for enumerating the shape rather than
finding it by eye each time.

Also extends `callsContinuation`: handing the continuation to a helper
(`yieldUnowned(c, next, …)`) now counts as yielding. Without that the checker
called this fix terminal — a false negative that would have pushed the compose
subtlety toward being duplicated at each call site instead of written once.

Guard: 7 yielding / 0 ratcheted / 5 exempt over 12 mounts. Self-test 17 cases.
adapters/hono 73 passed. Verified both defences bite: reverting the fix fails the
guard with the TERMINAL diagnostic and fails 2 of the 6 new tests. The 3 `tsc`
errors and 2 `eslint` rule-definition errors in this package are pre-existing,
measured identical on a clean tree.


Claude-Session: https://claude.ai/code/session_013VZLsKypjrGhiLpio2uWKu

Co-authored-by: Claude <noreply@anthropic.com>
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/xs skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant