Skip to content

test: replace docs-slug census count pin with slug↔page bijection#331

Merged
lesnik512 merged 1 commit into
mainfrom
census-bijection
Jul 15, 2026
Merged

test: replace docs-slug census count pin with slug↔page bijection#331
lesnik512 merged 1 commit into
mainfrom
census-bijection

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Replaces the hand-maintained _EXPECTED_CONCRETE_CLASS_COUNT = 22 pin in tests/test_docs_slug_census.py with a slug↔page bijection test.

Why

The count pin fired on any concrete-error add/remove even when the slug and troubleshooting page were supplied correctly — friction on valid changes with no behavioral cause. Its one genuine value was catching a narrowing walk (a filter regression finding fewer classes, letting the skipped ones escape the slug/page gates); the existing non-empty check only catches the walk finding zero.

What

  • Remove _EXPECTED_CONCRETE_CLASS_COUNT and test_census_pins_the_concrete_class_count.
  • Fold test_every_docs_slug_has_a_troubleshooting_page into test_slugs_and_troubleshooting_pages_are_in_bijection — set equality reporting both directions.
  • Keep the uniqueness and base-class tests; refresh the module docstring.

Net: magic constant gone (no hand-bump on valid add/remove), narrowing-walk guard preserved (fewer slugs than pages → mismatch), orphan-page coverage added (a stale page after a class removal).

Rationale bundle: planning/changes/2026-07-15.04-census-bijection.md.

Test

just test-ci green — 392 passed, 100% coverage. just lint-ci and just check-planning clean.

🤖 Generated with Claude Code

The count pin `_EXPECTED_CONCRETE_CLASS_COUNT = 22` fired on any error-class
add/remove even when slug and page were supplied correctly, friction with no
behavioral cause. Fold the class→page test into a single slug↔page bijection:
set equality reports missing pages and orphan pages separately, preserves the
narrowing-walk guard (fewer slugs than pages fails), and adds orphan-page
coverage the census lacked. No magic constant to hand-bump.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesnik512
lesnik512 merged commit 3762192 into main Jul 15, 2026
7 checks passed
@lesnik512
lesnik512 deleted the census-bijection branch July 15, 2026 16:32
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.

1 participant