feat(prompter): board-review → redraft loop for MegaTask batches (#411)

Batch parity with the single-draft keep-alive redraft loop. A first
board-route confirm-batch parks the intake session against the umbrella
(instead of the unconditional reap), so the existing board-completion
injection reaches the still-live chat — now with a batch-aware brief
(compose_batch_redraft_message: live root-subtask snapshots + board
notes + a one-propose_batch re-proposal instruction). The re-confirm
carries BatchConfirmRequest.task_id and routes to the new
PrompterService.update_live_batch: in-place umbrella + root-subtask
update (positional patch of live children, cancel+recreate on scope
change, create/cancel on count change, dependency edges rewired to the
fresh wave plan) gated by the same _validate_batch_scope as create.
Readers use the CANCELLED-excluding get_live_subtasks view so
multi-round redrafts survive earlier cancels.

Cold path: re-interview now handles a branchless umbrella by recovering
its multi-repo scope from live children (distinct_projects_for_batch)
and returning project_ids — fixes the live 400 behind the task-detail
redraft button on umbrellas. Panel: confirmBatch board branch keeps the
chat open, threads batchRedraftTaskIdRef (persisted) into the
re-confirm, treats a redraft re-confirm as terminal on both routes, and
surfaces the server's real validation message on confirm failure.

Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
Renzo F
2026-07-10 09:38:10 +02:00
committed by GitHub
co-authored by Renn F
parent 3674a1e002
commit bba20a3917
13 changed files with 1569 additions and 69 deletions
+7 -1
View File
@@ -32,6 +32,10 @@ export interface StartLivePayload {
export interface StartLiveResponse {
session_id: string;
// Present only from re-interview on a MegaTask umbrella: the recovered
// multi-project scope (the umbrella itself carries no project_id/product_id
// to seed the redraft chat from).
project_ids?: string[];
}
/** Event kinds the container relays — mirrors the backend driver.StreamChunk. */
@@ -78,7 +82,9 @@ export const prompterLiveApi = {
},
/** Re-open intake to re-draft a board-reviewed task with the board's feedback.
* Spawns a fresh session seeded with the current draft + the board review. */
* Spawns a fresh session seeded with the current draft + the board review.
* For a MegaTask umbrella, the response's `project_ids` carries the batch's
* recovered multi-project scope. */
reInterview: async (taskId: string): Promise<StartLiveResponse> => {
const { data } = await api.post<StartLiveResponse>(
`/prompter/live/re-interview/${taskId}`,
+3
View File
@@ -65,6 +65,9 @@ export interface BatchConfirmPayload {
drafts: DraftProposal[];
project_ids: string[];
route?: "board" | "main_pm";
// Set on a board-informed MegaTask re-draft: confirm updates the existing
// umbrella + root-subtasks in place instead of creating a new batch.
task_id?: string;
}
/** The backend's MegaTask create result: the umbrella, its root-subtasks, and