feat(export): --split-size for AI-review-sized chunks - #19
Merged
Conversation
Ported verbatim from astrapi69/alc-psychology#34 (the original implementation) - export_set.py was byte-identical between the two repos before this change (confirmed by diff), so this is the same file, no adaptation. --split-size N splits a large set's export into multiple self-contained files (each carrying its own review_instructions copy plus part/of/ lesson_count/total_lesson_count), instead of one huge file. Ported the full 8-test suite from alc-psychology's test_export_set.py: the three generic chunk_lessons() unit tests port verbatim, and the five KNOWN_SLUG-based integration tests port unchanged too, since this repo's known set (ansible-qe, 8 lessons) has the exact same lesson count as alc-psychology's known set, so split_size=5 (5+3 split) and split_size=3 (3+3+2 split) already exercise a real 2-/3-way split with no number adjustments needed. Gates: make validate PASS (2/2 sets), make lint PASS (self-test + engine-validate, 0 errors), make lint-warnings exit 0 (pre-existing content warnings only, unrelated), make stable-ids unchanged (315/315 ids, 18/18 lessons, 0/0 retired), make audit no issues, pytest 101 -> 109 passed (8 new tests), 1 skipped both times (pre-existing, unrelated). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The exporter (with --split-size support) shipped on this branch earlier this session with no make target and no doc update - only reachable via a bare python3 invocation, and --split-size was covered only by the script's own --help text. Wraps scripts/export_set.py the same way 'make generate' wraps scripts/generate_exercises.py - ARGS passthrough, e.g. 'make export ARGS="it-grundlagen --split-size 4"'. Documented --split-size in README.md's 'Export a set for AI review' section and in docs/export-set-usage.md / .de.md (usage table row, worked example, self-contained-parts explanation, and the 'review large sets in slices' bullet now points at --split-size). Verified: 'make export ARGS="..."' runs the real exporter and writes a valid file (ansible-qe, 8 lessons); --split-size + --out still correctly errors without writing a file. make validate/lint/lint- warnings/audit/stable-ids green, unchanged (18 lessons, 2 sets, 315 stable_ids untouched). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Closes #18
Summary
--split-size Ntoscripts/export_set.py, verbatim fromfeat(export): --split-size for AI-review-sized chunks alc-psychology#34 (the original implementation). The file
was byte-identical between the two repos before this change (confirmed
by diff), so no repo-specific adaptation was needed.
--split-size Nsplits a large set's export into multipleself-contained files (each carrying its own
review_instructionscopy plus
part/of/lesson_count/total_lesson_count), insteadof one huge file.
tests/test_export_set.py: the three genericchunk_lessons()unittests verbatim, and the five
KNOWN_SLUG-based integration testsunchanged too, since this repo's known set (
ansible-qe, 8 lessons)has the exact same lesson count as alc-psychology's known set - no
number adjustments needed.
Gate results
make validate: PASS (2/2 sets)make lint: PASS (self-test + engine-validate, 0 errors)make lint-warnings: exit 0 (pre-existing content warnings only,unrelated to this change)
make stable-ids: unchanged (315/315 ids, 18/18 lessons, 0/0retired)
make audit: no issuespytest: 101 -> 109 passed (8 new tests), 1 skipped both times(pre-existing, unrelated)
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com