Repository navigation
feat(subagent): codify outcome-aware worker escalation policy - #1394
TheGreatAxios merged 1 commit into
Conversation
|
Hey @bwachman Based on reading the PR -- is it possible to trim out the other elements and just be the relevant commits here? If this relies on other code, suggest using |
e7783e7 to
c713780
Compare
c713780 to
9375c76
Compare
9375c76 to
5c7743b
Compare
| return true; | ||
| }, | ||
|
|
||
| reportVerifiedOutcome(id: string, outcome: VerifiedOutcome): boolean { |
There was a problem hiding this comment.
reportVerifiedOutcome has no production caller (interface + tests only); "replace-only on explicit report" for verification_blocked is an uncalled store API, so a verification-blocked outcome can never be replaced at runtime. Wire it up or mark deferred.
Plain: there's a function for replacing a dead-end outcome, but nothing ever calls it — so a dead-end can never actually be replaced. Wire it or say it's coming later.
There was a problem hiding this comment.
Marked deferred rather than wired. The interface method now carries a doc comment saying there is no production caller because the runtime has no typed "worker verified" signal (comment), and the design options for that signal are laid out in CL-10568. I left this thread open for you to confirm that is acceptable.
TheGreatAxios
left a comment
There was a problem hiding this comment.
Policy codification verified — the classification union is closed, routine never parks, and least-authority is preserved (no permission-source change, envelope-only grant_request_id, text-only resolutions). Nine items — the two that matter: comparableConfidence overrides classification in routing (the policy's teeth), and reportVerifiedOutcome has no production caller (verification_blocked can never be replaced at runtime). Plus: inconsistent safeDefault rendering, dedup-key vs body claim, "six facts" miscount, routine-ask cap bypasses, stale base note, and a stale comment.
5c7743b to
fd6416e
Compare
0481351 to
8638639
Compare
|
@bwachman, please address the following:
|
|
On trimming to the relevant commits: this PR is now a single commit (CL-10432 only) stacked on #1393's branch, so its diff shows only its own change. The earlier stack commits are no longer part of this diff. |
8638639 to
b1b64b2
Compare
fd6416e to
2c73ecd
Compare
Note on base
This branch is stacked on #1393 (
cl-10189-show-required-input-for-primary-session-ask_operator-at-the, tip 8638639), which provides the worker-wait / parked-question machinery this policy integrates with. The diff in this PR is the CL-10432 change only.Summary
Codify an outcome-aware escalation policy for blocked workers: a closed classification union classifies every ask_director outcome from seven pre-escalation facts, routine questions never park/pending/wake, director_resolvable is parent-only (not operator), operator_decision_required stays distinct from minimum authority, and verification_blocked is a terminal outcome that is never verified, is retained in session state, and has a store-level replace-only-on-explicit-report API (
reportVerifiedOutcome, not yet called at runtime, see Deferred). Least-authority is preserved: no permission source change, grant_request_id attaches only the envelope, resolutions deliver text only, and there is no auto-retry.Verification
After the rebase onto main and the review fixes, CI passes on fd6416e; the results below are from the original verification.
bun test src/subagent/escalation-policy.test.ts src/subagent/ask-director.test.ts src/subagent/session-store.test.ts src/subagent/agent-fleet.test.ts src/subagent/lifecycle-tools.test.ts src/subagent/run-ask-director-grant.test.ts src/permission/worker-grant.test.ts src/permission/worker-grant-flow.test.ts src/subagent/fleet-report.ask-wake.test.ts src/tui/worker-wait.test.ts src/tui/agent-ask-wake.test.ts src/tui/runner/wiring.ask-wake.test.tsBoth blockers + all 8 should-fix + 5 nits in CL-10432-review-v2.md resolved (opt-in bypass removed, terminalOutcome visible, wait/list exposure, questionId validation, declines record outcome, per-field renderer bounding, question in wake, message/resolution overlap, routine audit, integration seams, nits). Least-authority boundary preserved.
AC to code and test mapping
Deferred / Notes
reportVerifiedOutcomehas no production caller: the runtime has no typed "worker verified" signal, so averification_blockedoutcome cannot yet be replaced at runtime. Tracked in CL-10568.Refs CL-10432