Skip to content

feat(export): --split-size for AI-review-sized chunks - #19

Merged
astrapi69 merged 2 commits into
mainfrom
feat/export-split-size
Sep 1, 2026
Merged

feat(export): --split-size for AI-review-sized chunks#19
astrapi69 merged 2 commits into
mainfrom
feat/export-split-size

Conversation

@astrapi69

Copy link
Copy Markdown
Owner

Closes #18

Zusammenfassung

Portiert --split-size verbatim aus astrapi69/alc-psychology#34 (Original-
Implementierung) - export_set.py war vor dieser Aenderung byte-identisch
zwischen beiden Repos (per diff bestaetigt), also keine Skript-Anpassung
noetig.

--split-size N splittet den Export eines grossen Sets in mehrere
eigenstaendige Dateien (je hoechstens N Lektionen), statt einer einzigen
grossen Datei. Jeder Teil traegt seine eigene review_instructions-Kopie
plus 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 das
bekannte Set dieses Repos angepasst - ki-einsteiger, 12 Lektionen,
--split-size 8 fuer einen echten 8+4-Split).

Gate-Ergebnisse

  • make validate: PASS (2 sets)
  • make lint: Engine-Selbsttest 9/9 + 0 Fehler ueber 21 Lektionen/3 Manifeste
  • make lint-warnings: exit 0, nur bestehende W-CARD-UNUSED/W-TILES-DUP/W-MATCH-AMBIG-Warnungen, keine neuen
  • make audit: 0 issues
  • make 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)

astrapisixtynine and others added 2 commits September 1, 2026 15:34
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>
@astrapi69
astrapi69 merged commit 0a78e78 into main Sep 1, 2026
6 checks passed
@astrapi69
astrapi69 deleted the feat/export-split-size branch September 1, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(export): --split-size for AI-review-sized chunks

2 participants