feat: gate plugin harness verbs through interactions - #266
Conversation
| return; | ||
| } | ||
| invocationBlocks(state); | ||
| this.session.requireLane(recorded.laneId); |
There was a problem hiding this comment.
🤖 devloop code-review · seed-2.1-turbo
The restore() method calls ensureScheduled() for every non-terminal state. For draft invocations, ensureScheduled now calls invocationBlocks() which throws if recorded.blocks is missing. This is the intended "fail closed" behavior for new code, but old persisted draft invocations (from before this refactor) may have blocks: undefined because the field was optional and not previously required. During Manager startup (startManager → restoreHarnessInvocations → restore), the uncaught throw would crash the entire plugin Manager initialization.
The fix should inspect the draft state in restore (or ensureScheduled) and, when blocks is missing for a draft verb, emit a _baton_harness_invocation_failed event instead of throwing, so the recovery path can cleanly mark the stale invocation as failed rather than crashing the process.
ccr:fp=4c509aa4fc3a
There was a problem hiding this comment.
ccr:label=debatable — 仅旧版已持久化且缺少 blocks 的 draft invocation 会进入该恢复分支;当前 Manager 只在 suggested-input Interaction submitted 后传入 blocks,HarnessInvocationStore.record 也会拒绝空 blocks。为旧 ledger 转 failed 属于本次明确不保留的兼容读取策略,因此不采纳 #stale
Route draft and harness reconcile verbs through durable Core interactions before creating any HarnessInvocation. Persist policy auto-approvals, expose typed cancellation and dispatch-failure outcomes, and align the TUI, public contracts, tests, and architecture documentation.
Remove the pre-Interaction awaiting-input event, store, Manager, and TUI paths. Draft HarnessInvocations now require submitted Interaction blocks and fail closed when that invariant is absent.
16bb8a0 to
e60598f
Compare
|
🤖 devloop code-review · 1 finding(s)(1 条已作为独立 review thread 发布) |
Route draft and harness reconcile verbs through durable Core interactions before creating any HarnessInvocation.
Persist policy auto-approvals, expose typed cancellation and dispatch-failure outcomes, and align the TUI, public contracts, tests, and architecture documentation.
Remove the pre-Interaction awaiting-input event, store, Manager, and TUI paths.
Draft HarnessInvocations now require submitted Interaction blocks and fail closed when that invariant is absent.