Skip to content

test(runtime,objectql): the D12 honesty gate iterates the fake inventory, not spot checks (#3898) - #4306

Merged
os-zhuang merged 2 commits into
mainfrom
claude/d12-honesty-capability-issues-503666
Jul 31, 2026
Merged

test(runtime,objectql): the D12 honesty gate iterates the fake inventory, not spot checks (#3898)#4306
os-zhuang merged 2 commits into
mainfrom
claude/d12-honesty-capability-issues-503666

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

背景

#3898 盘点的三个洞,核对当前 main,已全部由已合并的 PR 修复:

修复 路线
洞 1 —— _fallback 标记不被 readServiceSelfInfo 识别 #4082(#4058 step 1,即 issue #4089) 走了与 #3898 建议 1 相反且更优的路线:不教 reader 认第三种标记,而是把五个内存兜底(metadata/cache/queue/job/i18n)全部改带标准 __serviceInfo,message 逐个点名缺什么,_fallback 从生产代码中消失。app-plugin.ts 的 i18n 诊断分支也改读 readServiceSelfInfo
洞 2 —— data 槽位不传实例 #4141(issue #4130) svcAvailable(routes.data, 'kernel', dataSvc) 补上第三参,附跨 builder 一致性 pin
洞 3 —— metadata 硬编码 degraded / protocol.ts 硬编码 available #4114 两个 discovery builder 都改为读实现的 D12 自描述,方向相反的两个硬编码同时消灭

本 PR:补建议 4 的防复发门

现有测试是逐槽位 spot-check;fallbacks.test.ts工厂层遍历 CORE_FALLBACK_FACTORIES,但 discovery 层 cache/queue/job 三个槽位没有任何 pin —— 把它们的 svcAvailable(…, svc) 第三参删掉(正是洞 2 的复发形态)不会有任何测试变红。

两个 discovery builder 的套件各加一条表驱动的门:遍历 CORE_FALLBACK_FACTORIES(plugin-dev stub 表按 ADR-0115 退役、_fallback 被消灭后,这就是完整的已知 fake 清单),逐一注册进各自槽位,断言 discovery 报 degraded、绝不 available。新增兜底进表当天即被门覆盖。

  • packages/runtime/src/http-dispatcher.test.ts —— dispatcher builder(getDiscoveryInfo)
  • packages/objectql/src/protocol-discovery.test.ts —— metadata-protocol builder(getDiscovery)

验证

Closes #3898

🤖 Generated with Claude Code

…ory, not spot checks (#3898)

The three holes #3898 inventoried are all closed on main — #4082 eliminated
the `_fallback` marker by moving every kernel fallback onto the standard
`__serviceInfo` descriptor, #4114 made both discovery builders compute the
`metadata` slot, #4141 did the same for `data`. What remained was the issue's
suggestion 4: a recurrence gate over the known-fake INVENTORY rather than
per-slot spot checks.

This adds that gate to both discovery builders' suites: iterate
CORE_FALLBACK_FACTORIES (the complete fake inventory now that plugin-dev's
stub table is retired, ADR-0115), register each product into its own slot,
and assert discovery reports it `degraded` — never `available`. Table-driven,
so the next fallback added to the table is gated the day it lands.

cache/queue/job had no per-slot pin before this: dropping their
`svcAvailable(…, svc)` third argument — the exact #4130 regression shape —
was test-invisible. Verified the gate bites by simulating that regression
(`services.cache.status: expected 'available' to be 'degraded'`).

Closes #3898

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

vercel Bot commented Jul 31, 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 31, 2026 5:03am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

No hand-written docs reference the 0 changed package(s). ✅

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/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADR-0076 D12 诚实能力层的三个洞:_fallback 标记不被识别、data 槽位不传实例、metadata 硬编码 degraded

1 participant