Repository navigation
Move CSL sanitization out of the root file (Phase B, ticket 5) - #160
Merged
Merged
Conversation
The 14 CSL-JSON validation and sanitization functions move unchanged from bibliography-builder.php to includes/csl-sanitize.php, under the same names: the moved text is byte-identical to what was removed. The root file goes from 2,213 to 1,592 lines. Ticket 9 comes first so it guards this and every later move: FunctionInventoryTest fails if any of the 255 functions listed in tests/fixtures/function-inventory.txt is missing or defined in more than one file. Removing the new require_once makes it fail, naming the missing functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
=========================================
Coverage 88.27% 88.27%
Complexity 22 22
=========================================
Files 62 63 +1
Lines 7359 7359
Branches 699 699
=========================================
Hits 6496 6496
Misses 292 292
Partials 571 571 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Resolves the metrics doc's list of included files (now twelve, with csl-sanitize.php and email-output.php) and drops the two functions #158 deliberately removed, save_cite_export and save_export_link, from the function inventory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
dknauss
marked this pull request as ready for review
October 21, 2026 18:54
This was referenced Oct 21, 2026
Merged
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
This is Phase B, ticket 5 of
docs/planning/refactor-and-standards-memo.md, plus ticket 9 pulled forward.bibliography-builder.phpto the newincludes/csl-sanitize.php, unchanged and under the same names. Examples:bibliography_builder_get_known_csl_types(),…_sanitize_csl_date(),…_validate_and_sanitize_csl_item().bibliography-builder.phpdrops from 2,213 to 1,592 lines; its only addition is onerequire_once.cmp).tests/phpunit/FunctionInventoryTest.phpchecks the 255bibliography_builder_*functions listed intests/fixtures/function-inventory.txt(captured before any move).require_oncemakes the test fail, naming the missing functions.docs/current-metrics.md(line counts, the list of included files), and a progress table in the memo.This touches the same root file as #158, but in different places, so the second to merge should merge cleanly. The metrics doc's list of included files will need a one-line merge.
Validation
composer lint:php,composer analyze:php: pass.npm run format:check,composer verify:metrics: pass.npm run package:release: the ZIP includesincludes/csl-sanitize.php, since packaging copiesincludes/wholesale.Checklist
Generated by Claude Code