Archived
手改是**兜 AI 的错**的那一手 —— 这一轮把它从「摆在那儿但落不了地」做成真的: 件上就地改 · 保存**按地址收**,不看当下那张卡:载荷从前借道工单的 `blocks[i]` 取列名, 于是熔断卡(没有 blocks)在屏上时,人补的那一格一个字都送不出去 —— 而他要补的恰恰是把这一单卡住的那个必填格。授权面改由活动清单的台账声明把关。 · **能增删行**:错不止「这一格填错了」,还有「这一行不该在」与「漏了一行」。 删挂记号不当场抹掉(看得见、可后悔),且**删要说出来**(`drops`)—— 「没回传就是删了」会把一次不完整的回传变成一次删表。 · **必填没填按不下提交**:与放行门 L1 同一个数同一套算法;闸上摆出差在哪一行哪一格。 · 只写真改了的那几行 —— 改一格却留「修订 4 行」的痕,那句话是假的。 判据与门 · 裁量判据带谓词时**谓词说了算**:「选填缺口已补齐」基座数得出来, 人填好的目标价它照样判「客户未提供」的毛病由此消掉。 · 验收卡判据**读时现算** —— 人在成果件上补一格,判据跟着变。 · 放行门认「**办完了没有**」不认「有人写过」:从前写个 `false` 就把门推开, 于是一单没打标就进了放行门。三个数全由基座现数。 · 拒回把「活没干完」说成「数或行对不上」的毛病:判据点名的表一行都没写时直说那一步没办。 **指向两扇打不开的门,比不指还糟。** 界面不撒谎 · 日志只有三色:负责人绿 · 智能体蓝 · 系统灰(归侧五种是度量的分法,不是给人看的)。 · 验收收口答两件事:落了什么(按**交付物**点名,一份成果的几张表并成一行)、 往哪儿去(转出哪一口、带过去哪些字段);一个口都没发就直说到此为止。 · 签完到收尾之间那一段有自己的话「字已签下,正在落地」—— 中间态本来就该说出来,只是要说对。 · 消息不再被内部事件刷屏:只有从通道进来的件才谈得上「无人认领」。 · 建客户公司与联系人**一次确认落两行**;联系人编码自增不问人;卡面摆表的人读名。 A1 三案例端到端全 released:全 A 类直通 12 拍 / 客户点名跳一条 10 拍 / 新客户缺必填 14 拍。 五道门禁全绿(971 passed)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JsTDjoHovERXyy6Wmw1ALp
102 lines
3.3 KiB
TypeScript
102 lines
3.3 KiB
TypeScript
/**
|
|
* module: release —— 对外类型(编码规范 §10.1)。
|
|
*
|
|
* 放行门:草稿态 → 事实态的**唯一通道**。门归系统,启门归人(OS 10)。
|
|
*/
|
|
import type { ActionIntent, StaffId, TaskId } from '@contracts';
|
|
import type {
|
|
CriterionCheck,
|
|
DeliverableCheck,
|
|
LandingOutcome,
|
|
LandingVerdict,
|
|
PrecheckFinding,
|
|
PrecheckItem,
|
|
PrecheckReport,
|
|
} from './internal/domain/precheck.ts';
|
|
|
|
export type {
|
|
ActionIntent,
|
|
CriterionCheck,
|
|
DeliverableCheck,
|
|
LandingOutcome,
|
|
LandingVerdict,
|
|
PrecheckFinding,
|
|
PrecheckItem,
|
|
PrecheckReport,
|
|
};
|
|
|
|
export class PrecheckFailedError extends Error {
|
|
constructor(readonly report: PrecheckReport) {
|
|
super(`落地预检未过,不发放行卡:${report.findings.map((f) => f.message).join('; ')}`);
|
|
this.name = 'PrecheckFailedError';
|
|
}
|
|
}
|
|
|
|
export class DeliverablesMissingError extends Error {
|
|
constructor(readonly missing: readonly DeliverableCheck[]) {
|
|
super(`必交付物缺一不得提交放行:${missing.map((d) => d.label).join('、')}`);
|
|
this.name = 'DeliverablesMissingError';
|
|
}
|
|
}
|
|
|
|
export type SubmitForReleaseInput = {
|
|
readonly taskId: TaskId;
|
|
readonly ownerId: StaffId;
|
|
readonly humanCallCap: number;
|
|
readonly deliverableId: string;
|
|
readonly title: string;
|
|
readonly basis: ReadonlyArray<{ k: string; v: string }>;
|
|
readonly deliverables: readonly DeliverableCheck[];
|
|
readonly criteria: readonly CriterionCheck[];
|
|
/** 报告可修订:AI 拟值已填的表单字段 */
|
|
readonly fields?: ReadonlyArray<Record<string, unknown>>;
|
|
/**
|
|
* 验收页的正文块 —— 与执行工单同一套件,可含**绑台账的可编辑表**。
|
|
* 验收是最重的一道门:人得能在成果本身上改,不只是改几个整单级字段。
|
|
*/
|
|
readonly blocks?: ReadonlyArray<Record<string, unknown>>;
|
|
};
|
|
|
|
export type SubmitOutcome = {
|
|
readonly report: PrecheckReport;
|
|
/** 预检全过才发卡;这里是发出的验收工单 ID */
|
|
readonly workOrderId: string;
|
|
};
|
|
|
|
export type LandInput = {
|
|
readonly taskId: TaskId;
|
|
readonly ownerId: StaffId;
|
|
readonly humanCallCap: number;
|
|
readonly selectedPorts: Readonly<Record<string, string>>;
|
|
};
|
|
|
|
export type LandOutcome = {
|
|
readonly verdict: LandingVerdict;
|
|
/** 落地收敛后才发射的输出口 */
|
|
readonly emittedPorts: readonly string[];
|
|
readonly ledgerRowsMerged: number;
|
|
/** 已落地的事实 —— 输出口发射的载荷取自这里 */
|
|
readonly merged: ReadonlyArray<{
|
|
readonly domain: string;
|
|
readonly object: string;
|
|
readonly key: Record<string, unknown>;
|
|
readonly values: Record<string, unknown>;
|
|
}>;
|
|
/** 落地受阻时发出的落地失败卡 */
|
|
readonly failureWorkOrderId?: string;
|
|
};
|
|
|
|
export type ReleaseService = {
|
|
/** 登记写类动作意向(入参冻结,存入草稿态) */
|
|
registerIntent(taskId: TaskId, intent: Omit<ActionIntent, 'taskId' | 'state'>): Promise<ActionIntent>;
|
|
listIntents(taskId: TaskId): Promise<ActionIntent[]>;
|
|
|
|
/** 预检 → 全过才发验收工单;不过即抛 `PrecheckFailedError`,打回环内修正 */
|
|
submitForRelease(input: SubmitForReleaseInput): Promise<SubmitOutcome>;
|
|
/** 只跑预检不发卡 —— 环内随时可看「还差什么」 */
|
|
precheck(taskId: TaskId): Promise<PrecheckReport>;
|
|
|
|
/** 放行通过即刻落地:草稿合并 + 动作执行(附幂等键)→ 收敛才发射输出口 */
|
|
land(input: LandInput): Promise<LandOutcome>;
|
|
};
|