# Work Summary - 2026-02-07

## Feature: MysticAssistantRedux - Boss Skin "New" Alert Badge Fix

### Current State: IN PROGRESS — Partial Success

**User Report:** Boss skin "new" alert badge doesn't appear in the follower forms menu after purchasing from the Mystic Assistant shop.

### Investigation & Findings

#### Runtime Diagnostics (via PopulateBossSkins logging)

| Finding | Details |
|---------|---------|
| **Title vs Skin[0].Skin** | Identical for all 31 boss skins — no name mismatch |
| **Invariant flag** | Only 3 of 31 are Invariant: `Boss Death Cat`, `Boss Aym`, `Boss Baal` |
| **DropLocation** | All 3 Invariant boss skins have `DropLocation=Other` |
| **GetSkinsFromLocation filter** | Game unconditionally excludes `Invariant=true` skins from forms menus |
| **Alert registration** | `AddOnce` succeeds — alerts are in `_alerts` list correctly |

#### Key Code Paths

1. **`WorshipperData.GetSkinsFromLocation()`** (WorshipperData.cs:183): `if (!data.Invariant && ...)` — filters out Invariant skins before the forms menu ever sees them
2. **`UIFollowerFormsMenuController.OnShowStarted()`** — Calls `GetSkinsFromLocation` for each DropLocation category, feeds results to `Populate()` which creates `IndoctrinationFormItem` entries
3. **`IndoctrinationFormItem.Configure(skinAndData)`** — Sets `_alert.Configure(skinAndData.Skin[0].Skin)` for the badge
4. **`CharacterSkinAlerts.OnSkinUnlocked()`** — Returns early without `AddOnce` for Invariant skins
5. **`DataManager.ReplaceDeprication()`** (lines 4508-4511) — Removes alerts for Invariant skins on save load

### Changes Made

#### 1. `RegisterSkinAlert` — Use Skin[0].Skin as alert key (MysticShopPatches.cs)

```csharp
private static void RegisterSkinAlert(string skinName)
{
    var skinData = WorshipperData.Instance.GetCharacters(skinName);
    var alertKey = skinData?.Skin[0].Skin ?? skinName;
    DataManager.Instance.Alerts.CharacterSkinAlerts.AddOnce(alertKey);
}
```

**Result:** Defensive fix. Title == Skin[0].Skin for all boss skins, so this is a no-op currently but protects against future mismatches.

#### 2. `ReplaceDeprication_Postfix` — Re-register boss skin alerts after save load (MysticShopPatches.cs)

Postfix on `DataManager.ReplaceDeprication` that re-adds boss skin alerts stripped by the Invariant cleanup. Ensures badge persists across sessions.

#### 3. `GetSkinsFromLocation_Postfix` — Include unlocked Invariant boss skins in forms menu (MysticShopPatches.cs)

**THE KEY FIX.** Postfix on `WorshipperData.GetSkinsFromLocation` that adds back unlocked Invariant boss skins. Only adds skins where:
- `Invariant == true` (non-Invariant already included by vanilla)
- `Skin[0].Skin.Contains("Boss")` (doesn't leak CultLeader or other Invariant skins)
- `DataManager.GetFollowerSkinUnlocked(...)` is true (must be purchased)
- Matches the queried `DropLocation`

**Runtime log confirms:** All 3 Invariant boss skins added to `DropLocation.Other` section successfully.

#### 4. Cleaned up diagnostic logging in `PopulateBossSkins` (InventoryManager.cs)

Removed verbose Title/Skin[0].Skin/Invariant logging. Kept only the `NOT FOUND` warning for missing skins.

### Current Status

**Partial success:** User reports "interestingly aym had an icon this time" — Boss Aym IS now appearing in the forms menu (the postfix works). However, the "new" badge specifically may still not be showing. Need to:

1. Confirm whether the "new" badge (not just the icon) appears
2. The `[SkinForms]` diagnostic logging is still present — should be cleaned up once the fix is confirmed working
3. The `[SkinAlert]` log line in `RegisterSkinAlert` is also still present

### Open Issues

1. **"New" badge vs icon distinction:** User said "aym had an icon" — need to clarify if they mean the skin appeared in the menu (icon) vs the "new" badge overlay. The skin appearing is the GetSkinsFromLocation fix; the badge is the alert system fix.
2. **Boss Baal/Death Cat:** User only mentioned Aym. Need to verify all 3 appear.
3. **Non-Invariant boss skins:** The 28 non-Invariant boss skins should have always worked with the alert badge. The user originally tested with only the 2 Invariant ones (Aym, Baal), so non-Invariant behavior is untested.
4. **Apple follower skins anomaly:** `ValidateAppleSkins` says Orangutan/Robin/etc. NOT in WorshipperData, but `RegisterSkinAlert.GetCharacters` reports `found=True` for the same names. Contradictory — needs investigation.

### Files Modified

| File | Changes |
|------|---------|
| `MysticAssistantRedux/Patches/MysticShopPatches.cs` | Updated `RegisterSkinAlert` to resolve `Skin[0].Skin`; added `GetSkinsFromLocation_Postfix`; added `ReplaceDeprication_Postfix`; diagnostic logging in postfix |
| `MysticAssistantRedux/InventoryManager.cs` | Cleaned up `PopulateBossSkins` diagnostic logging |

### Architecture Notes

**Three-layer fix:**
1. **Data layer** (`GetSkinsFromLocation_Postfix`) — Makes Invariant boss skins visible in forms menus
2. **Alert layer** (`RegisterSkinAlert`) — Registers correct alert key for badge display
3. **Persistence layer** (`ReplaceDeprication_Postfix`) — Preserves alerts across save/load

**Why patching GetSkinsFromLocation is the right chokepoint:**
- Single method used by all 3 forms menu controllers (UIFollowerFormsMenuController, UIAppearanceMenuController_Form, UICustomizeClothesController_Form)
- Also affects `SetUnlockedText` counters (X/Y collected)
- Postfix scoped to boss skins only via `Contains("Boss")` check

---

## CLAUDE.md Updates

The project CLAUDE.md was updated to reflect 9 mods (added MysticAssistantRedux and QuickMenus descriptions) and updated summary file path reference to `work_summaries/summary-*.md`.
