fix(apes-sidebar): inject 改空数组(修 DSH entry pending → 恢复模式)

根因:inject: ['logger'] 声明了 logger 为硬依赖 service,但 DSH host
没有 provider 注册 logger service → entry 永远 pending →
'1 entry did not activate' → 插件树加载失败 → 恢复模式循环。

对比 dsh-better-sidebar:其 inject 是 host 实际提供的 service
(webServer/sessions/webRuntime/tools)。apes-sidebar host half 只用
ctx.logger 做可选链调用(log?.info?.() 在 try/catch 里),logger 是
软便利不是硬依赖——不该出现在 inject 列表里。

修正:inject 改空数组 [],host half 不声明任何硬依赖 service。
同步更新 smoke.spec.ts 断言(inject toEqual([]))+
verify-mount.cjs 检查(inject === [])。

门禁:typecheck rc=0 · build rc=0 · test 29/29
This commit is contained in:
figmar committed 2026-09-04 21:21:56 +08:00
1 parent cfc9d3c884
commit 0b79269b2c
3 files changed
+18 -4

No files matched your search

+5 -1
View File
@@ -29,7 +29,11 @@ describe('apes-sidebar host plugin shape', () => {
expect('default' in host).toBe(false)
expect(typeof host.apply).toBe('function')
expect(host.name).toBe('apes-sidebar')
expect(host.inject).toEqual(['logger'])
// inject MUST be empty: `logger` is used only via optional-chaining in
// apply(ctx) — declaring it as an injected service would make the entry
// wait on a provider DSH host does not register, blocking activation
// (recovery mode). See src/index.ts comment.
expect(host.inject).toEqual([])
})
it('apply mounts a logger line through the effect (Phase 0 minimal)', () => {