docs: add architecture review record for issue 217#220
Conversation
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
|
||
| 现状: | ||
|
|
||
| - `Gateway` 与 `RuntimePort` 只定义了契约,没有看到对应实现或被主链路消费。 |
There was a problem hiding this comment.
This section currently treats internal/gateway as if it were only an unused abstraction layer, but the package also contains concrete protocol assets in types.go, validate.go, and errors.go with coverage in internal/gateway/*_test.go. If the concern is specifically the unused Gateway/RuntimePort contracts, please scope the criticism to that port/interface layer; otherwise the recommendation to delete the whole package is broader than the code here supports.
|
|
||
| - `buildToolManager` 正常路径会注入 `security.NewWorkspaceSandbox()`,这条链路是合理的。 | ||
| - 但 `tools.NewManager` 在 `sandbox == nil` 时会回退到 `NoopWorkspaceSandbox`。 | ||
| - 该实现的 `Check` 直接返回 `nil, ctx.Err()`;在上下文正常时等价于“不做任何工作区限制”。 |
There was a problem hiding this comment.
NoopWorkspaceSandbox is weaker than the real workspace sandbox, but this sentence overstates the effect. With call.WorkspacePlan == nil, the tools still enforce workspace-root boundaries through ResolveWorkspaceTarget and per-tool path/workdir checks, so this is not equivalent to unrestricted execution. The more accurate risk is loss of the extra centralized hardening in security.NewWorkspaceSandbox() such as canonical-root, symlink-escape, and execution-time revalidation checks.
|
|
||
| 现状: | ||
|
|
||
| - `s.emit(...)` 在运行主循环中多次调用,但大多数返回值没有被处理。 |
There was a problem hiding this comment.
This wording is a bit too broad. emit does not drop events just because the channel is full; it retries and only returns an error when the run context is canceled before the send can complete. Narrowing this section to cancellation/backpressure-induced failures would make the runtime analysis more precise.
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Requested by @Cai-Tang-www
Summary
docs/architecture-review-issue-217.mdVerification
docsonly)