[Medium] [Bug] Pact System: signedPactDetails never populated by any production code #308

Closed
opened 2026-06-07 17:42:20 +02:00 by Anexim · 1 comment
Owner

Spec: docs/specs/attunements/invoker/systems/pact-system-spec.md §5.1
Severity: Medium

Problem: The signedPactDetails state field exists in prestigeStore.ts:41 and is persisted, but no production code writes to it. Both completePactRitual in prestigeStore.ts:113-143 and processPactRitual in pact-ritual.ts:30-52 never set it. Only debugSetPactDetails can write to it. Historical pact tracking is non-functional.

Files:

  • src/lib/game/stores/prestigeStore.ts:113-143
  • src/lib/game/stores/pipelines/pact-ritual.ts:30-52
**Spec:** docs/specs/attunements/invoker/systems/pact-system-spec.md §5.1 **Severity:** Medium **Problem:** The `signedPactDetails` state field exists in `prestigeStore.ts:41` and is persisted, but **no production code writes to it**. Both `completePactRitual` in `prestigeStore.ts:113-143` and `processPactRitual` in `pact-ritual.ts:30-52` never set it. Only `debugSetPactDetails` can write to it. Historical pact tracking is non-functional. **Files:** - `src/lib/game/stores/prestigeStore.ts:113-143` - `src/lib/game/stores/pipelines/pact-ritual.ts:30-52`
Anexim added the ai:todo label 2026-06-07 17:42:20 +02:00
n8n-gitea was assigned by Anexim 2026-06-07 17:42:20 +02:00
Anexim added ai:done and removed ai:todo labels 2026-06-08 14:28:42 +02:00
Author
Owner

Fixed. The root cause was that processPactRitual in pact-ritual.ts (the actual production code path for pact completion) never included signedPactDetails in its writes. Fixed by:

  1. Added signedPactDetails to PactRitualResult.writes interface
  2. Added signedPactDetails, currentDay, currentHour parameters to processPactRitual
  3. When completing a pact, the writes now include the new pact detail entry with floor, guardianId, signedAt time, and empty skillLevels
  4. Updated gameStore.ts call site to pass ctx.prestige.signedPactDetails and day, hour
  5. Also fixed completePactRitual in prestigeStore.ts for completeness (was dead code, now correct if called in future)
Fixed. The root cause was that `processPactRitual` in `pact-ritual.ts` (the actual production code path for pact completion) never included `signedPactDetails` in its writes. Fixed by: 1. Added `signedPactDetails` to `PactRitualResult.writes` interface 2. Added `signedPactDetails`, `currentDay`, `currentHour` parameters to `processPactRitual` 3. When completing a pact, the writes now include the new pact detail entry with floor, guardianId, signedAt time, and empty skillLevels 4. Updated `gameStore.ts` call site to pass `ctx.prestige.signedPactDetails` and `day, hour` 5. Also fixed `completePactRitual` in `prestigeStore.ts` for completeness (was dead code, now correct if called in future)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#308