Skip to content

feat: gate plugin harness verbs through interactions - #266

Merged
qiankunli merged 2 commits into
mainfrom
fix-harness-invocation-outcomes
Aug 11, 2026
Merged

feat: gate plugin harness verbs through interactions#266
qiankunli merged 2 commits into
mainfrom
fix-harness-invocation-outcomes

Conversation

@qiankunli

@qiankunli qiankunli commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

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.

return;
}
invocationBlocks(state);
this.session.requireLane(recorded.laneId);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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 (startManagerrestoreHarnessInvocationsrestore), 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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@qiankunli
qiankunli force-pushed the fix-harness-invocation-outcomes branch from 16bb8a0 to e60598f Compare August 11, 2026 08:27
@qiankunli

Copy link
Copy Markdown
Collaborator Author

🤖 devloop code-review · origin/main..HEAD · 16bb8a020 · models: deepseek-v4-pro×55, seed-2.1-pro×58, seed-2.1-turbo×73 · cost: 498s · ccr v1.13.48

1 finding(s)(1 条已作为独立 review thread 发布)

@qiankunli
qiankunli merged commit b23fd82 into main Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants