feat(export): --split-size for AI-review-sized chunks - #21
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 are adjusted to this repo's known set (react-grundlagen, 5 lessons) with split_size=3 (3+2 split, the main two-chunk scenario) and split_size=2 (2+2+1, the concatenation scenario) in place of the original's 8-lesson set with split_size=5/3. Gate results: - make validate: PASS (3/3 sets) - make lint: PASS (self-test OK, 28 lessons/4 manifests, 0 errors) - make lint-warnings: PASS (0 errors, 23 pre-existing warnings, unrelated) - make stable-ids: PASS (457/457 stable_ids, 28/28 lessons, 0/0 retired, base and head counts unchanged - this change touches no content) - make audit: PASS (28 lessons, no quality issues) - pytest tests -q: 109 passed, 1 skipped (was 101 passed, 1 skipped; +8 new tests in tests/test_export_set.py, 12 -> 20) 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="python-basics --split-size 5"'. Documented --split-size in README.md's 'Export a set for AI review' section (make export as the recommended form, matching the generate section's own convention) and in both docs/export-set-usage.md / .de.md (usage table row, a worked --split-size example, the self-contained-parts explanation, and the 'review large sets in slices' best-practice bullet now points at --split-size instead of manual cutting). Verified: 'make export ARGS="react-grundlagen --out ..."' runs the real exporter and writes valid YAML (lesson_count: 5); --split-size + --out together still correctly errors (exit 2, no file written); a real python-basics --split-size 5 run writes 3 parts as documented. make validate/lint/lint-warnings/audit/stable-ids green, unchanged (28 lessons, 3 sets, 457 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 #20
Portierung aus astrapi69/alc-psychology#34 (die Original-Implementierung).
scripts/export_set.pywar vor dieser Aenderung byteidentisch zwischenden beiden Repos, daher hier unveraendert uebernommen, keine Anpassung.
--split-size Nteilt den Export eines Sets in mehrere eigenstaendigeDateien (je mit eigener
review_instructions-Kopie pluspart/of/lesson_count/total_lesson_count) statt einer einzigengrossen Datei.
Volle 8-Test-Suite portiert, angepasst an das bekannte Set dieses Repos
(
react-grundlagen, 5 Lektionen;split_size=3undsplit_size=2).Gate-Ergebnisse
make validate: PASS (3/3 Sets)make lint: PASS (Self-Test OK, 28 Lektionen/4 Manifeste, 0 Fehler)make lint-warnings: PASS (0 Fehler, 23 vorbestehende Warnungen, unabhaengig)make stable-ids: PASS (457/457 stable_ids, 28/28 Lektionen, 0/0 retired, base/head unveraendert)make audit: PASS (28 Lektionen, keine Qualitaetsprobleme)pytest tests -q: 109 passed, 1 skipped (vorher 101 passed, 1 skipped; +8 neue Tests)