feat: seed the education catalog and a walkable demo planning tree - #1
Merged
AlejandroTatum merged 4 commits intoAug 17, 2026
Merged
Conversation
Load the LOEI education levels and subniveles as reference data so any fresh database can build a planning tree without manual setup. EducacionNivel.nombre is unique, so the planificacion model fixture can no longer create "Educación General Básica" by hand; it now uses a test-scoped name and leaves the real curriculum names to the seeded catalog.
seed_demo stopped at users, instituciones and roles, so a fresh local environment had no plan de estudio to open. It now builds one active plan with grados and asignaturas on the first demo institution, and dev.sh runs it as part of the backend bootstrap. The grados are chosen so RF-017 is demonstrable both ways: one meets its subnivel weekly minimum and one falls short and raises the alert. An existing active plan is reused instead of duplicated, because the institution allows only one, and the command fails with a clear error when the education catalog migration has not run.
…etup Node 26 ships an experimental global localStorage that stays undefined unless the process gets --localstorage-file. Under jsdom, globalThis and window are the same object, so that undefined global shadows the jsdom storage and leaves nothing to fall back to. Define an in-memory Storage for localStorage and sessionStorage whenever they are missing.
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.
What
Four commits that make a fresh SIGED environment usable end to end, plus one test-harness fix.
chore: ignore codegraph index—.codegraph/is a machine-local, per-worktree, regenerable index. Same rule and comment already used in the siblingacademic-report-automationrepo.feat(organizacion): seed educacion niveles catalog— migration0005loads the LOEI education levels and subniveles as reference data.EducacionNivel.nombreis unique, so the planificacion model fixture can no longer createEducación General Básicaby hand; it now uses a test-scoped name.feat(core): seed a walkable planificacion tree in seed_demo—seed_demostopped at users, instituciones and roles, so there was no plan de estudio to open. It now builds one active plan with grados and asignaturas, andscripts/dev.shruns it during backend bootstrap.test(frontend): install an in-memory storage fallback in the vitest setup— Node 26's experimental globallocalStoragestaysundefinedwithout--localstorage-file, and under jsdom it shadows the jsdom storage.Notes on the split
The migration and
seed_demoare separate commits on purpose: the catalog is production reference data that runs on every deploy, whileseed_demois dev-only demo data guarded behindDEBUG. Thetest_planificacion_models.pyfixture rename ships with the migration because the unique constraint forces it — without the rename that test fails the moment0005is applied.test_seed_catalogo.pyis split across both commits so each one carries its own tests: the catalog assertions land with the migration, theseed_demoassertions with the command.Demonstrating RF-017
The seeded grados are chosen so the weekly-minimum alert is visible both ways —
4to de Básicameets itsBásica Elementalminimum,8vo de Básicadeliberately falls short ofBásica Superiorand raises the alert.test_seeds_one_grado_that_meets_its_minimum_and_one_that_does_notlocks that in.Verification
python -m pytest(backend,--create-db)npm test(frontend, vitest)manage.py makemigrations --check --dry-run0005on a fresh database0004, no numbering conflict189bbeain isolation