Problem
runTask() persists adapter events exactly as emitted.
Relevant code:
src/runtime.ts:189-193
- contract test helper:
src/testing.ts:59-66
If an adapter emits an event for a different taskId, the event is stored under that other task while logs are appended under the local task ID.
Impact
A buggy adapter can corrupt another task's event stream or make logs/events inconsistent.
Suggested fix
In RuntimeService, either:
- validate
event.taskId === task.id and reject/fail the task, or
- normalize emitted events with
{ ...event, taskId: task.id } before persistence.
Keep adapter contract tests, but do not rely on adapter tests as the only runtime isolation guard.
Acceptance criteria
- Runtime tests cover an adapter emitting a mismatched task ID.
- No event can be persisted to a different task during a run.
Problem
runTask()persists adapter events exactly as emitted.Relevant code:
src/runtime.ts:189-193src/testing.ts:59-66If an adapter emits an event for a different
taskId, the event is stored under that other task while logs are appended under the local task ID.Impact
A buggy adapter can corrupt another task's event stream or make logs/events inconsistent.
Suggested fix
In
RuntimeService, either:event.taskId === task.idand reject/fail the task, or{ ...event, taskId: task.id }before persistence.Keep adapter contract tests, but do not rely on adapter tests as the only runtime isolation guard.
Acceptance criteria