Skip to content

feat: seed the education catalog and a walkable demo planning tree - #1

Merged
AlejandroTatum merged 4 commits into
mainfrom
feat/seed-educacion-catalog-and-demo-planning
Aug 17, 2026
Merged

feat: seed the education catalog and a walkable demo planning tree#1
AlejandroTatum merged 4 commits into
mainfrom
feat/seed-educacion-catalog-and-demo-planning

Conversation

@AlejandroTatum

Copy link
Copy Markdown
Owner

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 sibling academic-report-automation repo.
  • feat(organizacion): seed educacion niveles catalog — migration 0005 loads the LOEI education levels and subniveles as reference data. 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.
  • feat(core): seed a walkable planificacion tree in seed_demoseed_demo stopped at users, instituciones and roles, so there was no plan de estudio to open. It now builds one active plan with grados and asignaturas, and scripts/dev.sh runs it during backend bootstrap.
  • test(frontend): install an in-memory storage fallback in the vitest setup — Node 26's experimental global localStorage stays undefined without --localstorage-file, and under jsdom it shadows the jsdom storage.

Notes on the split

The migration and seed_demo are separate commits on purpose: the catalog is production reference data that runs on every deploy, while seed_demo is dev-only demo data guarded behind DEBUG. The test_planificacion_models.py fixture rename ships with the migration because the unique constraint forces it — without the rename that test fails the moment 0005 is applied.

test_seed_catalogo.py is split across both commits so each one carries its own tests: the catalog assertions land with the migration, the seed_demo assertions with the command.

Demonstrating RF-017

The seeded grados are chosen so the weekly-minimum alert is visible both ways — 4to de Básica meets its Básica Elemental minimum, 8vo de Básica deliberately falls short of Básica Superior and raises the alert. test_seeds_one_grado_that_meets_its_minimum_and_one_that_does_not locks that in.

Verification

Check Result
python -m pytest (backend, --create-db) 116 passed
npm test (frontend, vitest) 153 passed, 24 files
manage.py makemigrations --check --dry-run No changes detected
Migration 0005 on a fresh database Applies cleanly; depends on existing 0004, no numbering conflict
Commit 189bbea in isolation 111 passed — the branch bisects clean

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.
@AlejandroTatum
AlejandroTatum merged commit af218c3 into main Aug 17, 2026
2 checks passed
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