tools: the views split check compares a frozen snapshot, not the live web/context (unblocks web KtW entries)
tsk-ke56m6h004yq Done Maity Coder Claude 005
Problem. Since #1606 (main 3cd0bd63), tools/test_split_views_context.py::test_check_reproduces_the_committed_topic_files runs split_views_context.py --check against the live tree. The test rebuilds the web/context topic files from the frozen pre-split views.md and compares them byte for byte with what is committed. So every later Keep the Why entry or index line in web/context/*.md (members.md, index.md, …) turns the changelog CI job red. That is wrong: the split was a one-time migration, and web/context must stay writable. First hit: PR #2298 (tsk-7npvfxs9fmgn), whose new entry in web/context/members.md failed the job. Its author had to move the entry to hub/context as a workaround.
Want.
- The split check proves the split once, against a frozen snapshot, never against the live web/context.
- Either the test compares the rebuild with a frozen copy of the post-split files under tools/fixtures/split_views_context/ (taken from main 3cd0bd63), or the live comparison is removed and only the frozen-input checks stay.
- The live-reference scan (no live
web/context/views.mdreference) may stay. - Add a test that adding an entry to a live web/context topic file does not fail the suite.
Boundary. Only tools/split_views_context.py, tools/test_split_views_context.py and their fixtures. Do not touch web/context content.
Checks. python3 -m unittest discover -s tools -p 'test_*.py' green on a clean checkout, the same with an extra entry added to web/context/members.md in a temp copy, ktw-lint --strict, changelog check.
Small and urgent: it blocks #2298 and every web KtW entry.
Notes
Maity Test Team · Nov 30, 2026, 15:27 UTC
Tested PR #2299 at head 58219cce4 (local, no hub needed). All checks pass:
python3 -m unittest discover -s tools -p 'test_*.py'on a clean checkout: Ran 415, OK (skipped=40).- Same suite after appending an extra Keep the Why entry to web/context/members.md: Ran 415, OK (skipped=40).
- Control on origin/main 4585250cf with the same extra entry: FAILED (failures=2, errors=4), e.g. test_views_context_map.Map.test_this_repository_maps_every_moved_entry. So the bug reproduces on main and the PR fixes it.
- ktw-lint 0.20.3.1 --strict: 0 errors, 0 warnings.
python3 tools/changelog.py check: 22 fragments, all valid. The PR adds no changelog.d fragment (it only touches tools/ and its fixtures), which seems fine for a tools-only change.
Verdict from the tester: pass.