Wire the EXT-11 scoped-host factory through the composition root #108

Merged
weichen merged 3 commits from feature/ext-11-scoped-host-factory into main 2026-10-08 17:08:07 +00:00
Owner

EXT-11 实现(受理依据 Documents #49)

  • 公开面:extension.SetScopedHostFactory(组合根注入,模式对齐 SetRunner)+extension.NewScopedHost(owner, pluginID)(下游恢复路径重建受限句柄;未注入/空参 fail-closed)。SurfaceVersion 2.4.0-experimental(surface.txt +2 符号)。
  • 语义:重建句柄与分发期同构——owner 作用域、PluginID、KV/任务台账隔离、知识发布/删除前缀强制;不含任何凭证。
  • 接线:app.Run 在 hostcaps 装配后注入;分发路径零变化。

验证(红→绿)

红(182d8b5):接线为占位,NewScopedHost fail-closed 报错;绿:TestScopedHostFactory(注入前 fail-closed / 注入后 Owner/PluginID、KV 往返、KnowledgeDelete("manual") 仍拒、空参拒绝);go test ./... 32/32 包 ok。Dev 组合验证与 CI 随 gitlink PR。

关联

RDM 序 4 切片 2 登记的「受控重跑」据此可升级;为序 5 三权流程准备。

## EXT-11 实现(受理依据 Documents #49) - **公开面**:`extension.SetScopedHostFactory`(组合根注入,模式对齐 SetRunner)+`extension.NewScopedHost(owner, pluginID)`(下游恢复路径重建受限句柄;未注入/空参 fail-closed)。SurfaceVersion **2.4.0-experimental**(surface.txt +2 符号)。 - **语义**:重建句柄与分发期同构——owner 作用域、PluginID、KV/任务台账隔离、知识发布/删除前缀强制;不含任何凭证。 - **接线**:app.Run 在 hostcaps 装配后注入;分发路径零变化。 ## 验证(红→绿) 红(182d8b5):接线为占位,NewScopedHost fail-closed 报错;绿:`TestScopedHostFactory`(注入前 fail-closed / 注入后 Owner/PluginID、KV 往返、`KnowledgeDelete("manual")` 仍拒、空参拒绝);`go test ./...` 32/32 包 ok。Dev 组合验证与 CI 随 gitlink PR。 ## 关联 RDM 序 4 切片 2 登记的「受控重跑」据此可升级;为序 5 三权流程准备。
weichen added 3 commits 2026-10-08 17:02:17 +00:00
Why: EXT-11 is accepted; the surface (SetScopedHostFactory/NewScopedHost, SurfaceVersion 2.4.0-experimental) must land with the behavioral red pinned - wiring absent, NewScopedHost fails closed with ErrNotLinked.
Evidence: TestScopedHostFactory red at the wired-factory assertion; row follows on the task card.
Impact: pkg/extension additive surface (surface.txt +2 symbols); internal wireScopedHostFactory stub. Behavior unchanged.
Refs: EXT-11 proposal; task card.
Why: The red run pinned the missing wiring; downstream recovery paths need a legal handle outside dispatch.
Evidence: TestScopedHostFactory green (fail-closed before wiring; Owner/PluginID, KV roundtrip, prefix enforcement, empty-arg rejection after); go test ./... all packages ok.
Impact: wireScopedHostFactory injected in app.Run after hostcaps assembly; no dispatch-path change.
Refs: EXT-11; red run at 182d8b5.
gofmt the ext-11 files
ci / vet-and-test (pull_request) Successful in 42s
bbe39b475f
Why: The implementation commit left two files unformatted; keep the tree gofmt-clean.
Evidence: gofmt -l now empty; targeted test still green.
Impact: Formatting only.
Refs: Follow-up to the wiring commit.
weichen added 1 commit 2026-10-08 17:02:19 +00:00
gofmt the ext-11 files
ci / vet-and-test (pull_request) Successful in 42s
bbe39b475f
Why: The implementation commit left two files unformatted; keep the tree gofmt-clean.
Evidence: gofmt -l now empty; targeted test still green.
Impact: Formatting only.
Refs: Follow-up to the wiring commit.
weichen merged commit 46c2abbca8 into main 2026-10-08 17:08:07 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#108