打扰上限要覆盖「人步 + 人兜底」;发卡失败走声明的失败走向

A7 归档卡在最后一步:调人预算 1/1 触顶,S4 放行卡发不出来,
而引擎每一拍重发一次 —— 六行一模一样的「调用:步 4」,卡永远不出现,也永远不报错。

两处修:

① 发卡被 Harness 拦下(调人预算触顶等)= **这一步失败了**,走它声明的失败走向。
   不接住就是无限重发:预算照烧、负责人什么也看不到。
② 四个 flow 活动的打扰上限只按**人步**算,没算**声明的人兜底**。
   声明了 `fallback: human` 就等于承认这一步可能要调人,预算却不给它留位置 ——
   兜底一触发,后面的放行卡必然发不出。按「人步 + 人兜底」重算:
   A1 4 / A4 3 / A6 3 / A7 2。

gates: tsc / eslint / depcruise / 399 测试 全绿

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
2026-07-27 05:50:56 +08:00
co-authored by Claude Opus 5
parent 1577927214
commit c3cb82ef64
5 changed files with 32 additions and 18 deletions
@@ -151,14 +151,28 @@ export function createFlowRunner(deps: FlowRunnerDeps): FlowEngineService {
}
case 'human': {
// 异步步:完成条件 = 人事件;时限必配
const card = await deps.cards.issue({
taskId,
ownerId: context.ownerId,
humanCallCap: context.humanCallCap,
workOrder: step.workOrder,
card: step.card,
});
// 异步步:完成条件 = 人事件;时限必配。
// 发卡本身可能被 Harness 拦下(调人预算触顶等)—— 那是**这一步失败了**,
// 走它声明的失败走向;不接住就会每一拍重发一次、永远发不出去也永远不报错。
let card: { id: string };
try {
card = await deps.cards.issue({
taskId,
ownerId: context.ownerId,
humanCallCap: context.humanCallCap,
workOrder: step.workOrder,
card: step.card,
});
} catch (error) {
return handleFailure(
taskId,
step,
index,
position,
attempt,
error instanceof Error ? error.message : String(error),
);
}
await deps.listeners.register({
taskId,
eventType: 'human',