feat(工作台): 细化计划进展工时证据

关键改动:

- 支持需求覆盖和调研方向开始工作记录

- 日报按计划记录开始时间和进度下次开始时间计算证据

- 更新版本编辑校验、项目展示和 workflow 说明

Co-Authored-By: Codex GPT-5 <codex@openai.com>
This commit is contained in:
Script Generator
2026-07-01 11:02:38 +08:00
parent e5ce2d221e
commit 8947aeaac7
18 changed files with 1125 additions and 94 deletions

View File

@@ -2,7 +2,7 @@ import type { Bug, BugStatus } from './bug';
import type { DevTask, DevTaskStatus } from './dev-task';
import type { TestCase, TestCaseStatus } from './test-case';
import { REQUIREMENT_COVERAGE_LABEL, type VersionPlan, type VersionPlanLog } from './version-plan';
import type { WorkActivityDraft } from './work-activity';
import type { WorkActivityDraft, WorkActivitySourceType } from './work-activity';
const PLAN_TYPE_LABEL: Record<VersionPlan['type'], string> = {
research: '调研',
@@ -69,6 +69,7 @@ export function makeVersionPlanRequirementProgressActivity(plan: VersionPlan, lo
coverageStatus: log.coverageStatus,
completedContent: log.completedContent,
remainingContent: log.remainingContent,
workStartedAt: log.workStartedAt,
},
};
}
@@ -95,6 +96,50 @@ export function makeVersionPlanResearchDirectionProgressActivity(plan: VersionPl
coverageStatus: log.coverageStatus,
completedContent: log.completedContent,
remainingContent: log.remainingContent,
workStartedAt: log.workStartedAt,
},
};
}
export interface ProgressNoteActivityInput {
actorId: string;
sourceType: WorkActivitySourceType;
sourceId: string;
title: string;
note: string;
nextStartAt: string;
blocker?: string;
helperId?: string;
delayRisk?: string;
}
export function makeProgressNoteActivity(data: ProgressNoteActivityInput): WorkActivityDraft {
const note = data.note.trim();
const blocker = data.blocker?.trim() || undefined;
const helperId = data.helperId?.trim() || undefined;
const delayRisk = data.delayRisk?.trim() || undefined;
const nextStartAt = data.nextStartAt.trim();
const details = [
note,
blocker ? `阻塞:${blocker}` : '',
helperId ? `需协助:${helperId}` : '',
delayRisk ? `延期风险:${delayRisk}` : '',
].filter(Boolean);
return {
actorId: data.actorId,
sourceType: data.sourceType,
sourceId: data.sourceId,
action: 'progress_note_added',
category: blocker || delayRisk ? 'risk' : 'note',
title: data.title,
summary: `补充进展:${details.join('')}`,
metadata: {
note,
blocker,
helperId,
delayRisk,
nextStartAt: nextStartAt || undefined,
},
};
}