Skip to content

Commit d9712d3

Browse files
committed
Improve graph
1 parent e7458b0 commit d9712d3

33 files changed

Lines changed: 4662 additions & 320 deletions

CLAUDE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,39 @@ Whenever we encounter a bug, the workflow is:
2020
The "lax" part: not every change needs a test (UI tweaks, refactors
2121
under existing test coverage, doc changes). But every bug fix does.
2222

23+
## Transformations on labeled values need numerical tests
24+
25+
When code transforms a value that's surfaced to the user (chain
26+
labels, annotations, summaries — anything the user reads as a
27+
number), add a regression test that pins the transformation's
28+
output, not just "the transformation runs without error."
29+
30+
Examples of transformations that need pinned numerical tests:
31+
- **State-merging operations** (e.g. equivalence-class collapse):
32+
pin that the merged value reflects the aggregation rule (sum,
33+
min, max, mean) rather than inheriting one source's value.
34+
- **Probability re-normalisation**: pin that the post-transform
35+
total stays within the expected bound (≤ 1.0 for probabilities,
36+
no negatives, etc.).
37+
- **Display clamping** (e.g. capping P_reach at 100%): pin that
38+
the truncation marker fires when the value exceeds the cap, AND
39+
the underlying value isn't lost by the clamp.
40+
- **Per-side / per-tier / per-mod redistribution**: pin a known
41+
input → known output mapping for at least one canonical case.
42+
43+
A "smoke test" that checks the function runs without throwing is
44+
NOT sufficient for transformations — those bugs (label inherits
45+
wrong value, sums to >100%, drops mass) only surface as numerical
46+
mismatches. The bug only became visible when a user spotted a
47+
label looking wrong; a numerical test would have caught it on the
48+
PR that introduced the regression.
49+
50+
Concretely: if you write code that does `merged.value = source.value`,
51+
ask "could this `=` be wrong (sum-vs-pick-one, average-vs-sum, etc.)?"
52+
and add a test pinning the choice. If you write code that does
53+
`Math.min(1, p)` or `Math.max(0, x)`, ask "could the underlying
54+
value differ from the displayed value?" and pin both.
55+
2356
## Testable contract
2457

2558
The engine layer follows an "input → output" architecture so tests can

data/poe2/essence_mod_sides.json

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
{
2+
"_comment": "Auto-generated by scripts/update-poe2-essences.sh. For each essence, maps canonicalised mod text (#-form, matching extra_mods.json `text`) to the prefix/suffix side scraped from poe2db's Class|Modifier|Pre/Suf table. Conflicting rows (same canonical text → different sides) are dropped. Use for multi-mod essences (Hysteria) where the unanimous-side rule in essences.csv falls through.",
3+
"mod_sides": {
4+
"Lesser Essence of Ice": {
5+
"Adds # to # Cold Damage": "PREFIX"
6+
},
7+
"Perfect Essence of Ice": {
8+
"Gain #% of Damage as Extra Cold Damage": "PREFIX"
9+
},
10+
"Perfect Essence of Sorcery": {
11+
"+# to Level of all Spell Skills": "SUFFIX"
12+
},
13+
"Essence of Thawing": {
14+
"+#% to Cold Resistance": "SUFFIX"
15+
},
16+
"Lesser Essence of Battle": {
17+
"+# to Accuracy Rating": "PREFIX"
18+
},
19+
"Essence of Abrasion": {
20+
"Adds # to # Physical Damage": "PREFIX"
21+
},
22+
"Perfect Essence of Enhancement": {
23+
"#% increased Global Defences": "PREFIX"
24+
},
25+
"Essence of Grounding": {
26+
"+#% to Lightning Resistance": "SUFFIX"
27+
},
28+
"Greater Essence of Seeking": {
29+
"+#% to Critical Hit Chance": "SUFFIX",
30+
"#% increased Critical Hit Chance for Spells": "SUFFIX"
31+
},
32+
"Greater Essence of Ice": {
33+
"Adds # to # Cold Damage": "PREFIX"
34+
},
35+
"Lesser Essence of Sorcery": {
36+
"#% increased Spell Damage": "PREFIX"
37+
},
38+
"Greater Essence of Grounding": {
39+
"+#% to Lightning Resistance": "SUFFIX"
40+
},
41+
"Lesser Essence of Ruin": {
42+
"+#% to Chaos Resistance": "SUFFIX"
43+
},
44+
"Greater Essence of Enhancement": {
45+
"#% increased Armour, Evasion or Energy Shield": "PREFIX"
46+
},
47+
"Greater Essence of Command": {
48+
"Allies in your Presence deal #% increased Damage": "PREFIX"
49+
},
50+
"Lesser Essence of Flames": {
51+
"Adds # to # Fire Damage": "PREFIX"
52+
},
53+
"Essence of the Body": {
54+
"+# to maximum Life": "PREFIX"
55+
},
56+
"Lesser Essence of Enhancement": {
57+
"#% increased Armour, Evasion or Energy Shield": "PREFIX"
58+
},
59+
"Lesser Essence of the Infinite": {
60+
"+# to Strength, Dexterity or Intelligence": "SUFFIX"
61+
},
62+
"Perfect Essence of Insulation": {
63+
"#% of Fire Damage taken Recouped as Life": "SUFFIX"
64+
},
65+
"Lesser Essence of the Mind": {
66+
"+# to maximum Mana": "PREFIX"
67+
},
68+
"Perfect Essence of the Mind": {
69+
"#% increased maximum Mana": "PREFIX"
70+
},
71+
"Essence of Enhancement": {
72+
"#% increased Armour, Evasion or Energy Shield": "PREFIX"
73+
},
74+
"Perfect Essence of Alacrity": {
75+
"#% increased Mana Cost Efficiency": "SUFFIX"
76+
},
77+
"Lesser Essence of Alacrity": {
78+
"#% increased Cast Speed": "SUFFIX"
79+
},
80+
"Lesser Essence of Thawing": {
81+
"+#% to Cold Resistance": "SUFFIX"
82+
},
83+
"Essence of Insulation": {
84+
"+#% to Fire Resistance": "SUFFIX"
85+
},
86+
"Lesser Essence of Haste": {
87+
"#% increased Attack Speed": "SUFFIX"
88+
},
89+
"Perfect Essence of Battle": {
90+
"+# to Level of all Attack Skills": "SUFFIX"
91+
},
92+
"Essence of Opulence": {
93+
"#% increased Rarity of Items found": "SUFFIX"
94+
},
95+
"Perfect Essence of Haste": {
96+
"#% chance to gain Onslaught on Killing Hits with this Weapon": "SUFFIX"
97+
},
98+
"Essence of Delirium": {
99+
"Allocates a random Notable Passive Skill": "PREFIX"
100+
},
101+
"Greater Essence of Insulation": {
102+
"+#% to Fire Resistance": "SUFFIX"
103+
},
104+
"Greater Essence of the Infinite": {
105+
"+# to Strength, Dexterity or Intelligence": "SUFFIX"
106+
},
107+
"Greater Essence of Alacrity": {
108+
"#% increased Cast Speed": "SUFFIX"
109+
},
110+
"Greater Essence of the Mind": {
111+
"+# to maximum Mana": "PREFIX"
112+
},
113+
"Essence of Sorcery": {
114+
"#% increased Spell Damage": "PREFIX"
115+
},
116+
"Perfect Essence of Flames": {
117+
"Gain #% of Damage as Extra Fire Damage": "PREFIX"
118+
},
119+
"Perfect Essence of Thawing": {
120+
"#% of Cold Damage taken Recouped as Life": "SUFFIX"
121+
},
122+
"Lesser Essence of Grounding": {
123+
"+#% to Lightning Resistance": "SUFFIX"
124+
},
125+
"Essence of Hysteria": {
126+
"+# to Level of all Minion Skills": "SUFFIX",
127+
"# to # Physical Thorns damage": "PREFIX",
128+
"#% increased Critical Damage Bonus": "SUFFIX",
129+
"#% increased Movement Speed": "PREFIX",
130+
"#% increased Mana Regeneration Rate": "SUFFIX",
131+
"#% of Damage taken Recouped as Life": "SUFFIX",
132+
"+# to Stun Threshold": "SUFFIX",
133+
"#% increased Block chance": "PREFIX",
134+
"#% increased Damage with Bow Skills": "PREFIX",
135+
"#% increased Energy Shield Recharge Rate": "SUFFIX"
136+
},
137+
"Lesser Essence of Insulation": {
138+
"+#% to Fire Resistance": "SUFFIX"
139+
},
140+
"Perfect Essence of the Infinite": {
141+
"#% increased Strength, Dexterity or Intelligence": "SUFFIX"
142+
},
143+
"Essence of Horror": {
144+
"#% increased effect of Socketed Items": "SUFFIX"
145+
},
146+
"Greater Essence of Haste": {
147+
"#% increased Attack Speed": "SUFFIX"
148+
},
149+
"Essence of Alacrity": {
150+
"#% increased Cast Speed": "SUFFIX"
151+
},
152+
"Perfect Essence of Grounding": {
153+
"#% of Lightning Damage taken Recouped as Life": "SUFFIX"
154+
},
155+
"Essence of the Mind": {
156+
"+# to maximum Mana": "PREFIX"
157+
},
158+
"Lesser Essence of Opulence": {
159+
"#% increased Rarity of Items found": "SUFFIX"
160+
},
161+
"Perfect Essence of Opulence": {
162+
"#% increased Quantity of Gold Dropped by Slain Enemies": "SUFFIX"
163+
},
164+
"Greater Essence of Thawing": {
165+
"+#% to Cold Resistance": "SUFFIX"
166+
},
167+
"Greater Essence of Opulence": {
168+
"#% increased Rarity of Items found": "SUFFIX"
169+
},
170+
"Essence of Electricity": {
171+
"Adds # to # Lightning Damage": "PREFIX"
172+
},
173+
"Essence of Flames": {
174+
"Adds # to # Fire Damage": "PREFIX"
175+
},
176+
"Essence of Seeking": {
177+
"+#% to Critical Hit Chance": "SUFFIX",
178+
"#% increased Critical Hit Chance for Spells": "SUFFIX"
179+
},
180+
"Essence of Insanity": {
181+
"On Corruption, Item gains two Enchantments": "SUFFIX"
182+
},
183+
"Essence of Battle": {
184+
"+# to Accuracy Rating": "PREFIX"
185+
},
186+
"Essence of Command": {
187+
"Allies in your Presence deal #% increased Damage": "PREFIX"
188+
},
189+
"Essence of Ruin": {
190+
"+#% to Chaos Resistance": "SUFFIX"
191+
},
192+
"Greater Essence of Abrasion": {
193+
"Adds # to # Physical Damage": "PREFIX"
194+
},
195+
"Greater Essence of Flames": {
196+
"Adds # to # Fire Damage": "PREFIX"
197+
},
198+
"Essence of Ice": {
199+
"Adds # to # Cold Damage": "PREFIX"
200+
},
201+
"Perfect Essence of Seeking": {
202+
"Hits against you have #% reduced Critical Damage Bonus": "SUFFIX"
203+
},
204+
"Essence of the Infinite": {
205+
"+# to Strength, Dexterity or Intelligence": "SUFFIX"
206+
},
207+
"Perfect Essence of Electricity": {
208+
"Gain #% of Damage as Extra Lightning Damage": "PREFIX"
209+
},
210+
"Essence of Haste": {
211+
"#% increased Attack Speed": "SUFFIX"
212+
},
213+
"Greater Essence of Ruin": {
214+
"+#% to Chaos Resistance": "SUFFIX"
215+
},
216+
"Perfect Essence of Command": {
217+
"Aura Skills have #% increased Magnitudes": "SUFFIX"
218+
},
219+
"Lesser Essence of Abrasion": {
220+
"Adds # to # Physical Damage": "PREFIX"
221+
},
222+
"Perfect Essence of Abrasion": {
223+
"Gain #% of Damage as Extra Physical Damage": "PREFIX"
224+
},
225+
"Greater Essence of Sorcery": {
226+
"#% increased Spell Damage": "PREFIX"
227+
},
228+
"Greater Essence of the Body": {
229+
"+# to maximum Life": "PREFIX"
230+
},
231+
"Lesser Essence of Seeking": {
232+
"+#% to Critical Hit Chance": "SUFFIX",
233+
"#% increased Critical Hit Chance for Spells": "SUFFIX"
234+
},
235+
"Lesser Essence of Electricity": {
236+
"Adds # to # Lightning Damage": "PREFIX"
237+
},
238+
"Greater Essence of Battle": {
239+
"+# to Accuracy Rating": "PREFIX"
240+
},
241+
"Lesser Essence of the Body": {
242+
"+# to maximum Life": "PREFIX"
243+
},
244+
"Perfect Essence of the Body": {
245+
"#% increased maximum Life": "PREFIX"
246+
},
247+
"Lesser Essence of Command": {
248+
"Allies in your Presence deal #% increased Damage": "PREFIX"
249+
},
250+
"Greater Essence of Electricity": {
251+
"Adds # to # Lightning Damage": "PREFIX"
252+
},
253+
"Perfect Essence of Ruin": {
254+
"#% of Physical Damage from Hits taken as Chaos Damage": "PREFIX"
255+
}
256+
}
257+
}

data/poe2/essence_side_overrides.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
"abyss_kind": "ABYSS = neither prefix nor suffix; the affix replaces an existing slot whose side is determined by side-fill or Crystallisation omens. Rendered as a full-width row in the essence panel."
66
},
77
"overrides": {
8-
"#% increased effect of Socketed Items": { "side": "SUFFIX", "source": "Essence of Horror" },
9-
"Allocates a random Notable Passive Skill": { "side": "PREFIX", "source": "Essence of Delirium" },
10-
"On Corruption, Item gains two Enchantments": { "side": "SUFFIX", "source": "Essence of Insanity" },
11-
"#% of Physical Damage from Hits taken as Chaos Damage": { "side": "PREFIX", "source": "Perfect Essence of Ruin" },
12-
"Mark of the Abyssal Lord": { "side": "ABYSS", "source": "Essence of the Abyss — placeholder, inherits replaced affix's side" }
8+
"60% increased effect of Socketed Items": { "side": "SUFFIX", "source": "Essence of Horror" },
9+
"#% increased effect of Socketed Items": { "side": "SUFFIX", "source": "Essence of Horror — display-text alias" },
10+
"Allocates a random Notable Passive Skill": { "side": "PREFIX", "source": "Essence of Delirium" },
11+
"On Corruption, Item gains two Enchantments": { "side": "SUFFIX", "source": "Essence of Insanity" },
12+
"(10—15)% of Physical Damage from Hits taken as Chaos Damage": { "side": "PREFIX", "source": "Perfect Essence of Ruin" },
13+
"#% of Physical Damage from Hits taken as Chaos Damage": { "side": "PREFIX", "source": "Perfect Essence of Ruin — display-text alias" },
14+
"(20—30)% increased Global Defences": { "side": "PREFIX", "source": "Perfect Essence of Enhancement" },
15+
"(7—10)% increased Strength, Dexterity or Intelligence": { "side": "SUFFIX", "source": "Perfect Essence of the Infinite" },
16+
"Mark of the Abyssal Lord": { "side": "ABYSS", "source": "Essence of the Abyss — placeholder, inherits replaced affix's side" }
1317
}
1418
}

0 commit comments

Comments
 (0)