基线:鉴权会话+工作组+工作台三区修复+编排工作区+产品设计文档
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
@@ -16,20 +16,47 @@ export type ResolveContext = {
|
||||
readonly candidates: readonly Candidate[];
|
||||
/** 来源跟随:同一工作流内该岗位已解析出的人 */
|
||||
readonly alreadyResolved?: string | undefined;
|
||||
/**
|
||||
* 工作组绑定(ADR-011):该岗位绑定到的人,**调用方已确认其在岗**。
|
||||
*
|
||||
* 为什么不在这里核:`candidates` 是**该岗位**的在岗人员,
|
||||
* 而工作组的意义恰恰是跨岗位指派 —— 拿岗位候选集去核绑定,绑定永远核不过。
|
||||
* 在岗与否是组织事实,归调用方向 org 问;域侧只认已校验的结果。
|
||||
*/
|
||||
readonly bound?: string | undefined;
|
||||
};
|
||||
|
||||
export type Resolution =
|
||||
| { readonly kind: 'resolved'; readonly staffId: string; readonly by: OwnerSpec['strategy']; readonly rationale: string }
|
||||
| {
|
||||
readonly kind: 'resolved';
|
||||
readonly staffId: string;
|
||||
/** 'work-group' 是**绑定**,不是第五种策略 —— 留痕里一眼可辨 */
|
||||
readonly by: OwnerSpec['strategy'] | 'work-group';
|
||||
readonly rationale: string;
|
||||
}
|
||||
/** 岗位空缺 —— 按节点的失败走向处置,或转治理台待指派 */
|
||||
| { readonly kind: 'vacant'; readonly position: string };
|
||||
|
||||
/**
|
||||
* 「编排声明岗位,起单时**确定性解析**。策略封闭四选;
|
||||
* 默认:岗位唯一人;岗上多人时按轮值。解析发生在节点起单时,**结果与依据留痕**。」
|
||||
*
|
||||
* **绑定先于策略**(ADR-011):四策略回答的是「这个岗位该派给谁」,
|
||||
* 工作组已经给出了答案,策略于是无从发问。绑定的人若已离岗则不硬用,退回策略 ——
|
||||
* 绑定不该把单派给一个不在岗的人。
|
||||
*/
|
||||
export function resolveOwner(spec: OwnerSpec, context: ResolveContext): Resolution {
|
||||
const active = context.candidates;
|
||||
|
||||
if (context.bound !== undefined) {
|
||||
return {
|
||||
kind: 'resolved',
|
||||
staffId: context.bound,
|
||||
by: 'work-group',
|
||||
rationale: `工作组绑定:${spec.position}`,
|
||||
};
|
||||
}
|
||||
|
||||
switch (spec.strategy) {
|
||||
case 'assigned': {
|
||||
const staffId = spec.staffId;
|
||||
|
||||
Reference in New Issue
Block a user