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 verbatim, and the five KNOWN_SLUG-based integration tests adapted to this repo's known set (ki-einsteiger, 12 lessons) with split_size=8 for a real 8+4 two-way split (writes-one-file-per-chunk and self-contained tests), split_size=5 for the concatenation-order test (3 chunks), and split_size=100 for the single-file fallback test, mirroring the original's choices scaled to this repo's fixture. Gates: make validate (PASS, 2 sets), make lint (engine self-test 9/9 + 0 errors across 21 lessons/3 manifests), make lint-warnings (exit 0, pre-existing W-CARD-UNUSED/W-TILES-DUP/W-MATCH-AMBIG warnings only, none introduced by this change), make audit (0 issues), make stable-ids (386/386 base/head stable_ids, 21/21 lessons, 0 retired - unchanged, as expected for a scripts/tests-only change), pytest (103 passed/1 skipped before -> 111 passed/1 skipped after, +8 new tests, 0 failures). 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="ki-einsteiger --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 line, table row, worked example, self-contained-parts paragraph, 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 (ki-einsteiger, 12 lessons); --split-size + --out still correctly errors (exit 2, no file written). make validate/lint/ lint-warnings/audit/stable-ids green, unchanged (21 lessons, 2 sets, 386 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
Zusammenfassung
Portiert
--split-sizeverbatim aus astrapi69/alc-psychology#34 (Original-Implementierung) -
export_set.pywar vor dieser Aenderung byte-identischzwischen beiden Repos (per diff bestaetigt), also keine Skript-Anpassung
noetig.
--split-size Nsplittet den Export eines grossen Sets in mehrereeigenstaendige Dateien (je hoechstens N Lektionen), statt einer einzigen
grossen Datei. Jeder Teil traegt seine eigene
review_instructions-Kopieplus
part/of/lesson_count/total_lesson_count.Testsuite: volle 8-Test-Portierung aus alc-psychology (3 generische
chunk_lessons()-Unit-Tests unveraendert, 5 Integrationstests an dasbekannte Set dieses Repos angepasst -
ki-einsteiger, 12 Lektionen,--split-size 8fuer einen echten 8+4-Split).Gate-Ergebnisse
make validate: PASS (2 sets)make lint: Engine-Selbsttest 9/9 + 0 Fehler ueber 21 Lektionen/3 Manifestemake lint-warnings: exit 0, nur bestehende W-CARD-UNUSED/W-TILES-DUP/W-MATCH-AMBIG-Warnungen, keine neuenmake audit: 0 issuesmake stable-ids: 386/386 base/head stable_ids, 21/21 Lektionen, 0 retired - unveraendert (reine Scripts/Tests-Aenderung)pytest: 103 passed/1 skipped -> 111 passed/1 skipped (+8 neue Tests, 0 Fehlschlaege)