Skip to content

Governance: link election candidates to members (optional) - #2836

Open
peterdrier wants to merge 6 commits into
mainfrom
claude/project-thread-cohes1
Open

peterdrier wants to merge 6 commits into
mainfrom
claude/project-thread-cohes1

Conversation

@peterdrier

Copy link
Copy Markdown
Owner

What

An election candidate (an option on a ranked assembly vote) can optionally be linked to the member they are. Where the candidate is shown, the member appears beside the label with the shared Human hover card.

Why

Peter asked for it: people voted on in a real election are humans, and voters should be able to see who they are. The link is optional, so motions and test candidates work as before.

Existing surface checked

  • Reuses vc:human and vc:human-search unchanged.
  • One nullable column UserId on governance_assembly_vote_options, no cross-section foreign key.
  • The counting code is untouched: identity across an assembly's ranked items stays "same key = same person". Two guards at Open keep links consistent with that (one member under two keys, one key for two members).
  • New internal surface: UnlinkCandidaciesAsync on the Governance repository, the _Candidates partial, one resx key, one GDPR export slice AssemblyVoteCandidacies, two AssemblyVoteActionResult values.
  • Nothing shared with Surveys.

UI changes / screenshots

  • Votes admin Create/Edit: optional member picker per option.
  • Ballot and Results: a "Candidates" list when at least one option is linked. The tap-to-rank cards are unchanged.
  • Results outcome and Peek: the member beside the label for elected, tied, left-out and no-majority candidates.

Not yet looked at rendered; will be checked on the preview.

Checklist

  • Review tier stated: tier:standard.
  • No migration edited by hand: 20261201155445_AssemblyVoteOptionUser is EF output.
  • No NOT NULL column added to an existing table: the new column is nullable.
  • Targeting main on peterdrier/Humans, branched off origin/main.
  • Reuse-first checked.
  • Build + test pass locally: build clean; Governance tests 639 passed; Web tests 861 passed. The full solution suite was not run locally (single-section change plus the architecture tests).
  • Nav coverage: no new page.
  • NuGet packages updated none. New project rule none.

Reviewer notes

  • GDPR: export lists the member's candidacies; erasure clears the link and keeps the label as part of the election record.
  • An account merge does not move a link to the surviving account. Display and export follow the merge chain.
  • The picker's inline script does not run in script-added option rows, so the add-row handler re-creates it with the page nonce. Reasoned, to be confirmed on the preview.

Generated by Claude Code

A candidate option may link to the member it is. Bare Guid, no
cross-section key; EF-generated migration in GovernanceDbContext.
Each option row on the draft form gets an optional member picker
(the shared human-search, re-run in script-added rows). Open refuses a
ranked item when, across its assembly's ranked items, one member
stands under two keys or one key is linked to two members. GDPR export
lists a member's candidacies; erasure clears the link and keeps the
label.
Results, the admin peek and the ballot page show a linked candidate's
member beside the official label: in the outcome lines and elected
badges, and in a Candidates list above the ballot and on results. The
tap-to-rank cards and the count steps keep plain labels.
@peterdrier

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@github-actions github-actions Bot added the db PR includes EF Core migration label Dec 1, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T16:16:46.152916Z 50d5692 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Reviewed commit 50d5692 — no issues found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 50d5692890

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

PR Surface Report

Compared 587067f6...db50364c. Scored with reforge 0.34.0.

Summary: 34 changed file(s) | EF migrations: 1 added file(s), max 1/1 per context

Reforge Surface Score

metric base head delta
total 77473 77553 +80
surface 17608 17608 0

Section Deltas

section base head delta
Governance 3372 3452 +80

Section Size & Complexity Deltas

section LOC delta files delta classes delta cognitive p95 delta
Governance +115 0 0 0
Corpus +115 0 0 0

Corpus is the solution-wide rollup (same source as Corpus Size & Complexity below), not a sum of the section rows above - cognitive p95 in particular doesn't compose across sections.

Rule Deltas

rule base head delta
classSize 7227 7270 +43
sectionSize 9714 9740 +26
methodComplexity 22221 22229 +8
methodCount 19557 19560 +3

Corpus Size & Complexity

metric base head delta
locProd 202344 202459 +115
methods 9114 9116 +2

At head: largest class Service, most complex method Service.BookOneTransferAsync.

Published Write Surface

15 of 57 sections publish write capability, 47 interfaces (0).

Interface Surface

No new interfaces or interface members.

Diff Size

bucket added deleted
code 265 45
migrations 40 2
tests 166 1
docs 17 10
other 19 0

New Files

  • src/Sections/Humans.Governance/Data/Migrations/20261201155445_AssemblyVoteOptionUser.Designer.cs
  • src/Sections/Humans.Governance/Data/Migrations/20261201155445_AssemblyVoteOptionUser.cs
  • src/Sections/Humans.Governance/Views/Governance/Votes/_Candidates.cshtml
  • tests/Humans.Governance.Tests/Services/AssemblyVoteCandidateLinkTests.cs

EF Migrations (OK)

  • src/Sections/Humans.Governance/Data/Migrations/20261201155445_AssemblyVoteOptionUser.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db PR includes EF Core migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants