Skip to content

✨ Investigate AI-Assisted Code Review#2520

Open
Findeton wants to merge 4 commits intomainfrom
feat/meta-11563/main
Open

✨ Investigate AI-Assisted Code Review#2520
Findeton wants to merge 4 commits intomainfrom
feat/meta-11563/main

Conversation

@Findeton
Copy link
Contributor

@Findeton Findeton self-assigned this Mar 16, 2026
@Findeton Findeton added the enhancement New feature or request label Mar 16, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates repository agent documentation and modifies the SQL ordering used when exporting cast ballots for a given area/election (used by the windmill ceremony flow).

Changes:

  • Changed find_area_ballots SQL to order results only by voter_id_string.
  • Reframed AGENTS.md as a shared handbook for multiple AI coding agents and added pointers to Copilot-specific instructions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/windmill/src/services/cast_votes.rs Alters DISTINCT ON query ordering for exported ballots (currently introduces a Postgres DISTINCT ON/ORDER BY mismatch and changes which ballot row is selected).
AGENTS.md Updates agent guidance text and formatting; adds references to Copilot instruction files (currently points to paths that don’t exist).
Comments suppressed due to low confidence (2)

AGENTS.md:7

  • This references .github/copilot-instructions.md and .github/instructions/*.instructions.md, but those paths don’t exist in the repository (current .github/ only contains cla/, dependabot.yml, and workflows/). Either add the referenced instruction files or update this sentence to point at the actual location of Copilot/agent review guidance.
    AGENTS.md:120
  • The fenced code block under the "REUSE license headers" bullet is indented with tabs. This can render inconsistently in Markdown and introduces mixed whitespace; prefer spaces (or no indentation) to match the rest of the file’s formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 77 to 87
SELECT DISTINCT ON (election_id, voter_id_string)
voter_id_string,
content
FROM "sequent_backend".cast_vote
WHERE
tenant_id = '{tenant_id}' AND
election_event_id = '{election_event_id}' AND
area_id = '{area_id}' AND
election_id = '{election_id}'
ORDER BY election_id, voter_id_string, created_at DESC
ORDER BY voter_id_string
"#
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds repository guidance for AI coding/review agents (Copilot + other tools) and introduces scoped review instruction files, while also changing ballot export ordering in windmill’s find_area_ballots query.

Changes:

  • Add .github/copilot-instructions.md and scoped .github/instructions/*.instructions.md guidance for high-risk review areas (tally, auth/tenancy, schema IO, crypto/audit).
  • Update AGENTS.md to be the shared agent handbook and reference Copilot-specific instruction locations.
  • Modify packages/windmill/src/services/cast_votes.rs SQL ORDER BY for find_area_ballots.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/windmill/src/services/cast_votes.rs Changes DISTINCT ON query ordering used for area ballot export (high risk to tally semantics / runtime correctness).
AGENTS.md Renames/reframes agent handbook and points reviewers to Copilot instruction files.
.github/copilot-instructions.md Adds top-level Copilot review mindset for election-system invariants and risk areas.
.github/instructions/tally.instructions.md Adds tally/ballot-selection specific review checklist and invariants.
.github/instructions/schema-io.instructions.md Adds schema/migrations/import/export review checklist.
.github/instructions/crypto-audit.instructions.md Adds crypto/audit critical review checklist.
.github/instructions/auth-tenancy.instructions.md Adds authorization/tenancy boundary review checklist.
Comments suppressed due to low confidence (1)

AGENTS.md:120

  • The fenced code block under the REUSE header list item is indented with tab characters. Tabs can render inconsistently across Markdown viewers and may violate formatting/lint expectations; use spaces for indentation (or no indentation) so the code fence is stable and consistent with the rest of the document.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds repository guidance for AI coding agents and introduces GitHub Copilot review instruction files intended to focus reviews on election-system correctness, security, and auditability.

Changes:

  • Replaces/updates the agent handbook content in AGENTS.md to cover multiple AI agents and point to Copilot-specific review guidance.
  • Adds .github/copilot-instructions.md with high-level Copilot review priorities for this repo.
  • Adds scoped, path-targeted review checklists under .github/instructions/*.instructions.md.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
AGENTS.md Updates the shared AI-agent handbook and references the new Copilot instruction locations.
.github/copilot-instructions.md Adds high-level Copilot PR review guidance tailored to election software risk areas.
.github/instructions/tally.instructions.md Adds targeted review checklist for tally/ballot-selection paths.
.github/instructions/schema-io.instructions.md Adds targeted review checklist for schema/migrations/import/export changes.
.github/instructions/crypto-audit.instructions.md Adds targeted review checklist for crypto and audit-critical areas.
.github/instructions/auth-tenancy.instructions.md Adds targeted review checklist for authorization and tenant boundary changes.
Comments suppressed due to low confidence (2)

AGENTS.md:5

  • AGENTS.md currently lacks an SPDX license header comment at the top of the file (unlike other Markdown docs such as README.md). Given the repo’s REUSE guidance, add an HTML comment SPDX header before the first heading so REUSE/lint expectations are met consistently.
    AGENTS.md:120
  • The fenced code block under the REUSE header example is indented with tab characters. This is inconsistent with the rest of the Markdown code fences in this file and can render oddly in some viewers; remove the tabs (or use consistent spaces) so the code fence and its contents align with surrounding formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,19 @@
---
applyTo: "packages/windmill/src/services/cast_votes.rs,packages/windmill/src/services/insert_cast_vote.rs,packages/windmill/src/services/join.rs,packages/windmill/src/services/ceremonies/**/*.rs,packages/windmill/src/postgres/cast_vote.rs,beyond/packages/ballot-audit/**/*.rs,packages/step-cli/src/commands/duplicate_votes.rs"

## System Mindset

- Treat changes in packages/windmill, packages/sequent-core, packages/harvest, packages/immu-board, packages/keycloak-extensions, packages/voting-portal, packages/admin-portal, and beyond/packages/ballot-audit as high risk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants