Skip to content

Python track, Phase 0: per-language engine, overlays, Go migration, docs, CI, tools - #11

Open
ibacalu wants to merge 6 commits into
mainfrom
python/phase-0
Open

ibacalu wants to merge 6 commits into
mainfrom
python/phase-0

Conversation

@ibacalu

@ibacalu ibacalu commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 0 of the Python track (CONTEXT.md, Phase 6.0): everything the content phases depend on, with Python still stub.

  • Engine: shared and pack lessons declare verify type tests, resolved through languages.<code>.verify.type; each language owns one folder (content/<lang>/shared/..., content/<lang>/focus/...) whose overlay holds snippets/, exercise/, solution/ and optional TUTOR.md/quiz.json; LESSON.md anchors (<!-- lang: <slot> -->) are rendered per language at scaffold time. ci is lesson-centric and language-filterable, pytest runs as uv run -q --locked pytest -q, toolchains are preflighted, init seeds a workspace .gitignore and takes --carry-over, and sync_needed no longer fires for other languages' registry edits. exercises/<lang>/ and solutions/<lang>/ are retired.
  • Go migration: tools/migrate-go-overlays.py moved the Go slice of all 40 shared lessons into content/go/shared/ overlays (72 snippets). Every one of the 112 Go-path lessons renders byte-identically to main, so existing Go workspaces see no sync.
  • Registry: language runners, tests on 35 shared/pack lessons, the 54-lesson Python track with objectives and honest verify types; outline tables to match.
  • Docs, CI, tools: decision rows 19-32 and the Phase 6 checklist in CONTEXT.md; a language-neutral authoring guide with Python bars and self-checks; validate --strict plus tests/test_engine.py in CI and a go/python solutions matrix; workflow scripts with a LANG table, a variant mode and a ci gate.

Lessons touched

All 40 shared lessons that carried Go material (layout move only; rendered Go bytes unchanged). Registry: 35 shared/pack lessons flip gotest to tests; 24 Python stubs replaced by 54 Python lessons.

Checklist

  • python3 skills/tutor/scripts/tutor.py validate --strict passes (0 errors)
  • python3 skills/tutor/scripts/tutor.py ci --language go passes (88 solutions tested, 0 failed, 5 machine-inspecting graders skipped as before)
  • python3 -m unittest discover -s tests passes (30 tests)
  • Tutor-only files (TUTOR.md, quiz.json, solution/, snippets/) updated wherever the lesson changed
  • Paths in lesson prose use the ada example persona; nothing machine-specific
  • Commit messages follow Conventional Commits
  • I have read the CLA

… overlays, test what is on disk

Shared and pack lessons declare verify type `tests`; the workspace language's
runner (languages.<code>.verify.type) decides what runs. Each language owns
one folder: content/<lang>/shared/<stage>/<lesson>/ and
content/<lang>/focus/<pack>/<lesson>/ overlays hold snippets/, exercise/,
solution/ and optional TUTOR.md/quiz.json; LESSON.md carries
<!-- lang: <slot> --> anchors that scaffold renders per language, so a
language that ships no snippet for a slot leaves the other languages' bytes
untouched. exercises/<lang>/ and solutions/<lang>/ are retired.

- ci is lesson-centric: every (exercise, solution) pair on disk runs for every
  language that carries it, regardless of language status; --language filters;
  skips print a reason; an empty --filter fails; strict validate runs first
- pytest runs as `uv run -q --locked pytest -q`; pytest exercises must ship
  pyproject.toml, uv.lock and .python-version; toolchains are preflighted
  with an install hint instead of a traceback
- is_authored is per language; shared lessons without a variant are content
  pending for that language in sync, status, roadmap, graph and ci
- init seeds a workspace .gitignore, warns on focus packs that add nothing
  and on an ancestor pyproject.toml, and takes --carry-over DIR to note
  shared-lesson passes from another language's workspace
- sync_needed derives from a composition hash of the workspace's own slice
  of the registry, so edits to another language no longer nag learners
- validate checks the verify-type invariants, anchors and snippets, overlay
  layout, pytest project files, and warns on toolchain commands in a shared
  Exercise section or an overlay exercise without README.md
- tests/test_engine.py drives a scratch copy of the engine through a
  synthetic curriculum (30 cases); ruff.toml pins one style for the repo
…t/go/shared overlays

tools/migrate-go-overlays.py moves exercises/go/ and solutions/go/ into each
lesson's Go overlay and extracts every `In Go` block of the shared
LESSON.md files into snippets/<slot>.md, leaving a <!-- lang: <slot> -->
anchor in place (40 lessons, 72 snippets). The script fingerprints every
Go-path lesson the way the previous engine scaffolded it and again through
the new engine after the move: all 112 are byte-identical, so no Go learner
sees a sync. Unmarked Go prose and fences that remain in the shared theory
are the shared batch's work (CONTEXT.md, Phase 6.3).
…unners

languages.<code> gains verify.type (gotest, pytest) and workspace_ignore;
the 22 shared and 13 pack lessons that ran go test now declare `tests`.
The 24 Python stubs become the 54 lessons of the planned track (p1 17,
p3 18, p5 13, p7 6) with objectives and honest verify types; Python stays
`stub` until the track is authored. docs/curriculum-outline.md carries
the four Python tables with a deps column and the shared-stage note.
…n authoring conventions

CONTEXT.md gains decision rows 19-32, the overlay layout, verify types,
per-language rendering, the Python path table, the Phase 6 checklist and the
release policy; DESIGN.md explains why overlays live under content/<lang>/;
the authoring guide becomes language-neutral with Python bars, layouts,
self-checks and the anchor grammar; README, CONTRIBUTING, SKILL.md, the
issue and PR templates, .gitignore and renovate.json follow the engine.
The validate job runs validate --strict and the engine test suite and
extends the path guard. The solutions job becomes one row per language
whose content changed (shared lessons, the engine, the registry, the tests
and the workflow itself select both), with setup-uv pinned by SHA, a uv
managed CPython 3.14, and ruff over the engine, tests, tools and Python
content; an aggregate job keeps the ruleset's required check name.
…and a ci gate

The three workflow scripts take a language, derive exemplar, bar, runner,
formatter and markers from one LANG table, add a variant mode that writes
only under a language's overlay, carry a Python review lens, and check each
agent's reply for the ci summary line instead of trusting exit status.
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.

1 participant