Feature 09: Permission Enforcement Layer -> dev #104

Merged
orchestrator-agent merged 13 commits from feature/e2ac03c0-f830-42bd-ab05-fc727ae8352c-permission-enforcement into dev 2026-09-19 08:43:37 -04:00
Member

Feature 09: the backend permission gate. Registers the canonical ENTITIES-AND-SERVICES §2 service inventory with voluptuous schemas and services.yaml metadata, a single SERVICE_POLICY registry (complete_quest open; everything else admin-only), a permission_gate wrapper applied to every registered service (reads call.context.user_id, consults admin_allowlist.is_admin, raises Unauthorized; fails closed on no context), audit logging (warning on denial, debug on success), presence writes regenerating child instances, and the full permission test matrix with a registry coverage assertion.

Task PRs: #98 #99 #100 #101 #102 #103. Codex gpt-5.6-terra feature review: one P2 (sort_order=0 truthiness) verified as a false positive — see feature notes.

uv run pytest: 1361 passed. Schema still version 6; no migration.

Feature 09: the backend permission gate. Registers the canonical ENTITIES-AND-SERVICES §2 service inventory with voluptuous schemas and services.yaml metadata, a single SERVICE_POLICY registry (complete_quest open; everything else admin-only), a permission_gate wrapper applied to every registered service (reads call.context.user_id, consults admin_allowlist.is_admin, raises Unauthorized; fails closed on no context), audit logging (warning on denial, debug on success), presence writes regenerating child instances, and the full permission test matrix with a registry coverage assertion. Task PRs: #98 #99 #100 #101 #102 #103. Codex gpt-5.6-terra feature review: one P2 (sort_order=0 truthiness) verified as a false positive — see feature notes. `uv run pytest`: 1361 passed. Schema still version 6; no migration.
orchestrator-agent added 13 commits 2026-09-19 08:43:33 -04:00
Domain-global handlers for the ENTITIES-AND-SERVICES inventory plus
regenerate. No permission decorator yet.
Presence pattern and override handlers now call regenerate_for_child.
Definition edit/activate pass HA-local today and configured horizon.
Register canonical NestQuest HA services with schemas (#98)
One mapping in service_policy.py: complete_quest is open, every other
registered nestquest service is admin_only.
permission_gate wraps all registered services at registration time:
admin-only policy reads call.context.user_id against admin_allowlist
is_admin (fail closed on no context); complete_quest stays open.
Parametrised test denies no-context calls on every admin-only service;
complete_quest proceeds with no user; scheduled internals stay direct
function calls.
Warning on denial and debug on success carry the service, the caller
user id (or none), and a UTC stamp; nothing beyond the user id leaks.
Admin succeeds on all ten admin-only services; a non-admin and a
no-context call are refused on each; complete_quest stays open; a
kiosk-style id is refused on uncomplete_quest and regenerate; the
registry coverage assertion fails the suite on any gap.
orchestrator-agent merged commit 3ac1d32e1b into dev 2026-09-19 08:43:37 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#104