# Phase 5 Plan: Ontology and Learning Materials **Status:** Ready for execution **Phase Goal:** Ingest learning materials into source-backed ontology candidates. ## Requirements Covered - ONTO-01: User or operator can upload learning materials. - ONTO-02: System creates source-backed ontology candidate nodes and edges. - ONTO-03: System detects missing prerequisites and weakly supported concepts. - ONTO-04: Generated or inferred content is marked as candidate until reviewed. ## Tasks ### 1. Add ontology package - Define material, concept candidate, edge candidate, gap, and snapshot types. - Add in-memory store and service. ### 2. Implement deterministic MVP analyzer - Extract known backend interview concept candidates from material text. - Create prerequisite edges for supported concept pairs. - Create gap candidates for missing prerequisites and weak evidence. ### 3. Add HTTP endpoints - `POST /api/v1/materials` - `GET /api/v1/ontology` ### 4. Add tests and verification - Test material ingestion creates source-backed candidates. - Test gaps are candidate-only. - Test HTTP ingestion and ontology snapshot flow. - Run Go tests, OpenSpec validation, line-count check, and smoke. ## Out of Scope - Multipart upload. - Real document parsers. - Human review promotion.