[High] [Bug] Pact system: floors 140/150 unlock wrong elements, completion logic duplicated, spec self-contradictory #329
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spec:
docs/specs/attunements/invoker/systems/pact-system-spec.mdDiscrepancies found:
DISC-11 [HIGH] — Floors 140/150 element composition mismatched
light, fire. Codeguardian-data.tsuses[sand, earth, water]→ resolves toearth, water, sand❌air, death. Code uses[lightning, fire, air]→ resolves tofire, air, lightning❌['light', 'fire', 'radiantflames']and floor 150 to['air', 'death', 'miasma']DISC-12 [HIGH] — Spec internally inconsistent for floors 140-150
light, fireand 150→air, deathsand+earth+waterand 150→lightning+fire+air(matching the code)DISC-4 [HIGH] — Pact ritual completion logic duplicated
completePactRitual()methodprestigeStore.ts→completePactRitual(addLog)pact-ritual.ts→processPactRitual()which also performs completion inlinecompletePactRitual()instead of duplicating logicDISC-6 [MEDIUM] — 4 of 12 declared boon types never used
guardian-data.ts): Only uses 8 types:elementalDamage,maxMana,manaRegen,castingSpeed,rawDamage,critDamage,insightGain,spellEfficiencycritChance,manaGain,studySpeed,prestigeInsightDISC-8 [MEDIUM] —
signedPactDetailsreset bystartNewLoop()but spec says it should persistsignedPactDetailsshould NOT be reset on new loopprestigeStore.ts): BothstartNewLoop()andresetPrestigeForNewLoop()resetsignedPactDetailssignedPactDetailsfrom reset logic instartNewLoop()Progress Report — Issue #329 Pact System Bugs
Investigation complete. Here's my analysis:
DISC-11 [HIGH] — Floor 140/150 element composition
Root cause: In
guardian-data.ts, floor 140 uses['sand', 'earth', 'water'](resolves to Sand mana) instead of['light', 'fire', 'radiantflames'](Radiant Flames). Floor 150 uses['lightning', 'fire', 'air'](resolves to Lightning mana) instead of['air', 'death', 'miasma'](Miasma).DISC-12 [HIGH] — Spec §7.1 vs §8.2 contradiction
Root cause: Spec §7.1 maps floor 140→Radiant Flames (light+fire), §8.2 maps floor 140→sand+earth+water. The §7.1 table is the authoritative source. §8.2 needs to be updated to match.
DISC-4 [HIGH] — Pact ritual completion logic duplicated
Root cause:
pact-ritual.ts→processPactRitual()has inline completion logic (lines 46-61) that duplicatesprestigeStore.ts→completePactRitual(). The store method is never called by the pipeline. Fix: pipeline should delegate tocompletePactRitual().DISC-6 [MEDIUM] — 4 unused boon types
Root cause:
guardian-data.tsonly uses 8 of 12 boon types. Missing:critChance,manaGain,studySpeed,prestigeInsight. These need to be added to existing guardians or removed from spec.DISC-8 [MEDIUM] — signedPactDetails reset
Current state: Neither
startNewLoop()norresetPrestigeForNewLoop()explicitly resetssignedPactDetails. The code appears to already match the spec (persist across loops). Will verify and ensure no regression.Plan: Fix DISC-11, DISC-12, DISC-4, DISC-6 in order. DISC-8 appears already correct but will add guard.
Fixed and pushed (commit
cba3090).All 5 discrepancies resolved:
['sand','earth','water']→['light','fire','radiantflames']; Floor 150:['lightning','fire','air']→['air','death','miasma']. Updated boon descs and unique perks to match.pact-ritual.tspipeline to only handle progress advancement. Completion now delegates toprestigeStore.completePactRitual()— single source of truth for state writes + logging. Old duplicated inlining (76 lines → 49 lines) removed.critChance(floor 90),manaGain(floor 110),prestigeInsight(floor 200),studySpeed(floor 220). All 12 spec boon types now used.startNewLoop()norresetPrestigeForNewLoop()resetssignedPactDetails. Added explicit comment per spec §5.1.Test
spire-utils.test.tsupdated to match corrected floor 140/150 elements. All 1086 tests pass.All fixes implemented, tested, and pushed in commit
cba3090. Issue resolved.