Problem
The gateway currently infers audit-firehose authority from an agent-list response. That approximation does not evaluate the authenticated device scope, group/revoke precedence, profile enablement, or device revocation through the kernel's actual capability engine. A long-lived SSE connection can also retain its initial visibility after authority is narrowed.
Required behavior
- evaluate
audit:read_all through one generic kernel-owned principal/device/capability function
- keep the existing gateway state, default runner, and route-builder APIs source-compatible
- default callers without an in-process evaluator to self-only audit visibility
- evaluate historical audit records after the asynchronous log read
- re-evaluate open SSE streams for each audit event so revocation and narrowing take effect without reconnect
- reject malformed, unknown, revoked, disabled, group-revoked, and device-scope-denied authority
- keep the evaluator borrowed and boolean-only; do not expose signing/runtime keys or caller-selected identities
Verification
- no-device,
Full, scoped allow/deny, malformed, unknown, revoked, disabled, and group/revoke policy cases
- historical narrowing suppresses another principal's records while preserving the caller's records
- a real HTTP SSE stream starts with cross-principal visibility, revokes the authenticating device through the kernel, then retains only the caller's own events
- existing public gateway entrypoints remain compatible
Depends on #1237 and the device/cache guarantees in PR #1238.
Problem
The gateway currently infers audit-firehose authority from an agent-list response. That approximation does not evaluate the authenticated device scope, group/revoke precedence, profile enablement, or device revocation through the kernel's actual capability engine. A long-lived SSE connection can also retain its initial visibility after authority is narrowed.
Required behavior
audit:read_allthrough one generic kernel-owned principal/device/capability functionVerification
Full, scoped allow/deny, malformed, unknown, revoked, disabled, and group/revoke policy casesDepends on #1237 and the device/cache guarantees in PR #1238.