forked from ChaiHao/BPOS-MVP
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
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
/**
|
|
* module: report 的外部所需(编码规范 §10.1)。
|
|
* 汇报**不自己记账**:事实全部来自 memory(任务日志)与 task(终态 / 预算 / 纠正信号)。
|
|
*/
|
|
import type { StaffId } from '@contracts';
|
|
import type { Report } from './contract.ts';
|
|
import type { LogFact, TaskFact } from './internal/domain/aggregate.ts';
|
|
|
|
export type ReportStore = {
|
|
list(staffId: StaffId, limit: number): Promise<Report[]>;
|
|
get(reportId: string): Promise<Report | undefined>;
|
|
findOpen(staffId: StaffId, period: string, windowFrom: string): Promise<Report | undefined>;
|
|
save(report: Report): Promise<void>;
|
|
};
|
|
|
|
/** 事实源 —— app 注入 `memory`(L2)与 `task`(L6);report 在 L8,只读不写 */
|
|
export type FactSource = {
|
|
/** 某人(或全员)在窗口内的归侧日志行 */
|
|
logsOf(staffId: StaffId | undefined, from: string, to: string): Promise<LogFact[]>;
|
|
tasksOf(staffId: StaffId | undefined): Promise<TaskFact[]>;
|
|
};
|
|
|
|
export type ReportDeps = {
|
|
readonly store: ReportStore;
|
|
readonly facts: FactSource;
|
|
readonly ids: { next(): string };
|
|
readonly clock: { now(): Date };
|
|
};
|