Implement the fail-closed is_admin resolver (Feature 03, task 5) #55

Member

Task 5 of Feature 03.

Delivered

  • admin_allowlist.is_admin: True only for an allowlisted HA user id; False for non-allowlisted, unknown, empty, untrimmed, None, and non-string inputs; empty allowlist fails closed (nobody is admin, not everybody). Never raises for malformed input; DB errors propagate to the Feature 09 gate.
  • The last-admin removal refusal (from task 4) re-asserted as keeping the verdict sound.
  • Tests: verdict matrix (allowlisted/non-allowlisted/unknown/untrimmed/None/bool/list), empty-allowlist fail-closed, refusal persistence.

Verification

uv run pytest: 912 passed.

Closes task 3f2eb268 (Feature 03).

Task 5 of Feature 03. ## Delivered - **admin_allowlist.is_admin**: True only for an allowlisted HA user id; False for non-allowlisted, unknown, empty, untrimmed, None, and non-string inputs; empty allowlist fails closed (nobody is admin, not everybody). Never raises for malformed input; DB errors propagate to the Feature 09 gate. - The last-admin removal refusal (from task 4) re-asserted as keeping the verdict sound. - Tests: verdict matrix (allowlisted/non-allowlisted/unknown/untrimmed/None/bool/list), empty-allowlist fail-closed, refusal persistence. ## Verification uv run pytest: 912 passed. Closes task 3f2eb268 (Feature 03).
dev_agent added 1 commit 2026-09-15 17:35:15 -04:00
admin_allowlist.is_admin: True only for an allowlisted HA user id;
False for non-allowlisted, unknown, empty-string, untrimmed variants,
None, non-strings (bools, lists), and an empty allowlist (nobody is
admin rather than everybody). Never raises for malformed input —
malformed means not admin; DB errors propagate for the Feature 09
gate to handle. The last-admin removal refusal (set_admin_ids) is
re-asserted as keeping the verdict sound. Tests: full verdict matrix,
empty-allowlist fail-closed, refusal persistence. Suite: 912 passed.
Member

Independent review — Codex gpt-5.6-terra

Round 1 — APPROVED (zero findings). Suite 913 passed, reviewer-verified. One vacuous test (swallowing DB errors with a 'False or True' assertion) was removed by the author before review; DB-failure behavior is deliberately unspecified — is_admin propagates DB errors to the Feature 09 gate.

## Independent review — Codex gpt-5.6-terra **Round 1 — APPROVED (zero findings).** Suite 913 passed, reviewer-verified. One vacuous test (swallowing DB errors with a 'False or True' assertion) was removed by the author before review; DB-failure behavior is deliberately unspecified — is_admin propagates DB errors to the Feature 09 gate.
dev_agent merged commit c2cdbceb09 into feature/4f802471-1de1-4c35-844f-eebf3bea0de5-children-registry-admin-allowlist 2026-09-15 17:36:48 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#55