Archived
数据工单由剧本声明、引擎决定 —— 不靠模型抄卡骨架(W05 1.4.3)
用户:「右边 AI 聊天框里这个数据工单怎么又显示的执行工单?」查实:说明书骨架里 `"variant":"data"` 与 `gateLedgers` 并排写着,模型抄卡时 gateLedgers 抄到了、variant 丢了 (看着像元数据)。靠模型抄一个标记本来就靠不住。 改成与 `view` 同一条道理:这一步派的是什么单,写剧本时就定死 —— - 契约 `PlanStep.cardVariant: 'data'`;活动在 S0d_p08_master / S0d_p10_document 两步上声明; - `cards.issue` 入参多一项可选 `itemId`(turn-runner 从 human 动作带下来;引擎自发的验收/兜底卡没有项); - 组装层按 itemId 查剧本,`stepVariant ?? 卡上写的` —— 模型写不写都一样。 在跑那一单的卡已就地补上 variant(payload),刷新即见「数据工单」。 2102 测 / typecheck / lint / depcruise 绿;api-report 已刷;两处 CONTRACT.md 同步。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FJcX8A6TWp4GRs41TYryEh
This commit is contained in:
@@ -1362,6 +1362,8 @@ export function wireEngines(deps: EngineWiringDeps): EngineWiring {
|
||||
ownerId: StaffId;
|
||||
humanCallCap: number;
|
||||
workOrder: 'execution' | 'acceptance';
|
||||
/** 这张卡挂在哪个计划项上 —— 引擎按它查剧本声明(如 `cardVariant`),不靠模型抄卡骨架;引擎自己发的卡(验收/兜底)没有项 */
|
||||
itemId?: string | undefined;
|
||||
card: Record<string, unknown>;
|
||||
}) {
|
||||
const context = { taskId: input.taskId, ownerId: input.ownerId, humanCallCap: input.humanCallCap };
|
||||
@@ -1730,8 +1732,19 @@ export function wireEngines(deps: EngineWiringDeps): EngineWiring {
|
||||
const gateLedgers = Array.isArray(input.card['gateLedgers'])
|
||||
? input.card['gateLedgers'].map((x) => String(x).trim()).filter((x) => /^[a-z0-9_]+\.[a-z0-9_]+$/i.test(x))
|
||||
: [];
|
||||
/* 数据工单 = 执行工单的变体(契约 `variant`):活动在卡上写 `"variant":"data"`,对话区据此换一副面孔 */
|
||||
const variant = input.card['variant'] === 'data' ? ('data' as const) : undefined;
|
||||
/*
|
||||
* 数据工单 = 执行工单的变体(契约 `variant`)—— **由剧本声明、这里决定**(`PlanStep.cardVariant`),
|
||||
* 不靠模型抄卡骨架:说明书里写着 `"variant":"data"`,模型抄卡时把它丢了(2026-08-27 实测,
|
||||
* 同一张卡 gateLedgers 抄到了、variant 没有),对话区于是照旧摆「执行工单」。
|
||||
* 与 `view` 同一条道理:这一步派的是什么单,写剧本时就定死,模型写不写都一样。卡上写了只当提示。
|
||||
*/
|
||||
const stepVariant =
|
||||
input.itemId === undefined
|
||||
? undefined
|
||||
: (await deps.registry.manifestOf((await taskContext.of(input.taskId)).activityId)).assets.businessModel.steps?.find(
|
||||
(s) => s.item === input.itemId,
|
||||
)?.cardVariant;
|
||||
const variant = stepVariant ?? (input.card['variant'] === 'data' ? ('data' as const) : undefined);
|
||||
const issued = await deps.humanTool.issueExecution(context, {
|
||||
title,
|
||||
basis: basis.length > 0 ? basis : [{ k: '来源', v: '案例模型当下局面' }],
|
||||
|
||||
@@ -127,3 +127,8 @@
|
||||
与「写的授权面是台账声明」「调工具的授权面是白名单」同一条 ——
|
||||
立了没人叫醒的监听不是等待,是失联(实测:模型在依赖断点上临场立 data 监听,
|
||||
而那个活动一个监听都没声明,单子永久挂在 `awaiting-event`)
|
||||
|
||||
近变(2026-08-27):`cards.issue` 的入参多一项可选 `itemId`(这张卡挂在哪个计划项上)—— 组装层据此查剧本声明
|
||||
(`PlanStep.cardVariant`:这一步派的是数据工单),**不靠模型抄卡骨架**(实测它会把 `variant` 抄丢)。
|
||||
引擎自己发的卡(验收 / 兜底)没有项,不传。
|
||||
|
||||
|
||||
@@ -1126,6 +1126,7 @@ export function createTurnRunner(deps: TurnRunnerDeps): LoopEngineService {
|
||||
taskId,
|
||||
ownerId: context.ownerId,
|
||||
humanCallCap: context.humanCallCap,
|
||||
itemId: action.itemId,
|
||||
workOrder: action.workOrder,
|
||||
card: action.card,
|
||||
});
|
||||
|
||||
@@ -169,6 +169,8 @@ export type CardGateway = {
|
||||
ownerId: StaffId;
|
||||
humanCallCap: number;
|
||||
workOrder: 'execution' | 'acceptance';
|
||||
/** 这张卡挂在哪个计划项上 —— 引擎按它查剧本声明(如 `cardVariant`),不靠模型抄卡骨架;引擎自己发的卡(验收/兜底)没有项 */
|
||||
itemId?: string | undefined;
|
||||
card: Record<string, unknown>;
|
||||
}): Promise<{ id: string }>;
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user