Mentoory's Knowledge Module Launch: New Diagnostic Cascade & Cross-Schema Data Binding
Mentoory has launched a new core `Knowledge` module, introducing a complex data architecture that directly binds diagnostic forms to a structured knowledge hierarchy. The release centers on two new aggregate families: a global catalog of `KnowledgeStructureTemplate` and project-specific clones called `KnowledgeStructure`. Each structure holds a four-level hierarchy of Module → Topic → Subject → Resource, implemented via a new `knowledge.*` schema with 10 tables. Critically, the design includes cross-schema foreign keys, linking directly to the existing `diagnostic.FormTemplates` and `diagnostic.Questions` tables, creating a tightly coupled data dependency between previously separate domains.
The technical implementation reveals a significant automation feature: the `CloneFormTemplateHandler`. When a source form template is bound to a knowledge template, this handler automatically clones—or reuses—a project-owned `KnowledgeStructure`. It then performs a critical data rewrite, mapping all `Questions.TopicId` references from the template's topic IDs to the newly created project-specific topic IDs. This cascade is controlled via a new `topicIdRewriteMap` parameter on the `ProjectForm.CloneFromTemplate` operation, fulfilling specific functional requirements (FR-K21 / FR-K23).
This architectural shift creates a mandatory diagnostic cascade, embedding knowledge structures directly into the assessment lifecycle. The integration is further cemented by new query services (`ITopicUsageQuery` and `DiagnosticTopicUsageQuery`) designed to wire topic usage checks, referenced as EC-30, which likely governs validation or deletion rules. The deployment includes an idempotent seed script (`005.SeedKnowledgeData.sql`) to reconcile existing hard-coded `Questions.TopicId` literals with the new system, indicating a substantial, one-time data migration to align legacy content with the new knowledge governance model.