feat: sync auto-next obligation gate hardening
This commit is contained in:
@@ -356,6 +356,11 @@ function buildApprovedPlanContinuityInput(wrapperResult: any, autoChainPlanResul
|
||||
: (wrapperResult?.handoff?.mode === "button_path" ? "waiting_user" : "completed");
|
||||
|
||||
const dispatchReceipt = wrapperResult?.dispatchReceipt ?? null;
|
||||
const nextTaskKnown = wrapperResult?.nextTaskKnown === true
|
||||
|| (plannerDerivedAction != null && typeof autoChainPlanResult?.derivedAction === 'string' && autoChainPlanResult.derivedAction !== 'none');
|
||||
const sameApprovedPlan = wrapperResult?.sameApprovedPlan === true || plannerDerivedAction != null;
|
||||
const taskBoundaryStop = wrapperResult?.taskBoundaryStop === true || replyClosureState === 'completed';
|
||||
const highRiskStop = wrapperResult?.highRiskStop === true;
|
||||
|
||||
return {
|
||||
planId: wrapperResult?.planId ?? "hook-preflight-approved-plan",
|
||||
@@ -364,6 +369,10 @@ function buildApprovedPlanContinuityInput(wrapperResult: any, autoChainPlanResul
|
||||
nextDerivedAction,
|
||||
replyClosureState,
|
||||
dispatchReceipt,
|
||||
nextTaskKnown,
|
||||
sameApprovedPlan,
|
||||
taskBoundaryStop,
|
||||
highRiskStop,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -387,7 +396,12 @@ function buildApprovedPlanContinuityBlock(result: ApprovedPlanContinuityResult |
|
||||
|
||||
if (result.ok === false) {
|
||||
lines.push("- HARD_GATE: Do not close out this reply as normal completion.");
|
||||
lines.push("- HARD_GATE: Route back to continuity failure until a real next dispatch receipt exists, unless closure state is waiting_user, blocked, or pending_verification.");
|
||||
if (result.reason === 'missing_auto_next_dispatch') {
|
||||
lines.push("- HARD_GATE: Do not stop at this completed-task boundary.");
|
||||
lines.push("- HARD_GATE: Auto-dispatch the next task in the same approved plan, unless waiting_user, blocked, pending_verification, or high-risk stop applies.");
|
||||
} else {
|
||||
lines.push("- HARD_GATE: Route back to continuity failure until a real next dispatch receipt exists, unless closure state is waiting_user, blocked, or pending_verification.");
|
||||
}
|
||||
}
|
||||
|
||||
lines.push("[/APPROVED_PLAN_CONTINUITY_GATE]", "");
|
||||
|
||||
Reference in New Issue
Block a user