Archived
M6(3/n): minute 与 report —— L8 两个模块补齐
minute(纪要):工作台五要素里唯一的主动动作。 纪要本身不产生责任,唯一通往责任的路是决议经登记触发起单 —— 登记人即来源。 正文可续、决议只增;同一决议不重复起单(起单一刻已有一条带来源的流在跑)。 report(汇报):日/周/月/年对任务日志的聚合投影,零手工汇报。 未提交的草案每次取回都重算 —— 汇报是投影不是账本,提交那刻才固定为事实快照。 度量八指标落在这里(§4 注:度量是只读投影,不设独立模块): 自主率 / 纠正率 / 有效自主率 / 打扰率 / 断点率 / DMN 覆盖率 / 单位成本 / 终态分布。 口径全部挂归侧标签与事件流,零埋点;单位成本的分母只认放行通过。 周窗口以周一为首日,按 UTC 切分(单组织单时区)。 FactSource 只读 memory 与 task,一行都不另记 —— 五要素同源。 gates: tsc / eslint / depcruise(305 模块)/ api-report / 377 测试 全绿 日报已在真实系统上由 A1 任务日志聚合出来,含治理干预两行 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* module: minute —— 对外类型(编码规范 §10.1;语义出处 OS 2.1 / 3.1)。
|
||||
*
|
||||
* 纪要是工作台五要素里**唯一的主动动作**:团队主动维护上传的沉淀(会议纪要等)。
|
||||
* 它本身不产生责任;责任的产生只有一条路——**决议经登记触发转为工作流的启动**,
|
||||
* 「登记人即来源」。所以本模块的写面很薄,重头在「决议 → 登记起单」这一跳。
|
||||
*/
|
||||
import type { StaffId } from '@contracts';
|
||||
import type { Minute, MinuteResolution, ResolutionState } from './internal/domain/minute.ts';
|
||||
export type { Minute, MinuteResolution, ResolutionState };
|
||||
export declare class MinuteNotFoundError extends Error {
|
||||
readonly minuteId: string;
|
||||
constructor(minuteId: string);
|
||||
}
|
||||
export declare class ResolutionAlreadyRegisteredError extends Error {
|
||||
readonly resolutionId: string;
|
||||
readonly workflowId: string;
|
||||
constructor(resolutionId: string, workflowId: string);
|
||||
}
|
||||
export type CreateMinuteInput = {
|
||||
readonly title: string;
|
||||
readonly body: string;
|
||||
readonly authorId: StaffId;
|
||||
/** 与会/相关人 —— 仅作沉淀标注,不产生责任 */
|
||||
readonly participants?: readonly StaffId[];
|
||||
readonly occurredOn: string;
|
||||
readonly resolutions?: ReadonlyArray<{
|
||||
text: string;
|
||||
ownerId?: StaffId | undefined;
|
||||
}>;
|
||||
};
|
||||
export type RegisterInput = {
|
||||
readonly resolutionId: string;
|
||||
/** 登记人 —— 凡单必有来源,登记触发的来源就是他 */
|
||||
readonly byId: StaffId;
|
||||
readonly processPackageId: string;
|
||||
/** 按调用接口 schema 填写的输入(表单由 schema 自动渲染) */
|
||||
readonly data: Record<string, unknown>;
|
||||
};
|
||||
export type MinuteService = {
|
||||
list(limit?: number): Promise<Minute[]>;
|
||||
get(minuteId: string): Promise<Minute>;
|
||||
create(input: CreateMinuteInput): Promise<Minute>;
|
||||
/** 只增不改的编辑:正文可续,决议只增 —— 纪要是沉淀,不是可覆写的文档 */
|
||||
appendResolution(minuteId: string, text: string, ownerId?: StaffId): Promise<Minute>;
|
||||
/** 决议 → 登记起单:登记人即来源;同一决议只起一次单 */
|
||||
register(input: RegisterInput): Promise<{
|
||||
workflowId: string;
|
||||
resolutionId: string;
|
||||
}>;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
/** module: minute —— 唯一出口(编码规范 §10.1):纯再导出,不含实现。 */
|
||||
export type { CreateMinuteInput, Minute, MinuteResolution, MinuteService, RegisterInput, ResolutionState, } from './contract.ts';
|
||||
export { MinuteNotFoundError, ResolutionAlreadyRegisteredError } from './contract.ts';
|
||||
export { createMinuteService } from './internal/usecase/minute-service.ts';
|
||||
export { createMinuteStore } from './internal/adapter/minute-store.ts';
|
||||
export { minutes, minuteResolutions } from './internal/adapter/minute-schema.ts';
|
||||
export { newMinute, addResolution, markRegistered } from './internal/domain/minute.ts';
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* module: minute 的外部所需(编码规范 §10.1)。
|
||||
* 「port 声明本模块需要外界提供什么」—— 由 app 层注入,模块自己不认实现。
|
||||
*/
|
||||
import type { StaffId } from '@contracts';
|
||||
import type { Minute } from './internal/domain/minute.ts';
|
||||
export type MinuteStore = {
|
||||
list(limit: number): Promise<Minute[]>;
|
||||
get(minuteId: string): Promise<Minute | undefined>;
|
||||
save(minute: Minute): Promise<void>;
|
||||
};
|
||||
/** 登记起单 —— app 注入 `process`(L7):经调用接口调起流程包,不碰流程内部 */
|
||||
export type RegistrationGateway = {
|
||||
start(input: {
|
||||
processPackageId: string;
|
||||
subject: string;
|
||||
data: Record<string, unknown>;
|
||||
/** 来源:登记人 */
|
||||
byId: StaffId;
|
||||
}): Promise<{
|
||||
workflowId: string;
|
||||
}>;
|
||||
};
|
||||
export type MinuteDeps = {
|
||||
readonly store: MinuteStore;
|
||||
readonly registration: RegistrationGateway;
|
||||
readonly ids: {
|
||||
next(): string;
|
||||
};
|
||||
readonly clock: {
|
||||
now(): Date;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user