feat(tools): propose_scope recalibration valve for the execution loop

When a write is blocked for being outside the claimed task's
affected_paths, the implementer can propose widening scope via a new
T2 propose_scope tool. The operator decides (invariant #4 — the agent
can't self-grant). Approve unions the proposed paths into the task's
affected_paths (existing TaskAffectedPathsSetEvent); activeScope
re-derives the wider manifest from events so the same write then passes.
Reject blocks the task (via TaskClaimCoordinator.blockActiveTask, hooked
on both approval-denial branches, scoped to propose_scope) so the loop
advances. No new event types.
This commit is contained in:
2026-06-29 01:04:48 +04:00
parent 3e44c6d107
commit a00bd4aade
6 changed files with 136 additions and 0 deletions
@@ -26,4 +26,8 @@ class DefaultTaskClaimCoordinator(
override fun activeScope(sessionId: SessionId): List<String> =
taskService.activeClaim(sessionId.value)?.state?.affectedPaths ?: emptyList()
override suspend fun blockActiveTask(sessionId: SessionId, reason: String) {
taskService.activeClaim(sessionId.value)?.let { taskService.block(it.taskId, reason) }
}
}