## Implementation Plan: Fix Avatar `size` Parameter ### Changes Required **1. `devplacepy/avatar.py` — `generate_avatar_svg` function** - Add a `size: int = 128` parameter (default preserves existing callers). - After the SVG string is built (via `multiavatar(seed, None, None)`), inject `width="{size}"` and `height="{size}"` attributes into the root `` element. Use string manipulation (e.g., regex or `xml.etree.ElementTree`) to insert or replace the attributes. Keep the existing `viewBox` unchanged. - Return the modified SVG. **2. `devplacepy/routers/avatar.py` — avatar endpoint** - Update the route function signature: `async def avatar_image(request: Request, seed: str, size: int = 128)`. - Add size clamping: `size = max(16, min(512, size))`. - Change the cache key from `seed` to `f"{seed}:{size}"`. - Pass `size` to `generate_avatar_svg(seed, size=size)`. **3. `tests/api/avatar.py` — add size-attribute test** - Add a new test function: - Fetch `GET /avatar/multiavatar/test?size=32`, parse SVG, assert `width="32"` and `height="32"`. - Fetch `GET /avatar/multiavatar/test?size=256`, assert `width="256"`. - Optionally fetch without size parameter to verify default (128). - Keep existing test(s) unchanged. **4. Do not change any other files** — the CSS and JS masks are client-side and irrelevant to this fix; the devRant compatibility route is a reference only and must not be touched. ### Verification Steps - Run `pip install -e '.[dev]' -q && make test-unit` — must exit 0, no new failures. - Run `pip install -q ruff && ruff check .` — must exit 0. - Confirm no new `ModuleNotFoundError` or side-effect test failures. ### Definition of Done - [ ] `generate_avatar_svg` accepts `size` and returns SVG with explicit `width`/`height` matching that size. - [ ] `avatar_image` router uses `size` in cache key, clamps input, and passes size to generator. - [ ] Test exists that verifies `?size=32` returns SVG `width="32"` and `?size=256` returns `width="256"`. - [ ] All existing unit tests pass (exit code 0). - [ ] Ruff lint passes (exit code 0). - [ ] No changes outside the three files listed above.