Repository navigation
Name each test file's private-member reaches once, in the file - #267
Merged
Merged
Conversation
The comments beside each -fno-access-control flag in tests/CMakeLists.txt named every private member a file reaches and why, and had grown into long prose that repeated the tests' own comments. Each test file now names its reaches, and why, once: a reach several of its tests share at the top of the file or on their fixture, any other in the comment of the test or helper that takes it. The CMake comment says only that the file compiles with the flag and names what it reaches. docs/conventions.md states that rule and, under Documentation, that each fact has one home; the test-standards and docs-sync skills check both, and CLAUDE.md summarizes the first. Reaches the old notes missed are named too, and stale "see CMakeLists" pointers are dropped.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain in the documentation cleanup that places private-access explanations alongside the relevant tests.
No open issues 🎉
What changed in this PR
This documentation-only cleanup extends #266’s approach across the white-box tests, placing private-access explanations beside the tests that need them rather than in build configuration. Test logic and compile flags remain unchanged.
Changes:
- Move private-member names and access reasons into 13 test files, shortening CMake comments to pointers.
- Document where shared and test-specific access explanations belong.
- Update review guidance to enforce one authoritative home per documented fact.
| File | Description |
|---|---|
| tests/test_source_role.cpp | Documents capture, encoder, and protocol-task access locally. |
| tests/test_role_deactivation.cpp | Explains private state inspected during role removal. |
| tests/test_record_store.cpp | Documents record lookups and allocation observations. |
| tests/test_player_role.cpp | Names private access for player and sync-task tests. |
| tests/test_pairing_state_machine.cpp | Places access explanations on fixtures, helpers, and tests. |
| tests/test_noise_transport.cpp | Documents cipher, buffer, and send-state access. |
| tests/test_json_arena.cpp | Centralizes allocator private-access rationale. |
| tests/test_inbox.cpp | Explains the private mutex probe. |
| tests/test_inbound_ring.cpp | Names drop-counter and consumed-event access. |
| tests/test_encrypted_lifecycle.cpp | Documents lifecycle, persistence, and metadata access locally. |
| tests/test_decoder.cpp | Explains decoder and chunk-decoding access. |
| tests/test_cpace.cpp | Moves fixed-scalar rationale to its helper. |
| tests/test_client_lifecycle.cpp | Consolidates shared access notes and adds local explanations. |
| tests/CMakeLists.txt | Replaces member inventories with pointers to test comments. |
| docs/conventions.md | Defines access-note placement and single-home documentation rules. |
| CLAUDE.md | Updates the white-box testing convention summary. |
| .claude/skills/test-standards/SKILL.md | Aligns access-documentation checks with the new convention. |
| .claude/skills/docs-sync/SKILL.md | Adds a check for duplicated documentation facts. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The comment beside each
-fno-access-controlflag intests/CMakeLists.txtnamed every privatemember its file reaches and why. Several had grown into long prose (about 120 lines for
test_client_lifecycle.cpp) that repeated what the tests already said. #266 moved the visualizertests' notes into the tests; this applies that to every file and writes the rule down.
Change
docs/conventions.md: a test file names each private member it reaches, and why, once: a reachseveral of its tests share at the top of the file or on their fixture, any other in the comment
of the test or helper that takes it. The CMake comment says only that the file compiles with the
flag and names what it reaches.
docs/conventions.md(Documentation): each fact has one home, at the code that owns it; a copyelsewhere is a pointer, and only where the site would mislead without it.
CLAUDE.mdsummarizes the first.comments shrink to two lines each. Comment text drops by about 1,190 words overall.
send_transport_frame(),chunk_is_unplayably_late(),InboundDropLog::dropped_,config_), and stale "seeCMakeLists" include comments are dropped.
Tests
tests/*.cpp: with comments stripped, every changed file matchesmain.comments; the only names dropped are public or no longer reached (for example
process_binary_message()intest_encrypted_lifecycle.cpp).