Skip to content

Sibling Node Ordering in 'My Goals'

Generated artifact. Do not edit manually.

Generated by: scripts/build_compendia.py Regenerate with: python3 scripts/build_compendia.py --compendium dev-handbook --web-and-tex Source of truth: docs/dev/source/

Language / Sprache: English (EN) · Deutsch (DE) | PDF: English PDF · Deutsches PDF

Compendium: §1 Documentation Guidelines · §2 Landscape JSON Reference · §3 Minimal Schema & Fallback · §4 Authoring Editors · §5 Graph Editor · §6 Flashcard Editor · §7 Node Ordering · §8 Liquibase · §9 Auto-Update (SSE)


7. Sibling Node Ordering in 'My Goals'

In the learner-facing competence tree (CompetenceTree.tsx), sibling nodes under a cluster are ordered deterministically by sortSiblingGoalsBalanced in goalSorter.ts so prerequisites appear before dependents while preserving intentional didactic structure.

7.1. Hard Direct requires Topological Sort Plus Six-Tier Tie-Breaker

Given sibling goals under one parent cluster (guaranteed acyclic on requires), sortSiblingGoalsBalanced executes Kahn's topological sort over direct sibling-to-sibling requires edges and resolves ready-queue ties strictly in six lexicographic tiers:

| Priority | Criterion | Exact Rule | | –- | –- | –- | | 1. Manual order | Explicit authoring override | Numeric extendedData.{treeOrder,sortOrder,displayOrder,order,position} or tag order:<n>. | | 2. Didactic bucket | Pedagogical framing | why (orientation/motivation) \(<\) tutorial / core competencies \(<\) flashcards (memory) \(<\) exercises / exams. | | 3. Phase order | Curricular progression | SekI / 5–10 \(<\) E \(<\) Q1 \(<\) Q2 \(<\) Q3 \(<\) Q4 \(<\) Abitur / GLOBAL. | | 4. Descendant support | Soft cross-cluster requires | softScore(v) over descendant-level prerequisite dependencies gated by minAbsoluteSupport = 2 and minRelativeSupport = 0.25 so isolated single edges do not unexpectedly reorder large clusters. | | 5. Localized title | Human-readable fallback | Collator localeCompare (de-DE, numeric: true). | | 6. Canonical ID | Final determinism | Lexicographic goal.id comparison ensuring 100% deterministic output. | {cols="20%,24%,56%"}

Note that default raw content-tree inspection (View Projection) preserves authored contains / treeOrder sequence, whereas sortSiblingGoalsBalanced powers the didactic learner navigation view when explicit treeOrder overrides are absent.