// 分量(职称/获奖/职务) 单测 —— 2026-07-21「权重全面下调」重写。 // 新设计:credentials【不再折进六轴】(那是叠满83的根),改成独立「分量」维,由 office5d 克制折算(中等不值钱)。 // 守:①不碰六轴/王/劳、独立暴露 ②填得越硬官越高,但【中等不抬】。 import test from 'node:test'; import assert from 'node:assert/strict'; import { buildProfile } from '../src/services/shishu.js'; import { computeOffice5D } from '../src/office5d.js'; test('①credentials 不再抬六轴(轴=纯擅长/性格),作为独立分量维暴露;绝不碰王/劳', async () => { const bare = { _id: 'a', professionLei: 'wen', talents: { sub_talents: [] } }; const cred = { _id: 'b', professionLei: 'wen', talents: { sub_talents: [] }, credentials: { zhicheng: 3, jiangxiang: 3, zhiwu: 0 } }; const pb = await buildProfile(bare); const pc = await buildProfile(cred); assert.equal(pb.axes.wen, 40, '没天赋 → wen 基线 40'); assert.equal(pc.axes.wen, 40, '★ credentials 不再抬六轴(轴恒基线,不叠 83)'); assert.deepEqual(pc.credentials, { zhicheng: 3, jiangxiang: 3, zhiwu: 0 }, '★ credentials 独立暴露给 office5d'); assert.equal(pc.wang, pb.wang, '★ 分量绝不碰王'); assert.equal(pc.lao, pb.lao, '★ 分量绝不碰劳'); }); test('②分量填得越硬官越高,但【中等不值钱】(office5d 克制折算)', async () => { const mk = (cred) => buildProfile({ _id: 'x', profession: '知识博主', professionLei: 'wen', talents: { sub_talents: [] }, credentials: cred }); const t = (p) => computeOffice5D(p, 'tang').rank.tier; const bare = await mk(undefined); const mid = await mk({ zhicheng: 1, jiangxiang: 2, zhiwu: 0 }); // 中级+省级=3 const high = await mk({ zhicheng: 3, jiangxiang: 3, zhiwu: 3 }); // 全高=9 assert.equal(t(mid), t(bare), '★★ 分量中等 → 官职不抬(老板重点:中等不值钱)'); assert.ok(t(high) > t(bare), '分量全高 → 官职抬'); });