Skip to content

Access control PR 4b follow-up: no-owner selection routing, stricter tests, docs - #371

Merged
joske merged 8 commits into
joske:masterfrom
ariel3259:feat/access-control-pr4b-followup
Nov 17, 2026
Merged

joske merged 8 commits into
joske:masterfrom
ariel3259:feat/access-control-pr4b-followup

Conversation

@ariel3259

Copy link
Copy Markdown
Contributor

Follow-up to the review of #369 (access control PR 4b).

Production change (one)

  • Selection: a ConvertSelection with no owner is now answered to the issuer. A server-issued conversion goes to the rootless refusal path; a client's gets SelectionNotify(None), the same routing the denied path already used.

Tests

  • Resource-check tests fail on unexpected policy calls: the recording policy no longer falls back to the owner for Receive, and the expected_*resource_checks helpers no longer filter Receive out.
  • No-policy tests compare the output with complete event frames written in the test, not with recording-Allow bytes from the same branch. Allow parity is still asserted separately. No test calls another #[test] function anymore.

Docs

  • status.md: one PR 4b entry; the duplicated 4a entry and the "Task N report" references are removed.
  • Plans cite Xorg as ../xserver (xorg-server-21.1.24) and XLibre as ../xlibre, instead of local paths.

Still open (not here)

Testing

  • Workspace tests, the --ignored lavapipe suite, clippy (Linux + FreeBSD cross), layout check, just man.
  • 5 runs of the access/selection/Present tests under 16 busy loops.
  • Hardware, NVIDIA RTX 5060 Ti (KMS, i3, xterm/xev/xclip script), 3 runs master 58d7d3f vs 3 runs this branch: identical client events and selection results; the only differences are i3 event-order noise also seen between master runs.

🤖 Generated with Claude Code

ariel3259 and others added 8 commits November 15, 2026 17:18
Implemented-By: codex (gpt-6-luna xhigh)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Implemented-By: codex (gpt-6-luna xhigh)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Implemented-By: codex (gpt-6-luna xhigh)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Implemented-By: Claude Sonnet 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Round 1 fixes: compare baseline output directly with test-authored complete frames. Allow parity remains a separate check. Dynamic timestamps retain their bounds checks and every other byte has an independent expected value. No production code changed.

Corrected per-function coverage audit (Full means complete frame bytes or, for bridge queues, every typed event field; “reason” rows state why that function has no independent no-policy frame run):

| Function / case | Site(s) | Registered test | Independent expectation |
|---|---|---|---|
| `receive_host_expose_checks_each_delivery_window` | N01–N02 | Yes | Full literal Expose frames for both recipients |
| `receive_clear_area_expose_denial_keeps_paint` | N04 | Yes | Full literal Expose frame |
| `receive_map_visibility_denial_keeps_descendant_walk` | N03, N21 | Yes | Full literal VisibilityNotify frames for the descendant walk |
| `receive_expose_rectangles_keep_counts_and_collapse` | N04 | Yes | Full literal Expose frames for split and collapsed regions |
| `receive_structure_subject_is_delivery_window` | N05–N12, N14–N15, N19–N20, N22–N27, N29–N30 | Yes | Full literal 32-byte frames for each delivery and byte order |
| `receive_reparent_preserves_three_targets_and_order` | N05–N11 | Yes | Full literal ReparentNotify and structure frames, including same-parent case |
| `receive_gravity_denial_keeps_child_move` | N16–N17 | Yes | Full literal GravityNotify frames for both deliveries, including coordinates |
| `receive_structure_noop_does_not_ask` | Structure no-op cases | Yes | Explicit empty output |
| `receive_redirect_denial_preserves_redirection` | N13, N18, N28 | Yes | Full literal redirect frames |
| `receive_redirect_does_not_check_unselected_clients` | Redirect bypass / ordinary notifications | Yes | Full literal ordinary notification streams for both byte orders |
| `receive_redirect_revocation_still_redirects` | N13, N18, N28 | Yes | Reason: no own no-policy run; full no-policy frames for these sites are checked by the two redirect tests above |
| `receive_destroy_denial_keeps_cleanup` | N31–N34 | Yes | Full literal UnmapNotify and DestroyNotify streams, per recipient and opcode |
| `receive_disconnect_destroy_notifies_survivors` | N31–N34 | Yes | Full literal no-policy destruction streams for both receivers |
| `receive_cow_notifications_keep_extension_request` | N35–N36; teardown N31–N34 | Yes | Full no-policy CreateNotify/MapNotify and reply; release subcase is policy-only, with independent no-policy teardown in the following row |
| `receive_last_cow_claim_disconnect_uses_no_request` | COW teardown N31–N34 | Yes | Full literal UnmapNotify and DestroyNotify stream |
| `receive_focus_checks_transition_windows_and_keeps_xi2` | N37 | Yes | Full raw streams: core focus frames and selected 76-byte XI2 focus frames; Allow parity is separate |
| `receive_colormap_uses_each_subscribing_window` | N38 | Yes | Reason: own runs install policy; the dedicated no-policy holder below supplies the independent frame expectation |
| `receive_colormap_no_policy_matches_independent_bytes` | N38 | Yes, dedicated registered holder | Full literal ColormapNotify frames |
| `receive_get_property_delete_keeps_reply` | N39 | Yes | Full test-authored GetProperty reply and PropertyNotify frames |
| `receive_bridge_property_denial_keeps_clients_and_property` | N47 and client N39 output | Yes | Full literal client frames and complete typed bridge Property record, including time/deleted |
| `receive_property_fanout_is_per_recipient` | N39 | Yes | Full literal PropertyNotify frames for both byte orders |
| `receive_selection_clear_targets_previous_setter` | N40 | Yes | Full literal SelectionClear and XFIXES frames; current time is bounded then normalized |
| `receive_selection_request_denied_answers_actual_requester` | N41 | Yes | Full literal SelectionRequest and direct refusal frames |
| `receive_bridge_selection_denial_answers_requester` | N46 | Yes | Full typed SelectionEvent::Request; successful bridge delivery has no socket frame |
| `receive_bridge_clear_denial_does_not_queue` | N45 | Yes | Full typed Clear/Owner records, including bounded times and all fields |
| `receive_rootless_outgoing_core_events_are_checked` | N42–N44 | Yes | Full ConfigureNotify and ClientMessage frames; ClientMessage time is bounded then normalized |
| `receive_exempt_results_and_mapping_bypass_policy` / `assert_copy_wire`, `assert_mapping_wire` | Copy exemptions / MappingNotify | Yes / helpers | Full no-policy output streams, including all event frames and direct replies |
| `receive_deny_all_keeps_later_extension_writers` / `run_xi_mapping`, `run_xkb_mapping`, `run_present_configure`, `run_xfixes_owner_change` | Later writer exemptions | Yes / helpers | Full XI1, XKB, Present and XFIXES frames; XFIXES current time is bounded then normalized |
| `configure_window_pure_move_emits_present_configure_notify` | Present before core ConfigureNotify | Yes | Full independent 72-byte Present-plus-core stream |
| `synthetic_selection_notify` | Aggregate synthetic SelectionNotify | Plain helper held by `receive_no_policy_aggregate_paths_match_expected_bytes` | Full independent 32-byte frame, including synthetic bit and padding |
| `buffered_property_output` | Buffered PropertyNotify | Plain helper held by `receive_no_policy_aggregate_paths_match_expected_bytes` | Full literal PropertyNotify frame at queue tail and complete filler-plus-drained output |

RED/GREEN evidence: each requested production mutation was applied only in a scratch extraction made with `git archive`, and its registered test failed at a complete-frame assertion. Final repository verification is recorded in `/data/Projects/claude-scratch/access-control/pr4/followup-4b/sdd/task-3-fix-r1-report.md`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Implemented-By: codex (gpt-6-luna xhigh)
The policy description omits the synthetic bit; including it is the
mutation the assertions reject.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@joske
joske merged commit 158d5a1 into joske:master Nov 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants