feat(shipping-notice): 收敛阶段能力投影并修复库存 RPA 运行链路

下发 preparation capabilities 并与右卡展示同源授权;
库存 RPA 运行态请求内 memo;取消会话 Profile 本地 TTL;
并为 shipping-worker 挂载共享盘。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-09-07 14:46:48 +08:00
1 parent f773237226
commit a6edc4fe61
16 files changed
+433 -179

No files matched your search

@@ -1829,16 +1829,26 @@ async function handleCurrentTaskAction(
) {
const params = (parameters || {}) as Record<string, unknown>;
const normalizedCode = String(code || '').trim();
// [AUTHORITY] 正式 OT 的所有可写动作都从任务详情的 ui_state.actions 原样委托。
// 缺少同码的正式动作即不执行,不能降级到历史 Projection 或 Case 快照。
// [AUTHORITY] 正式 OT:右卡按钮只读 A(shippingProcessingProjection.ui_state),
// 点击必须与展示同源授权;capabilities 供 stageCapabilityBypass,B.actions
// 仅作兼容回退。禁止「A 已展示、B 无同码」时落到 actionUnknown。
if (hasFormalOt.value) {
// [STAGE_CAPABILITY] 阶段能力(重抓/重读/改源)从右侧卡点击时,走 submitFormalGateAction
// 的能力分支——绕过门禁 gate-membership 守卫并直达后端 request_gate_action。
if (!(await ensureFormalTaskDetailReady())) return;
// [STAGE_CAPABILITY] 命中能力(含 disabled)走 submitFormalGateAction,
// 由能力分支展示 disabled_reason 或 stageCapabilityBypass 提交。
const capability = formalPreparationContext.value?.capabilities?.find(
(cap) => cap.enabled && String(cap.action_code || '').trim() === normalizedCode,
(cap) => String(cap.action_code || '').trim() === normalizedCode,
);
if (capability) {
if (!(await ensureFormalTaskDetailReady())) return;
await submitFormalGateAction(normalizedCode);
return;
}
// [§2.4 单源] A 已下发的主/侧路动作与展示同源,直接提交 Gate,不要求 B.actions。
const aPrimary = String(currentTaskUiState.value?.primary_action?.code || '').trim();
const aSecondaryHit = (currentTaskUiState.value?.secondary_actions || []).some(
(action) => action.enabled && String(action.code || '').trim() === normalizedCode,
);
if (normalizedCode && (normalizedCode === aPrimary || aSecondaryHit)) {
await submitFormalGateAction(normalizedCode);
return;
}
@@ -1849,7 +1859,6 @@ async function handleCurrentTaskAction(
msg.info(t('chat.shippingOrderReview.currentTask.actionUnknown', { code: normalizedCode }));
return;
}
if (!(await ensureFormalTaskDetailReady())) return;
await executeFormalTaskAction(formalAction, params);
return;
}
@@ -3548,8 +3557,16 @@ const submitFormalGateAction = async (
const authorized = formalTaskActions.value.some((action) => (
action.enabled && String(action.code || '').trim() === normalizedCode
));
// [§2.4 单源] A 已展示的主/侧路动作与右卡同源,允许作为写路径授权(B.actions 可能滞后)。
const aPrimary = String(currentTaskUiState.value?.primary_action?.code || '').trim();
const aAuthorized = Boolean(normalizedCode) && (
normalizedCode === aPrimary
|| (currentTaskUiState.value?.secondary_actions || []).some(
(action) => action.enabled && String(action.code || '').trim() === normalizedCode,
)
);
// [STEP] 阶段能力分支:capability 命中优先按 enabled/disabled_reason 裁决,
// 仅在未命中能力时回退到通用 Gate noAction 校验(Task 5)。
// 仅在未命中能力时回退到 A 展示授权或 B.actions / Gate noAction 校验。
const capability = formalPreparationContext.value?.capabilities?.find(
(c) => String(c.action_code || '') === normalizedCode,
);
@@ -3560,7 +3577,7 @@ const submitFormalGateAction = async (
: t('workspace.shippingNotice.processGate.noAction'));
return;
}
} else if (!normalizedCode || !gate || !authorized) {
} else if (!normalizedCode || !gate || !(authorized || aAuthorized)) {
msg.info(t('workspace.shippingNotice.processGate.noAction'));
return;
}