feat: add per-user avatar seed regeneration with irreversible random avatar replacement

Implement a new `avatar_seed` column on the users table that overrides the username-based seed for Multiavatar generation. Introduce a null-safe `avatar_seed(user)` choke point in `avatar.py` that resolves `user.get("avatar_seed") or user.get("username")`, registered as a Jinja global so every render site (`_avatar_link.html`, `avatar_url(...)` calls, SEO `og_image`, issues ad-hoc dicts, devRant payload/PNG) propagates a regenerated seed. Add `POST /profile/{username}/regenerate-avatar` endpoint (owner-or-admin only) that writes a fresh `generate_uid()` to `avatar_seed`, invalidates the target's user cache, and audits `profile.avatar.regenerate`. The previous seed is overwritten and never stored, making regeneration irreversible. Document the feature in `AGENTS.md` and `README.md`, add the API endpoint to `docs_api.py`, and include the `regenerate_avatar` Devii tool in `CONFIRM_REQUIRED`.
This commit is contained in:
2026-06-27 22:31:34 +00:00
parent e773067106
commit 6f340a6818
60 changed files with 1626 additions and 97 deletions
+11
View File
@@ -32,6 +32,11 @@
<span class="hud-value" data-hud-prestige>{{ farm.prestige }}</span>
<span class="hud-sub" data-hud-prestige-mult>+{{ (farm.prestige_multiplier * 100 - 100)|round|int }}% coins</span>
</div>
<div class="hud-stat">
<span class="hud-label">Stars</span>
<span class="hud-value" data-hud-stars>{{ farm.stars }}</span>
<span class="hud-sub">spend on Legacy</span>
</div>
</section>
<div class="game-layout">
@@ -50,6 +55,12 @@
<h2 class="game-section-title">Perks</h2>
<div class="perk-grid" data-perk-host>{% include "_game_perks.html" %}</div>
</section>
<section class="game-legacy">
<h2 class="game-section-title">Legacy (Stars)</h2>
<p class="game-legacy-note">Earn Stars every Refactor. Legacy upgrades are permanent and survive every refactor.</p>
<div class="perk-grid" data-legacy-host>{% include "_game_legacy.html" %}</div>
</section>
</div>
<aside class="game-side">