Skip to content

bug-report-py 3.3.0: canTriage and myVote; idempotent votes - #34

Merged
kenatleap merged 2 commits into
mainfrom
feat/vote-state
Nov 15, 2026
Merged

kenatleap merged 2 commits into
mainfrom
feat/vote-state

Conversation

@kenatleap

Copy link
Copy Markdown
Collaborator

Why: since 3.2.0 a non-admin's list answers 200. PIV, SV and seal inferred "admin" from a successful list, so they show triage controls to everyone; the server refuses the changes. Apps need an explicit signal, and the vote button needs to know whether you voted.

What changes

  • `canTriage` (the blueprint's `is_admin` for the caller) at the top level of the list body, and on the detail.
  • `myVote` (whether this caller voted) on each report in the list and on the detail.
    • Reads never use `default_actor_email`, so an anonymous caller is always false.
  • Idempotent votes: POST answers `{voted: true}`, and DELETE answers `{voted: false}`, whatever the state before.
  • `Store.voted_among(ids, voter)` on every Python store. Postgres uses one query per list.
  • Caller fields: `myVote` and `canTriage` describe the caller, not the report. They sit in a new `callerFields` entry in the contract, next to `canNotify`, not in the required report fields.
  • The Node backend is documented as not ported.

Tests (rerun by the coordinator in a fresh venv): Python + CLI 455, e2e 97 (with Postgres), Node 64, none failing. Each new test fails with its fix removed (T4):

  • `myVote` after a vote and an un-vote, for a different caller, and with no identity;
  • `myVote` never uses the default actor;
  • `canTriage` for an admin, a non-admin and no identity, direct and through the proxy;
  • `voted_among` on every store, and a store without it;
  • a bounded query count on Postgres;
  • a drift test of the list body against openapi and the types;
  • the caller fields kept out of the report field lists.

Review (T1): done by a fresh reviewer.

  • Closed: the default-actor leak into `myVote`, and the list-body drift test.
  • Decided by the coordinator: the caller fields stay out of the report field lists.
  • Optional items done: a no-identity proxy test, README notes (claims-mode votes, the `is_admin` default), and the store fallback.

Tag `backends-v3.3.0` after merge.

🤖 Generated with Claude Code

kmoy007 and others added 2 commits November 15, 2026 10:46
…rs, Store.voted_among (bug-report-py 3.3.0)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… lists; list-body drift test; README notes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kenatleap
kenatleap enabled auto-merge (squash) November 15, 2026 18:52
@kenatleap
kenatleap merged commit 6f6216a into main Nov 15, 2026
1 check passed
@kenatleap
kenatleap deleted the feat/vote-state branch November 15, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants