Skip to content

Name each test file's private-member reaches once, in the file - #267

Merged
kahrendt merged 1 commit into
mainfrom
test-access-notes-in-tests
Nov 17, 2026
Merged

kahrendt merged 1 commit into
mainfrom
test-access-notes-in-tests

Conversation

@kahrendt

Copy link
Copy Markdown
Contributor

Summary

The comment beside each -fno-access-control flag in tests/CMakeLists.txt named every private
member 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 visualizer
tests' 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 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 (Documentation): each fact has one home, at the code that owns it; a copy
    elsewhere is a pointer, and only where the site would mislead without it.
  • The test-standards and docs-sync skills check both; CLAUDE.md summarizes the first.
  • 13 test files: each note moved to its one home, merged with the existing comments; the CMake
    comments shrink to two lines each. Comment text drops by about 1,190 words overall.
  • Reaches the old notes missed are named (for example send_transport_frame(),
    chunk_is_unplayably_late(), InboundDropLog::dropped_, config_), and stale "see
    CMakeLists" include comments are dropped.

Tests

  • Comment-only in tests/*.cpp: with comments stripped, every changed file matches main.
  • A script checked that every member the old CMake notes named is still named in its file's
    comments; the only names dropped are public or no longer reached (for example
    process_binary_message() in test_encrypted_lifecycle.cpp).

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.
@kahrendt
kahrendt requested a balanced review from Copilot November 17, 2026 18:58
@kahrendt
kahrendt marked this pull request as ready for review November 17, 2026 18:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@kahrendt
kahrendt merged commit aa53371 into main Nov 17, 2026
17 checks passed
@kahrendt
kahrendt deleted the test-access-notes-in-tests branch November 17, 2026 19:14
@kahrendt kahrendt added the documentation Improvements or additions to documentation label Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants