fix(webapp): a player can't rename an item that isn't identified yet (#912) #913

Merged
claude-bot merged 1 commit from fix/912-unidentified-rename into main 2026-09-28 17:23:09 +00:00
Collaborator

Closes #912.

The problem. PATCH /lore/{id} accepted a non-GM's title for an item that isn't identified yet. The player sees the party's name for it (player_title), so a save could overwrite the real title.

The fix. It sits inside the existing non-GM branch, before the split between editing directly and suggesting, so the suggestion path is covered too:

  • If the sent title equals what the player sees, it's dropped silently. The editor sends it back unchanged.
  • Any other title gets a 403, "You can't rename this until it's identified."
  • A GM's rename is unchanged.

Tests (in test_wiki_edit_api.py):

  • Priya sends back the party's name: the real title is kept, and her body edit applies.
  • Priya sends a new name: 403, and nothing changes.
  • Dana renames: it works.

Checks:

  • tests/wiki/: 518 passed.
  • ruff: clean.

🤖 Generated with Claude Code

Closes #912. **The problem.** `PATCH /lore/{id}` accepted a non-GM's `title` for an item that isn't identified yet. The player sees the party's name for it (`player_title`), so a save could overwrite the real title. **The fix.** It sits inside the existing non-GM branch, before the split between editing directly and suggesting, so the suggestion path is covered too: - If the sent title equals what the player sees, it's dropped silently. The editor sends it back unchanged. - Any other title gets a 403, "You can't rename this until it's identified." - A GM's rename is unchanged. **Tests** (in `test_wiki_edit_api.py`): - Priya sends back the party's name: the real title is kept, and her body edit applies. - Priya sends a new name: 403, and nothing changes. - Dana renames: it works. **Checks:** - `tests/wiki/`: 518 passed. - ruff: clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(webapp): a player's wiki save can't rename an unidentified item (#912)
All checks were successful
CI / Backend lint (ruff) (pull_request) Successful in 48s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 59s
CI / Bot/backend version sync (pull_request) Successful in 25s
CI / Feedback site tests (pull_request) Successful in 1m2s
CI / Docker image build (pull_request) Successful in 30s
CI / Does this change touch the recording path? (pull_request) Successful in 16s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Bot tests and audit (pull_request) Successful in 2m44s
CI / Backend migration, tests, and audit (pull_request) Successful in 21m14s
CI / Frontend tests, audit, and build (pull_request) Successful in 24m18s
CI / End-to-end journeys (desktop, phone, keyboard-only) (pull_request) Successful in 21m45s
3c73b28f64
The lore PATCH let a non-GM's title through unchecked, even though the
player only ever reads the party's name (player_title) for an item that
isn't identified yet, never its real title. A hand-made request could
overwrite the real title, and a mismatch between the two would reveal
that it existed at all.

Sending back what she was shown is now a silent no-op (the real title is
kept); anything else is refused with a 403. Applies to both the direct
edit and the suggestion path, since the guard runs before they split. A
GM's rename is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.