feat: implement the reference host-risk operation flow (§9.3) - #3
Conversation
The template declared it was runtime-backed but only answered describe/health/plan. Now it implements the whole §9.3 flow end to end, so a new plugin has a correct shape to copy and so the server's execute protocol has a real caller. The plan-effect method returns a PluginOperationPlan — summary, targets, redacted preview, steps, rollback, opaque data — that the server turns into a pending approval. The new execute action, which only the approval executor can reach, enqueues one bounded task per approved target through the task.enqueue host call. The plugin applies nothing itself and never sees the operation grant: it asks the host to enqueue, and the host refuses anything outside the approved plan. The reference is deliberately careful where a real plugin must be: it single-quotes the approval id and node id into the sh command so neither can break out, it treats an empty-target plan as a validation error rather than an unsupported method (so the conformance probe stays honest), and it surfaces a host refusal verbatim rather than swallowing it. README documents the flow and the rules a production plugin keeps. The manifest gains task:run, is bumped to 0.2.1-alpha.4 in lockstep with the go const and ui/package.json, and is re-packed and re-signed: the bundle digest was recomputed with the CI toolchain (go1.26.4) and verified to match a deterministic double-pack, so the digest gate passes without a rebuild in CI. Tests: system-go green (describe/health/plan/execute/injection-quoting/conformance); UI test + typecheck + build green; double-pack digest == manifest digest.
|
[ack] — zeus review, Olympus TASK-0007 (2026-07-26): the reference §9.3 flow mirrors the server-side semantics I verified in lattice-server#12 (plan applies nothing; execute only via the approval executor's one-time host-bound grant; task.enqueue per approved node under the operator's own task validation). Manual end-to-end (plan→approve→execute→task on a live server with #12) still owed before any production plugin copies this path — on record in Olympus. Merge disposition: merge-ready behind template#2, lands when this repo's |
The template said it was runtime-backed but only answered
describe/health/plan. It now implements the whole §9.3 flow end to end.The flow
plan-effect method returns aPluginOperationPlan(summary, targets, redacted preview, steps, rollback, opaque data). Applies nothing. The server bounds it, authorizes every target, and stores a pending approval with the binding in typed columns.executeaction with a one-time grant bound host-side. The plugin never receives the grant.task.enqueueonce per approved node.task:runis eligibility; the grant is authorization. The host refuses any task outside the approved plan and applies the operator's own task validation.What makes it a good reference
task.enqueue.shcommand; a test feedsa'; rm -rf /; echo 'and asserts it stays a string literal.unsupported method, so the conformance probe still counts the method as served.task:run+backing: "runtime").Artifact + signing
Manifest gains
task:run, bumped to0.2.1-alpha.4in lockstep with the Go const andui/package.json, re-packed and re-signed with the publisher key. The new bundle digest was computed with the CI toolchain (go1.26.4 viaGOTOOLCHAIN) and verified to equal a deterministic double-pack — I reproduced the previous committed digest byte-for-byte first to confirm my environment matches CI, so the digest gate passes without a rebuild.Depends on
The runtime side is lattice-server #12. No production deployment ships this
executepath until #12 lands — which is the order the spec asks for.Test plan
go test ./...(system-go): describe / health / plan-returns-operation-plan / empty-targets / execute-per-target / host-refusal / injection-quoting / conformancenpm test+typecheck+buildgreendigest == manifest.bundle.digest_sha256; version parity manifest = ui = go consthttps://claude.ai/code/session_01FzYExyy6G7Cb7QpXoUEY78