Skip to content

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

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

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

Conversation

@astrapi69

Copy link
Copy Markdown
Owner

Closes #20

Portierung aus astrapi69/alc-psychology#34 (die Original-Implementierung).
scripts/export_set.py war vor dieser Aenderung byteidentisch zwischen
den beiden Repos, daher hier unveraendert uebernommen, keine Anpassung.

--split-size N teilt den Export eines Sets in mehrere eigenstaendige
Dateien (je mit eigener review_instructions-Kopie plus
part/of/lesson_count/total_lesson_count) statt einer einzigen
grossen Datei.

Volle 8-Test-Suite portiert, angepasst an das bekannte Set dieses Repos
(react-grundlagen, 5 Lektionen; split_size=3 und split_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)

astrapisixtynine and others added 2 commits September 1, 2026 15:33
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>
@astrapi69
astrapi69 merged commit 297d7de 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