Archived
harness 与工作台同日修:数据工单确认即入库 · 叫了人不再自动推进(两道结构闸)· 审核卡 = 终局验收卡结构 · 验收清单人点达标 · 迟到守卫不丢放行裁决 · 画面跟着这一拍发出去的卡走 · 成果详情只翻页 · 占位居中 · 进度条
human-tool / ledger / loop-engine / release / task / interaction 六模块与 app 层(desk 路由、engines、consumers、 data-order-landing、case-stamp、reset-runs、seed-activities、容器与 server 装配),web 的 desk-task (ViewRegion / chat-bubbles / review-face)与 app.css、ui-kit 图标;契约 card / manifest; 迁移 0034_task_seq 与迁移日志;api-report 快照;CLAUDE.md 快照、debt、活动开发规范、HTML 报告规范同步。 逐条口径见 CLAUDE.md 快照(2026-08-27 下午至晚)。另一会话做的,一直留在工作树没入库;与同批另两条提交互相依赖。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0167qWjeyBwvfdGovd7FWbCu
This commit is contained in:
@@ -17,6 +17,7 @@ import { activityManifestSchema } from '@contracts';
|
||||
import type { Container } from './container.ts';
|
||||
import { MASTER_DOMAINS, MASTER_OBJECTS, MASTER_SAMPLE_ROWS } from './seed-mvp-data.ts';
|
||||
import { W05_TOOLS, W05_TOOL_SAMPLE } from './tools-w05.ts';
|
||||
import { createActivityOpsStore } from './activity-ops/store.ts';
|
||||
|
||||
/** 已开发完成、要随播种装上的真活动包(目录名 = 包目录,不是 activityId) */
|
||||
/*
|
||||
@@ -34,6 +35,33 @@ import { W05_TOOLS, W05_TOOL_SAMPLE } from './tools-w05.ts';
|
||||
*/
|
||||
const REAL_PACKAGES = ['crm-relationship-coverage', 'brand-content-toolkit', 'part-substitution-assessment'] as const;
|
||||
|
||||
/**
|
||||
* 运营侧活动档案(2026-08-27 用户定:负责人 / 说明 / 图标 / 色相另建 `sys.activity_profile`,活动包不载这些)。
|
||||
* 按包目录名登记;负责人按**岗位**挑第一个在职的人 —— 员工 id 是 Keycloak 的 sub、首登即建,
|
||||
* seed 拿不到真 sub,只能按岗位现查;**查不到就留空并说一声**,不编一个(界面不撒谎)。
|
||||
* 重复播种是覆盖不是堆叠;运营面的改口另起(见 debt)。
|
||||
*/
|
||||
const ACTIVITY_PROFILES: Readonly<Record<(typeof REAL_PACKAGES)[number], { description: string; ico: string; hue: string; ownerPosition: string }>> = {
|
||||
'crm-relationship-coverage': {
|
||||
description: '按客户线月度 / 事件驱动地评估关系覆盖度,识别关键人缺口,编排经营计划并回收执行回执。',
|
||||
ico: 'target',
|
||||
hue: 'blue',
|
||||
ownerPosition: 'BD',
|
||||
},
|
||||
'brand-content-toolkit': {
|
||||
description: '受理品牌形象与销售工具包的内容需求,产出初稿交审核,发布后入品牌内容库。',
|
||||
ico: 'palette',
|
||||
hue: 'amber',
|
||||
ownerPosition: 'OP',
|
||||
},
|
||||
'part-substitution-assessment': {
|
||||
description: '对候选料号逐项比较参数、判四态、定推荐等级,审核后落 P-11 替代关系并回写 P-01。',
|
||||
ico: 'git-compare',
|
||||
hue: 'teal',
|
||||
ownerPosition: 'FAE',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 活动包根目录。
|
||||
*
|
||||
@@ -122,6 +150,18 @@ export async function installRealActivities(container: Container): Promise<void>
|
||||
*/
|
||||
const declared = parsed.data.declarations.tools.map((t) => t.name);
|
||||
await container.toolbox.setAllowlist(parsed.data.identity.activityId, declared);
|
||||
await seedProfile(container, dir, parsed.data.identity.activityId, log);
|
||||
/*
|
||||
* **同版重装不许说「已装」**(2026-08-27,一天里静默丢了两次):两审过了、版本已在库,
|
||||
* 库里一个字没动 —— 这一句话就是人判断「改动上没上」的唯一依据,说错就是误导。
|
||||
*/
|
||||
if (!verdict.stored) {
|
||||
log(
|
||||
` 活动包已是这一版,未重装:${parsed.data.identity.name}(${parsed.data.identity.activityId}@${version})` +
|
||||
' —— 改了内容要升 packageVersion 再装(同版重装是 no-op,库里仍是先前那份)',
|
||||
);
|
||||
continue;
|
||||
}
|
||||
log(
|
||||
` 活动包已装:${parsed.data.identity.name}(${parsed.data.identity.activityId}@${version})` +
|
||||
(declared.length === 0 ? '' : ` · 已授权工具 ${declared.length} 件`) +
|
||||
@@ -155,3 +195,22 @@ export async function installRealActivities(container: Container): Promise<void>
|
||||
}
|
||||
log(` 样例主数据已就位:${MASTER_SAMPLE_ROWS.length} 行(客户 / 项目 / 联系人 / 料号)`);
|
||||
}
|
||||
|
||||
/** 运营侧档案落库:说明 / 图标 / 色相照表,负责人按岗位现查(取不到留空,如实报) */
|
||||
async function seedProfile(container: Container, dir: (typeof REAL_PACKAGES)[number], activityId: string, log: (line: string) => void): Promise<void> {
|
||||
const spec = ACTIVITY_PROFILES[dir];
|
||||
const candidates = await container.org.staffOfPosition(spec.ownerPosition).catch(() => []);
|
||||
const owner = candidates[0];
|
||||
await createActivityOpsStore(container.db).upsertProfile({
|
||||
activityId,
|
||||
ownerId: owner === undefined ? null : owner.id,
|
||||
description: spec.description,
|
||||
ico: spec.ico,
|
||||
hue: spec.hue,
|
||||
});
|
||||
log(
|
||||
owner === undefined
|
||||
? ` 活动档案已记(${activityId}):负责人留空 —— 岗位 ${spec.ownerPosition} 当前没有在职的人`
|
||||
: ` 活动档案已记(${activityId}):负责人 ${owner.name}(岗位 ${spec.ownerPosition})`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user