Files
digital-me-history/digital-me-backend/scripts/probe-newfields.mjs
T
admin 0593ff7e62
nginx serve /uploads direct (audio speed) / patch-nginx (push) Failing after 1m34s
数字我 Digital Me:全量入库(大文件走 Git LFS)
2026-10-10 16:24:43 +08:00

33 lines
2.5 KiB
JavaScript

// ★★★ 自查:【这一刀新加的每一个字段/每一个分支,本身是不是又一个空操作?】
// ⚠ 本文件的铁律逐字:「不制造第二个」。而第八刀在「让它出声」那一刀里【自己造了一个】(byZelu)。
// ⇒ 所以这一刀的新字段必须自己先过一遍 census:【每一个取值都要真的跑到】。
import { DYNASTIES, computeRank, computeAxes, AXIS_IDS } from '../src/dynasties.js';
import { chushenOf } from '../src/chushen.js';
import { SUB_REGISTRY } from '../src/talents.js';
const SUBS = SUB_REGISTRY.map((s) => s.id);
const WANGS = [0, 29, 30, 54, 55, 74, 75, 100];
const m = new Map();
for (let b = 0; b < (1 << 16); b++) { const s = []; for (let i = 0; i < 16; i++) if (b & (1 << i)) s.push(SUBS[i]);
const a = computeAxes(s); const k = AXIS_IDS.map((x) => a[x]).join(','); m.set(k, (m.get(k) || 0) + 1); }
const T = [...m].map(([k, w]) => ({ axes: Object.fromEntries(k.split(',').map((v, i) => [AXIS_IDS[i], Number(v)])), w }));
const CFG = {}; for (const d of DYNASTIES) { const x = chushenOf(d.id); CFG[d.id] = x ? [null, ...x.values.map((v) => v.id)] : [null]; }
const N = (n) => n.toLocaleString();
const hit = { by_count: 0, by_gap: 0, by_idx: 0, sameAxis_true: 0, sameAxis_false: 0, mixed_true: 0, mixed_false: 0, kind_scale: 0, kind_codename: 0, rivals1: 0, rivals2plus: 0, gapLine: 0 };
const byDyn = {};
for (const d of DYNASTIES) for (const cs of CFG[d.id]) for (const t of T) for (const wang of WANGS) {
const r = computeRank({ axes: t.axes, wang, chushen: cs }, d.id);
if (r.channel || !r.nearest) continue;
hit['by_' + r.nearestBy] += t.w;
if (r.nearestBy !== 'gap') continue;
const g = r.nearestGap;
hit[g.sameAxis ? 'sameAxis_true' : 'sameAxis_false'] += t.w;
hit[g.mixedKind ? 'mixed_true' : 'mixed_false'] += t.w;
for (const s of [g.mine, ...g.rivals]) hit['kind_' + s.kind] += t.w;
hit[g.rivals.length === 1 ? 'rivals1' : 'rivals2plus'] += t.w;
if (r.reasons.some((x) => /最接近的那条是怎么挑出来的/.test(x))) hit.gapLine += t.w;
if (g.sameAxis) { const k = `${d.id}|${cs}`; byDyn[k] = (byDyn[k] || 0) + t.w; }
}
console.log('\n══ 这一刀新加的每一个取值,跑到了几格?【0 = 我造了一个新的空操作】══\n');
for (const [k, v] of Object.entries(hit)) console.log(` ${k.padEnd(18)} ${N(v).padStart(12)} ${v === 0 ? ' ★★★★ 死!这是我自己造的空操作' : ''}`);
console.log('\n sameAxis=true 落在:', Object.keys(byDyn).length ? JSON.stringify(byDyn) : '【没有一格】');