Repository navigation
SCA-2284: exempt generated API types and add David as UI approver - #25315
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| // Account-scoped UI approval. All inputs are API data, never executable PR code. | ||
| const ACTOR_ID = 9387252; // Git-on-my-level, stable across login renames. | ||
| const NIK_ID = 43514161; | ||
| const APPROVER_IDS = new Set([NIK_ID, ACTOR_ID]); |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: HIGH
APPROVER_IDS now includes ACTOR_ID, the same GitHub account this gate is meant to constrain. Coding agents already push and comment as that account, so an agent-authored UI change can be cleared by that same identity posting /approve-ui with the current head SHA. That removes the previous Nik-only split between the gated principal and the approver.
Impact: Unreviewed UI from this account can satisfy the required UI author approval check without an independent human commenter.
Reviewed by Cursor Security Reviewer for commit 2e757e1. Configure here.
| for (const file of first.files) { | ||
| for (const path of new Set([file.filename,file.previous_filename].filter(Boolean))) { | ||
| if (!/^desktop\/macos\/.*\.swift$/.test(path)) continue; | ||
| if (GENERATED_API_FILES.has(path) || !/^desktop\/macos\/.*\.swift$/.test(path)) continue; |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: MEDIUM
The generated Swift OpenAPI client is now skipped by the immutable source inspection that exists to catch SwiftUI/AppKit UI in arbitrarily named files. isUI() also does not treat this path as UI by name, and tests assert that import SwiftUI here succeeds with no content fetch and no approval.
Impact: UI declarations can live only in this exempt file and still compile in the macOS module without triggering /approve-ui.
Reviewed by Cursor Security Reviewer for commit 2e757e1. Configure here.




Updates the account-scoped UI approval policy requested by David. The five exact outputs of the TypeScript and Swift OpenAPI generators no longer count as UI; the Swift output also skips immutable source inspection. Real UI files, including other generated Swift files and renamed UI, remain gated.
Nik (43514161) and David (9387252, Git-on-my-level) can issue current-head
/approve-ui <sha>and/reject-ui <sha>commands. The newest matching command wins. Incomplete-evidence failures, same-head multi-PR reconciliation, the bot marker comment, and workflow triggers/permissions are preserved. The check manifest's rationale reflects the new policy; its registration and CI budget are unchanged.Consequence
9387252 is also ACTOR_ID, the account this gate checks, and coding agents push and comment as that account. After this change, a comment from that account can approve that account's own UI changes. The gate will no longer separate “an agent working as David” from “David”.
Verification
node --test .github/scripts/tests/ui-author-approval.test.cjs: 18 tests pass, covering generated-only diffs, mixed UI diffs, real web UI, both approvers, stale SHAs, revocation, ignored third accounts, Swift inspection/rename boundaries, and existing fail-closed behavior.make preflight: passed all 14 selected checks.scripts/pr-preflight --pr-body-file ../pr-body.md: passed all 14 selected checks and PR metadata validation.2e757e18f29a062b7540450ec37f9642a75486dc; logs confirm all 18 gate tests and all 14 preflight checks pass. Other CI jobs were still running when this evidence was collected.Product invariants affected
none
Tracks SCA-2284.