fix(plugin): bound worker capability calls per invocation (H3-A)

- enforce at most 64 capability requests and 64 KiB per serialized request
  in both the worker handler and the host bridge
- return structured capability.budget_exceeded / request_too_large errors and
  kill the worker on a host-side violation
- add a real C loop fixture and CLI test proving a runaway plugin is stopped
  without producing file contents
- update ADR-0018, plugin-abi and STATUS
This commit is contained in:
cflmy committed 2026-11-20 13:11:24 +08:00
1 parent ea41256671
commit f69c563afd
7 files changed
+101 -10

No files matched your search

+3 -2
View File
@@ -212,8 +212,9 @@ Foreign provider integrity and environment metadata:
return `capability.unavailable` rather than empty success. Worker
request/reply frames are request-scoped and carry no trusted identity
(ADR-0018).
* H3-A remains open for live ABI session identity, resource budgets per
capability call, and broader executing services. H3-B (OS isolation) remains
* Per-invocation capability budgets are enforced in both the worker handler
and the host: 64 requests and 64 KiB per request. H3-A remains open for live
ABI session identity and broader executing services. H3-B (OS isolation) remains
open; `strict` is refused on every platform and no G-C claim is made.
### M0.6 implementation progress
@@ -54,6 +54,11 @@ Rules:
single deadline for the whole `invoke`, including capability round-trips.
* Only the broker's executing capabilities are reachable. In this build that
means `fs.read`; everything else returns `capability.unavailable`.
* Budgets: at most 64 capability requests per invocation and 64 KiB per
serialized request. Exceeding either returns
`capability.budget_exceeded`/`capability.request_too_large`; the worker-side
handler and the host both enforce the limits, and a host violation kills the
worker.
* The frames do not change the C ABI or `MqHostApi`. They are an internal IPC
protocol between the host and its own worker binary.