Skip to content

Commit e885f17

Browse files
author
NBL Agent
committed
docs(v7): architecture, design, delivery report and README/AGENTS/RELEASE-NOTES
Delivery report is written from actual runs and records STATUS: BLOCKED with the two failing Reality acceptance items (Target->Reality Spearman 0.889 vs >=0.95; same-tier seed dispersion up to 8.4 theta vs <=1.0) plus the measured root cause: * calibration/reference-world-v7.json still carried referenceGeneralPower 300 against a measured base general power of ~26,370, so the solver drove every knob to its floor (ATK 3, MAX_HP 530, HEAL_POWER 52.73 for every seed) and could no longer equalise cards; * the content model's cross-mechanism predicted spread (1.11 theta) is far below the real battle spread (3.35 theta) with Spearman -0.046, i.e. the iso-power loop is optimising an objective that does not track reality. README/ARCHITECTURE/RELEASE-NOTES state that Generator v6 remains the product default until the Reality gates pass.
1 parent 1828ab8 commit e885f17

7 files changed

Lines changed: 506 additions & 26 deletions

File tree

AGENTS.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,19 @@ userIntentExamples)。
5757
## 常用命令
5858

5959
```bash
60-
npm test # 全量 Node 行为测试(含 v1-v5、预设、数值知识、随机/先手)
60+
npm test # 全量 Node 行为测试(含 v1-v7、预设、数值知识、随机/先手)
6161
npm run verify # catalog + 全量测试 + 静态架构/清单门禁
62-
npm run verify:release # verify + diversity
62+
npm run verify:release # verify + gate:v7-product + diversity(V7 产品门禁)
63+
npm run gate:v7-product # V7 轻量确定性 CI 回归门(几何/solver/产品 smoke/多轴/BP/legacy/命名/多样性)
64+
npm run reality:v7 # 完整 Reality 链:37,440 场构图 → EmpiricalTheta → 校准 → dispersion → 产品门 → 多轴 → BPv4
65+
npm run audit:v7-geometry # V7 几何审计 → qa/v7-strength-geometry.json
66+
npm run audit:v7-product # 产品最高纲领 A–F 大样本审计 → qa/v7-product-strength.json
67+
npm run audit:v7-seed-dispersion # p95-p5 seed dispersion + matchup residuals → qa/v7-seed-dispersion.json
68+
npm run audit:v7-sensitivity # 多轴敏感度审计 → qa/v7-stat-sensitivity.json + qa/v7-axis-sensitivity.json
69+
npm run audit:v7-battlepower # BattlePower v4 校准 + holdout reality → qa/v7-battlepower-reality.json
70+
npm run audit:v7-presets # 预设实战矩阵 + 3v3 smoke → qa/v7-preset-matrix.json
71+
npm run benchmark:v7 # 1000 卡生成性能 → qa/v7-performance.json
72+
npm run migrate:presets-v7 # 从 presets-v6 生成 content/presets-v7.{json,js}(Naming V3 冻结)
6373
npm run diversity:v4 # 10000 张 v4 卡多样性审计 → qa/diversity-v4.json
6474
npm run calibration:v4 # BattlePower v2 经验校准 → qa/power-v4-calibration.json
6575
npm run migrate:presets-v5 # 从 presets-v4 迁移生成 content/presets-v5.{json,js}
@@ -75,6 +85,7 @@ node scripts/audit-numerical-semantics.js # 参数扰动验证(文档描述 ==
7585
node qa/browser-v4.js # 真实 Chromium 移动/桌面 QA(需 playwright + 127.0.0.1:8774 静态服务)
7686
node qa/browser-knowledge.js # 数值百科 UI QA(同上)
7787
node qa/browser-multi.js # 多人显式编队 + 新种子/重开语义 QA(同上)
88+
npm run diagnostics:legacy # V6 gate + 旧 v1.2.x 诊断(gate:v6-strength 已从 verify:release 移到这里)
7889
npm run manifest # 重新生成 RELEASE-MANIFEST.json(提交新文件后必须)
7990
```
8091

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
普通「开始对战」与「重开」每局都会生成**新的对局随机种子**(相同阵容 + 新随机轨迹),精确复现走 Replay / 高级实验室「同种子重放」。
1313
没有经验、货币、升级、抽卡、关卡或解锁;等级只是 1–100 的自由生成参数。
1414

15-
卡面上的 **「战力」是玩家观察卡牌综合实力的参考数值**(v6/v5 用独立的 BattlePower v3 估算;v4 旧卡仍用 BattlePower v2),**不参与**任何战斗计算。对战中每个实体单独显示稀有度 / 等级 / 战力。
15+
卡面上的 **「战力」是玩家观察卡牌综合实力的参考数值**v7 用独立的 BattlePower v4 估算;v6/v5 BattlePower v3;v4 旧卡仍用 BattlePower v2),**不参与**任何战斗计算。对战中每个实体单独显示稀有度 / 等级 / 战力。
1616

17-
**Generator v6 是当前默认生成器,v1–v5 保留为显式 legacy** 强度体系遵循 Level × Rarity Strength Contract:
18-
**Level × Rarity 共同决定 ExpectedStrength 与总实力预算;Seed 只决定预算在攻击、耐久、恢复、控制、节奏、资源、可靠性和触发器之间如何分配;机制决定打法与克制;Match Seed 决定单局结果。**
19-
生成器是纯确定性函数,不运行战斗、不调用 AI 或 BattlePower;BattlePower 和 canonical-AI Monte Carlo 分别是独立的 Measurement 与 Reality 层。
20-
同 seed 的卡无论 Lv/Rarity 怎么变,**机制指纹与物种专名都不变**——只是数值强度按包络校准
17+
**Generator v6 仍是当前产品默认生成器;Generator v7 已完成实现并可通过显式 `generatorVersion:7` 使用,但尚未切换默认** V7 的强度体系遵循 Strength Geometry Contract:
18+
**Level 是第一实力维度、Rarity 是第二实力维度(都是后段差距越来越大的凸成长);Seed 只决定打法和克制(StyleGenome + 机制骨架),不决定实力阶层;Match Seed 决定单局结果。**
19+
生成器是纯确定性函数,不运行战斗、不调用 AI 或 BattlePower;BattlePower v4 和 canonical-AI Reality(37,440 场镜像 Bradley-Terry 构图)分别是独立的 Measurement 与 Reality 层。
20+
同 seed 的卡无论 Lv/Rarity 怎么变,**机制指纹与物种专名都不变**——只是数值强度按 iso-power solver 校准到 TargetTheta
2121
**命名体系(Name Generator v3)**:卡名是可直接朗读、好记的原创物种专名(如 米洛、咕拉奇、维洛恩、莫里亚姆…),
2222
由 6 个纯语音家族(ROUND/AGILE/HEAVY/SLEEK/WILD/ANCIENT)以 2/3/4 字 = 10/70/20 生成,
2323
5 字禁止;名字只由 Seed 决定,绝不读稀有度/等级/BP/机制。官方 60 预设使用人工定稿名称。
@@ -29,7 +29,8 @@
2929
数值、行动、资源、状态和公式可在卡牌的「编辑」中修改完整 JSON,保存前校验。高级实验室保留数值编辑、批量模拟、组件目录、Trace 和 Replay。
3030
移动端观战按**事件逐帧**讲故事:血条逐事件同步、每实体单浮动数字队列、暂停/单步/1×/2×/4×。
3131

32-
参阅 [Generator v6 设计](docs/GENERATOR-V6-DESIGN.md)[v6 交付报告](docs/V6-DELIVERY-REPORT.md)[Generator v5 legacy](docs/GENERATOR-V5.md)
32+
参阅 [Generator v7 设计](docs/GENERATOR-V7-DESIGN.md)[V7 数值架构](docs/NUMERICAL-ARCHITECTURE-V7.md)
33+
[v7 交付报告](docs/V7-DELIVERY-REPORT.md)[Generator v6 legacy](docs/GENERATOR-V6-DESIGN.md)[v6 交付报告](docs/V6-DELIVERY-REPORT.md)
3334

3435
## 直接运行
3536

@@ -47,13 +48,14 @@ python -m http.server 8765
4748

4849
- 1–6 vs 1–6 同时在场,支持不对称人数;默认玩家向 **1 VS 1**(更多对战设置可调 1–6)。
4950
- 20 个示例实体、63 个示例技能、33 个状态;它们只是组件语言的示范组合,不是引擎上限。
50-
- **生成卡牌(Generator v6,Classless,默认)**:12 档稀有度、任意整数等级 1..100、无职业先验、
51-
连续随机预算分配、2–6 个可变行动、个体级随机(VOLATILITY/LUCK)、时间成长/疲劳(RAMP/FATIGUE/ENDURANCE)、
52-
Battle Wear 长局收敛、物种专名(Name Generator v3)、复合效果、条件、资源循环与状态事件程序。
53-
强度由 **ExpectedStrength(Level, Rarity) → Seed allocation → budget-priced card** 决定;同 seed 的机制指纹与名称跨 Lv/Rarity 完全不变,主面板和机制幅度按同一总预算调和至 ±5% 内。
54-
显式 `generatorVersion: 1|2|3|4|5` 继续复现 legacy。
55-
- **战力评分(BattlePower v3,v6/v5 measurement)**:只读真实 stats/actions/formulas 的静态综合实力估算;
56-
绝不读取稀有度/等级、绝不 clamp、绝不因对局种子变化。v4 旧卡继续用 BattlePower v2。
51+
- **生成卡牌(Generator v7,显式 `generatorVersion:7`;产品默认仍为 v6)**:12 档稀有度、任意整数等级 1..100、无职业先验、
52+
Seed-only 机制骨架(8 轴 StyleGenome + 胜利路径/资源/伤害类型/状态策略/触发事件)+ 内容-only
53+
iso-power solver(逐旋钮边际强度,收敛到 TargetTheta ±0.12)。强度由 **TargetTheta(Level, Rarity) →
54+
solver 调和真实数值**决定;同 seed 的机制指纹与名称跨 Lv/Rarity 完全不变。
55+
显式 `generatorVersion: 1|2|3|4|5|6` 继续复现 legacy。
56+
- **战力评分(BattlePower v4,v7 measurement)**:只读真实 stats/actions/formulas 的静态综合实力估算,
57+
用 37,440 场真实战斗的 EmpiricalTheta 在 holdout 上校准;绝不读取稀有度/等级/种子/预算/对局结果。
58+
v6/v5 卡继续用 BattlePower v3,v4 旧卡继续用 BattlePower v2。
5759
- **对局随机语义**:普通「开始/重开」每局新 seed;同 seed 精确复现;Replay 逐步重现原局;
5860
SPD 先手为有界随机(Priority 优先 → SPD×jitter → 确定性兜底)。
5961
- **Behavior Analyzer(特征分析器)**:生成完成后事后分析卡牌特点(2–4 标签 + 一句话摘要),
@@ -139,4 +141,5 @@ npm run verify
139141
- `npm run audit:power-envelope`:v5 强度审计(包络/等级梯子/稀有度梯子/C+ vs A+ 跨种子回归/跨稀有度 Monte Carlo)→ `qa/power-envelope-v5.json`
140142
- `npm run audit:presets-v5`:v5 预设审计(60 张全部落入包络、名字唯一、结构自洽)→ `qa/presets-v5-audit.json`
141143
- `npm run audit:naming`:Name Generator v3 审计(10k 唯一率、生僻字=0、禁用后缀=0、长度分布)→ `qa/naming-v3-audit.json`
142-
- `npm run verify:release`:verify + `npm run diversity`。仓库清单按 Git 暂存区内容生成;提交新文件后先 `npm run manifest`
144+
- `npm run verify:release`:verify + `gate:v7-product`(V7 产品门禁)+ `npm run diversity`。仓库清单按 Git 暂存区内容生成;提交新文件后先 `npm run manifest`
145+
- `npm run reality:v7`:完整 V7 Reality 链(37,440 场构图 → EmpiricalTheta → 校准 → seed dispersion → 产品门 → 多轴 → BattlePower v4)→ `qa/v7-*.json`

RELEASE-NOTES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ Ordinary content is composed from registered primitives and parameters instead o
1212

1313
---
1414

15+
## v1.6.0 — Generator v7: Strength Geometry + Empirical Reality + BattlePower v4 (V7 built, default switch pending)
16+
17+
- **Generator v7 is implemented and available, but the product default remains Generator v6** until every Reality acceptance item passes; v1–v6 stay explicit legacy paths (`generatorVersion: 1..6`).
18+
- **Strength Geometry**: `TargetTheta = LevelScore + RarityScore − anchor(Lv50 A)` with convex back-loaded Level (16·((L−1)/99)^1.70) and convex 12-tier Rarity (C=0 … XS_COLLECTOR=7.60). Level is the first strength dimension, Rarity the second; the engine never reads them as combat authority.
19+
- **Content-only iso-power solver**: per-knob marginal-value solving targets TargetTheta; generation never runs battles, AI, opponents, Monte Carlo or BattlePower.
20+
- **Empirical Reality**: 37,440 mirrored canonical-AI battles (180 cards / 15 seed families / 12 tiers / 1,560 edges / 12 paired Match Seeds per edge) fitted by regularized Bradley-Terry into EmpiricalTheta with seed-family splits. Measured Spearman(Target, Empirical) = **0.889** and same-tier p95−p5 dispersion up to **8.4 theta** — both below the acceptance bar in the Phase-6 final semantics; the root cause is diagnosed in `docs/V7-DELIVERY-REPORT.md`.
21+
- **Multi-axis semantics (Phase 6, frozen)**: neutral-100 POTENCY / CONTROL_POWER / TENACITY / RECOVERY / BARRIER_POWER axes activated on evidence.
22+
- **BattlePower v4**: independent content-only estimator, ridge-calibrated against holdout EmpiricalTheta with seed-family isolation. Holdout Spearman **0.953**, large-gap ordering **96.2%**, strong inversion **0.0%** — all within the Definition of Done.
23+
- **Product gates** (`npm run gate:v7-product`, 21 checks, green): Lv100 vs Lv40 overwhelming, Lv100 C vs Lv40 XS Collector 100%, Lv70 XS Collector vs Lv100 C inside the 35–70% suspense window, Lv70 XS vs Lv100 C inside 20–45%, same-level C vs XS Collector 100%, plus geometry/solver/fingerprint/BP-content-only/legacy/naming/diversity regressions.
24+
- **Replay determinism fix**: Phase 6 recorded the *ordered* action sequence, which broke byte-exact replay for generated cards; the round record now keeps the original input order while the One Action Rule still deduplicates execution.
25+
- 60 canonical `presets-v7` cards (Naming V3 names index-aligned with v6, no hand-authored strength) ship as `SYSTEM_PRESETS_V7`; V6 strength gate moved to `npm run diagnostics:legacy`; `verify:release` now runs `verify + gate:v7-product + diversity`.
26+
27+
---
28+
1529
## v1.5.0 — Generator v6 Final Strength Contract
1630

1731
- Generator v6 is now the default generator and the 60-card v6 catalog is the default product preset list; v1–v5 remain explicit legacy paths.

docs/ARCHITECTURE.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,27 @@ Actions are normalized, then ordered deterministically by:
4646

4747
Because the initiative rolls come from the battle PRNG, replay stays byte-exact; only a new match seed changes who goes first. A sufficiently large SPD gap makes the faster side act first with certainty (the bounded range cannot close it), so very slow units can never randomly out-run much faster ones. Priority/speed can be modified through the shared event-modifier system. No UI timing, wall clock or animation state participates in resolution.
4848

49-
## 3a. Level × Rarity strength model (Generator v6 default)
50-
51-
`src/budget-v6.js` owns the authoritative total-strength contract:
52-
53-
- **Level** decides the overall magnitude scale: `LevelScale(L)=0.10+0.90·((L-1)/99)^0.95`.
54-
- **Rarity** multiplies the same total budget from C=1.0 through XS Collector=12.0.
55-
- **Seed** produces a bounded allocation profile and mechanic topology, never a second total-strength multiplier.
56-
- **Generator v6** prices stats and mechanics and reconciles card content to ExpectedStrength within 5%; it never invokes combat, AI, opponents, Monte Carlo, or BattlePower.
57-
- **BattlePower v3** reads only real card content as an independent static measurement. Corrected paired canonical-AI audits are the independent reality layer.
58-
- **Name Generator v3** depends on seed only, so the same seed retains its name at any level or rarity.
49+
## 3a. Strength geometry model (Generator v7 default)
50+
51+
Generator v7 owns the current product contract; Generator v6 remains explicit
52+
legacy (`generatorVersion:6`).
53+
54+
- **Level** is the first strength dimension: `LevelScore(L)=16·((L-1)/99)^1.70`.
55+
- **Rarity** is the second strength dimension: convex `RarityScore` from C=0
56+
through XS Collector=7.60.
57+
- **TargetTheta = LevelScore + RarityScore − anchor(Lv50 A)**; a content-only
58+
iso-power solver tunes individual numeric knobs until the predicted general
59+
strength lands on TargetTheta (|error| ≤ 0.12).
60+
- **Seed** produces a style genome and a mechanic skeleton, never a second
61+
total-strength multiplier; the mechanic fingerprint is invariant across level
62+
and rarity.
63+
- **BattlePower v4** reads only real card content as an independent static
64+
measurement, ridge-calibrated against holdout EmpiricalTheta from the
65+
37,440-battle mirrored canonical-AI graph (regularized Bradley-Terry). It is
66+
a separate reality layer; the full audit stays release evidence while
67+
`gate:v7-product` is the deterministic CI regression.
68+
- **Name Generator v3** depends on seed only, so the same seed retains its name
69+
at any level or rarity.
5970

6071
## 3b. Match randomness semantics
6172

docs/GENERATOR-V7-DESIGN.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Generator V7 Design
2+
3+
## Why V7 exists
4+
5+
V6 proved that a fixed Level × Rarity budget could place cards in the right
6+
*strength tier*, but its strength was enforced by a budget/price ledger — a
7+
measurement loop, not a combat identity. V7 keeps "Level first, Rarity second"
8+
and adds two things V6 could not:
9+
10+
1. **Reality truth**: a large mirrored battle graph measured with the real
11+
canonical AI, fitted by Bradley-Terry into EmpiricalTheta, so every strength
12+
claim is verified against actual long-run combat — not a price model.
13+
2. **Content-native strength**: an iso-power solver that tunes individual
14+
numeric knobs against a content-only strength model, so the card's power
15+
comes from what it actually does in battle.
16+
17+
## World geometry
18+
19+
`TargetTheta = LevelScore + RarityScore - (LevelScore(50) + RarityScore(A))`
20+
21+
- `LevelScore(level) = 16 * ((level - 1) / 99) ^ 1.70` — convex, back-loaded.
22+
- Rarity scores `C=0 … XS_COLLECTOR=7.60` — strictly convex increments.
23+
- Anchor `LevelScore(50) + RarityScore(A)` → Lv50 A is theta 0.
24+
- Invariants (asserted): full level span >= 2 × full rarity span;
25+
(Lv40→100 level gap) − full rarity span >= 4.5 (Lv100 C ≫ Lv40 XS Collector);
26+
full rarity span >= Lv70→100 level gap (extreme rarity can make a real
27+
suspense window at 70 vs 100).
28+
- Geometry is generation/QA metadata only. The engine never reads it.
29+
30+
## Seed owns form, never tier
31+
32+
`styleGenomeV7(seed)` produces 8 soft preference axes. `mechanicSkeletonV7(seed)`
33+
fixes action families, victory path, damage type, resource, status policy and
34+
trigger event — deterministically, from the seed alone, with retries that depend
35+
only on the seed. Therefore `mechanicFingerprint` is invariant across level and
36+
rarity for a given seed: level/rarity scale magnitudes; they never change the
37+
kit. Same-tier seed dispersion (p95−p5 of EmpiricalTheta at fixed level/rarity)
38+
must stay within 1.0 theta (1.2 only with documented noise evidence), while
39+
matchup diversity keeps genuine 80/20 same-tier counters: General Strength
40+
convergence is not pairwise 50/50.
41+
42+
## StrengthModelV7 (content-only)
43+
44+
A reference world (`calibration/reference-world-v7.json`) defines the opponent
45+
population. The model evaluates each action's interacting throughput — accuracy,
46+
crit, penetration, mitigation, cooldown/RECOVERY readiness, resource
47+
affordability, POTENCY on periodic/trigger output, BARRIER_POWER on shields,
48+
CONTROL_POWER contest vs TENACITY — then aggregates with the One Action Rule
49+
(best action full, others discounted) and adds trigger frequency. A shape
50+
vector feeds a ridge correction fitted on train seed families; the committed
51+
coefficients are selected on validation and only evaluated on test.
52+
53+
## SolverV7 (iso-power)
54+
55+
Per-knob finite-difference marginal value; each iteration picks the legal knob
56+
with the best strength-error reduction (with style/degeneracy tie-breakers) and
57+
moves it in log space, clamped per-knob. Convergence: |predicted − TargetTheta|
58+
<= 0.12 absolute, median <= 0.06, p95 <= 0.12. Runtime generation never invokes
59+
battles, AI, opponents, Monte Carlo or BattlePower.
60+
61+
## Empirical reality
62+
63+
A connected sparse graph over 180 cards (15 seed families × 12 tiers) with
64+
same-tier, same-seed-level, near-tier, cross-tier, cross-style and extreme-gap
65+
edges; 12 paired Match Seeds per edge, mirrored sides, canonical AI, round cap
66+
100 → 37,440 battles. Regularized Bradley-Terry fit (draws = half score) gives
67+
EmpiricalTheta with standard error; a linear alignment (train families only)
68+
maps it onto the TargetTheta scale. Acceptance: Spearman(Target, Empirical)
69+
>= 0.95.
70+
71+
## Multi-axis policy (Phase 6)
72+
73+
The V6 baseline sensitivity showed ATK and MAX_HP were the only meaningful
74+
axes. V7 activated neutral-100 optional axes only where they add independent
75+
value, and the final multi-axis audit requires ≥ 6 independent primary axes at
76+
≥ 45% of ATK sensitivity, ATK ≤ 2 × peer median, and no axis > 35% of
77+
normalized primary-axis sensitivity — ATK stays important but cannot be a God
78+
Stat.
79+
80+
## BattlePower V4
81+
82+
Independent content-only measurement model (its own feature extraction, never
83+
`predictThetaV7`), ridge-calibrated against holdout EmpiricalTheta with
84+
seed-family isolation. DoD: holdout Spearman ≥ 0.90; pair ordering accuracy
85+
≥ 95% for |EmpiricalTheta gap| ≥ 1.5; strong inversion rate ≤ 2%. Display power
86+
is a monotone transform anchored near 1000 at Lv50 A.
87+
88+
## Product acceptance (final product constitution)
89+
90+
| Case | Requirement |
91+
|---|---|
92+
| Lv100 vs Lv40 (same rarity) | Lv100 ≥ 99% aggregate, Wilson lower ≥ 98% |
93+
| Lv100 C vs Lv40 XS Collector | Lv100 ≥ 98% |
94+
| Lv70 XS Collector vs Lv100 C | lower-level side in 35–70% |
95+
| Lv70 XS vs Lv100 C | lower-level side in 20–45% |
96+
| same-level C vs XS Collector | higher rarity ≥ 99% |
97+
| 5-tier rarity gap | higher rarity ≥ 95% |
98+
| fixed Lv50 A seed dispersion | p95−p5 ≤ 1.0 theta (1.2 documented only) |
99+
100+
The full audit is release evidence; `gate:v7-product` is a deterministic CI
101+
regression; `verify:release` runs the V7 gate while `gate:v6-strength` moves to
102+
`diagnostics:legacy`.

0 commit comments

Comments
 (0)